DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4ParticlePrint.h
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 #ifndef DD4HEP_DDG4_GEANT4PARTICLEPRINT_H
16 #define DD4HEP_DDG4_GEANT4PARTICLEPRINT_H
17 
18 // Framework include files
19 #include "DDG4/Geant4EventAction.h"
21 #include "DDG4/Geant4Particle.h"
22 
23 // Forward declarations
24 class G4Event;
25 
27 namespace DD4hep {
28 
30  namespace Simulation {
31 
33 
40  public:
44  protected:
50  bool m_printEnd;
55 
56  void printParticle(const std::string& prefix, const G4Event* e, Geant4ParticleHandle p) const;
58  void printParticles(const G4Event* e, const ParticleMap& particles) const;
60  void printParticleTree(const G4Event* e, const ParticleMap& particles, int level, Geant4ParticleHandle p) const;
62  void printParticleTree(const G4Event* e, const ParticleMap& particles) const;
64  void makePrintout(const G4Event* e) const;
65 
66 
67  public:
69  Geant4ParticlePrint(Geant4Context* context, const std::string& nam);
71  virtual ~Geant4ParticlePrint();
73  virtual void begin(const G4Event* event);
75  virtual void end(const G4Event* event);
77  virtual void operator()(G4Event* event);
78 
79  };
80  } // End namespace Simulation
81 } // End namespace DD4hep
82 
83 #endif // DD4HEP_DDG4_GEANT4PARTICLEPRINT_H
void makePrintout(const G4Event *e) const
Print particle table.
void printParticle(const std::string &prefix, const G4Event *e, Geant4ParticleHandle p) const
std::map< int, Particle * > ParticleMap
Data structure to store the MC particle information.
void printParticleTree(const G4Event *e, const ParticleMap &particles, int level, Geant4ParticleHandle p) const
Print tree of kept particles.
void printParticles(const G4Event *e, const ParticleMap &particles) const
Print record of kept particles.
bool m_printGeneration
Property: Flag to indicate output type as part of the generator action.
return e
Definition: Volumes.cpp:297
Concrete basic implementation of the Geant4 event action.
Geant4Context * context() const
Access the context.
Definition: Geant4Action.h:261
Geant4ParticlePrint(Geant4Context *context, const std::string &nam)
Standard constructor.
Geant4ParticleMap::ParticleMap ParticleMap
int m_outputType
Property: Flag to indicate output type: 1: TABLE, 2:TREE, 3:BOTH (default)
virtual void begin(const G4Event *event)
Pre-event action callback.
virtual void end(const G4Event *event)
Post-event action callback.
Geant4ParticleMap::TrackEquivalents TrackEquivalents
virtual void operator()(G4Event *event)
Generation action callback.
Data structure to access derived MC particle information.
bool m_printBegin
Property: Flag to indicate output type at begin of event.
bool m_printHits
Property: Flag to indicate output of hit data in tree.
Generic context to extend user, run and event information.
bool m_printEnd
Property: Flag to indicate output type at end of event.
virtual ~Geant4ParticlePrint()
Default destructor.
Geant4Action to print MC particle information.