Skip to content

CHG: Handling of comments in depth calibration files - #234

Merged
fhagemann merged 1 commit into
cositools:develop/emfrom
fhagemann:feature/depth-file-comments
Oct 7, 2026
Merged

fhagemann merged 1 commit into
cositools:develop/emfrom
fhagemann:feature/depth-file-comments

Conversation

@fhagemann

Copy link
Copy Markdown

Currently, comments in the depth spline files are used to pass information on DetID etc.
These comments should always start with three ### as denoted in their comments:

Comments in the depth splines file (we use this to pass the Detector ID, especially for files with multiple splines):

// Input spline files should have the following format:
// ### DetID, HV, Temperature, Photopeak Energy (TODO: More? Fewer?)
// depth, ctd0, (optional) e_drift_times, (optional) h_drift_times
// '' '' ''

Comments for the depth coefficients file (we use this to pass information about at which energy the timing resolution is quoted):

// Read in the stretch and offset file, which should have a header line with information on the measurements:
// ### 800 V 80 K 59.5 keV
// And which should contain for each pixel:
// Pixel code (10000*det + 100*LVStrip + HVStrip), Stretch, Offset, Timing/CTD noise in units of sigma, Chi2 for the CTD fit (for diagnostics mainly)

The way the nuclearizer code operates right now is that is parses EVERY line starting with # as a comment carrying that information. This does not allow us to put any other comments in the files, except for adding more tokens to these files.

Following the convention that will also be used in the charge trapping module in #184, I am proposing to explicitly search for ### for those comments carrying information, and to allow for single-# comments that will just be ignored.

Relevant information is put in lines starting with three ###

We should also allow for "regular" comments starting with single #
@ckierans

ckierans commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Nice easy convention. I like it. Once the checks have passed, feel free to merge.

@zoglauer

zoglauer commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

The code looks OK.

@fhagemann
fhagemann merged commit 37b471a into cositools:develop/em Oct 7, 2026
1 check passed
@fhagemann

Copy link
Copy Markdown
Author

Thanks for the swift responses!

@fhagemann
fhagemann deleted the feature/depth-file-comments branch October 7, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants