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* fInputEvent = nullptr;
16 TRestRawReadoutMetadata* fReadoutMetadata = nullptr;
17
19 Double_t fThresholdOverBaseline = 2.0;
21 Double_t fSigmaOverBaseline = 10.0;
23 TVector2 fBaselineRange = {0, 10};
25 UShort_t fDistance = 10;
27 UShort_t fWindow = 10;
29 Bool_t fRemoveAllVetoes = false;
31 Bool_t fRemovePeaklessVetoes = false;
32
33 Double_t fTimeBinToTimeFactorMultiplier = 0.0;
34 Double_t fTimeBinToTimeFactorOffset = 0.0;
35 Double_t fTimeBinToTimeFactorOffsetTCM = 0.0;
36
37 Bool_t fTimeConversionElectronics = false;
38
39 Double_t fADCtoEnergyFactor = 0.0;
40 std::map<UShort_t, Double_t> fChannelIDToADCtoEnergyFactor = {};
41
42 std::set<std::string> fChannelTypes = {}; // this process will only be applied to selected channel types
43
44 public:
45 RESTValue GetInputEvent() const override { return fInputEvent; }
46 RESTValue GetOutputEvent() const override { return fInputEvent; }
47
48 void PrintMetadata() override;
49
50 void InitProcess() override;
51 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
52 void EndProcess() override {}
53
54 const char* GetProcessName() const override { return "peaksFinder"; }
55
56 explicit TRestRawPeaksFinderProcess(const char* configFilename){};
57
58 void InitFromConfigFile() override;
59
62
63 ClassDefOverride(TRestRawPeaksFinderProcess, 6);
64};
65
66#endif // REST_TRESTRAWPEAKSFINDERPROCESS_H
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
Double_t fSigmaOverBaseline
choose times the sigma of the baseline must be overcome to consider a peak
UShort_t fDistance
distance between two peaks to consider them as different (ADC units)
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
Bool_t fRemovePeaklessVetoes
option to remove peak-less veto signals after finding the peaks
Double_t fThresholdOverBaseline
threshold over baseline to consider a peak
UShort_t fWindow
window size to calculate the peak amplitude (time bins)
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.
Bool_t fRemoveAllVetoes
option to remove all veto signals after finding the peaks
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.