ATLAS Offline Software
Loading...
Searching...
No Matches
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
17class G4ParticleDefinition;
18
19namespace iFatras
20{
21
28
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
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
AlgTool to convert a pdgCode into a particle definition used by the G4 decayer.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor from base class.
Gaudi::Property< std::vector< int > > m_useParticles
G4ParticleDefinition * getParticleDefinition(int pdgCode) const
Returns the G4ParticleDefinition of particle with PDG ID pdgCode, 0 otherwise.
void printListOfParticles(bool withDecayTableOnly=false) const
prints list of particles to stdout
std::map< int, G4ParticleDefinition * > PDGG4ParticleMap
std::map< int, G4ParticleDefinition * > predefinedParticles()
fills default particles in map
std::vector< std::pair< int, std::string > > listOfParticles() const
returns a vector of pdgid / particlename pairs containing all particles
virtual StatusCode initialize() override
AlgTool initailize method.
Gaudi::Property< bool > m_printList
PDGG4ParticleMap m_pdgG4ParticleMap
map from pdg codes to defined Geant4 particles