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 trackMgrVerbose(p.getUntrackedParameter<int>(
"G4TrackManagerVerbosity",0)) {
26 worldSolid = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume()->GetSolid();
59 if (
worldSolid->Inside(aTrack->GetVertexPosition()) == kOutside) {
61 G4Track* theTrack = (G4Track *)(aTrack);
62 theTrack->SetTrackStatus(fStopAndKill);
74 if (extractor(aTrack).storeTrack())
79 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
80 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
83 uint32_t
id = aTrack->GetTrackID();
85 std::pair<math::XYZVectorD,math::XYZTLorentzVectorD>
p(
pos,mom);
88 LogDebug(
"SimTrackManager") <<
"TrackingAction addTkCaloStateInfo " <<
id <<
" of momentum " << mom <<
" at " <<
pos;
92 bool withAncestor = ((extractor(aTrack).getIDonCaloSurface() == aTrack->GetTrackID()) || (extractor(aTrack).isAncestor()));
93 if (extractor(aTrack).isInHistory())
99 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
100 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
101 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack " <<
currentTrack_->
trackID() <<
" added with " <<
true <<
" and " << withAncestor <<
" at " <<
pos;
120 G4TrackingManager * theTrackingManager = 0;
121 theTrackingManager = fpTrackingManager;
123 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)
bool isNewPrimary(const G4Track *aTrack)
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal