REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawSignalChannelActivityProcess.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_TRestRawSignalChannelActivityProcess
24 #define RestCore_TRestRawSignalChannelActivityProcess
25 
26 #include <TH1D.h>
27 #include <TRestRawSignalEvent.h>
28 
29 #include "TRestEventProcess.h"
30 
34  protected:
36  Double_t fLowThreshold = 25;
37 
39  Double_t fHighThreshold = 50;
40 
42  Int_t fDaqChannels = 300;
43 
45  Int_t fDaqStartChannel = 4320;
46 
48  Int_t fDaqEndChannel = 4620;
49 
51  TH1D* fDaqChannelsHisto = nullptr;
52 
53  private:
56 
57  void Initialize() override;
58 
59  public:
60  RESTValue GetInputEvent() const override { return fSignalEvent; }
61  RESTValue GetOutputEvent() const override { return fSignalEvent; }
62 
63  void InitProcess() override;
64  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
65  void EndProcess() override;
66 
68  void PrintMetadata() override {
70 
71  RESTMetadata << "Low signal threshold activity : " << fLowThreshold << RESTendl;
72  RESTMetadata << "High signal threshold activity : " << fHighThreshold << RESTendl;
73 
74  RESTMetadata << "Number of daq histogram channels : " << fDaqChannels << RESTendl;
75  RESTMetadata << "Start daq channel : " << fDaqStartChannel << RESTendl;
76  RESTMetadata << "End daq channel : " << fDaqEndChannel << RESTendl;
77 
78  EndPrintProcess();
79  }
80 
82  const char* GetProcessName() const override { return "rawSignalChannelActivity"; }
83 
86 
87  ClassDefOverride(TRestRawSignalChannelActivityProcess, 4);
88 };
89 #endif
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.
Int_t fDaqChannels
The number of bins at the daq channels histogram.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestRawSignalEvent * fSignalEvent
A pointer to the specific TRestRawSignalEvent input.
Int_t fDaqStartChannel
The first channel at the daq channels histogram.
void InitProcess() override
Process initialization. The ROOT TH1 histograms are created here using the limits defined in the proc...
Int_t fDaqEndChannel
The last channel at the daq channels histogram.
const char * GetProcessName() const override
Returns the name of this process.
void EndProcess() override
Function to include required actions after all events have been processed. In this process it will ta...
void Initialize() override
Function to initialize input/output event members and define the section name.
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.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
Double_t fLowThreshold
The value of the lower signal threshold to add it to the histogram.
An event container for time rawdata signals with fixed length.