REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorTriggerAnalysisProcess.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_TRestDetectorTriggerAnalysisProcess
24#define RestCore_TRestDetectorTriggerAnalysisProcess
25
26#include <TRestEventProcess.h>
27
28#include "TRestDetectorSignalEvent.h"
29
32 private:
35
37 std::vector<std::string> fIntegralObservables;
38
40 std::vector<double> fThreshold;
41
42 void Initialize() override;
43
44 void LoadDefaultConfig();
45
46 protected:
48 Double_t fSampling = 0.2;
49
51 Int_t fADCLength = 512;
52
53 public:
55 RESTValue GetInputEvent() const override { return fSignalEvent; }
56
58 RESTValue GetOutputEvent() const override { return fSignalEvent; }
59
60 void InitProcess() override;
61 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
62
63 void LoadConfig(const std::string& configFilename, const std::string& name = "");
64
66 void PrintMetadata() override {
68
69 RESTMetadata << "Sampling : " << fSampling << " us" << RESTendl;
70 RESTMetadata << "ADC length : " << fADCLength << RESTendl;
71
72 EndPrintProcess();
73 }
74
76 const char* GetProcessName() const override { return "triggerAnalysis"; }
77
79 TRestDetectorTriggerAnalysisProcess(const char* configFilename);
80
82
83 ClassDefOverride(TRestDetectorTriggerAnalysisProcess, 2);
84};
85#endif
A process to generate integral observables for signal ADC windows found above the defined energy thre...
RESTValue GetOutputEvent() const override
Returns a pointer to the input signal event.
Int_t fADCLength
It defines the number of bins used to define the sampling depth.
TRestDetectorSignalEvent * fSignalEvent
A pointer to the specific TRestSignalEvent input.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
RESTValue GetInputEvent() const override
Returns a pointer to the input signal event.
const char * GetProcessName() const override
Returns a std::string with the process name.
void PrintMetadata() override
Prints on screen the metadata information registered by this process.
std::vector< double > fThreshold
A std::vector to temporary the extracted threshold value from the corresponding observable.
void Initialize() override
Function to initialize input/output event members and define the section name.
Double_t fSampling
It defines the sampling time in us to treat the signal as if it would be a rawsignal.
void InitProcess() override
Process initialization. Observable names are interpreted here.
std::vector< std::string > fIntegralObservables
A std::vector to temporary store the name of threshold observables.
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.