REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestGeant4PhysicsInfo.h
1 #ifndef REST_TRESTGEANT4PHYSICSINFO_H
2 #define REST_TRESTGEANT4PHYSICSINFO_H
3 
4 #include <TString.h>
5 
6 #include <map>
7 #include <mutex>
8 #include <set>
9 #include <vector>
10 
11 class G4VProcess;
12 
14  ClassDef(TRestGeant4PhysicsInfo, 3);
15 
16  private:
17  std::map<Int_t, TString> fProcessNamesMap = {};
18  std::map<TString, Int_t> fProcessNamesReverseMap = {};
19 
20  std::map<Int_t, TString> fParticleNamesMap = {};
21  std::map<TString, Int_t> fParticleNamesReverseMap = {};
22 
23  std::map<TString, TString> fProcessTypesMap = {}; // process name -> process type
24 
25  public:
26  TString GetProcessName(Int_t id) const;
27  Int_t GetProcessID(const TString& processName) const;
28  void InsertProcessName(Int_t id, const TString& processName, const TString& processType);
29  std::set<TString> GetAllParticles() const;
30 
31  TString GetParticleName(Int_t id) const;
32  Int_t GetParticleID(const TString& processName) const;
33  void InsertParticleName(Int_t id, const TString& particleName);
34  std::set<TString> GetAllProcesses() const;
35 
36  TString GetProcessType(const TString& processName) const;
37  std::set<TString> GetAllProcessTypes() const;
38 
39  public:
40  inline TRestGeant4PhysicsInfo() = default;
41  inline ~TRestGeant4PhysicsInfo() = default;
42 
43  void Print() const;
44  void PrintProcesses() const;
45  void PrintParticles() const;
46 
47  static Int_t GetProcessIDFromGeant4Process(const G4VProcess*); // implemented in restG4
48 };
49 #endif // REST_TRESTGEANT4PHYSICSINFO_H