16 #ifndef LArG4_ParticleListAction_h 17 #define LArG4_ParticleListAction_h 27 #include "Geant4/globals.hh" 78 ParticleListAction(
double energyCut,
bool storeTrajectories=
false,
bool keepEMShowerDaughters=
false);
83 virtual void BeginOfEventAction(
const G4Event*);
84 virtual void EndOfEventAction (
const G4Event*);
85 virtual void PreTrackingAction (
const G4Track*);
86 virtual void PostTrackingAction(
const G4Track*);
87 virtual void SteppingAction (
const G4Step* );
91 { fFilter = std::move(
filter); }
106 {
return fPrimaryTruthMap; }
121 int GetParentage(
int trackid)
const;
128 G4bool fstoreTrajectories;
132 static int fCurrentPdgCode;
135 bool fKeepEMShowerDaughters;
138 std::unique_ptr<util::PositionInVolumeFilter>
fFilter;
144 void AddPointToCurrentParticle(TLorentzVector
const& pos,
145 TLorentzVector
const& mom,
146 std::string
const& process);
152 #endif // LArG4_ParticleListAction_h
std::map< int, GeneratedParticleIndex_t > fPrimaryTruthMap
Map: particle track ID -> index of primary information in MC truth.
bool keepParticle() const
Rerturns whether there is a particle known to be kept.
GeneratedParticleIndex_t truthInfoIndex() const
Returns the index of the particle in the generator truth record.
std::map< int, int > fParentIDMap
key is current track ID, value is parent ID
constexpr GeneratedParticleIndex_t NoGeneratedParticleIndex
Constant representing the absence of generator truth information.
void clear()
Resets the information (does not release memory it does not own)
void ResetTrackIDOffset()
static int fTrackIDOffset
static int GetCurrentPdgCode()
simb::GeneratedParticleIndex_t GeneratedParticleIndex_t
void ParticleFilter(std::unique_ptr< util::PositionInVolumeFilter > &&filter)
Grabs a particle filter.
bool isGeneratedParticleIndex(GeneratedParticleIndex_t index)
Returns whether the specified one is an acceptable generator index.
std::unique_ptr< util::PositionInVolumeFilter > fFilter
filter for particles to be kept
bool isPrimary() const
Returns whether there is a particle.
static int GetCurrentTrackID()
bool hasParticle() const
Returns whether there is a particle.
Defines classes to filter particles based on their trajectory.
Particle list in DetSim contains Monte Carlo particle information.
Tools and modules for checking out the basics of the Monte Carlo.
Common type definitions for data products (and a bit beyond).
std::map< int, GeneratedParticleIndex_t > const & GetPrimaryTruthMap() const
std::size_t GeneratedParticleIndex_t
Type of particle index in the generator truth record (simb::MCTruth).
static int fCurrentTrackID