14 #include "G4UImanager.hh"
15 #include "G4TrackingManager.hh"
16 #include "G4PhysicalVolumeStore.hh"
17 #include "G4TransportationManager.hh"
24 : eventAction_(e),currentTrack_(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);
84 if (extractor(aTrack).storeTrack()) {
88 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
89 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
92 uint32_t
id = aTrack->GetTrackID();
94 std::pair<math::XYZVectorD,math::XYZTLorentzVectorD>
p(pos,mom);
97 LogDebug(
"SimTrackManager") <<
"TrackingAction addTkCaloStateInfo "
98 <<
id <<
" of momentum " << mom <<
" at " << pos;
103 ((extractor(aTrack).getIDonCaloSurface() == aTrack->GetTrackID())
104 || (extractor(aTrack).isAncestor()));
106 if (extractor(aTrack).isInHistory()) {
121 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
y(),
122 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).
z());
123 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
125 <<
" added with " <<
true <<
" and " << withAncestor
133 LogDebug(
"SimTrackManager") <<
"TrackingAction addTrack "
135 <<
false <<
" and " <<
false;
148 G4TrackingManager * theTrackingManager = 0;
149 theTrackingManager = fpTrackingManager;
151 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