-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTRestRawSignalAnalysisProcess.h
95 lines (73 loc) · 4.24 KB
/
TRestRawSignalAnalysisProcess.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/
#ifndef RestCore_TRestRawSignalAnalysisProcess
#define RestCore_TRestRawSignalAnalysisProcess
#include <TRestRawSignalEvent.h>
#include "TRestEventProcess.h"
//! An analysis process to extract valuable information from a TRestRawSignalEvent.
class TRestRawSignalAnalysisProcess : public TRestEventProcess {
private:
/// A pointer to the specific TRestRawSignalEvent input
TRestRawSignalEvent* fSignalEvent; //!
/// Just a flag to quickly determine if we have to apply the range filter
Bool_t fRangeEnabled = false; //!
/// The range where the baseline range will be calculated
TVector2 fBaseLineRange = TVector2(5, 55);
/// The range where the observables will be calculated
TVector2 fAnalysisRange = TVector2(10, 500);
/// Option for calculation of baseline parameters, can be set to "ROBUST"
std::string fBaseLineOption = ""; //<
/// The number of sigmas over baseline fluctuations to identify a point overthreshold
Double_t fPointThreshold = 2;
/// A parameter to define a minimum signal fluctuation. Measured in sigmas.
Double_t fSignalThreshold = 5;
/// The minimum number of points over threshold to identify a signal as such
Int_t fPointsOverThreshold = 5;
/// It defines the signals id range where analysis is applied
TVector2 fSignalsRange = TVector2(-1, -1); //<
void Initialize() override;
protected:
// add here the members of your event process
public:
any GetInputEvent() const override { return fSignalEvent; }
any GetOutputEvent() const override { return fSignalEvent; }
void InitProcess() override;
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
void PrintMetadata() override {
BeginPrintProcess();
RESTMetadata << "Baseline range : ( " << fBaseLineRange.X() << " , " << fBaseLineRange.Y() << " ) "
<< RESTendl;
RESTMetadata << "Integral range : ( " << fAnalysisRange.X() << " , " << fAnalysisRange.Y() << " ) "
<< RESTendl;
RESTMetadata << "Point Threshold : " << fPointThreshold << " sigmas" << RESTendl;
RESTMetadata << "Signal threshold : " << fSignalThreshold << " sigmas" << RESTendl;
RESTMetadata << "Number of points over threshold : " << fPointsOverThreshold << RESTendl;
RESTMetadata << "Baseline calculation method: " << (fBaseLineOption.empty() ? "Standard" : "Robust")
<< RESTendl;
EndPrintProcess();
}
const char* GetProcessName() const override { return "rawSignalAnalysis"; }
TRestRawSignalAnalysisProcess(); // Constructor
~TRestRawSignalAnalysisProcess(); // Destructor
ClassDefOverride(TRestRawSignalAnalysisProcess, 6);
};
#endif