diff --git a/inc/TRestDetectorSignalToRawSignalProcess.h b/inc/TRestDetectorSignalToRawSignalProcess.h index f281a5e..f59f6d0 100644 --- a/inc/TRestDetectorSignalToRawSignalProcess.h +++ b/inc/TRestDetectorSignalToRawSignalProcess.h @@ -69,6 +69,7 @@ class TRestDetectorSignalToRawSignalProcess : public TRestEventProcess { /// This parameter is used by integralWindow trigger mode to define the acquisition window. Double_t fIntegralThreshold = 1229.0; + Double_t fIntegralThresholdTPCkeV = 0.1; /// two distinct energy values used for calibration TVector2 fCalibrationEnergy = TVector2(0.0, 0.0); @@ -148,7 +149,7 @@ class TRestDetectorSignalToRawSignalProcess : public TRestEventProcess { std::map fParametersMap; std::set fReadoutTypes; - ClassDefOverride(TRestDetectorSignalToRawSignalProcess, 6); + ClassDefOverride(TRestDetectorSignalToRawSignalProcess, 7); }; #endif diff --git a/src/TRestDetectorSignalToRawSignalProcess.cxx b/src/TRestDetectorSignalToRawSignalProcess.cxx index fa4e83c..68ce937 100644 --- a/src/TRestDetectorSignalToRawSignalProcess.cxx +++ b/src/TRestDetectorSignalToRawSignalProcess.cxx @@ -290,12 +290,11 @@ TRestEvent* TRestDetectorSignalToRawSignalProcess::ProcessEvent(TRestEvent* inpu RESTDebug << "TRestDetectorSignalToRawSignalProcess::ProcessEvent: " << "Trigger mode integralThresholdTPC" << RESTendl; - const double signalIntegralThreshold = 0.5; // keV double totalEnergy = 0; for (const auto& signal : tpcSignals) { totalEnergy += signal->GetIntegral(); } - if (totalEnergy < signalIntegralThreshold) { + if (totalEnergy < fIntegralThresholdTPCkeV) { return nullptr; } @@ -340,7 +339,7 @@ TRestEvent* TRestDetectorSignalToRawSignalProcess::ProcessEvent(TRestEvent* inpu if (energy > maxEnergy) { maxEnergy = energy; } - if (maxEnergy > signalIntegralThreshold) { + if (maxEnergy >= fIntegralThresholdTPCkeV) { thresholdReached = true; break; } @@ -577,6 +576,15 @@ void TRestDetectorSignalToRawSignalProcess::InitFromConfigFile() { fTriggerDelay = StringToInteger(GetParameter("triggerDelay", fTriggerDelay)); fIntegralThreshold = StringToDouble(GetParameter("integralThreshold", fIntegralThreshold)); + fIntegralThresholdTPCkeV = + StringToDouble(GetParameter("integralThresholdTPCkeV", fIntegralThresholdTPCkeV)); + if (fIntegralThresholdTPCkeV <= 0) { + RESTWarning << "integralThresholdTPCkeV must be greater than 0: " << fIntegralThresholdTPCkeV + << RESTendl; + // This should always be an error but breaks the CI... + // exit(1); + } + fTriggerFixedStartTime = GetDblParameterWithUnits("triggerFixedStartTime", fTriggerFixedStartTime); // load default parameters (for backward compatibility)