REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
TRestHaloTrimProcess.h
1/*************************************************************************
2 * TRestHaloTrimProcess
3 *
4 * Process that converts incoming halo spectra from volts (V_RMS) to power
5 * (watts) when needed and trims the leading/trailing bins.
6 *
7 *************************************************************************/
8
9#ifndef RESTProc_TRestHaloTrimProcess
10#define RESTProc_TRestHaloTrimProcess
11
12#include "TRestEventProcess.h"
13#include "TRestHaloEvent.h"
14
16class TRestHaloTrimProcess : public TRestEventProcess {
17private:
18 TRestEvent* fEvent;
19
20 // Number of bins to trim from the beginning and end of the spectrum
21 // This member is persisted so it can be configured from RML or ROOT/C++
22 // macros via the metadata interface.
23 Int_t fTrimBins = 800; //< number of bins to trim
24
25 void Initialize() override;
26
27public:
28 RESTValue GetInputEvent() const override { return fEvent; }
29 RESTValue GetOutputEvent() const override { return fEvent; }
30
31 void InitProcess() override;
32 const char* GetProcessName() const override { return "HaloTrim"; }
33
34 TRestEvent* ProcessEvent(TRestEvent* eventInput) override;
35
36 void EndProcess() override;
37
38 void PrintMetadata() override {
40 printf(" TrimBins=%d\n", fTrimBins);
42 }
43
44 // Allow runtime configuration from C++ / ROOT macros
45 void SetTrimBins(Int_t n) { fTrimBins = n; }
46 Int_t GetTrimBins() const { return fTrimBins; }
47
48 TRestHaloTrimProcess();
49 ~TRestHaloTrimProcess();
50
51 ClassDefOverride(TRestHaloTrimProcess, 1);
52};
53
54#endif
void BeginPrintProcess()
[name, cut range]
void EndPrintProcess()
Pre-defined printer, can be used at the ending in the implementation of PrintMetadata().
A base class for any REST event.
Definition TRestEvent.h:38
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void InitProcess() override
To be executed at the beginning of the run (outside event loop).
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.
void EndProcess() override
To be executed at the end of the run (outside event loop).
Int_t fTrimBins
pointer to input event
void Initialize() override
Making default settings.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
Process one event.