28#include <TMCParticleStatus.h>
29#include <TMCProcess.h>
30#include <TVirtualMC.h>
31#include <TVirtualMCApplication.h>
33#include <G4TrackVector.hh>
34#include <G4TrackingManager.hh>
35#include <G4UImanager.hh>
54 fOverwriteLastTrack(false),
56 fNewVerboseTrackID(-1),
57 fDoFinishPrimary(true)
63 "Cannot create two instances of singleton.");
97 "TG4TrackingAction",
"UserProcessHits",
"Cannot locate track vertex.");
103 pv->GetLogicalVolume()->GetSensitiveDetector());
173 G4bool isFirstStep = (track->GetCurrentStepNumber() == 0);
176 if (track->GetParentID() == 0 && isFirstStep) {
192 TMCParticleStatus* particleStatus =
200 if (track->GetParentID() == 0) {
205 if (!particleStatus ||
206 (particleStatus->fStepNumber == 0 && particleStatus->fParentId < 0)) {
212 if (particleStatus && particleStatus->fParentId > -1) {
245 if (!particleStatus || particleStatus->fStepNumber == 0) {
252 if (track->GetTrackStatus() != fStopAndKill) {
264#ifdef STACK_WITH_KEEP_FLAG
270 (!fpTrackingManager->GimmeSecondaries() ||
271 fpTrackingManager->GimmeSecondaries()->size() == 0);
294 if (track->GetTrackStatus() != fSuspend && !trackInfo->IsInterrupt()) {
305 if (particleStatus && particleStatus->fParentId < 0 &&
306 trackInfo->IsInterrupt()) {
324 G4Track* noTrack = 0;
Definition of the TG4GeometryServices class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4ParticlesManager class.
Definition of the TG4PhysicsManager class.
Definition of the TG4SDServices class.
Definition of the TG4SensitiveDetector class.
Definition of the TG4SpecialControlsV2 class.
Definition of the TG4StackPopper class.
Definition of the TG4StepManager class.
Definition of the TG4TrackManager class.
Definition of the TG4TrackingAction class.
static void Warning(const TString &className, const TString &methodName, const TString &text)
static void Exception(const TString &className, const TString &methodName, const TString &text)
TG4SensitiveDetector * GetSensitiveDetector(G4VSensitiveDetector *sd) const
static TG4SDServices * Instance()
Sensitive detector class for calling a user defined stepping function.
virtual void ProcessHitsOnTrackStart()
Bool_t IsApplicable() const
void StartTrack(const G4Track *track)
void RestoreProcessActivations()
static TG4StackPopper * Instance()
void SetSteppingManager(G4SteppingManager *manager)
static TG4StepManager * Instance()
void SetStep(G4Step *step, TG4StepStatus status)
G4VPhysicalVolume * GetCurrentPhysicalVolume() const
TG4Limits * GetLimitsModifiedOnFly() const
void SetInitialVMCTrackStatus(TMCParticleStatus *status)
The class for storing G4 tracks in VMC sack.
TG4TrackSaveControl GetTrackSaveControl() const
void SetG4TrackingManager(G4TrackingManager *trackingManager)
void SetBackPDGLifetime(const G4Track *aTrack)
TG4TrackInformation * GetTrackInformation(const G4Track *track) const
void SetParentToTrackInformation(const G4Track *aTrack)
G4bool IsUserTrack(const G4Track *track) const
void TrackToStack(const G4Track *track, G4bool overWrite=false)
void SetNofTracks(G4int nofTracks)
TG4TrackInformation * SetTrackInformation(const G4Track *aTrack, G4bool overWrite=false)
Actions at the beginnig and at the end of track.
G4int fPrimaryTrackID
current primary track ID
virtual void PostTrackingAction(const G4Track *aTrack)
void SetNewVerboseLevel(G4int level)
G4bool fOverwriteLastTrack
control of saving current track
static G4ThreadLocal TG4TrackingAction * fgInstance
this instance
TG4TrackManager * GetTrackManager() const
G4int fCurrentTrackID
current track ID
G4int fNewVerboseTrackID
track ID for which the new verbose level is applied
virtual void PreUserTrackingAction(const G4Track *aTrack)
G4int GetNewVerboseLevel() const
virtual ~TG4TrackingAction()
TG4StepManager * fStepManager
Cached pointer to thread-local step manager.
TG4TrackManager * fTrackManager
track manager
G4int fNewVerboseLevel
new /tracking/verbose level
void UserProcessHits(const G4Track *aTrack)
G4int GetNewVerboseTrackID() const
virtual void PreTrackingAction(const G4Track *aTrack)
void FinishPrimaryTrack()
TG4TrackSaveControl fTrackSaveControl
control of saving secondary tracks
virtual void PrepareNewEvent()
TG4StackPopper * fStackPopper
Cached pointer to thread-local stack popper.
TVirtualMCApplication * fMCApplication
Cached pointer to thread-local VMC application.
void SetNewVerboseTrackID(G4int trackID)
virtual void PostUserTrackingAction(const G4Track *aTrack)
TVirtualMCStack * fMCStack
Cached pointer to thread-local VMC stack.
TG4SpecialControlsV2 * fSpecialControls
the special controls manager
Base class for defining the verbose level and a common messenger.
virtual G4int VerboseLevel() const
@ kSaveInPreTrack
save in pre-track