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 617 of file ParticleListAction_service.cxx.

Constructor & Destructor Documentation

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

Definition at line 619 of file ParticleListAction_service.cxx.

larg4::UpdateDaughterInformation::UpdateDaughterInformation ( )
inline

Definition at line 389 of file ParticleListAction.cxx.

Member Function Documentation

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

Definition at line 396 of file ParticleListAction.cxx.

397  {
398  // We're looking at this Particle in the list.
399  int particleID = particleListEntry.first;
400 
401  // The parent ID of this particle;
402  // we ask the particle list since the particle itself might have been lost
403  // ("archived"), but the particle list still holds the information we need
404  int parentID = particleList->GetMotherOf(particleID);
405 
406  // If the parentID <= 0, this is a primary particle.
407  if (parentID <= 0) return;
408 
409  // If we get here, this particle is somebody's daughter. Add
410  // it to the list of daughter particles for that parent.
411 
412  // Get the parent particle from the list.
413  sim::ParticleList::iterator parentEntry = particleList->find(parentID);
414 
415  if (parentEntry == particleList->end()) {
416  // We have an "orphan": a particle whose parent isn't
417  // recorded in the particle list. This is not signficant;
418  // it's possible for a particle not to be saved in the list
419  // because it failed an energy cut, but for it to have a
420  // daughter that passed the cut (e.g., a nuclear decay).
421  return;
422  }
423  if (!parentEntry->second) return; // particle archived, nothing to update
424 
425  // Add the current particle to the daughter list of the
426  // parent.
427  simb::MCParticle* parent = (*parentEntry).second;
428  parent->AddDaughter(particleID);
429  }
intermediate_table::iterator iterator
void AddDaughter(const int trackID)
Definition: MCParticle.h:268
def parent(G, child, parent_type)
Definition: graph.py:67
void larg4::UpdateDaughterInformation::operator() ( sim::ParticleList::value_type &  particleListEntry) const
inline

Definition at line 621 of file ParticleListAction_service.cxx.

622  {
623  // We're looking at this Particle in the list.
624  int particleID = particleListEntry.first;
625 
626  // The parent ID of this particle;
627  // we ask the particle list since the particle itself might have been lost
628  // ("archived"), but the particle list still holds the information we need
629  int parentID = particleList->GetMotherOf(particleID);
630 
631  // If the parentID <= 0, this is a primary particle.
632  if (parentID <= 0) return;
633 
634  // If we get here, this particle is somebody's daughter. Add
635  // it to the list of daughter particles for that parent.
636 
637  // Get the parent particle from the list.
638  sim::ParticleList::iterator parentEntry = particleList->find(parentID);
639 
640  if (parentEntry == particleList->end()) {
641  // We have an "orphan": a particle whose parent isn't
642  // recorded in the particle list. This is not signficant;
643  // it's possible for a particle not to be saved in the list
644  // because it failed an energy cut, but for it to have a
645  // daughter that passed the cut (e.g., a nuclear decay).
646  return;
647  }
648  if (!parentEntry->second) return; // particle archived, nothing to update
649 
650  // Add the current particle to the daughter list of the parent.
651  simb::MCParticle* parent = parentEntry->second;
652  parent->AddDaughter(particleID);
653  }
intermediate_table::iterator iterator
void AddDaughter(const int trackID)
Definition: MCParticle.h:268
def parent(G, child, parent_type)
Definition: graph.py:67
void larg4::UpdateDaughterInformation::SetParticleList ( sim::ParticleList *  p)
inline

Definition at line 391 of file ParticleListAction.cxx.

392  {
393  particleList = p;
394  }
p
Definition: test.py:223

Member Data Documentation

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

Definition at line 656 of file ParticleListAction_service.cxx.


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