G4TrackingManager Class Reference

#include <G4TrackingManager.hh>


Public Member Functions

 G4TrackingManager ()
 ~G4TrackingManager ()
G4TrackGetTrack () const
G4int GetStoreTrajectory () const
void SetStoreTrajectory (G4int value)
G4SteppingManagerGetSteppingManager () const
G4UserTrackingActionGetUserTrackingAction () const
G4VTrajectoryGimmeTrajectory () const
void SetTrajectory (G4VTrajectory *aTrajectory)
G4TrackVectorGimmeSecondaries () const
void SetUserAction (G4UserTrackingAction *apAction)
void SetUserAction (G4UserSteppingAction *apAction)
void SetVerboseLevel (G4int vLevel)
G4int GetVerboseLevel () const
void ProcessOneTrack (G4Track *apValueG4Track)
void EventAborted ()
void SetUserTrackInformation (G4VUserTrackInformation *aValue)


Detailed Description

Definition at line 69 of file G4TrackingManager.hh.


Constructor & Destructor Documentation

G4TrackingManager::G4TrackingManager (  ) 

Definition at line 48 of file G4TrackingManager.cc.

00050   : fpUserTrackingAction(0), fpTrajectory(0),
00051     StoreTrajectory(0), verboseLevel(0), EventIsAborted(false)
00052 {
00053   fpSteppingManager = new G4SteppingManager();
00054   messenger = new G4TrackingMessenger(this);
00055 }

G4TrackingManager::~G4TrackingManager (  ) 

Definition at line 58 of file G4TrackingManager.cc.

00060 {
00061   delete messenger;
00062   delete fpSteppingManager;
00063   if (fpUserTrackingAction) delete fpUserTrackingAction;
00064 }


Member Function Documentation

void G4TrackingManager::EventAborted (  ) 

Definition at line 163 of file G4TrackingManager.cc.

References fKillTrackAndSecondaries, and G4Track::SetTrackStatus().

Referenced by G4EventManager::AbortCurrentEvent().

00165 {
00166   fpTrack->SetTrackStatus( fKillTrackAndSecondaries );
00167   EventIsAborted = true;
00168 }

G4SteppingManager * G4TrackingManager::GetSteppingManager (  )  const [inline]

Definition at line 169 of file G4TrackingManager.hh.

Referenced by G4ErrorPropagator::G4ErrorPropagator(), G4TrackingMessenger::G4TrackingMessenger(), and G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel().

00169                                                                          { 
00170      return fpSteppingManager; 
00171    }

G4int G4TrackingManager::GetStoreTrajectory (  )  const [inline]

Definition at line 161 of file G4TrackingManager.hh.

Referenced by G4TrackingMessenger::GetCurrentValue().

00161                                                             { 
00162      return StoreTrajectory;
00163    }

G4Track * G4TrackingManager::GetTrack (  )  const [inline]

Definition at line 157 of file G4TrackingManager.hh.

00157                                                      { 
00158      return fpTrack;
00159    }

G4UserTrackingAction * G4TrackingManager::GetUserTrackingAction (  )  const [inline]

Definition at line 173 of file G4TrackingManager.hh.

00173                                                                                 { 
00174      return fpUserTrackingAction; 
00175    }

G4int G4TrackingManager::GetVerboseLevel (  )  const [inline]

Definition at line 205 of file G4TrackingManager.hh.

Referenced by G4TrackingMessenger::GetCurrentValue(), and G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel().

00205                                                          { 
00206      return verboseLevel; 
00207    }

G4TrackVector * G4TrackingManager::GimmeSecondaries (  )  const [inline]

Definition at line 181 of file G4TrackingManager.hh.

References G4SteppingManager::GetfSecondary().

Referenced by ProcessOneTrack().

00181                                                                    { 
00182      return fpSteppingManager->GetfSecondary(); 
00183    }

G4VTrajectory * G4TrackingManager::GimmeTrajectory (  )  const [inline]

Definition at line 177 of file G4TrackingManager.hh.

00177                                                                   { 
00178      return fpTrajectory ; 
00179    }

void G4TrackingManager::ProcessOneTrack ( G4Track apValueG4Track  ) 

Definition at line 67 of file G4TrackingManager.cc.

References G4ProcessManager::EndTracking(), fAlive, fKillTrackAndSecondaries, fStopButAlive, G4Track::GetDefinition(), G4ParticleDefinition::GetProcessManager(), G4SteppingManager::GetProcessNumber(), G4VSteppingVerbose::GetSilent(), G4SteppingManager::GetStep(), G4Track::GetTrackStatus(), GimmeSecondaries(), G4Track::IncrementCurrentStepNumber(), G4UserTrackingAction::PostUserTrackingAction(), G4UserTrackingAction::PreUserTrackingAction(), G4SteppingManager::SetInitialStep(), G4Track::SetStep(), G4Track::SetTrackStatus(), G4VTrajectory::ShowTrajectory(), G4ProcessManager::StartTracking(), G4SteppingManager::Stepping(), and G4VSteppingVerbose::verboseLevel.

00069 {
00070 
00071   // Receiving a G4Track from the EventManager, this funciton has the
00072   // responsibility to trace the track till it stops.
00073   fpTrack = apValueG4Track;
00074   EventIsAborted = false;
00075 
00076   // Clear 2ndary particle vector
00077   //  GimmeSecondaries()->clearAndDestroy();    
00078   //  std::vector<G4Track*>::iterator itr;
00079   size_t itr;
00080   //  for(itr=GimmeSecondaries()->begin();itr=GimmeSecondaries()->end();itr++){ 
00081   for(itr=0;itr<GimmeSecondaries()->size();itr++){ 
00082      delete (*GimmeSecondaries())[itr];
00083   }
00084   GimmeSecondaries()->clear();  
00085    
00086   if(verboseLevel>0 && (G4VSteppingVerbose::GetSilent()!=1) ) TrackBanner();
00087   
00088   // Give SteppingManger the pointer to the track which will be tracked 
00089   fpSteppingManager->SetInitialStep(fpTrack);
00090 
00091   // Pre tracking user intervention process.
00092   fpTrajectory = 0;
00093   if( fpUserTrackingAction != 0 ) {
00094      fpUserTrackingAction->PreUserTrackingAction(fpTrack);
00095   }
00096 #ifdef G4_STORE_TRAJECTORY
00097   // Construct a trajectory if it is requested
00098   if(StoreTrajectory&&(!fpTrajectory)) { 
00099     // default trajectory concrete class object
00100     switch (StoreTrajectory) {
00101     default:
00102     case 1: fpTrajectory = new G4Trajectory(fpTrack); break;
00103     case 2: fpTrajectory = new G4SmoothTrajectory(fpTrack); break;
00104     case 3: fpTrajectory = new G4RichTrajectory(fpTrack); break;
00105     }
00106   }
00107 #endif
00108 
00109   // Give SteppingManger the maxmimum number of processes 
00110   fpSteppingManager->GetProcessNumber();
00111 
00112   // Give track the pointer to the Step
00113   fpTrack->SetStep(fpSteppingManager->GetStep());
00114 
00115   // Inform beginning of tracking to physics processes 
00116   fpTrack->GetDefinition()->GetProcessManager()->StartTracking(fpTrack);
00117 
00118   // Track the particle Step-by-Step while it is alive
00119   //  G4StepStatus stepStatus;
00120 
00121   while( (fpTrack->GetTrackStatus() == fAlive) ||
00122          (fpTrack->GetTrackStatus() == fStopButAlive) ){
00123 
00124     fpTrack->IncrementCurrentStepNumber();
00125     fpSteppingManager->Stepping();
00126 #ifdef G4_STORE_TRAJECTORY
00127     if(StoreTrajectory) fpTrajectory->
00128                         AppendStep(fpSteppingManager->GetStep()); 
00129 #endif
00130     if(EventIsAborted) {
00131       fpTrack->SetTrackStatus( fKillTrackAndSecondaries );
00132     }
00133   }
00134   // Inform end of tracking to physics processes 
00135   fpTrack->GetDefinition()->GetProcessManager()->EndTracking();
00136 
00137   // Post tracking user intervention process.
00138   if( fpUserTrackingAction != 0 ) {
00139      fpUserTrackingAction->PostUserTrackingAction(fpTrack);
00140   }
00141 
00142   // Destruct the trajectory if it was created
00143 #ifdef G4VERBOSE
00144   if(StoreTrajectory&&verboseLevel>10) fpTrajectory->ShowTrajectory();
00145 #endif
00146   if( (!StoreTrajectory)&&fpTrajectory ) {
00147       delete fpTrajectory;
00148       fpTrajectory = 0;
00149   }
00150 }

void G4TrackingManager::SetStoreTrajectory ( G4int  value  )  [inline]

Definition at line 165 of file G4TrackingManager.hh.

Referenced by G4TrackingMessenger::SetNewValue().

00165                                                                { 
00166      StoreTrajectory = value;
00167    }

void G4TrackingManager::SetTrajectory ( G4VTrajectory aTrajectory  ) 

Definition at line 152 of file G4TrackingManager.cc.

References FatalException, and G4Exception().

Referenced by G4RTTrackingAction::PreUserTrackingAction().

00153 {
00154 #ifndef G4_STORE_TRAJECTORY
00155   G4Exception("G4TrackingManager::SetTrajectory()",
00156               "Tracking0015", FatalException,
00157               "Invoked without G4_STORE_TRAJECTORY option set!");
00158 #endif
00159   fpTrajectory = aTrajectory;
00160 }

void G4TrackingManager::SetUserAction ( G4UserSteppingAction apAction  )  [inline]

Definition at line 192 of file G4TrackingManager.hh.

References G4UserSteppingAction::SetSteppingManagerPointer(), and G4SteppingManager::SetUserAction().

00192                                                                              {
00193      fpSteppingManager->SetUserAction(apAction);
00194      if(apAction != 0){
00195        apAction->SetSteppingManagerPointer(fpSteppingManager);  
00196      }  
00197    }

void G4TrackingManager::SetUserAction ( G4UserTrackingAction apAction  )  [inline]

Definition at line 185 of file G4TrackingManager.hh.

References G4UserTrackingAction::SetTrackingManagerPointer().

Referenced by G4EventManager::SetUserAction().

00185                                                                              {
00186      fpUserTrackingAction = apAction;
00187      if(apAction != 0){
00188        apAction->SetTrackingManagerPointer(this);
00189      }  
00190    }

void G4TrackingManager::SetUserTrackInformation ( G4VUserTrackInformation aValue  )  [inline]

Definition at line 209 of file G4TrackingManager.hh.

References G4Track::SetUserInformation().

00209                                                                                          {
00210      if(fpTrack) fpTrack->SetUserInformation(aValue);
00211    }

void G4TrackingManager::SetVerboseLevel ( G4int  vLevel  )  [inline]

Definition at line 199 of file G4TrackingManager.hh.

Referenced by G4TrackingMessenger::SetNewValue().

00199                                                              { 
00200      verboseLevel = vLevel; 
00201      fpSteppingManager -> SetVerboseLevel( vLevel );
00202    }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:32 2013 for Geant4 by  doxygen 1.4.7