16 #ifndef LArG4_ParticleListAction_h 17 #define LArG4_ParticleListAction_h 19 #include "Geant4/G4Types.hh" 20 #include "TLorentzVector.h" 24 #include "nug4/G4Base/UserAction.h" 69 return !particle.
empty();
83 return hasParticle() && keep;
97 bool storeTrajectories =
false,
98 bool keepEMShowerDaughters =
false,
99 bool keepMCParticleList =
true);
103 virtual void BeginOfEventAction(
const G4Event*);
104 virtual void EndOfEventAction(
const G4Event*);
105 virtual void PreTrackingAction(
const G4Track*);
106 virtual void PostTrackingAction(
const G4Track*);
107 virtual void SteppingAction(
const G4Step*);
120 return fCurrentTrackID;
125 return fCurrentPdgCode;
135 const sim::ParticleList* GetList()
const;
139 std::map<int, GeneratedParticleIndex_t>
const&
142 return fPrimaryTruthMap;
149 return static_cast<bool>(fparticleList);
156 sim::ParticleList&& YieldList();
164 int GetParentage(
int trackid)
const;
181 std::unique_ptr<util::PositionInVolumeFilter>
fFilter;
187 void AddPointToCurrentParticle(TLorentzVector
const&
pos,
188 TLorentzVector
const& mom,
194 #endif // LArG4_ParticleListAction_h G4bool fstoreTrajectories
Whether to store particle trajectories with each particle.
static int fCurrentPdgCode
pdg code of current particle
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.
constexpr bool empty() const noexcept
GeneratedParticleIndex_t truthInfoIndex() const
Returns the index of the particle in the generator truth record.
ParticleInfo_t fCurrentParticle
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
bool fKeepEMShowerDaughters
whether to keep EM shower secondaries, tertiaries, etc
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.
Code to link reconstructed objects back to the MC truth information.
Base utilities and modules for event generation and detector simulation.
std::unique_ptr< util::PositionInVolumeFilter > fFilter
filter for particles to be kept
std::unique_ptr< sim::ParticleList > fparticleList
bool isPrimary() const
Returns whether there is a particle.
cet::exempt_ptr< simb::MCParticle > particle
Object representing particle.
bool hasList() const
Returns whether a particle list is being kept.
static int GetCurrentTrackID()
bool hasParticle() const
Returns whether there is a particle.
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