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 <TRestEventProcess.h>
28
29#include "TRestRawSignalEvent.h"
30
34 protected:
36 Int_t fDaqChannels = 300;
37
39 Int_t fDaqStartChannel = 4320;
40
42 Int_t fDaqEndChannel = 4620;
43
45 TH1D* fDaqChannelsHisto = nullptr;
46
47 private:
50
51 std::string fChannelType;
52 TRestRawReadoutMetadata* fReadoutMetadata = nullptr;
53
54 void Initialize() override;
55
56 public:
57 RESTValue GetInputEvent() const override { return fInputEvent; }
58 RESTValue GetOutputEvent() const override { return fInputEvent; }
59
60 void InitProcess() override;
61 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
62 void EndProcess() override;
63
65 void PrintMetadata() override {
67
68 if (!fChannelType.empty()) {
69 RESTMetadata << "channelType : " << fChannelType << RESTendl;
70 }
71
72 RESTMetadata << "Number of daq histogram channels : " << fDaqChannels << RESTendl;
73 RESTMetadata << "Start daq channel : " << fDaqStartChannel << RESTendl;
74 RESTMetadata << "End daq channel : " << fDaqEndChannel << RESTendl;
75
76 EndPrintProcess();
77 }
78
80 const char* GetProcessName() const override { return "rawSignalChannelActivity"; }
81
84
85 ClassDefOverride(TRestRawSignalChannelActivityProcess, 6);
86};
87#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.
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.
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.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
const char * GetProcessName() const override
Returns the name of this process.
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.
TRestRawSignalEvent * fInputEvent
A pointer to the specific TRestRawSignalEvent input.
An event container for time rawdata signals with fixed length.