14 #include "G4UImanager.hh"
15 #include "G4TrackingManager.hh"
16 #include "G4PhysicalVolumeStore.hh"
17 #include "G4TransportationManager.hh"
22 : eventAction_(e),currentTrack_(0),
23 detailedTiming(p.getUntrackedParameter<bool>(
"DetailedTiming",
false)),
24 checkTrack(p.getUntrackedParameter<bool>(
"CheckTrack",
false)),
25 trackMgrVerbose(p.getUntrackedParameter<int>(
"G4TrackManagerVerbosity",0))
27 worldSolid = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume()->GetSolid();
68 if (
worldSolid->Inside(aTrack->GetVertexPosition()) == kOutside) {
70 G4Track* theTrack = (G4Track *)(aTrack);
71 theTrack->SetTrackStatus(fStopAndKill);
81 if (extractor(aTrack).storeTrack()) {
85 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
86 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
89 uint32_t
id = aTrack->GetTrackID();
91 std::pair<math::XYZVectorD,math::XYZTLorentzVectorD>
p(pos,mom);
94 LogDebug(
"SimTrackManager") <<
"TrackingAction addTkCaloStateInfo "
95 <<
id <<
" of momentum " << mom <<
" at " << pos;
100 ((extractor(aTrack).getIDonCaloSurface() == aTrack->GetTrackID())
101 || (extractor(aTrack).isAncestor()));
103 if (extractor(aTrack).isInHistory()) {
111 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
112 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
113 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
115 <<
" added with " <<
true <<
" and " << withAncestor
123 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
125 <<
false <<
" and " <<
false;
138 G4TrackingManager * theTrackingManager = 0;
139 theTrackingManager = fpTrackingManager;
141 return theTrackingManager;
virtual ~TrackingAction()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
static void setTrack(const G4Track *)
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
static void postTracking(const G4Track *)
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