CMS 3D CMS Logo

CustomParticleFactory.h
Go to the documentation of this file.
1 #ifndef SimG4Core_CustomPhysics_CustomParticleFactory_h
2 #define SimG4Core_CustomPhysics_CustomParticleFactory_h 1
3 
4 #include "G4Threading.hh"
5 #include <vector>
6 #include <string>
7 #include <fstream>
8 
9 class G4DecayTable;
10 class G4ParticleDefinition;
11 
13 
14 public:
15 
16  explicit CustomParticleFactory();
18 
19  void loadCustomParticles(const std::string & filePath);
20  const std::vector<G4ParticleDefinition *>& GetCustomParticles();
21 
22 private:
23 
24  void addCustomParticle(int pdgCode, double mass, const std::string & name );
25  void getMassTable(std::ifstream *configFile);
26  G4DecayTable* getDecayTable(std::ifstream *configFile, int pdgId);
27  G4DecayTable* getAntiDecayTable(int pdgId, G4DecayTable *theDecayTable);
29 
30  static bool loaded;
31  static std::vector<G4ParticleDefinition *> m_particles;
32 #ifdef G4MULTITHREADED
33  static G4Mutex customParticleFactoryMutex;
34 #endif
35 
36 };
37 
38 #endif
void loadCustomParticles(const std::string &filePath)
static std::vector< G4ParticleDefinition * > m_particles
std::string ToLower(std::string str)
void getMassTable(std::ifstream *configFile)
G4DecayTable * getDecayTable(std::ifstream *configFile, int pdgId)
void addCustomParticle(int pdgCode, double mass, const std::string &name)
G4DecayTable * getAntiDecayTable(int pdgId, G4DecayTable *theDecayTable)
const std::vector< G4ParticleDefinition * > & GetCustomParticles()