REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorAvalancheProcess.h
1
15
16#ifndef RestCore_TRestDetectorAvalancheProcess
17#define RestCore_TRestDetectorAvalancheProcess
18
19#include <TRestDetectorGas.h>
20#include <TRestDetectorHitsEvent.h>
21
22#include "TRestEventProcess.h"
23
25 private:
26 TRestDetectorHitsEvent* fHitsInputEvent;
27 TRestDetectorHitsEvent* fHitsOutputEvent;
28
29 Double_t fEnergyRef;
31 Double_t fDetectorGain;
32
33 void InitFromConfigFile() override;
34 void Initialize() override;
35 void LoadDefaultConfig();
36
37 protected:
38 // add here the members of your event process
39 TRestDetectorGas* fGas;
40
41 public:
42 RESTValue GetInputEvent() const override { return fHitsInputEvent; }
43 RESTValue GetOutputEvent() const override { return fHitsOutputEvent; }
44
45 void InitProcess() override;
46 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
47 void EndProcess() override;
48
49 void LoadConfig(std::string configFilename);
50
51 void PrintMetadata() override {
53
54 RESTMetadata << " reference energy (Eref): " << fEnergyRef << RESTendl;
55 RESTMetadata << " resolution at Eref : " << fResolutionAtEref << RESTendl;
56 RESTMetadata << " detector gain : " << fDetectorGain << RESTendl;
57
58 EndPrintProcess();
59 }
60
61 TRestMetadata* GetProcessMetadata() const { return fGas; }
62
63 const char* GetProcessName() const override { return "avalancheProcess"; }
64
65 inline Double_t GetEnergyReference() const { return fEnergyRef; }
66 inline Double_t GetResolutionReference() const { return fResolutionAtEref; }
67 inline Double_t GetDetectorGain() const { return fDetectorGain; }
68
69 // Constructor
71 TRestDetectorAvalancheProcess(const char* configFilename);
72 // Destructor
74
75 ClassDefOverride(TRestDetectorAvalancheProcess, 1); // Template for a REST "event process"
76 // class inherited from TRestEventProcess
77};
78#endif
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)
void EndProcess() override
To be executed at the end of the run (outside event loop)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
Double_t fEnergyRef
reference energy for the FWHM
Double_t fResolutionAtEref
FWHM at Energy of reference.
void Initialize() override
Making default settings.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
A base class for any REST event process.
void BeginPrintProcess()
[name, cut range]
A base class for any REST event.
Definition: TRestEvent.h:38
A base class for any REST metadata class.
Definition: TRestMetadata.h:70
endl_t RESTendl
Termination flag object for TRestStringOutput.