14 #include "G4UImanager.hh"
15 #include "G4TrackingManager.hh"
16 #include "G4PhysicalVolumeStore.hh"
17 #include "G4TransportationManager.hh"
24 : eventAction_(e),currentTrack_(0),g4Track_(0),
25 detailedTiming(p.getUntrackedParameter<bool>(
"DetailedTiming",
false)),
26 checkTrack(p.getUntrackedParameter<bool>(
"CheckTrack",
false)),
27 trackMgrVerbose(p.getUntrackedParameter<int>(
"G4TrackManagerVerbosity",0))
29 worldSolid = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume()->GetSolid();
71 if (
worldSolid->Inside(aTrack->GetVertexPosition()) == kOutside) {
73 G4Track* theTrack = (G4Track *)(aTrack);
74 theTrack->SetTrackStatus(fStopAndKill);
83 if (extractor(aTrack).storeTrack()) {
87 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
88 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
91 uint32_t
id = aTrack->GetTrackID();
93 std::pair<math::XYZVectorD,math::XYZTLorentzVectorD>
p(pos,mom);
96 LogDebug(
"SimTrackManager") <<
"TrackingAction addTkCaloStateInfo "
97 <<
id <<
" of momentum " << mom <<
" at " << pos;
102 ((extractor(aTrack).getIDonCaloSurface() == aTrack->GetTrackID())
103 || (extractor(aTrack).isAncestor()));
105 if (extractor(aTrack).isInHistory()) {
120 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
121 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
122 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
124 <<
" added with " <<
true <<
" and " << withAncestor
132 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
134 <<
false <<
" and " <<
false;
147 G4TrackingManager * theTrackingManager = 0;
148 theTrackingManager = fpTrackingManager;
150 return theTrackingManager;
virtual ~TrackingAction()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void PreUserTrackingAction(const G4Track *aTrack)
TrackWithHistory * currentTrack_
void prepareForNewPrimary()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
EventAction * eventAction_
G4TrackingManager * getTrackManager()
unsigned int trackID() const
void checkAtEnd(const G4Track *)
TrackingAction(EventAction *ea, const edm::ParameterSet &ps)
SimActivityRegistry::EndOfTrackSignal m_endOfTrackSignal
const TrackContainer * trackContainer() const
virtual void PostUserTrackingAction(const G4Track *aTrack)
void addTkCaloStateInfo(uint32_t t, const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &p)
volatile std::atomic< bool > shutdown_flag false
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal