REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorElectronDiffusionProcess.h
1 
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 fLongitudinalDiffusionCoefficient;
43  Double_t fTransversalDiffusionCoefficient;
44  Bool_t fPoissonElectronExcitation;
45  Bool_t fUnitElectronEnergy;
46  UInt_t fMaxHits;
47  Double_t fSeed = 0;
48  Bool_t fCheckIsInside = true;
49 
50  public:
51  RESTValue GetInputEvent() const override { return fInputHitsEvent; }
52  RESTValue GetOutputEvent() const override { return fOutputHitsEvent; }
53 
54  void InitProcess() override;
55  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
56  void EndProcess() override;
57 
58  void LoadConfig(const std::string& configFilename, const std::string& name = "");
59 
60  void PrintMetadata() override {
62 
63  RESTMetadata << " eField : " << fElectricField * units("V/cm") << " V/cm" << RESTendl;
64  RESTMetadata << " attachment coeficient : " << fAttachment << " V/cm" << RESTendl;
65  RESTMetadata << " gas pressure : " << fGasPressure << " atm" << RESTendl;
66  RESTMetadata << " longitudinal diffusion coefficient : " << fLongitudinalDiffusionCoefficient
67  << " cm^1/2" << RESTendl;
68  RESTMetadata << " transversal diffusion coefficient : " << fTransversalDiffusionCoefficient
69  << " cm^1/2" << RESTendl;
70  RESTMetadata << " W value : " << fWValue << " eV" << RESTendl;
71 
72  RESTMetadata << " Maximum number of hits : " << fMaxHits << RESTendl;
73 
74  RESTMetadata << " seed : " << fSeed << RESTendl;
75 
76  EndPrintProcess();
77  }
78 
79  TRestMetadata* GetProcessMetadata() const { return fGas; }
80 
81  const char* GetProcessName() const override { return "electronDiffusion"; }
82 
83  inline Double_t GetElectricField() const { return fElectricField; }
84  inline Double_t GetAttachmentCoefficient() const { return fAttachment; }
85  inline Double_t GetGasPressure() const { return fGasPressure; }
86 
87  // Constructor
89  TRestDetectorElectronDiffusionProcess(const char* configFilename);
90  // Destructor
92 
93  ClassDefOverride(TRestDetectorElectronDiffusionProcess, 4); // Template for a REST "event process" class
94  // inherited from TRestEventProcess
95 };
96 #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.