Skip to content

[DEE] Update inverse depth calibration from pixel-based to strip-based - #158

Draft
fhagemann wants to merge 1 commit into
cositools:develop/emfrom
fhagemann:develop/strip-based-depth
Draft

[DEE] Update inverse depth calibration from pixel-based to strip-based#158
fhagemann wants to merge 1 commit into
cositools:develop/emfrom
fhagemann:develop/strip-based-depth

Conversation

@fhagemann

Copy link
Copy Markdown

Currently, we apply stretch and offset to the CTD/TAC values on a pixel by pixel basis.
Field looked into composing these stretches and offsets on a strip basis, and this PR provides the nuclearizer code to read it.

The file format currently looks like this (very preliminary, this might still change depending if we need more information):

#detector_info,detector_id,detector_name,depth_spline_filename,mean_stretch,mean_offset
#detector_info,0,lbl_HP52406-3,HV32_LV32_59.5keV_lbl_HP52406-3_15.93mm_1050V_4.53e9_83K_ctd_depth_mcSPICE,1.124962607911977,21.15978945295241
#
#STRIP_ID,detector,side,strip,stretch_correction,offset_correction,timing_resolution_1σ_60_keV
96,0,0,0,1.0460236944724564,-9.128100617278196,9.892898259233435
97,0,0,1,1.0290178925959224,-8.802895822507075,8.486136187899895
98,0,0,2,1.021702711739791,-10.675809115071125,7.525486207481912
99,0,0,3,1.0120196046486603,-9.652688271376434,8.092190648673894
100,0,0,4,1.005529715566832,-6.459132565872501,8.476423433322116
101,0,0,5,1.0012518297022444,-8.861778237543035,8.393700918283095
102,0,0,6,1.0057693308480216,-9.151225747582288,8.141965836063068
...

I made some comparison to show that the pixel-based and strip-based files yield similar results (406-3 in STTC, illuminating with 241Am from the HV side):

image

@fhagemann fhagemann added the DEE Development related to the detector effects engine label May 29, 2026
@ckierans

ckierans commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Do we want to provide the option to provide a strip-based calibration or a pixel-based calibration? Or are we moving entirely to a strip-based calibration?

@fhagemann

Copy link
Copy Markdown
Author

I mean, the code exists for both, so we could also allow for either.
I would favor strip-based calibration though, because with pixel-based calibrations we might get very weird artifacts of TAC values for hits on the same strip being inconsistent (e.g. if neighboring pixels on the same strip have different stretch/offsets).

@ckierans

ckierans commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

So we'll need to make the same changes to the forward pipeline Depth Calibration module.

@fhagemann

Copy link
Copy Markdown
Author

My understanding was to keep the pixel-based calibration for the forward pipeline, but have the strip-based calibration for the DEE. Let's discuss this together with Field in tomorrow's meeting.

@fhagemann

Copy link
Copy Markdown
Author

I would postpone this PR to after having merged #165, as the latter might change where things are calculated/stored.

@fhagemann

Copy link
Copy Markdown
Author

Now that #165 is merged, I will look into updating this PR accordingly :)

@fhagemann
fhagemann force-pushed the develop/strip-based-depth branch from 6cd1cfe to a0f9f56 Compare August 5, 2026 00:05
@fhagemann

Copy link
Copy Markdown
Author

This PR is now rebased onto the latest commits on develop/em.

@fhagemann

Copy link
Copy Markdown
Author

The implementation seems to work as previously reported:
image

/////////////////////////////////////////////////////////////////////////////////


bool MModuleDepthCalibration::LoadStripCoeffsFile(MString FileName)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Up for debate:
I added the LoadStripCoeffsFile to read the strip-based depth coefficients file to MModuleDepthCalibration, even though it is never used in the forward pipeline.
The thought behind this was that both MSubModuleChargeTransport and MSubModuleDepthReadout require reading this file for z->drift time and timing smearing, respectively.

@fhagemann
fhagemann marked this pull request as ready for review August 5, 2026 00:09
@fhagemann

Copy link
Copy Markdown
Author

I'm marking this as "ready for review", but this will also require the generation of strip-based calibration files for all 16 flight detectors to be used with the COSI-SMEX-Payload mass model.

@fhagemann
fhagemann marked this pull request as draft August 11, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEE Development related to the detector effects engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants