00001
00002
00003
00004
00005
00006
00007 const int DEBUG = 0;
00008
00009 #include "BDSGlobalConstants.hh"
00010
00011 #include "BDSUserTrackingAction.hh"
00012 #include "G4TrackingManager.hh"
00013 #include "G4Track.hh"
00014
00015
00016
00017 void BDSUserTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
00018 {
00019
00020
00021 if(BDSGlobals->GetStoreMuonTrajectories())
00022 {
00023 if (DEBUG) G4cout<<"STORING MUON TRAJECTORIES"<<G4endl;
00024
00025 if( abs(aTrack->GetDefinition()->GetPDGEncoding())==13)
00026 { fpTrackingManager->SetStoreTrajectory(true); }
00027 else
00028 { fpTrackingManager->SetStoreTrajectory(false); }
00029 }
00030
00031
00032 if(BDSGlobals->GetStoreNeutronTrajectories())
00033 {
00034 if (DEBUG) G4cout<<"STORING NEUTRON TRAJECTORIES"<<G4endl;
00035
00036 if( abs(aTrack->GetDefinition()->GetPDGEncoding())==2112)
00037 { fpTrackingManager->SetStoreTrajectory(true); }
00038 else
00039 { fpTrackingManager->SetStoreTrajectory(false); }
00040 }
00041
00042
00043
00044 if(BDSGlobals->GetStoreTrajectory())
00045 {
00046 if (DEBUG) G4cout<<"STORING PRIMARY TRAJECTORIES"<<G4endl;
00047
00048 if(aTrack->GetParentID()==0)
00049 { fpTrackingManager->SetStoreTrajectory(true); }
00050 else
00051 { fpTrackingManager->SetStoreTrajectory(false); }
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 }
00065
00066 BDSUserTrackingAction::~BDSUserTrackingAction()
00067 {;}
00068
00069