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