REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawPeaksFinderProcess.h
1 //
2 // Created by lobis on 24-Aug-23.
3 //
4 
5 #ifndef REST_TRESTRAWPEAKSFINDERPROCESS_H
6 #define REST_TRESTRAWPEAKSFINDERPROCESS_H
7 
8 #include <TRestEventProcess.h>
9 
10 #include "TRestRawReadoutMetadata.h"
11 #include "TRestRawSignalEvent.h"
12 
14  private:
15  TRestRawSignalEvent* fSignalEvent = nullptr;
16  TRestRawReadoutMetadata* fReadoutMetadata = nullptr;
17 
19  Double_t fThresholdOverBaseline = 2.0;
21  TVector2 fBaselineRange = {0, 10};
23  UShort_t fDistance = 10;
25  UShort_t fWindow = 10;
26 
27  std::set<std::string> fChannelTypes = {}; // this process will only be applied to selected channel types
28 
29  public:
30  RESTValue GetInputEvent() const override { return fSignalEvent; }
31  RESTValue GetOutputEvent() const override { return fSignalEvent; }
32 
33  void PrintMetadata() override;
34 
35  void InitProcess() override;
36  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
37  void EndProcess() override {}
38 
39  const char* GetProcessName() const override { return "peaksFinder"; }
40 
41  explicit TRestRawPeaksFinderProcess(const char* configFilename){};
42 
43  void InitFromConfigFile() override;
44 
45  TRestRawPeaksFinderProcess() = default;
46  ~TRestRawPeaksFinderProcess() = default;
47 
48  ClassDefOverride(TRestRawPeaksFinderProcess, 3);
49 };
50 
51 #endif // REST_TRESTRAWPEAKSFINDERPROCESS_H
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
UShort_t fDistance
distance between two peaks to consider them as different
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
Double_t fThresholdOverBaseline
threshold over baseline to consider a peak
UShort_t fWindow
window size to calculate the peak amplitude
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
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 *inputEvent) override
Process one event.
TVector2 fBaselineRange
range of samples to calculate baseline for peak finding
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void EndProcess() override
To be executed at the end of the run (outside event loop)
An event container for time rawdata signals with fixed length.