Skip to content

Conversation

@henrylay97
Copy link
Member

@henrylay97 henrylay97 commented Aug 21, 2025

Description

Part of a pair of PRs to enhance the SBND CRT contribution to the calibration ntuples. (See also SBNSoftware/sbnobj#139).

This PR:

  • Adds a new T0 source (SBND-only) from CRTSpacePoint matching. This falls in lowest priority (after Pandora (Both), CRTTrack (SBND-only) and CRTHit (ICARUS-only) and will be denoted by whicht0==3.
  • Applies appropriate x shifts to TPC track end points for this new T0.
  • Adds in x shifting of hit / spacepoint using either of the SBND-only CRT T0 tags - previously only implemented for CRTHit.
  • Skips shower-like PFPs now that all PFPs are characterised as tracks, this returns to original behaviour (before ~2years ago) and removes a sea of deltas and michels from the calib ntuples.

Presenting today at the calibration meeting - will link slides after.

  • Have you added a label? (bug/enhancement/physics etc.)
  • Have you assigned at least 1 reviewer?
  • Is this PR related to an open issue / project?
  • Does this PR affect CAF data format? If so, please assign a CAF maintainer as additional reviewer.
  • Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)? If so, please link it in the description.
  • Are you submitting this PR on behalf of someone else who made the code changes? If so, please mention them in the description.

Copy link
Contributor

@linyan-w linyan-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot Henry!

DocDB entry: https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=43000

Now we have whicht0 = 0 for TPC, 1 for SBND CRT track, 3 for SBND CRT spacepoint, 2 for ICARUS CRT hit. It's not intuitive but reasonably documented in code and the docdb entry, so looks good to me! Thanks!

@kjplows kjplows moved this to Open pull requests in SBN software development Aug 26, 2025
@kjplows kjplows moved this from Open pull requests to Partially reviewed in SBN software development Aug 26, 2025
@linyan-w linyan-w moved this from Todo to Approved in SBND 2025 Fall Production Sep 2, 2025
@kjplows kjplows moved this from Partially reviewed to Testing in SBN software development Sep 2, 2025
@kjplows
Copy link
Contributor

kjplows commented Sep 2, 2025

trigger build ci_ref=v10_06_02 LArSoft/lar*@LARSOFT_SUITE_v10_09_00 SBNSoftware/sbnobj#139

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase ci_tests ICARUS on slf7 for e26:prof - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the failed phase, check the ci_tests ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

⚠️ CI build for SBND Warning at phase ci_tests SBND on slf7 for e26:prof - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the warning phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@kjplows kjplows moved this from Testing to Urgent checks in SBN software development Sep 3, 2025
@kjplows
Copy link
Contributor

kjplows commented Sep 3, 2025

@mrmooney @gputnam @francescopoppi just pinging here - from a CI perspective this and #564 (production branch version, on the larsoft v10_06 line) are good to go. Any chance you could look at this? Thanks!

@linyan-w linyan-w moved this from Approved to To be merged in SBND 2025 Fall Production Sep 10, 2025
double anodeDistance = (hit.PeakTime()-dclock.Time2Tick(dclock.TriggerTime())-time/dclock.TPCClock().TickPeriod())*dclock.TPCClock().TickPeriod()*driftv;
double wirePlaneX = wireReadout->Plane(geo::PlaneID(hit.WireID().Cryostat, hit.WireID().TPC, hit.WireID().Plane)).GetCenter().X();

recoX = wirePlaneX - driftDir*anodeDistance;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since xshift is now being passed as a parameter, shouldn't you just apply it instead of calculating recoX here?

Backing up -- tp.x and sp.x should be shifted by the same amount. They shouldn't have different calculations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. This second calculation comes from a PR from yourself and Francesco back in March? I was just broadening it to use any CRT T0 rather than just the ICARUS hit tag.

I am happy to pass the xShift, validate the same result is arrived at, and assuming so remove the second calc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please do use the xShift

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gputnam @francescopoppi I am seeing ~0mm, ~3mm and ~6mm differences between this technique and pure use of the xshift. Clearly one of the methods doesn't / double accounts for interplane drift time.

I will try and investigate this this afternoon but given you implemented it I would welcome your input - do you know for example, whether this is over corrected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you do want the interplane timing corrected for in the x-shift. The most important thing though is that the tp and the sp are shifted in x by the same amount.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But clearly one of these instances is wrong so it's worth understanding which.

I would expect that the interplane drift is already accounted for in the creation of the spacepoints given they're already 3D constructs. I'm not familiar with the trajectory points so I would need to understand how they work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have looked into this more - SPs explicitly account for the interplane drift as would be expected, TPs are based on the trajectory which itself is a fit to the SPs.

Correcting for interplane drift here is wrong. I've made a couple of plots that show that the SP x's give and agreed x range (with the first induction location being the limit) whilst the TP x's with their current correction give shifted distributions.
hits_all_tpc_0_sp_x
hits_all_tpc_0_tp_x

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am therefore going to remove this section and correct all locations by the xshift calculated previously, avoiding double correcting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit now pushed.

@mrmooney @linyan-w just making you aware of this too!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Henry for fixing this!

@linyan-w linyan-w moved this from To be merged to Approved in SBND 2025 Fall Production Sep 11, 2025
@kjplows kjplows moved this from Urgent checks to Partially reviewed in SBN software development Sep 12, 2025
@kjplows
Copy link
Contributor

kjplows commented Sep 18, 2025

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_10_02 SBNSoftware/sbnobj#139

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

⚠️ CI build for SBND Warning at phase ci_tests SBND on slf7 for e26:prof - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the warning phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@kjplows kjplows moved this from Partially reviewed to To merge in SBN software development Sep 18, 2025
@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase ci_tests ICARUS on slf7 for e26:prof - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the failed phase, check the ci_tests ICARUS phase logs

parent CI build details are available through the CI dashboard

@kjplows kjplows merged commit d8b2f20 into develop Sep 18, 2025
@github-project-automation github-project-automation bot moved this from To merge to Done in SBN software development Sep 18, 2025
@kjplows kjplows moved this from Done to Recently done in SBN software development Sep 18, 2025
@linyan-w linyan-w moved this from Reviewer Approved to In tagged release in SBND 2025 Fall Production Sep 18, 2025
@kjplows kjplows moved this from Recently done to Done in SBN software development Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done
Status: In tagged release

Development

Successfully merging this pull request may close these issues.

CRT-TPC Matching in Calib NTuples

7 participants