REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestRawSignalChannelActivityProcess.cxx
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
99#include "TRestRawSignalChannelActivityProcess.h"
100
101using namespace std;
102
104
109
114
120 SetSectionName(this->ClassName());
121 SetLibraryVersion(LIBRARY_VERSION);
122
123 fSignalEvent = nullptr;
124}
125
136 if (!fReadOnly) {
137 fDaqChannelsHisto = new TH1D("daqChannelActivityRaw", "daqChannelActivityRaw", fDaqChannels,
139 }
140}
141
146 fSignalEvent = (TRestRawSignalEvent*)inputEvent;
147
148 Int_t Nlow = 0;
149 Int_t Nhigh = 0;
150 for (int s = 0; s < fSignalEvent->GetNumberOfSignals(); s++) {
151 TRestRawSignal* sgnl = fSignalEvent->GetSignal(s);
152 if (sgnl->GetMaxValue() > fHighThreshold) Nhigh++;
153 if (sgnl->GetMaxValue() > fLowThreshold) Nlow++;
154 }
155
156 for (int s = 0; s < fSignalEvent->GetNumberOfSignals(); s++) {
157 // Adding signal to the channel activity histogram
158 if (!fReadOnly) {
159 Int_t daqChannel = fSignalEvent->GetSignal(s)->GetID();
160 fDaqChannelsHisto->Fill(daqChannel);
161 }
162 }
163
165 fAnalysisTree->PrintObservables();
166
167 return fSignalEvent;
168}
169
TRestAnalysisTree * fAnalysisTree
bool fReadOnly
not used, keep for compatibility
A base class for any REST event.
Definition TRestEvent.h:38
void SetLibraryVersion(TString version)
Set the library version of this metadata class.
TRestStringOutput::REST_Verbose_Level GetVerboseLevel()
returns the verboselevel in type of REST_Verbose_Level enumerator
void SetSectionName(std::string sName)
set the section name, clear the section content
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.
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.
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.
It defines a Short_t array with a physical parameter that evolves in time using a fixed time bin.
Int_t GetID() const
Returns the value of signal ID.
Double_t GetMaxValue()
Returns the maximum value found in the data points. It includes baseline correction.
@ REST_Debug
+show the defined debug messages