10 #include "G4EventManager.hh"
11 #include "G4LogicalVolume.hh"
12 #include "G4PropagatorInField.hh"
13 #include "G4RunManagerKernel.hh"
16 #include "G4ThreeVector.hh"
18 #include "G4TransportationManager.hh"
19 #include "G4VProcess.hh"
23 #include "GaudiKernel/Bootstrap.h"
24 #include "GaudiKernel/ISvcLocator.h"
25 #include "GaudiKernel/IMessageSvc.h"
34 AthMessaging(
Gaudi::svcLocator()->service< IMessageSvc >(
"MessageSvc" ),
"VerboseSelector"),
35 m_evtStore(
"StoreGateSvc/StoreGateSvc",
"VerboseSelector"),
36 m_detStore(
"StoreGateSvc/DetectorStore",
"LooperKiller"),
37 m_config(
config),m_evtCount(0)
54 const G4ThreeVector& myPos = aStep->GetPostStepPoint()->GetPosition();
60 G4TransportationManager *tm = G4TransportationManager::GetTransportationManager();
64 G4RunManagerKernel *rmk = G4RunManagerKernel::GetRunManagerKernel();
69 G4Track *tr = aStep->GetTrack();
70 const G4ThreeVector&
mom = tr->GetMomentumDirection();
72 std::cout <<
"Moving " << tr->GetDefinition()->GetParticleName() <<
" at (" << myPos.x()
73 <<
", " << myPos.y() <<
", " << myPos.z() <<
") to (" <<
mom.x() <<
", " <<
mom.y()
74 <<
", " <<
mom.z() <<
") from ";
75 if (aStep->GetPreStepPoint()->GetPhysicalVolume()) std::cout << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();
76 else std::cout <<
"noVolume";
78 if (aStep->GetPostStepPoint()->GetPhysicalVolume()) std::cout << aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
79 else std::cout <<
"outOfWorld";
80 std::cout <<
" with KE=" << tr->GetKineticEnergy() <<
" pT=" << tr->GetMomentum().perp()
81 <<
" eta=" << tr->GetMomentum().eta() <<
" length " << aStep->GetStepLength() <<
" energy "
82 << aStep->GetTotalEnergyDeposit() <<
" with process ";
83 if (aStep->GetPostStepPoint()->GetProcessDefinedStep()) std::cout << aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
84 else std::cout <<
"Unknown";
85 std::cout <<
" from a ";
86 if (tr->GetCreatorProcess()) std::cout << tr->GetCreatorProcess()->GetProcessName();
87 else if (tr->GetParentID()==0) std::cout <<
"Generator";
88 else std::cout <<
"pid="<<tr->GetParentID();
89 if (tr->GetLogicalVolumeAtVertex()) std::cout <<
" in " << tr->GetLogicalVolumeAtVertex()->GetName() <<
", ";
90 else std::cout <<
" nowhere, ";
91 std::cout << tr->GetTrackLength() <<
" mm ago" << std::endl;
103 int trackID = aTrack->GetTrackID();
107 (G4EventManager::GetEventManager()->GetConstCurrentEvent()->
108 GetUserInformation());
110 int currentBarcode(0);
122 if (std::abs(aTrack->GetParticleDefinition()->GetPDGEncoding()) == pdgID ) {
128 if(
p1 ||
p2 ||
p3 || p4) {
129 ATH_MSG_INFO(std::endl <<
"---------> Dumping now track #"
130 << trackID <<
" barcode " << currentBarcode
131 <<
" pdgID " << aTrack->GetParticleDefinition()->GetPDGEncoding()
133 G4EventManager::GetEventManager()->GetTrackingManager()->
143 G4EventManager::GetEventManager()->GetTrackingManager()->SetVerboseLevel(0);
145 if (std::abs(aTrack->GetParticleDefinition()->GetPDGEncoding()) == pdgID ) {
146 G4EventManager::GetEventManager()->GetTrackingManager()->SetVerboseLevel(0);