Updated strip hit threshold logic#81
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.
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.
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.
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.
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.
It is better to define "magic numbers" explicitly in the beginning:
const double DefaultSlowThreshold = 15.0;
There was a problem hiding this comment.
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.
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. |
|
@zoglauer, I've address all of your comments, if you want to take another look. I'll open up another PR that cleans up the rest of the BD and QA flags. |
Emily-Broadbent
left a comment
There was a problem hiding this comment.
After @zoglauer 's updates, the logic looks good to me
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.