All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
larg4::UpdateDaughterInformation Class Reference
Inheritance diagram for larg4::UpdateDaughterInformation:

Public Member Functions

 UpdateDaughterInformation (sim::ParticleList &p)
 
void operator() (sim::ParticleList::value_type &particleListEntry) const
 
 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 600 of file ParticleListAction.cc.

Constructor & Destructor Documentation

larg4::UpdateDaughterInformation::UpdateDaughterInformation ( sim::ParticleList &  p)
inlineexplicit

Definition at line 602 of file ParticleListAction.cc.

602 : particleList{&p} {}
pdgs p
Definition: selectors.fcl:22
larg4::UpdateDaughterInformation::UpdateDaughterInformation ( )
inline

Definition at line 417 of file ParticleListAction.cxx.

417 : particleList(0) {}

Member Function Documentation

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

Definition at line 424 of file ParticleListAction.cxx.

425  {
426  // We're looking at this Particle in the list.
427  int particleID = particleListEntry.first;
428 
429  // The parent ID of this particle;
430  // we ask the particle list since the particle itself might have been lost
431  // ("archived"), but the particle list still holds the information we need
432  int parentID = particleList->GetMotherOf(particleID);
433 
434  // If the parentID <= 0, this is a primary particle.
435  if (parentID <= 0) return;
436 
437  // If we get here, this particle is somebody's daughter. Add
438  // it to the list of daughter particles for that parent.
439 
440  // Get the parent particle from the list.
441  sim::ParticleList::iterator parentEntry = particleList->find(parentID);
442 
443  if (parentEntry == particleList->end()) {
444  // We have an "orphan": a particle whose parent isn't
445  // recorded in the particle list. This is not signficant;
446  // it's possible for a particle not to be saved in the list
447  // because it failed an energy cut, but for it to have a
448  // daughter that passed the cut (e.g., a nuclear decay).
449  return;
450  }
451  if (!parentEntry->second) return; // particle archived, nothing to update
452 
453  // Add the current particle to the daughter list of the
454  // parent.
455  simb::MCParticle* parent = (*parentEntry).second;
456  parent->AddDaughter(particleID);
457  }
void larg4::UpdateDaughterInformation::operator() ( sim::ParticleList::value_type &  particleListEntry) const
inline

Definition at line 604 of file ParticleListAction.cc.

605  {
606  // We're looking at this Particle in the list.
607  int particleID = particleListEntry.first;
608 
609  // The parent ID of this particle;
610  // we ask the particle list since the particle itself might have been lost
611  // ("archived"), but the particle list still holds the information we need
612  int parentID = particleList->GetMotherOf(particleID);
613 
614  // If the parentID <= 0, this is a primary particle.
615  if (parentID <= 0) return;
616 
617  // If we get here, this particle is somebody's daughter. Add
618  // it to the list of daughter particles for that parent.
619 
620  // Get the parent particle from the list.
621  sim::ParticleList::iterator parentEntry = particleList->find(parentID);
622 
623  if (parentEntry == particleList->end()) {
624  // We have an "orphan": a particle whose parent isn't
625  // recorded in the particle list. This is not signficant;
626  // it's possible for a particle not to be saved in the list
627  // because it failed an energy cut, but for it to have a
628  // daughter that passed the cut (e.g., a nuclear decay).
629  return;
630  }
631  if (!parentEntry->second) return; // particle archived, nothing to update
632 
633  // Add the current particle to the daughter list of the parent.
634  simb::MCParticle* parent = parentEntry->second;
635  parent->AddDaughter(particleID);
636  }
void larg4::UpdateDaughterInformation::SetParticleList ( sim::ParticleList *  p)
inline

Definition at line 419 of file ParticleListAction.cxx.

420  {
421  particleList = p;
422  }
pdgs p
Definition: selectors.fcl:22

Member Data Documentation

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

Definition at line 639 of file ParticleListAction.cc.


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