REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorElectronDiffusionProcess.h
1
11
12#ifndef RestCore_TRestDetectorElectronDiffusionProcess
13#define RestCore_TRestDetectorElectronDiffusionProcess
14
15#include <TRandom3.h>
16#include <TRestDetectorGas.h>
17#include <TRestDetectorHitsEvent.h>
18#include <TRestDetectorReadout.h>
19#include <TRestEventProcess.h>
20
22 private:
23 TRestDetectorHitsEvent* fInputHitsEvent;
24 TRestDetectorHitsEvent* fOutputHitsEvent;
25
26 TRestDetectorGas* fGas;
27 TRestDetectorReadout* fReadout;
28
29 TRandom3* fRandom;
30
31 void InitFromConfigFile() override;
32
33 void Initialize() override;
34
35 void LoadDefaultConfig();
36
37 protected:
38 Double_t fElectricField;
39 Double_t fAttachment;
40 Double_t fGasPressure;
41 Double_t fWValue;
42 Double_t fFanoFactor;
43 Double_t fLongitudinalDiffusionCoefficient;
44 Double_t fTransversalDiffusionCoefficient;
45 Bool_t fUnitElectronEnergy;
46 UInt_t fMaxHits;
47 UInt_t fSeed = 0;
48 Bool_t fCheckIsInside = true;
49 Bool_t fUseFanoFactor = false;
50 Bool_t fPoissonElectronExcitation = false;
51
52 public:
53 RESTValue GetInputEvent() const override { return fInputHitsEvent; }
54 RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }
55
56 void InitProcess() override;
57 TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
58 void EndProcess() override;
59
60 void LoadConfig(const std::string& configFilename, const std::string& name = "");
61
62 void PrintMetadata() override {
64
65 RESTMetadata << " eField : " << fElectricField * units("V/cm") << " V/cm" << RESTendl;
66 RESTMetadata << " attachment coefficient : " << fAttachment << " V/cm" << RESTendl;
67 RESTMetadata << " gas pressure : " << fGasPressure << " atm" << RESTendl;
68 RESTMetadata << " longitudinal diffusion coefficient : " << fLongitudinalDiffusionCoefficient
69 << " cm^1/2" << RESTendl;
70 RESTMetadata << " transversal diffusion coefficient : " << fTransversalDiffusionCoefficient
71 << " cm^1/2" << RESTendl;
72 RESTMetadata << " W value : " << fWValue << " eV" << RESTendl;
73
74 RESTMetadata << " Maximum number of hits : " << fMaxHits << RESTendl;
75
76 RESTMetadata << " seed : " << fSeed << RESTendl;
77
78 EndPrintProcess();
79 }
80
81 TRestMetadata* GetProcessMetadata() const { return fGas; }
82
83 const char* GetProcessName() const override { return "electronDiffusion"; }
84
85 inline Double_t GetElectricField() const { return fElectricField; }
86 inline Double_t GetAttachmentCoefficient() const { return fAttachment; }
87 inline Double_t GetGasPressure() const { return fGasPressure; }
88
89 // Constructor
91 TRestDetectorElectronDiffusionProcess(const char* configFilename);
92 // Destructor
94
95 ClassDefOverride(TRestDetectorElectronDiffusionProcess, 5); // Template for a REST "event process" class
96 // inherited from TRestEventProcess
97};
98#endif
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.
void EndProcess() override
To be executed at the end of the run (outside event loop)
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
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 Initialize() override
Making default settings.
A metadata class to generate/store a readout description.
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:74
endl_t RESTendl
Termination flag object for TRestStringOutput.