ATLAS Offline Software
PDGToG4Particle.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FATRASG4TOOLS_PDGTOG4PARTICLE_H
6 #define FATRASG4TOOLS_PDGTOG4PARTICLE_H
7 
8 // Gaudi/Athena
10 #include "GaudiKernel/MsgStream.h"
11 
12 // STL
13 #include <map>
14 #include <vector>
15 #include <string>
16 
17 class G4ParticleDefinition;
18 
19 namespace iFatras
20 {
21 
22  static const InterfaceID IID_PDGToG4Particle("PDGToG4Particle", 1, 0);
23 
31  class PDGToG4Particle : public AthAlgTool
32  {
33  public:
35  PDGToG4Particle( const std::string&,
36  const std::string&,
37  const IInterface*);
38 
39  virtual ~PDGToG4Particle() = default;
40 
43 
45  static const InterfaceID& interfaceID() { return IID_PDGToG4Particle; }
46 
51  virtual G4ParticleDefinition* getParticleDefinition( int pdgCode) const;
52 
56  virtual std::vector<std::pair<int,std::string> > listOfParticles() const;
57 
59  virtual void printListOfParticles( bool withDecayTableOnly=false) const;
60 
61  typedef std::map<int,G4ParticleDefinition*> PDGG4ParticleMap;
62 
63  private:
64  /*---------------------------------------------------------------------
65  * Private members
66  *---------------------------------------------------------------------*/
68  std::map<int,G4ParticleDefinition*> predefinedParticles();
69 
72 
73  /*---------------------------------------------------------------------
74  * Properties
75  *---------------------------------------------------------------------*/
77  std::vector<int> m_useParticles;
78 
81  };
82 }
83 
84 #endif // FATRASG4TOOLS_PDGTOG4PARTICLE_H
iFatras::PDGToG4Particle::PDGToG4Particle
PDGToG4Particle(const std::string &, const std::string &, const IInterface *)
Default constructor.
Definition: PDGToG4Particle.cxx:33
iFatras::PDGToG4Particle::~PDGToG4Particle
virtual ~PDGToG4Particle()=default
iFatras::PDGToG4Particle
Definition: PDGToG4Particle.h:32
iFatras
Definition: ActsFatrasSimTool.h:55
iFatras::PDGToG4Particle::getParticleDefinition
virtual G4ParticleDefinition * getParticleDefinition(int pdgCode) const
Returns the G4ParticleDefinition of particle with PDG ID pdgCode, 0 otherwise.
Definition: PDGToG4Particle.cxx:109
iFatras::PDGToG4Particle::predefinedParticles
std::map< int, G4ParticleDefinition * > predefinedParticles()
fills default particles in map
Definition: PDGToG4Particle.cxx:211
iFatras::PDGToG4Particle::m_useParticles
std::vector< int > m_useParticles
List of particles which should be available for conversion.
Definition: PDGToG4Particle.h:77
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
iFatras::PDGToG4Particle::PDGG4ParticleMap
std::map< int, G4ParticleDefinition * > PDGG4ParticleMap
Definition: PDGToG4Particle.h:61
AthAlgTool.h
iFatras::PDGToG4Particle::m_printList
bool m_printList
Print list of loaded particles in initialize()
Definition: PDGToG4Particle.h:80
iFatras::PDGToG4Particle::interfaceID
static const InterfaceID & interfaceID()
AlgTool interface methods.
Definition: PDGToG4Particle.h:45
iFatras::PDGToG4Particle::listOfParticles
virtual std::vector< std::pair< int, std::string > > listOfParticles() const
returns a vector of pdgid / particlename pairs containing all particles
Definition: PDGToG4Particle.cxx:140
iFatras::PDGToG4Particle::printListOfParticles
virtual void printListOfParticles(bool withDecayTableOnly=false) const
prints list of particles to stdout
Definition: PDGToG4Particle.cxx:162
iFatras::PDGToG4Particle::initialize
StatusCode initialize()
AlgTool initailize method.
Definition: PDGToG4Particle.cxx:52
iFatras::PDGToG4Particle::m_pdgG4ParticleMap
PDGG4ParticleMap m_pdgG4ParticleMap
map from pdg codes to defined Geant4 particles
Definition: PDGToG4Particle.h:71
AthAlgTool
Definition: AthAlgTool.h:26