Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:10

0001 #ifndef G4MAIN_PHG4PROCESSMAP_H
0002 #define G4MAIN_PHG4PROCESSMAP_H
0003 
0004 #include "PHG4MCProcessDefs.h"
0005 
0006 #include <cstdint>
0007 #include <map>
0008 #include <string_view>
0009 
0010 class G4VProcess;
0011 
0012 class PHG4ProcessMap
0013 {
0014  public:
0015   PHG4ProcessMap() = default;
0016   PHG4ProcessMap(const PHG4ProcessMap& rhs) = delete;
0017   PHG4ProcessMap(PHG4ProcessMap&& rhs) = delete;
0018   PHG4ProcessMap& operator=(const PHG4ProcessMap& rhs) = delete;
0019   PHG4ProcessMap& operator=(PHG4ProcessMap&& rhs) = delete;
0020   ~PHG4ProcessMap() { Clear(); }
0021 
0022   // static access method
0023   static PHG4ProcessMap& Instance()
0024   {
0025     static PHG4ProcessMap fgInstance;
0026     return fgInstance;
0027   };
0028 
0029   // methods
0030   bool Add(int subType, PHG4MCProcess mcProcess);
0031   void PrintAll() const;
0032   void Clear();
0033 
0034   // get methods
0035   PHG4MCProcess GetMCProcess(const G4VProcess* process) const;
0036   std::string_view GetMCProcessName(const G4VProcess* process) const;
0037 
0038  private:
0039   // methods
0040   bool IsDefined(int subType);
0041 
0042   // data members
0043   std::map<int, PHG4MCProcess> fMap;
0044 };
0045 
0046 #endif  // G4MAIN_PHG4PROCESSMAP_H