diff --git a/include/MReadOutAssembly.h b/include/MReadOutAssembly.h index 1a8b0aa..cc2d210 100644 --- a/include/MReadOutAssembly.h +++ b/include/MReadOutAssembly.h @@ -269,10 +269,15 @@ class MReadOutAssembly : public MReadOutSequence bool IsStripHitBelowThreshold() const { return m_StripHitBelowThreshold; } - //! Set the strip-pairing-incomplete flag + //! Set the strip-pairing-incomplete flag void SetStripPairingIncomplete(bool Flag = true, MString Text = "") { m_StripPairingIncomplete = Flag; m_StripPairingIncompleteString = Text; } //! Get the strip-pairing-incomplete flag bool IsStripPairingIncomplete() const { return m_StripPairingIncomplete; } + + //! Set the strip-pairing-incomplete flag + void SetStripPairingQualityFlag(bool Flag = true, MString Text = "") { m_StripPairingQualityFlag = Flag; m_StripPairingQualityFlagString = Text; } + //! Get the strip-pairing-incomplete flag + bool GetStripPairingQualityFlag() const { return m_StripPairingQualityFlag; } //! Set the LLD Event flag void SetLLDEvent(bool Flag = true, MString Text = "") { m_LLDEvent = Flag; m_LLDEventString = Text; } @@ -453,6 +458,11 @@ class MReadOutAssembly : public MReadOutSequence MString m_DepthCalibration_OutofRangeString; bool m_StripHitBelowThreshold; MString m_StripHitBelowThresholdString; + + // Flags indicating the quality of the event: quality warning, but not to be filtered out + bool m_StripPairingQualityFlag; + MString m_StripPairingQualityFlagString; + diff --git a/src/MModuleStripPairingMultiRoundChiSquare.cxx b/src/MModuleStripPairingMultiRoundChiSquare.cxx index a3e42f1..7a75fe1 100644 --- a/src/MModuleStripPairingMultiRoundChiSquare.cxx +++ b/src/MModuleStripPairingMultiRoundChiSquare.cxx @@ -272,9 +272,7 @@ bool MModuleStripPairingMultiRoundChiSquare::EventSelection(MReadOutAssembly* Ev for (unsigned int d = 0; d < StripHits.size(); ++d) { // Detector loop for (unsigned int side = 0; side <= 1; ++side) { // Side loop if (StripHits[d][side].size() > MaxStripHits) { - Event->SetStripPairingIncomplete(true, "More than 6 hit strips on one side"); - Event->SetAnalysisProgress(MAssembly::c_StripPairing); - return false; + Event->SetStripPairingQualityFlag(true, "More than 6 hit strips on one side"); //Only set a quality flag, but don't filter out event } // Check if one side of the detector has no strip hits @@ -359,11 +357,6 @@ tuple>, vector>, double> MModul unsigned int MinSize = min(Combinations[d][0][lv].size(), Combinations[d][1][hv].size()); - // Skip pairing if either side has more than 5 sets of strips - if (max(Combinations[d][0][lv].size(), Combinations[d][1][hv].size()) > MaxCombinations) { - continue; - } - bool MorePermutations = true; while (MorePermutations == true) { @@ -660,9 +653,7 @@ bool MModuleStripPairingMultiRoundChiSquare::CreateHits(unsigned int d, MReadOut // One last quality selection based on total event energies if ((EnergyTotal > max(LVEnergyTotal, HVEnergyTotal) + 2.5 * max(LVEnergyResTotal, HVEnergyResTotal) || EnergyTotal < min(LVEnergyTotal, HVEnergyTotal) - 2.5 * max(LVEnergyResTotal, HVEnergyResTotal))) { - Event->SetStripPairingIncomplete(true, "Strips not pairable wihin 2.5 sigma of measured energy"); - Event->SetAnalysisProgress(MAssembly::c_StripPairing); - return false; + Event->SetStripPairingQualityFlag(true, "Strips not pairable wihin 2.5 sigma of measured energy"); // Set quality flag, but don't filter out event } // Plot the good events else if ((HasExpos() == true) and Event->IsGood() == true) { @@ -765,9 +756,12 @@ bool MModuleStripPairingMultiRoundChiSquare::AnalyzeEvent(MReadOutAssembly* Even } // Flag events with a reduced chi square > 25 else if (BestChiSquare > 25) { - Event->SetStripPairingIncomplete(true, "Best reduced chi square is not below 25"); - Event->SetAnalysisProgress(MAssembly::c_StripPairing); - return false; + Event->SetStripPairingQualityFlag(true, "Best reduced chi square is not below 25"); // Set quality flag but don't filter out event + } + + if (max(BestLVSideCombo.size(), BestHVSideCombo.size()) > MaxCombinations) { + Event->SetStripPairingQualityFlag(true, "Best LV or HV combination has more than 5 strip groupings"); + // Set quality flag, but don't filter out event } // Assign the best reduced chi square to the event diff --git a/src/MReadOutAssembly.cxx b/src/MReadOutAssembly.cxx index 0c6a9fa..e02848b 100644 --- a/src/MReadOutAssembly.cxx +++ b/src/MReadOutAssembly.cxx @@ -184,6 +184,8 @@ void MReadOutAssembly::Clear() m_EnergyResolutionCalibrationIncompleteString = ""; m_StripPairingIncomplete = false; m_StripPairingIncompleteString = ""; + m_StripPairingQualityFlag = false; + m_StripPairingQualityFlagString = ""; m_LLDEvent = false; m_LLDEventString = ""; m_DepthCalibrationIncomplete = false; @@ -590,6 +592,11 @@ bool MReadOutAssembly::StreamDat(ostream& S, int Version) if (m_StripPairingIncompleteString != "") S<<" ("<GetStripHitMultipleTimesX()) { - S<<"BD Multiple Hits on LV Strip"<GetStripHitMultipleTimesY()) { - S<<"BD Multiple Hits on HV Strip"<GetStripHitMultipleTimesX()) { - S<<"BD Multiple Hits on LV Strip"<GetStripHitMultipleTimesY()) { - S<<"BD Multiple Hits on HV Strip"<