REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorSetup.h
1 
15 #ifndef RestCore_TRestDetectorSetup
16 #define RestCore_TRestDetectorSetup
17 
18 #include <TRestMetadata.h>
19 #include <stdio.h>
20 #include <stdlib.h>
21 
22 #include <cstdio>
23 #include <cstring>
24 #include <fstream>
25 #include <iostream>
26 #include <vector>
27 
29  private:
30  void Initialize() override;
31 
32  void InitFromConfigFile() override;
33 
34  Int_t fRunNumber;
35  Int_t fSubRunNumber;
36  TString fRunTag;
37 
38  Double_t fMeshVoltage;
39  Double_t fDriftField; // Drift field in V/cm/bar
40  Double_t fDetectorPressure; // In bar
41 
42  TString fElectronicsGain;
43  TString fShapingTime;
44  TString fSamplingTime;
45 
46  Double_t fSamplingInMicroSec;
47 
48  public:
49  inline Int_t GetRunNumber() const { return fRunNumber; }
50  inline Int_t GetSubRunNumber() const { return fSubRunNumber; }
51  inline TString GetRunTag() const { return fRunTag; }
52 
53  void SetRunNumber(Int_t runNumber) { fRunNumber = runNumber; }
54  void SetSubRunNumber(Int_t subRunNumber) { fSubRunNumber = subRunNumber; }
55 
56  inline Double_t GetSamplingInMicroSeconds() const { return fSamplingInMicroSec; }
57 
58  Double_t GetFieldInVPerCm() { return fDriftField * fDetectorPressure; }
59 
60  inline Double_t GetPressureInBar() const { return fDetectorPressure; }
61 
62  void InitFromFileName(TString fName);
63 
64  void PrintMetadata() override;
65 
66  // Constructors
68  TRestDetectorSetup(const char* configFilename, const std::string& name = "");
69 
70  // Destructor
72 
73  ClassDefOverride(TRestDetectorSetup, 1);
74 };
75 #endif
void InitFromConfigFile() override
To make settings from rml file. This method 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 base class for any REST metadata class.
Definition: TRestMetadata.h:74