Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/MModuleEnergyCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ class MModuleEnergyCalibration : public MModule

//! Max value of the ADC units
static constexpr double m_MaxADCRange = 16383;
//! ADC value above which a strip hit is flagged as having a high ADC value
static constexpr double m_HighADCThreshold = 14000;

#ifdef ___CLING___
public:
Expand Down
10 changes: 10 additions & 0 deletions include/MReadOutAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ class MReadOutAssembly : public MReadOutSequence
//! Get the Strip Hit Below Threshold quality flag
bool HasStripHitBelowThreshold_QualityFlag() const { return m_StripHitBelowThreshold_QualityFlag; }

//! Set the High ADC quality flag
void SetHighADC_QualityFlag(const MString& Text = "") { m_HighADC_QualityFlag = true; if (Text != "") m_HighADCString_QualityFlag.push_back(Text); }
//! Get the High ADC quality flag
bool HasHighADC_QualityFlag() const { return m_HighADC_QualityFlag; }

//! Set the Strip Pairing quality flag
void SetStripPairing_QualityFlag(const MString& Text = "") { m_StripPairing_QualityFlag = true; if (Text != "") m_StripPairingString_QualityFlag.push_back(Text); }
//! Get the Strip Pairing quality flag
Expand Down Expand Up @@ -412,6 +417,11 @@ class MReadOutAssembly : public MReadOutSequence
//! Strip hit below threshold quality string
vector<MString> m_StripHitBelowThresholdString_QualityFlag;

//! High ADC quality flag
bool m_HighADC_QualityFlag;
//! High ADC quality string
vector<MString> m_HighADCString_QualityFlag;

//! Strip pairing quality flag
bool m_StripPairing_QualityFlag;
//! Strip pairing quality string
Expand Down
10 changes: 10 additions & 0 deletions resource/unittestdata/406-1/hdf5-to-tra.reference.tra
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ SE
ID 171
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 16.052900) (Strip hit removed with energy 11.981073) (Strip hit removed with energy 8.771925) (Strip hit removed with energy 7.845102) (Strip hit removed with energy 8.958687) (Strip hit removed with energy 14.364213) (Strip hit removed with energy 15.618454) (Strip hit removed with energy -28.297535) (Strip hit removed with energy -7.770818)
QA HighADC (High ADC value 15804 for Detector: 0, side: LV, strip: 20) (High ADC value 16013 for Detector: 0, side: LV, strip: 21) (High ADC value 16006 for Detector: 0, side: LV, strip: 22) (High ADC value 15449 for Detector: 0, side: LV, strip: 23) (High ADC value 15058 for Detector: 0, side: HV, strip: 53) (High ADC value 16015 for Detector: 0, side: HV, strip: 54) (High ADC value 16038 for Detector: 0, side: HV, strip: 55)
QA StripPairing (Best reduced chi square is not below 25 (466.978427)) (GR Hit: Detector ID 0 and Energy 294.916417)
BD GR Veto
PQ 466.978
Expand Down Expand Up @@ -9626,6 +9627,7 @@ ID 1253
BD StripPairingError (More than maximum number of strip hits allowed on one side (7))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 6.961407) (Strip hit removed with energy 8.933764) (Strip hit removed with energy 17.695176) (Strip hit removed with energy 11.402859) (Strip hit removed with energy 7.629766) (Strip hit removed with energy 17.062778) (Strip hit removed with energy 13.739803)
QA HighADC (High ADC value 16033 for Detector: 0, side: LV, strip: 42) (High ADC value 15965 for Detector: 0, side: LV, strip: 43) (High ADC value 16077 for Detector: 0, side: HV, strip: 61)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -9919,6 +9921,7 @@ ID 1293
BD StripPairingError (More than maximum number of strip hits allowed on one side (8))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 10.624611) (Strip hit removed with energy 18.359129) (Strip hit removed with energy 14.883559) (Strip hit removed with energy 10.931843) (Strip hit removed with energy 8.633496) (Strip hit removed with energy 8.894950) (Strip hit removed with energy 12.278867) (Strip hit removed with energy -0.823052)
QA HighADC (High ADC value 14135 for Detector: 0, side: LV, strip: 1) (High ADC value 16123 for Detector: 0, side: LV, strip: 64) (High ADC value 16014 for Detector: 0, side: HV, strip: 64)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -24905,6 +24908,7 @@ SE
ID 3247
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 7.116343) (Strip hit removed with energy 10.714684) (Strip hit removed with energy 18.330011) (Strip hit removed with energy 15.782019) (Strip hit removed with energy 15.881703) (Strip hit removed with energy 10.092588) (Strip hit removed with energy 7.156331) (Strip hit removed with energy 8.711120) (Strip hit removed with energy 7.829357) (Strip hit removed with energy 8.236825) (Strip hit removed with energy 12.113871)
QA HighADC (High ADC value 14773 for Detector: 0, side: LV, strip: 8) (High ADC value 14062 for Detector: 0, side: LV, strip: 11) (High ADC value 16065 for Detector: 0, side: HV, strip: 2) (High ADC value 14972 for Detector: 0, side: HV, strip: 3)
QA StripPairing (Best reduced chi square is not below 25 (478.096823)) (Best strip pairing contains more than 5 strip groupings on one side) (Best strip pairing leaves at least one grouping of strips unpaired (unpaired energy: 5332.539902)) (Event contains multiple hits on a single strip) (GR Hit: Detector ID 0 and Energy 181.908526)
BD GR Veto
PQ 478.097
Expand Down Expand Up @@ -28409,6 +28413,7 @@ SE
ID 3706
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 7.938531) (Strip hit removed with energy 10.729861) (Strip hit removed with energy 11.572864) (Strip hit removed with energy 13.057852)
QA HighADC (High ADC value 14691 for Detector: 0, side: LV, strip: 64)
QA StripPairing (Best strip pairing leaves at least one grouping of strips unpaired (unpaired energy: 21.583803)) (GR Hit: Detector ID 0 and Energy 2008.377728)
BD GR Veto
PQ 0.688171
Expand Down Expand Up @@ -36526,6 +36531,7 @@ SE
ID 4784
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 8.000643) (Strip hit removed with energy 7.667605) (Strip hit removed with energy 9.765564) (Strip hit removed with energy 7.838833) (Strip hit removed with energy 12.329513) (Strip hit removed with energy 16.020982) (Strip hit removed with energy 17.575923) (Strip hit removed with energy 12.322915) (Strip hit removed with energy 11.493931) (Strip hit removed with energy 7.947770) (Strip hit removed with energy 9.194799) (Strip hit removed with energy 14.312189) (Strip hit removed with energy 16.240531) (Strip hit removed with energy -9.221858) (Strip hit removed with energy 18.540329)
QA HighADC (High ADC value 16123 for Detector: 0, side: LV, strip: 64) (High ADC value 16014 for Detector: 0, side: HV, strip: 64)
QA StripPairing (Best reduced chi square is not below 25 (42.859504)) (Best strip pairing leaves at least one grouping of strips unpaired (unpaired energy: 129.529017)) (Event contains multiple hits on a single strip) (GR Hit: Detector ID 0 and Energy 34.480688) (GR Hit: Detector ID 0 and Energy 68.944180) (GR Hit: Detector ID 0 and Energy 2243.958918)
BD GR Veto
PQ 42.8595
Expand Down Expand Up @@ -38958,6 +38964,7 @@ SE
ID 5102
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 10.847868) (Strip hit removed with energy 10.407519) (Strip hit removed with energy 7.814563) (Strip hit removed with energy 7.832260) (Strip hit removed with energy 12.573667) (Strip hit removed with energy 13.002596) (Strip hit removed with energy 13.516989) (Strip hit removed with energy 10.361103) (Strip hit removed with energy 8.906325) (Strip hit removed with energy -10.986370)
QA HighADC (High ADC value 16040 for Detector: 0, side: LV, strip: 58) (High ADC value 16055 for Detector: 0, side: LV, strip: 59) (High ADC value 15997 for Detector: 0, side: LV, strip: 60) (High ADC value 16056 for Detector: 0, side: LV, strip: 61) (High ADC value 15696 for Detector: 0, side: LV, strip: 64) (High ADC value 15813 for Detector: 0, side: HV, strip: 7) (High ADC value 16041 for Detector: 0, side: HV, strip: 8) (High ADC value 16011 for Detector: 0, side: HV, strip: 9) (High ADC value 16021 for Detector: 0, side: HV, strip: 10) (High ADC value 15915 for Detector: 0, side: HV, strip: 12) (High ADC value 15970 for Detector: 0, side: HV, strip: 64)
QA StripPairing (Best reduced chi square is not below 25 (1063.315896)) (GR Hit: Detector ID 0 and Energy 2390.281672)
BD GR Veto
PQ 1063.32
Expand Down Expand Up @@ -40532,6 +40539,7 @@ ID 5314
BD StripPairingError (More than maximum number of strip hits allowed on one side (8))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 10.953168) (Strip hit removed with energy 15.073470) (Strip hit removed with energy 15.021121) (Strip hit removed with energy 14.916823) (Strip hit removed with energy 9.691315) (Strip hit removed with energy 8.445107) (Strip hit removed with energy 6.878826) (Strip hit removed with energy 10.837057)
QA HighADC (High ADC value 16042 for Detector: 0, side: LV, strip: 41) (High ADC value 16121 for Detector: 0, side: LV, strip: 64) (High ADC value 15979 for Detector: 0, side: HV, strip: 64)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -49355,6 +49363,7 @@ ID 6482
BD StripPairingError (More than maximum number of strip hits allowed on one side (8))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 6.740801) (Strip hit removed with energy 6.303791) (Strip hit removed with energy 8.010620) (Strip hit removed with energy 9.084545) (Strip hit removed with energy 12.185240) (Strip hit removed with energy 13.419191) (Strip hit removed with energy 18.605867) (Strip hit removed with energy 13.114570)
QA HighADC (High ADC value 16123 for Detector: 0, side: LV, strip: 64) (High ADC value 16014 for Detector: 0, side: HV, strip: 64)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -56122,6 +56131,7 @@ ID 7371
BD StripPairingError (More than maximum number of strip hits allowed on one side (11))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 15.135602) (Strip hit removed with energy 10.825201) (Strip hit removed with energy 10.925057) (Strip hit removed with energy 18.841883)
QA HighADC (High ADC value 15979 for Detector: 0, side: LV, strip: 2) (High ADC value 15990 for Detector: 0, side: LV, strip: 3) (High ADC value 14353 for Detector: 0, side: LV, strip: 4) (High ADC value 14982 for Detector: 0, side: LV, strip: 5) (High ADC value 16012 for Detector: 0, side: HV, strip: 49) (High ADC value 15344 for Detector: 0, side: HV, strip: 50) (High ADC value 14266 for Detector: 0, side: HV, strip: 53)
BD GR Veto
PQ
SE
Expand Down
3 changes: 3 additions & 0 deletions resource/unittestdata/542-1/hdf5-to-tra.reference.tra
Original file line number Diff line number Diff line change
Expand Up @@ -15126,6 +15126,7 @@ ID 1880
BD StripPairingError (More than maximum number of strip hits allowed on one side (21))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 19.233721) (Strip hit removed with energy 18.976474) (Strip hit removed with energy 19.234818) (Strip hit removed with energy 19.704374) (Strip hit removed with energy 18.685952) (Strip hit removed with energy 9.259302) (Strip hit removed with energy 10.131297) (Strip hit removed with energy 10.035446) (Strip hit removed with energy 12.924219) (Strip hit removed with energy 14.244382) (Strip hit removed with energy 8.304193) (Strip hit removed with energy 9.575914)
QA HighADC (High ADC value 15253 for Detector: 0, side: LV, strip: 49) (High ADC value 16032 for Detector: 0, side: LV, strip: 50) (High ADC value 16046 for Detector: 0, side: LV, strip: 51) (High ADC value 16039 for Detector: 0, side: LV, strip: 52) (High ADC value 15985 for Detector: 0, side: LV, strip: 53) (High ADC value 16038 for Detector: 0, side: LV, strip: 64) (High ADC value 16051 for Detector: 0, side: HV, strip: 56) (High ADC value 15982 for Detector: 0, side: HV, strip: 57) (High ADC value 14447 for Detector: 0, side: HV, strip: 58) (High ADC value 14816 for Detector: 0, side: HV, strip: 59) (High ADC value 15988 for Detector: 0, side: HV, strip: 60) (High ADC value 16019 for Detector: 0, side: HV, strip: 61) (High ADC value 14201 for Detector: 0, side: HV, strip: 63) (High ADC value 16110 for Detector: 0, side: HV, strip: 64)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -18912,6 +18913,7 @@ ID 2347
BD StripPairingError (More than maximum number of strip hits allowed on one side (17))
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 17.634230) (Strip hit removed with energy -1.711899) (Strip hit removed with energy 19.864592) (Strip hit removed with energy 18.924463) (Strip hit removed with energy 18.547828) (Strip hit removed with energy 10.036853) (Strip hit removed with energy 10.273034) (Strip hit removed with energy 14.155659) (Strip hit removed with energy 15.555762) (Strip hit removed with energy 16.478008) (Strip hit removed with energy 11.143212) (Strip hit removed with energy 8.620146) (Strip hit removed with energy 10.216403)
QA HighADC (High ADC value 15827 for Detector: 0, side: LV, strip: 36) (High ADC value 16044 for Detector: 0, side: LV, strip: 38) (High ADC value 14517 for Detector: 0, side: LV, strip: 39) (High ADC value 15803 for Detector: 0, side: LV, strip: 42) (High ADC value 16049 for Detector: 0, side: LV, strip: 44) (High ADC value 15065 for Detector: 0, side: LV, strip: 64) (High ADC value 15231 for Detector: 0, side: HV, strip: 64)
BD GR Veto
PQ
SE
Expand Down Expand Up @@ -41219,6 +41221,7 @@ SE
ID 5112
BD DepthCalibrationError (GR Veto)
QA StripHitBelowThreshold (Strip hit removed with energy 9.652147) (Strip hit removed with energy 13.842069) (Strip hit removed with energy 11.328372) (Strip hit removed with energy 17.456197)
QA HighADC (High ADC value 15080 for Detector: 0, side: HV, strip: 64)
QA StripPairing (Best reduced chi square is not below 25 (151874.330455)) (GR Hit: Detector ID 0 and Energy 2669.457316)
BD GR Veto
PQ 151874
Expand Down
9 changes: 9 additions & 0 deletions src/MModuleEnergyCalibration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ bool MModuleEnergyCalibration::AnalyzeEvent(MReadOutAssembly* Event)
MStripHit* SH = Event->GetStripHit(i);
MReadOutElementDoubleStrip R = *dynamic_cast<MReadOutElementDoubleStrip*>(SH->GetReadOutElement());

// Flag strip hits whose ADC value is close to the ADC saturation limit, since their
// calibrated energy is not trustworthy. The hit is kept, it is only marked.
if (SH->GetADCUnits() > m_HighADCThreshold) {
if (g_Verbosity >= c_Warning) {
cout << m_XmlTag << ": Warning: High ADC value " << (int) SH->GetADCUnits() << " for read-out element " << R << endl;
}
Event->SetHighADC_QualityFlag("High ADC value " + to_string((int) SH->GetADCUnits()) + " for " + R.ToString().Data());
}

TF1* Fit = m_Calibration[R];
TF1* FitRes = m_ResolutionCalibration[R];

Expand Down
14 changes: 14 additions & 0 deletions src/MReadOutAssembly.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ void MReadOutAssembly::Clear()
m_StripHitBelowThreshold_QualityFlag = false;
m_StripHitBelowThresholdString_QualityFlag.clear();

m_HighADC_QualityFlag = false;
m_HighADCString_QualityFlag.clear();

m_StripPairing_QualityFlag = false;
m_StripPairingString_QualityFlag.clear();

Expand Down Expand Up @@ -767,6 +770,17 @@ void MReadOutAssembly::StreamBDFlags(ostream& S)
S<<endl;
}

if (m_HighADC_QualityFlag == true) {
S<<"QA HighADC";
if (m_HighADCString_QualityFlag.empty() == false) {
// Append any associated error text
for (auto i : m_HighADCString_QualityFlag) {
S<<" ("<<i<<")";
}
}
S<<endl;
}

if (m_StripPairing_QualityFlag == true) {
S<<"QA StripPairing";
if (m_StripPairingString_QualityFlag.empty() == false) {
Expand Down
Loading