Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PDGToG4Particle.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 
29  class PDGToG4Particle : public AthAlgTool
30  {
31  public:
34 
36  virtual StatusCode initialize() override;
37 
42  G4ParticleDefinition* getParticleDefinition( int pdgCode) const;
43 
47  std::vector<std::pair<int,std::string> > listOfParticles() const;
48 
50  void printListOfParticles( bool withDecayTableOnly=false) const;
51 
52  typedef std::map<int,G4ParticleDefinition*> PDGG4ParticleMap;
53 
54  private:
55  /*---------------------------------------------------------------------
56  * Private members
57  *---------------------------------------------------------------------*/
59  std::map<int,G4ParticleDefinition*> predefinedParticles();
60 
63 
64  /*---------------------------------------------------------------------
65  * Properties
66  *---------------------------------------------------------------------*/
67  Gaudi::Property<std::vector<int>> m_useParticles{this, "UseParticles", {},
68  "List of particles which should be available for conversion"};
69 
70  Gaudi::Property<bool> m_printList{this, "PrintList", false,
71  "Print list of loaded particles in initialize()"};
72 
73  };
74 }
75 
76 #endif // FATRASG4TOOLS_PDGTOG4PARTICLE_H
iFatras::PDGToG4Particle::m_useParticles
Gaudi::Property< std::vector< int > > m_useParticles
Definition: PDGToG4Particle.h:67
iFatras::PDGToG4Particle
Definition: PDGToG4Particle.h:30
iFatras::PDGToG4Particle::initialize
virtual StatusCode initialize() override
AlgTool initailize method.
Definition: PDGToG4Particle.cxx:35
iFatras
Definition: ActsFatrasSimTool.h:55
iFatras::PDGToG4Particle::getParticleDefinition
G4ParticleDefinition * getParticleDefinition(int pdgCode) const
Returns the G4ParticleDefinition of particle with PDG ID pdgCode, 0 otherwise.
Definition: PDGToG4Particle.cxx:92
iFatras::PDGToG4Particle::predefinedParticles
std::map< int, G4ParticleDefinition * > predefinedParticles()
fills default particles in map
Definition: PDGToG4Particle.cxx:194
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:52
AthAlgTool.h
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
iFatras::PDGToG4Particle::listOfParticles
std::vector< std::pair< int, std::string > > listOfParticles() const
returns a vector of pdgid / particlename pairs containing all particles
Definition: PDGToG4Particle.cxx:123
iFatras::PDGToG4Particle::printListOfParticles
void printListOfParticles(bool withDecayTableOnly=false) const
prints list of particles to stdout
Definition: PDGToG4Particle.cxx:145
iFatras::PDGToG4Particle::m_printList
Gaudi::Property< bool > m_printList
Definition: PDGToG4Particle.h:70
iFatras::PDGToG4Particle::m_pdgG4ParticleMap
PDGG4ParticleMap m_pdgG4ParticleMap
map from pdg codes to defined Geant4 particles
Definition: PDGToG4Particle.h:62
AthAlgTool
Definition: AthAlgTool.h:26