File indexing completed on 2025-01-18 09:14:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/InstanceCount.h>
0016 #include <DDG4/Geant4TrackingPreAction.h>
0017
0018
0019 #include <G4TrackingManager.hh>
0020
0021 using namespace dd4hep::sim;
0022
0023
0024 Geant4TrackingPreAction::Geant4TrackingPreAction(Geant4Context* ctxt, const std::string& nam)
0025 : Geant4TrackingAction(ctxt, nam) {
0026 InstanceCount::increment(this);
0027 }
0028
0029
0030 Geant4TrackingPreAction::~Geant4TrackingPreAction() {
0031 InstanceCount::decrement(this);
0032 }
0033
0034
0035 void Geant4TrackingPreAction::begin(const G4Track* track) {
0036
0037
0038 if (0 == track || 0 == trackMgr() || 0 != trackMgr()->GimmeTrajectory())
0039 return;
0040 trackMgr()->SetStoreTrajectory(true);
0041
0042 G4VTrajectory* tr = context()->createTrajectory(track);
0043 trackMgr()->SetTrajectory(tr);
0044 }
0045
0046
0047 void Geant4TrackingPreAction::end(const G4Track* ) {
0048 }