-
Notifications
You must be signed in to change notification settings - Fork 12
Updated strip hit threshold logic #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop/em
Are you sure you want to change the base?
Conversation
… these events in revan
| if (g_Verbosity >= c_Warning) { | ||
| cout << m_XmlTag << ": Strip Hit below threshold, deleting SH with Energy " << Energy << " keV " << endl; | ||
| } | ||
| Event->SetStripHitBelowThreshold(true, "with Energy " + to_string(Energy)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have multiples this gets overwritten. Do we want that?
Or do we want to keep the smallest value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Maybe instead we should track how many SH we loose and all of the energies...?
I can edit that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
AddStripHitBelowThreshold(Energy)
And add a bit of logic into the event to track it?
How many hits, and total loss seems reasonable.
| if (m_SlowThresholdCutMode == MSlowThresholdCutModes::e_Fixed) { //check if user input threshold is enabled (one value applied to all strips) | ||
| Threshold = m_SlowThresholdCutFixedValue; | ||
| } else if (m_SlowThresholdCutMode == MSlowThresholdCutModes::e_File) { //check if threshold file is enabled (unique value applied to each strip) | ||
| double Threshold_map = m_ThresholdMap[R]; // if file enabled, declare value from map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to ThresholdFromFile
| if (g_Verbosity >= c_Error) { | ||
| cout << m_XmlTag << ": Error: Threshold not found for read-out element " << R << endl; | ||
| } | ||
| Threshold = 15; // set default threshold if threshold not found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to define "magic numbers" explicitly in the beginning:
const double DefaultSlowThreshold = 15.0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think about if this might actually be part of the map file ?
| MString m_StripHitBelowThresholdString; | ||
|
|
||
|
|
||
| // Flags indicating the quality of the event: quality warning, but not to be filtered out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the names are already long:
...Incomplete always results in a bad flag
... Do you want something similar for the quality flags?
Think of soemthing - or something similar
m_StripHitBelowThresholdQF;
m_StripHitBelowThresholdQualityFlag;
|
I didn't check if it runs, I just reviewed the code. |
Julian reported that the slow threshold cut was dramatically decreasing the number of events in the final ARM plots (using cut of 35 keV).
I confirmed with HP52358-3 gse_20250709T113820.hdf that I recovered only 30% of Compton events in revan when the slow threshold of 35 keV was applied.
The changes implemented:
After these changes we now recover 71% of Compton events in revan with the 35 keV threshold (and 99.5% of the Compton events when using a slow threshold file with realistic thresholds ~10 keV). I confirmed the ARM isn't dramatically altered.