137#include "TRestRawVetoAnalysisProcess.h"
177 SetName(this->ClassName());
178 SetTitle(
"Default config");
223 map<int, Double_t> VetoMaxPeakAmplitude_map;
224 map<int, Double_t> VetoPeakTime_map;
226 Int_t VetoAboveThreshold = 0;
227 Int_t NVetoAboveThreshold = 0;
228 Int_t VetoInTimeWindow = 0;
229 Int_t NVetoInTimeWindow = 0;
233 VetoMaxPeakAmplitude_map.clear();
234 VetoPeakTime_map.clear();
251 fPointsOverThreshold);
268 VetoAboveThreshold = 1;
269 NVetoAboveThreshold += 1;
273 VetoInTimeWindow = 1;
274 NVetoInTimeWindow += 1;
306 for (
unsigned int j = 0; j < groupIds.size(); j++) {
315 fPointsOverThreshold);
323 VetoMaxPeakAmplitude_map[groupIds[j]] = 0;
331 VetoAboveThreshold = 1;
332 NVetoAboveThreshold += 1;
336 VetoInTimeWindow = 1;
337 NVetoInTimeWindow += 1;
344 VetoMaxPeakAmplitude_map.clear();
345 VetoPeakTime_map.clear();
379 return std::string(
"-1");
392 cout <<
"Error: timeWindow has to consist of two comma-separated values." << endl;
397 fSignalThreshold = potpars[1];
398 fPointsOverThreshold = (Int_t)potpars[2];
412 TiXmlElement* vetoDefinition =
GetElement(
"vetoGroup");
414 while (vetoDefinition !=
nullptr) {
422 cout <<
"Error: veto groups and veto IDs defined separately!" << endl;
445 RESTMetadata <<
"All veto signal IDs: ";
446 for (
unsigned int i = 0; i <
fVetoGroupIds.size() - 1; i++) {
457 RESTMetadata <<
"Noise reduction: Points over Threshold parameters = (" <<
fPointThreshold <<
", "
458 << fSignalThreshold <<
", " << fPointsOverThreshold <<
")" <<
RESTendl;
void BeginPrintProcess()
[name, cut range]
void SetObservableValue(const std::string &name, const T &value)
Set observable value for AnalysisTree.
A base class for any REST event.
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.
Double_t GetMaxPeakValue()
It returns the amplitude of the signal maximum, baseline will be corrected if CalculateBaseLine was c...
void CalculateBaseLine(Int_t startBin, Int_t endBin, const std::string &option="")
This method calculates the average and fluctuation of the baseline in the specified range and writes ...
std::vector< Int_t > GetPointsOverThreshold() const
Returns a std::vector containing the indexes of data points over threshold.
void InitializePointsOverThreshold(const TVector2 &thrPar, Int_t nPointsOver, Int_t nPointsFlat=512)
It initializes the fPointsOverThreshold array with the indexes of data points that are found over thr...
Int_t GetMaxPeakBin()
It returns the bin at which the maximum peak amplitude happens.
~TRestRawVetoAnalysisProcess()
Default destructor.
std::vector< double > fVetoSignalId
Veto signal IDs.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
std::vector< std::string > fPeakTime
Peak Time observable names.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
void Initialize() override
Function to initialize input/output event members and define the section name and library version.
Int_t fThreshold
Threshold of the vetoes.
Double_t fPointThreshold
PointsOverThreshold() Parameters:
void InitProcess() override
Function to use in initialization of process members before starting to process the event.
TRestRawSignalEvent * fSignalEvent
A pointer to the specific TRestRawSignalEvent.
std::vector< std::string > fPeakAmp
Max peak amplitude observable names.
TVector2 fRange
The range used to calculate the veto signal parameters.
std::vector< std::string > fVetoGroupIds
Veto signal IDs per group.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestRawVetoAnalysisProcess section.
std::string GetGroupIds(std::string groupName)
Function that returns a string of the signal IDs for the specified veto group.
TRestRawVetoAnalysisProcess()
Default constructor.
Int_t GetGroupIndex(std::string groupName)
Function that returns the index of a specified veto group within the group name vector and ID vector.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TVector2 fBaseLineRange
The range used to calculate the baseline parameters from the veto signal.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
std::vector< std::string > fVetoGroupNames
Veto group Names.
std::vector< double > fTimeWindow
Peak time window for cut.
@ REST_Extreme
show everything
@ REST_Debug
+show the defined debug messages
Int_t GetChar(std::string hint="Press a KEY to continue ...")
Helps to pause the program, printing a message before pausing.
Int_t StringToInteger(std::string in)
Gets an integer from a string.
TVector2 StringTo2DVector(std::string in)
Gets a 2D-vector from a string.
std::vector< double > StringToElements(std::string in, std::string separator)
Convert the input string into a vector of double elements.