REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawVetoAnalysisProcess.h
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see http://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see http://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
23#ifndef RestCore_TRestRawVetoAnalysisProcess
24#define RestCore_TRestRawVetoAnalysisProcess
25
26#include "TRestEventProcess.h"
27#include "TRestRawSignalEvent.h"
28
33 private:
35 TVector2 fBaseLineRange; //<
36
38 TVector2 fRange; //<
39
42
44 std::vector<double> fTimeWindow;
45
47 std::vector<double> fVetoSignalId;
48
50 std::vector<std::string> fVetoGroupIds;
51
53 std::vector<std::string> fVetoGroupNames;
54
56 std::vector<std::string> fPeakTime;
57
59 std::vector<std::string> fPeakAmp;
60
63
66 Double_t fSignalThreshold;
67 Int_t fPointsOverThreshold;
68
69 TRestRawReadoutMetadata* fReadoutMetadata = nullptr;
70
71 void InitFromConfigFile() override;
72
73 void Initialize() override;
74
75 void LoadDefaultConfig();
76
77 protected:
78 public:
79 RESTValue GetInputEvent() const override { return fSignalEvent; }
80 RESTValue GetOutputEvent() const override { return fSignalEvent; }
81
82 void InitProcess() override;
83 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
84
85 void LoadConfig(const std::string& configFilename, const std::string& name = "");
86
87 void PrintMetadata() override;
88
91
93 const char* GetProcessName() const override { return "vetoAnalysis"; }
94
96 std::vector<double> GetVetoSignalIDs() { return fVetoSignalId; }
97 double GetVetoSignalIDs(Int_t index) {
98 if (index >= (int)fVetoSignalId.size()) return -1;
99 return fVetoSignalId[index];
100 }
101
103 std::pair<std::vector<std::string>, std::vector<std::string>> GetVetoGroups() {
104 std::pair<std::vector<std::string>, std::vector<std::string>> output;
105 output.first = fVetoGroupNames;
106 output.second = fVetoGroupIds;
107 return output;
108 }
109
110 Int_t GetGroupIndex(const std::string& groupName);
111 std::string GetGroupIds(const std::string& groupName);
112
114 TRestRawVetoAnalysisProcess(const char* configFilename);
115
117
118 // If new members are added, removed or modified in this class version number
119 // must be increased!
120 ClassDefOverride(TRestRawVetoAnalysisProcess, 2);
121};
122#endif
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
An event container for time rawdata signals with fixed length.
Int_t GetGroupIndex(const std::string &groupName)
Function that returns the index of a specified veto group within the group name vector and ID vector.
std::vector< double > fVetoSignalId
Veto signal IDs.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
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.
const char * GetProcessName() const override
Returns the name of this process.
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.
TRestEventProcess * Maker()
Returns a new instance of this class.
std::pair< std::vector< std::string >, std::vector< std::string > > GetVetoGroups()
Returns the veto group names and IDs.
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.
TRestRawVetoAnalysisProcess()
Default constructor.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
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.
std::vector< double > GetVetoSignalIDs()
Returns the veto IDs, if they where defined in a list.
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.
std::string GetGroupIds(const std::string &groupName)
Function that returns a string of the signal IDs for the specified veto group.