REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorSignalChannelActivityProcess.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_TRestDetectorSignalChannelActivityProcess
24#define RestCore_TRestDetectorSignalChannelActivityProcess
25
26#include <TH1D.h>
27#include <TRestEventProcess.h>
28
29#include "TRestDetectorReadout.h"
30#include "TRestDetectorSignalEvent.h"
31
34 private:
37
40
41 void InitFromConfigFile() override;
42
43 void Initialize() override;
44
45 void LoadDefaultConfig();
46
47 protected:
49 Double_t fLowThreshold;
50
53
56
59
62
65
68
71
74
77
80
83
86
89
92
95
98
101
102 public:
103 RESTValue GetInputEvent() const override { return fSignalEvent; }
104 RESTValue GetOutputEvent() const override { return fSignalEvent; }
105
106 void InitProcess() override;
107 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
108 void EndProcess() override;
109
110 void LoadConfig(const std::string& configFilename, const std::string& name = "");
111
113 void PrintMetadata() override {
115
116 RESTMetadata << "Low signal threshold activity : " << fLowThreshold << RESTendl;
117 RESTMetadata << "High signal threshold activity : " << fHighThreshold << RESTendl;
118
119 RESTMetadata << "Number of daq histogram channels : " << fDaqHistogramChannels << RESTendl;
120 RESTMetadata << "Start daq channel : " << fDaqStartChannel << RESTendl;
121 RESTMetadata << "End daq channel : " << fDaqEndChannel << RESTendl;
122
123 RESTMetadata << "Number of readout histogram channels : " << fReadoutHistogramChannels << RESTendl;
124 RESTMetadata << "Start readout channel : " << fReadoutStartChannel << RESTendl;
125 RESTMetadata << "End readout channel : " << fReadoutEndChannel << RESTendl;
126
127 EndPrintProcess();
128 }
129
131 const char* GetProcessName() const override { return "SignalChannelActivity"; }
132
133 // Constructor
135 TRestDetectorSignalChannelActivityProcess(const char* configFilename);
136 // Destructor
138
140};
141#endif
A metadata class to generate/store a readout description.
A pure analysis process to generate histograms with detector channels activity.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TH1D * fReadoutChannelsHisto_TwoSignals
The readout channels histogram built with 2-signal events (low threshold)
TRestDetectorReadout * fReadout
A pointer to the readout metadata information accessible to TRestRun.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
TRestDetectorSignalEvent * fSignalEvent
A pointer to the specific TRestDetectorSignalEvent input.
Int_t fReadoutHistogramChannels
The number of bins at the readout channels histogram.
TH1D * fReadoutChannelsHisto_MultiSignals
The readout channels histogram built more than 3-signal events (low threshold)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
TH1D * fReadoutChannelsHisto_TwoSignals_High
The readout channels histogram built with 2-signal events (high threshold)
Int_t fReadoutEndChannel
The last channel at the readout channels histogram.
void Initialize() override
Function to initialize input/output event members and define the section name.
TH1D * fReadoutChannelsHisto_MultiSignals_High
The readout channels histogram built more than 3-signal events (high threshold)
void InitFromConfigFile() override
Function to read input parameters from the RML TRestDetectorSignalChannelActivityProcess metadata sec...
const char * GetProcessName() const override
Returns the name of this process.
Int_t fDaqHistogramChannels
The number of bins at the daq channels histogram.
Int_t fReadoutStartChannel
The first channel at the readout channels histogram.
TH1D * fReadoutChannelsHisto_OneSignal_High
The readout channels histogram built with 1-signal events (high threshold)
void EndProcess() override
Function to include required actions after all events have been processed. In this process it will ta...
Int_t fDaqStartChannel
The first channel at the daq channels histogram.
TH1D * fReadoutChannelsHisto_OneSignal
The readout channels histogram built with 1-signal events (low threshold)
Double_t fHighThreshold
The value of the higher signal threshold to add it to the histogram.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
Double_t fLowThreshold
The value of the lower signal threshold to add it to the histogram.
TH1D * fReadoutChannelsHisto_ThreeSignals_High
The readout channels histogram built with 3-signal events (high threshold)
void InitProcess() override
Process initialization. The ROOT TH1 histograms are created here using the limits defined in the proc...
TH1D * fReadoutChannelsHisto_ThreeSignals
The readout channels histogram built with 3-signal events (low threshold)
Int_t fDaqEndChannel
The last channel at the daq channels histogram.
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.