File indexing completed on 2025-07-14 08:50:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef DDG4_GEANT4PARTICLEPRINT_H
0015 #define DDG4_GEANT4PARTICLEPRINT_H
0016
0017
0018 #include <DDG4/Geant4EventAction.h>
0019 #include <DDG4/Geant4GeneratorAction.h>
0020 #include <DDG4/Geant4Particle.h>
0021
0022
0023 class G4Event;
0024
0025
0026 namespace dd4hep {
0027
0028
0029 namespace sim {
0030
0031
0032
0033
0034
0035
0036
0037
0038 class Geant4ParticlePrint : public Geant4EventAction {
0039 public:
0040 typedef Geant4ParticleMap::Particle Particle;
0041 typedef Geant4ParticleMap::ParticleMap ParticleMap;
0042 typedef Geant4ParticleMap::TrackEquivalents TrackEquivalents;
0043 protected:
0044
0045 int m_outputType;
0046
0047 bool m_printBegin;
0048
0049 bool m_printEnd;
0050
0051 bool m_printGeneration;
0052
0053 bool m_printHits;
0054
0055 void printParticle(const std::string& prefix, const G4Event* e, Geant4ParticleHandle p) const;
0056
0057 void printParticles(const G4Event* e, const ParticleMap& particles) const;
0058
0059 void printParticleTree(const G4Event* e, const ParticleMap& particles, int level, Geant4ParticleHandle p) const;
0060
0061 void printParticleTree(const G4Event* e, const ParticleMap& particles) const;
0062
0063 void makePrintout(const G4Event* e) const;
0064
0065
0066 public:
0067
0068 Geant4ParticlePrint(Geant4Context* context, const std::string& nam);
0069
0070 virtual ~Geant4ParticlePrint();
0071
0072 virtual void begin(const G4Event* event) override;
0073
0074 virtual void end(const G4Event* event) override;
0075
0076 virtual void operator()(G4Event* event);
0077
0078 };
0079 }
0080 }
0081
0082 #endif