Skip to content

Removed HasTriggered variable from MStripHit - #202

Merged
ckierans merged 4 commits into
cositools:develop/emfrom
ckierans:remove_HasTriggered
Aug 24, 2026
Merged

Removed HasTriggered variable from MStripHit#202
ckierans merged 4 commits into
cositools:develop/emfrom
ckierans:remove_HasTriggered

Conversation

@ckierans

Copy link
Copy Markdown
Collaborator

As agreed upon in the August 18th CDEE meeting, we're removing the HasTriggered variable from MStripHit. This variable wasn't used in the HDF measurement loader, and it is redundant (but opposite to) IsNearestNeighbor.

Note that I kept the HasTriggered variable as part of the MShieldCrystalHit and MCrystalHit class (it seems like one of these is a duplicate...)

@ckierans
ckierans requested a review from fhagemann August 21, 2026 18:04

@fhagemann fhagemann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I made adjustments to this PR to get the unit level tests to pass again.

However, we might want to think, that instead of completely removing the information on m_HasTriggered to an output file, we might want to replace it with the information in m_IsNearestNeighbor instead.

Comment thread src/MStripHit.cxx Outdated
@fhagemann
fhagemann force-pushed the remove_HasTriggered branch from d5926e9 to 4a6ca8e Compare August 22, 2026 18:41

@fhagemann fhagemann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I force-pushed making this PR non-breaking when it comes to reading/writing to DAT/ROA files (by replacing m_HasTriggered streaming with (the inverse of) m_IsNearestNeighbor.

Comment thread src/MStripHit.cxx
Comment on lines +172 to 177
<<(m_IsNearestNeighbor == false)<<" "
<<setprecision(9)<<m_Timing<<" "
<<m_ADCUnits<<" "
<<m_Energy<<" "
<<m_EnergyResolution<<" "
<<MakeFlags()<<endl;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ok, I now replaced all instances of m_HasTriggered when writing/reading ROA/DAT files to (the inverse of) m_IsNearestNeighbor.
Only thing is: it looks like we're writing redundant data write now (and also did before), as the information if a strip hit was a "nearest neighbor" is saved both through the previous m_HasTriggered slot and the strip flags via MakeFlags().

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You're right about the MakeFlags(). Andreas is planning an overhaul on the .dat reading/writing (PR #179 ), so I'm okay will leaving this redundancy for now. I'm not sure how many people are using the .dat format, but the bitmask for MakeFlags takes a minute to get used to...

@fhagemann

fhagemann commented Aug 22, 2026

Copy link
Copy Markdown

I moved the commit to add m_IsNearestNeighbor to MDEEStripHit from #190 to this PR.

@ckierans

Copy link
Copy Markdown
Collaborator Author

Thanks for handling the UnitTests! I had completely forgotten to check those files 😬

Things look good, so I'll merge now.

@ckierans
ckierans merged commit 0a4f42f into cositools:develop/em Aug 24, 2026
1 check passed
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.

2 participants