Mu2eG4/src/Mu2eG4UserHelpers.cc
G4String findTrackStoppingProcessName(G4Track const* const trk){

      // First check to see if Mu2e code killed this track.
      G4VUserTrackInformation* info = trk->GetUserInformation();
      Mu2eG4UserTrackInformation const* tinfo   = dynamic_cast<Mu2eG4UserTrackInformation*>(info);

      if ( tinfo->isForced() ){
        return tinfo->code().name();
      }

      // Otherwise, G4 killed this track.
      return findStepStoppingProcessName(trk->GetStep());

    }
// Find the name of the process that stopped this track.
// G4String const & findTrackStoppingProcessName(G4Track const* const trk){
Find the name of the process that stopped this track.
Find the name of the process that stopped this track .
G4String findTrackStoppingProcessName(G4Track const* const trk){
      G4VUserTrackInformation* info = trk->GetUserInformation();
      Mu2eG4UserTrackInformation const* tinfo   = dynamic_cast<Mu2eG4UserTrackInformation*>(info);
      if ( tinfo->isForced() ){
        return tinfo->code().name();
      }
      return findStepStoppingProcessName(trk->GetStep());
    }
G4String findTrackStoppingProcessName ( G4Track const * const trk ) { G4VUserTrackInformation * info = trk -> GetUserInformation ( ) ; Mu2eG4UserTrackInformation const * tinfo = dynamic_cast < Mu2eG4UserTrackInformation * > ( info ) ; if ( tinfo -> isForced ( ) ) { return tinfo -> code ( ) . name ( ) ; } return findStepStoppingProcessName ( trk -> GetStep ( ) ) ; }
Find the name of the process that stopped this track.
Find the name of the process that stopped this track .
// First check to see if Mu2e code killed this track. // Otherwise, G4 killed this track.