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

Public Member Functions

 UpdateDaughterInformation ()
 
void SetParticleList (sim::ParticleList *p)
 
void operator() (sim::ParticleList::value_type &particleListEntry)
 

Private Attributes

sim::ParticleList * particleList
 

Detailed Description

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

Definition at line 436 of file ParticleListAction.cxx.

Constructor & Destructor Documentation

gar::garg4::UpdateDaughterInformation::UpdateDaughterInformation ( )
inline

Definition at line 440 of file ParticleListAction.cxx.

441  : particleList(0)
442  {}

Member Function Documentation

void gar::garg4::UpdateDaughterInformation::operator() ( sim::ParticleList::value_type &  particleListEntry)
inline

Definition at line 444 of file ParticleListAction.cxx.

445  {
446  // We're looking at this Particle in the list.
447  int particleID = particleListEntry.first;
448 
449  // The parent ID of this particle;
450  // we ask the particle list since the particle itself might have been lost
451  // ("archived"), but the particle list still holds the information we need
452  int parentID = particleList->GetMotherOf(particleID);
453 
454  // If the parentID <= 0, this is a primary particle.
455  if ( parentID <= 0 ) return;
456 
457  // If we get here, this particle is somebody's daughter. Add
458  // it to the list of daughter particles for that parent.
459 
460  // Get the parent particle from the list.
461  sim::ParticleList::iterator parentEntry = particleList->find( parentID );
462 
463  if ( parentEntry == particleList->end() ){
464  // We have an "orphan": a particle whose parent isn't
465  // recorded in the particle list. This is not signficant;
466  // it's possible for a particle not to be saved in the list
467  // because it failed an energy cut, but for it to have a
468  // daughter that passed the cut (e.g., a nuclear decay).
469  return;
470  }
471  if ( !parentEntry->second ) return; // particle archived, nothing to update
472 
473  // Add the current particle to the daughter list of the
474  // parent.
475  simb::MCParticle* parent = (*parentEntry).second;
476  parent->AddDaughter( particleID );
477  }
intermediate_table::iterator iterator
void AddDaughter(const int trackID)
Definition: MCParticle.h:268
def parent(G, child, parent_type)
Definition: graph.py:67
void gar::garg4::UpdateDaughterInformation::SetParticleList ( sim::ParticleList *  p)
inline

Definition at line 443 of file ParticleListAction.cxx.

443 { particleList = p; }
p
Definition: test.py:223

Member Data Documentation

sim::ParticleList* gar::garg4::UpdateDaughterInformation::particleList
private

Definition at line 479 of file ParticleListAction.cxx.


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