67 #include "TRestRawFindResponseSignalProcess.h"
95 if (LoadConfigFromFile(configFilename) == -1) LoadDefaultConfig();
110 SetName(
"findResponseSignal-Default");
111 SetTitle(
"Default config");
119 SetSectionName(this->ClassName());
120 SetLibraryVersion(LIBRARY_VERSION);
122 fInputSignalEvent =
nullptr;
139 if (LoadConfigFromFile(configFilename, name) == -1) LoadDefaultConfig();
156 if (fInputSignalEvent->GetNumberOfSignals() <= 0)
return nullptr;
157 if (fInputSignalEvent->GetNumberOfSignals() > 8)
return nullptr;
159 Int_t dominantSignal = -1;
160 Double_t maxPeak = 0;
162 for (
int n = 0; n < fInputSignalEvent->GetNumberOfSignals(); n++) {
163 if (fInputSignalEvent->GetSignal(n)->GetMaxPeakValue() > maxPeak) {
164 maxPeak = fInputSignalEvent->GetSignal(n)->GetMaxPeakValue();
170 if (maxPeak < 400 || maxPeak > 600)
return nullptr;
172 TRestRawSignal* sgnl = fInputSignalEvent->GetSignal(dominantSignal);
173 sgnl->
Scale(1000. / maxPeak);
175 fOutputSignalEvent->AddSignal(*sgnl);
177 return fOutputSignalEvent;
A base class for any REST event.
A process to find a representative signal to generate a response signal.
void InitProcess() override
Process initialization. Function to be executed once at the beginning of process (before starting the...
TRestRawFindResponseSignalProcess()
Default constructor.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void EndProcess() override
End of procesing. Function to be executed once at the end of the process. It gets access to all the a...
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
void Initialize() override
Function to initialize input/output event members and define the section name.
~TRestRawFindResponseSignalProcess()
Default destructor.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
An event container for time rawdata signals with fixed length.
It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.
void Scale(Double_t value)
This method scales the signal by a given value.