FIX: Assign correct DetIDs to strip detectors when loading detector dimensions - #182
Conversation
|
Note: this does not affect if events in the guard ring detector get read into the DEE. nuclearizer/src/MSubModuleDEEIntake.cxx Lines 144 to 147 in 1a1b3ee |
There was a problem hiding this comment.
Pull request overview
This PR fixes DetID assignment for germanium strip (Strip3D) detectors when loading detector dimensions in geometries where the detector list also contains non-strip detectors (e.g., guard rings), ensuring strip detectors receive contiguous DetIDs.
Changes:
- Update
MSubModuleChargeTransportto incrementDetIDonly when encountering aStrip3Ddetector. - Update
MModuleDepthCalibrationto incrementDetIDonly when encountering aStrip3Ddetector, while preserving the UCSD override behavior (DetID = 11).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/MSubModuleChargeTransport.cxx | Adjusts DetID assignment so guard-ring detectors don’t consume DetID values when loading strip detector dimensions. |
| src/MModuleDepthCalibration.cxx | Adjusts DetID assignment similarly for depth calibration dimension loading, with UCSD override preserved. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Is there a reason we can't use the same logic to assign the DetID here? |
|
It looks like there is no way that DetID corresponds to the same number as X in GeD_X, but maybe I'm reading the code wrong. Can we either read the detector number from the mass model name, or do some sanity check to make sure the values are the same? |
|
DetID is determined by iterating through all detectors (and skipping the GR detectors in this PR), so if the We can read this from the detector names (right now, we are only checking the names of the SENSITIVE VOLUMES here, which is why we get Advantage: reading it from the name yields the same mapping as the DEE intake -> hits will always be attributed to the correct detector volume, no matter their "occurence" in the mass model. |
|
For example, for the UCSD cage, the detector would HAVE to be called |
|
Sorry, my original comment should have read "It looks like there is no confirmation that DetID corresponds to the same number as X in GeD_X". I agree that if the detectors are listed in order then all should be okay, but we should add a sanity check to be sure. I'd like to enforce the GeD_X naming for all mass models going forward, but that might make backward compatibility (i.e. applying the DEE to an older mass model) more challenging so if you want to keep this as is with the numerical iterations, let's at least confirm the GeD_X corresponds to DetID X. |
|
But then only throw a warning if the GeD_X names do not agree with the DetID, without exiting the computation? Because throwing an error and exiting poses the same issue with the code then not being backward compatible. |
|
Sorry for the delay in responding. I worry a warning messages might get lost in the long command line output. But if the detector IDs don't match, then that should be a showstopper for most analysis, unless someone knows what they're doing. What about checking the name of the Geometry itself before enforcing the error? If it's COSI-SMEX-Payload and the numbers don't match then you can exit with an error, if not, then just give a warning? The MGeometry class has a GetName() function, and each geometry has a Name at the top of the .geo.setup file. |
|
Like this? 😅 |
|
Yes :) Looks good! |
Currently, with the massmodel-cosi-payload (and probably every other massmodel using more than just 1 detector), when loading the detector dimensions for the
MModuleDepthCalibrationandMSubModuleChargeTransport, we assignDetIDsto all detectors in theDetectorList.However, this
DetectorListalso includes the guard ring detectors.Thus, the germanium strip detectors are only assigned even
DetIDsin increments of 2:In this PR, we only increment the
DetIDonce we actually have found a"Strip3D"detector, to avoid incrementing theDetIDalso for theSimpleguard ring detectors.I'm also keeping the
m_UCSDOverwriteto assign aDetIDof11