Skip to content
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

add threshold energy tpc parameter #43

Merged
merged 2 commits into from
Mar 7, 2024
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
3 changes: 2 additions & 1 deletion inc/TRestDetectorSignalToRawSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -148,7 +149,7 @@ class TRestDetectorSignalToRawSignalProcess : public TRestEventProcess {
std::map<std::string, Parameters> fParametersMap;
std::set<std::string> fReadoutTypes;

ClassDefOverride(TRestDetectorSignalToRawSignalProcess, 6);
ClassDefOverride(TRestDetectorSignalToRawSignalProcess, 7);
};

#endif
14 changes: 11 additions & 3 deletions src/TRestDetectorSignalToRawSignalProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -340,7 +339,7 @@ TRestEvent* TRestDetectorSignalToRawSignalProcess::ProcessEvent(TRestEvent* inpu
if (energy > maxEnergy) {
maxEnergy = energy;
}
if (maxEnergy > signalIntegralThreshold) {
if (maxEnergy >= fIntegralThresholdTPCkeV) {
thresholdReached = true;
break;
}
Expand Down Expand Up @@ -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)
Expand Down
Loading