LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
sim::GeneratedParticleInfo Class Reference

Contains information about a generated particle. More...

#include "GeneratedParticleInfo.h"

Public Member Functions

 GeneratedParticleInfo ()=default
 Default constructor (for ROOT I/O only). More...
 
 GeneratedParticleInfo (GeneratedParticleIndex_t index)
 Constructor: assigns all the values. More...
 

Private Attributes

GeneratedParticleIndex_t fGeneratedParticleIndex = NoGeneratedParticleIndex
 Index of the generated particle in its simb::MCTruth record. More...
 

Generated particle index

using GeneratedParticleIndex_t = simb::GeneratedParticleIndex_t
 Type of particle index in the generator truth record (simb::MCTruth). More...
 
static constexpr GeneratedParticleIndex_t NoGeneratedParticleIndex
 Constant representing the absence of generator truth information. More...
 
GeneratedParticleIndex_t generatedParticleIndex () const
 Returns the generated particle index. More...
 
bool hasGeneratedParticleIndex () const
 Returns whether the specified one is an acceptable generator index. More...
 

Detailed Description

Contains information about a generated particle.

This information is designed to be added as metadata to an association between a simb::MCParticle produced by the simulation of particle propagation through the detector (e.g. LArG4) with the generator truth record that particle derives from:

The associated simb::MCParticle is expected to be the generated particle of the generator truth record, as processed by the simulation. The provided information is currently:

  • index of the generated particle within the generator record; the particle itself can be obtained as:
    mctruthPtr->GetParticle(genParticleInfo.generatedParticleIndex());

Definition at line 38 of file GeneratedParticleInfo.h.

Member Typedef Documentation

Type of particle index in the generator truth record (simb::MCTruth).

Definition at line 46 of file GeneratedParticleInfo.h.

Constructor & Destructor Documentation

sim::GeneratedParticleInfo::GeneratedParticleInfo ( )
default

Default constructor (for ROOT I/O only).

Referenced by hasGeneratedParticleIndex().

sim::GeneratedParticleInfo::GeneratedParticleInfo ( GeneratedParticleIndex_t  index)
inline

Constructor: assigns all the values.

Parameters
indexgenerated particle index (NoGeneratedParticleIndex if none)

Definition at line 75 of file GeneratedParticleInfo.h.

75 : fGeneratedParticleIndex(index) {}
GeneratedParticleIndex_t fGeneratedParticleIndex
Index of the generated particle in its simb::MCTruth record.

Member Function Documentation

GeneratedParticleIndex_t sim::GeneratedParticleInfo::generatedParticleIndex ( ) const
inline

Returns the generated particle index.

Returns
generated particle index (NoGeneratedParticleIndex if none)

Definition at line 56 of file GeneratedParticleInfo.h.

References fGeneratedParticleIndex.

Referenced by sim::DumpMCParticles::DumpMCParticle().

56 { return fGeneratedParticleIndex; }
GeneratedParticleIndex_t fGeneratedParticleIndex
Index of the generated particle in its simb::MCTruth record.
bool sim::GeneratedParticleInfo::hasGeneratedParticleIndex ( ) const
inline

Returns whether the specified one is an acceptable generator index.

Definition at line 59 of file GeneratedParticleInfo.h.

References fGeneratedParticleIndex, GeneratedParticleInfo(), and simb::isGeneratedParticleIndex().

Referenced by sim::DumpMCParticles::DumpMCParticle().

60  {
62  }
bool isGeneratedParticleIndex(GeneratedParticleIndex_t index)
Returns whether the specified one is an acceptable generator index.
Definition: simb.h:37
GeneratedParticleIndex_t fGeneratedParticleIndex
Index of the generated particle in its simb::MCTruth record.

Member Data Documentation

GeneratedParticleIndex_t sim::GeneratedParticleInfo::fGeneratedParticleIndex = NoGeneratedParticleIndex
private

Index of the generated particle in its simb::MCTruth record.

Definition at line 80 of file GeneratedParticleInfo.h.

Referenced by generatedParticleIndex(), and hasGeneratedParticleIndex().

constexpr GeneratedParticleIndex_t sim::GeneratedParticleInfo::NoGeneratedParticleIndex
static
Initial value:

Constant representing the absence of generator truth information.

Definition at line 49 of file GeneratedParticleInfo.h.

Referenced by sim::DumpMCParticles::analyze().


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