LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::UpdateDaughterInformation Class Reference
Inheritance diagram for larg4::UpdateDaughterInformation:

Public Member Functions

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

Private Attributes

sim::ParticleListparticleList
 

Detailed Description

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

Definition at line 403 of file ParticleListAction.cxx.

Constructor & Destructor Documentation

larg4::UpdateDaughterInformation::UpdateDaughterInformation ( )
inline

Definition at line 407 of file ParticleListAction.cxx.

408  : particleList(0)
409  {}

Member Function Documentation

void larg4::UpdateDaughterInformation::operator() ( sim::ParticleList::value_type particleListEntry)
inline

Definition at line 411 of file ParticleListAction.cxx.

References simb::MCParticle::AddDaughter().

412  {
413  // We're looking at this Particle in the list.
414  int particleID = particleListEntry.first;
415 
416  // The parent ID of this particle;
417  // we ask the particle list since the particle itself might have been lost
418  // ("archived"), but the particle list still holds the information we need
419  int parentID = particleList->GetMotherOf(particleID);
420 
421  // If the parentID <= 0, this is a primary particle.
422  if ( parentID <= 0 ) return;
423 
424  // If we get here, this particle is somebody's daughter. Add
425  // it to the list of daughter particles for that parent.
426 
427  // Get the parent particle from the list.
428  sim::ParticleList::iterator parentEntry = particleList->find( parentID );
429 
430  if ( parentEntry == particleList->end() ){
431  // We have an "orphan": a particle whose parent isn't
432  // recorded in the particle list. This is not signficant;
433  // it's possible for a particle not to be saved in the list
434  // because it failed an energy cut, but for it to have a
435  // daughter that passed the cut (e.g., a nuclear decay).
436  return;
437  }
438  if ( !parentEntry->second ) return; // particle archived, nothing to update
439 
440  // Add the current particle to the daughter list of the
441  // parent.
442  simb::MCParticle* parent = (*parentEntry).second;
443  parent->AddDaughter( particleID );
444  }
void AddDaughter(const int trackID)
Definition: MCParticle.h:269
list_type::iterator iterator
Definition: ParticleList.h:131
iterator find(const key_type &key)
Definition: ParticleList.h:318
int GetMotherOf(const key_type &key) const
This function seeks for the exact key, not its absolute value.
void larg4::UpdateDaughterInformation::SetParticleList ( sim::ParticleList p)
inline

Definition at line 410 of file ParticleListAction.cxx.

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

410 { particleList = p; }

Member Data Documentation

sim::ParticleList* larg4::UpdateDaughterInformation::particleList
private

Definition at line 446 of file ParticleListAction.cxx.


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