src/BDSUserTrackingAction.cc

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
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   // store muon trajectories
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   // store neutron trajectories
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   // store trajectories for primaries
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     if(aTrack->GetDefinition()->GetParticleName()=="neutron")
00058     {
00059     BDSNeutronTrackInfo* Info= new BDSNeutronTrackInfo();
00060     Info->SetIsLogged(false);
00061     fpTrackingManager->SetUserTrackInformation(Info);
00062     }
00063   */
00064   
00065 }
00066 
00067 BDSUserTrackingAction::~BDSUserTrackingAction()
00068 {;}
00069 
00070 

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7