REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawBaseLineCorrectionProcess.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_TRestRawBaseLineCorrectionProcess
24#define RESTProc_TRestRawBaseLineCorrectionProcess
25
26#include "TRestEventProcess.h"
27#include "TRestRawReadoutMetadata.h"
28#include "TRestRawSignalEvent.h"
29
31 private:
32 // We define specific input/output event data holders
33 TRestRawSignalEvent* fInputEvent;
34 TRestRawSignalEvent* fOutputEvent;
35 TRestRawReadoutMetadata* fReadoutMetadata = nullptr;
36
37 void Initialize() override;
38
40 TVector2 fSignalsRange = {-1, -1};
41
43 Int_t fSmoothingWindow = 75;
44
46 Bool_t fRangeEnabled = false;
47
48 std::set<std::string> fChannelTypes = {}; // this process will only be applied to selected channel types
49
50 public:
51 RESTValue GetInputEvent() const override { return fInputEvent; }
52 RESTValue GetOutputEvent() const override { return fOutputEvent; }
53
54 void PrintMetadata() override;
55
56 void InitProcess() override;
57
58 TRestEvent* ProcessEvent(TRestEvent* eventInput) override;
59
60 void EndProcess() override;
61
62 void InitFromConfigFile() override;
63
66
68 const char* GetProcessName() const override { return "baseLineCorrection"; }
69
72
73 // ROOT class definition helper. Increase the number in it every time
74 // you add/rename/remove the process parameters
75 ClassDefOverride(TRestRawBaseLineCorrectionProcess, 2);
76};
77#endif
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
Process one event.
void EndProcess() override
To be executed at the end of the run (outside event loop)
TRestEventProcess * Maker()
Returns a new instance of this class.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
TVector2 fSignalsRange
It defines the signals id range where analysis is applied.
void Initialize() override
Making default settings.
Int_t fSmoothingWindow
Time window width in bins for the moving average filter for baseline correction.
Bool_t fRangeEnabled
Just a flag to quickly determine if we have to apply the range filter.
const char * GetProcessName() const override
Returns the name of this process.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
An event container for time rawdata signals with fixed length.