Public Member Functions | Private Attributes | List of all members
g4n::UpdateDaughterInformation Class Reference
Inheritance diagram for g4n::UpdateDaughterInformation:

Public Member Functions

 UpdateDaughterInformation ()
 
void SetParticleNav (sim::ParticleNavigator *p)
 
void operator() (sim::ParticleNavigator::value_type &particleNavEntry)
 

Private Attributes

sim::ParticleNavigatorparticleNav
 

Detailed Description

Utility class for the EndOfEventAction method: update the daughter relationships in the particle list.

Definition at line 518 of file ParticleListAction.cxx.

Constructor & Destructor Documentation

g4n::UpdateDaughterInformation::UpdateDaughterInformation ( )
inline

Definition at line 521 of file ParticleListAction.cxx.

522  : particleNav(0)
523  {}
sim::ParticleNavigator * particleNav

Member Function Documentation

void g4n::UpdateDaughterInformation::operator() ( sim::ParticleNavigator::value_type particleNavEntry)
inline

Definition at line 525 of file ParticleListAction.cxx.

References simb::MCParticle::AddDaughter(), simb::MCParticle::Mother(), file_size_ana::parent, parentID, and simb::MCParticle::TrackId().

526  {
527  // We're looking at this Particle in the list.
528  sim::Particle* particle = particleNavEntry.second;
529 
530  // The parent ID of this particle.
531  int parentID = particle->Mother();
532 
533  // If the parentID <= 0, this is a primary particle.
534  if ( parentID <= 0 ) return;
535 
536  // If we get here, this particle is somebody's daughter. Add
537  // it to the list of daughter particles for that parent.
538 
539  // Get the parent particle from the list.
540  sim::ParticleNavigator::iterator parentEntry = particleNav->find( parentID );
541 
542  if ( parentEntry == particleNav->end() ){
543  // We have an "orphan": a particle whose parent isn't
544  // recorded in the particle list. This is not signficant;
545  // it's possible for a particle not to be saved in the list
546  // because it failed an energy cut, but for it to have a
547  // daughter that passed the cut (e.g., a nuclear decay).
548  return;
549  }
550 
551  // Add the current particle to the daughter list of the
552  // parent.
553  sim::Particle* parent = (*parentEntry).second;
554  parent->AddDaughter( particle->TrackId() );
555  }
void AddDaughter(const int trackID)
Definition: MCParticle.h:264
int Mother() const
Definition: MCParticle.h:212
list_type::iterator iterator
int TrackId() const
Definition: MCParticle.h:209
Int_t parentID
Definition: plot.C:85
iterator find(const key_type &key)
sim::ParticleNavigator * particleNav
void g4n::UpdateDaughterInformation::SetParticleNav ( sim::ParticleNavigator p)
inline

Definition at line 524 of file ParticleListAction.cxx.

Referenced by g4n::ParticleListAction::EndOfEventAction().

524 { particleNav = p; }
const char * p
Definition: xmltok.h:285
sim::ParticleNavigator * particleNav

Member Data Documentation

sim::ParticleNavigator* g4n::UpdateDaughterInformation::particleNav
private

Definition at line 557 of file ParticleListAction.cxx.


The documentation for this class was generated from the following file: