REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawSignalRecoverSaturationProcess.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 RESTProc_TRestRawSignalRecoverSaturationProcess
24#define RESTProc_TRestRawSignalRecoverSaturationProcess
25
26#include "TRestEventProcess.h"
27#include "TRestRawSignalEvent.h"
28
31 private:
34
35 void Initialize() override;
36
39
42
45
48
50 TVector2 fBaseLineRange; //<
51
53 TVector2 fFitRange; //<
54
57
59 TCanvas* fC;
60
61 public:
62 RESTValue GetInputEvent() const override { return fAnaEvent; }
63 RESTValue GetOutputEvent() const override { return fAnaEvent; }
64
65 void InitProcess() override;
66
67 const char* GetProcessName() const override { return "RawSignalRecoverSaturationProcess"; }
68
69 TRestEvent* ProcessEvent(TRestEvent* eventInput) override;
70
71 void EndProcess() override;
72
74 void PrintMetadata() override {
76
77 // Write here how to print the added process members and parameters.
78 std::string strProcessAllSignals = fProcessAllSignals ? "true" : "false";
79 RESTMetadata << "MinSaturatedBins: " << fMinSaturatedBins << RESTendl;
80 RESTMetadata << "ProcessAllSignals: " << strProcessAllSignals << RESTendl;
81 RESTMetadata << "NBinsIfNotSaturated: " << fNBinsIfNotSaturated << RESTendl;
82 RESTMetadata << "MinSaturationValue: " << fMinSaturationValue << RESTendl;
83 RESTMetadata << "BaseLineRange: (" << fBaseLineRange.X() << ", " << fBaseLineRange.Y() << ")"
84 << RESTendl;
85 RESTMetadata << "FitRange: (" << fFitRange.X() << ", " << fFitRange.Y() << ")" << RESTendl;
86 RESTMetadata << "InitPointsOverThreshold: (" << fInitPointsOverThreshold.X() << ", "
87 << fInitPointsOverThreshold.Y() << ", " << fInitPointsOverThreshold.Z() << ")"
88 << RESTendl;
89
90 EndPrintProcess();
91 }
92
95
96 // ROOT class definition helper. Increase the number in it every time
97 // you add/rename/remove the process parameters
98 ClassDefOverride(TRestRawSignalRecoverSaturationProcess, 1);
99};
100#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.
An event container for time rawdata signals with fixed length.
This class recovers the saturated signals in a TRestRawSignalEvent using a fit to the AGET pulse.
TVector2 fBaseLineRange
Range of bins to calculate the baseline and fix that parameter in the fit.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestRawSignalEvent * fAnaEvent
A pointer to the specific TRestRawSignalEvent input event.
void EndProcess() override
Function to include required actions after all events have been processed.
Size_t fMinSaturatedBins
Minimum number of saturated bins to consider a signal as saturated.
void InitProcess() override
Process initialization. Observable names can be re-interpreted here. Any action in the process requir...
TVector3 fInitPointsOverThreshold
Wrapper of (pointThreshold, signalThreshold, pointsOverThreshold) params.
TVector2 fFitRange
Range of bins to fit the signal.
Short_t fMinSaturationValue
Minimum value to consider a signal as saturated.
Bool_t fProcessAllSignals
Process all signals in the event.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
The main processing event function.
Size_t fNBinsIfNotSaturated
Number of bins to consider if the signal is not saturated.