16 #ifndef LArG4_ParticleListAction_h 17 #define LArG4_ParticleListAction_h 19 #include "Geant4/G4Types.hh" 20 #include "TLorentzVector.h" 22 #include "cetlib/exempt_ptr.h" 83 bool storeTrajectories =
false,
84 bool keepEMShowerDaughters =
false,
85 bool keepMCParticleList =
true,
86 bool storeDroppedMCParticles =
false);
90 virtual void BeginOfEventAction(
const G4Event*);
91 virtual void EndOfEventAction(
const G4Event*);
92 virtual void PreTrackingAction(
const G4Track*);
93 virtual void PostTrackingAction(
const G4Track*);
94 virtual void SteppingAction(
const G4Step*);
99 fFilter = std::move(
filter);
116 return fPrimaryTruthMap;
120 bool hasList()
const {
return static_cast<bool>(fparticleList); }
137 int GetParentage(
int trackid,
bool useOrigTrackIDMap =
false)
const;
142 std::unique_ptr<sim::ParticleList> fparticleList;
144 std::unique_ptr<sim::ParticleList>
147 G4bool fstoreTrajectories;
156 static int fCurrentPdgCode;
159 bool fKeepEMShowerDaughters;
162 std::unique_ptr<util::PositionInVolumeFilter>
fFilter;
168 void AddPointToCurrentParticle(TLorentzVector
const& pos,
169 TLorentzVector
const& mom,
170 std::string
const& process);
175 #endif // LArG4_ParticleListAction_h
static int GetCurrentOrigTrackID()
std::map< int, GeneratedParticleIndex_t > fPrimaryTruthMap
Map: particle track ID -> index of primary information in MC truth.
std::unique_ptr< sim::ParticleList > fdroppedParticleList
std::map< int, int > fParentIDMap_OrigTrackID
key is current track ID, value is parent ID – for real G4 track ID tracking only ...
bool keepParticle() const
Returns 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.
cet::exempt_ptr< simb::MCParticle > particle
Object representing particle.
bool hasList() const
Returns whether a particle list is being kept.
static int GetCurrentTrackID()
static int fCurrentOrigTrackID
except for EM shower particles where it always shows the original track ID
bool hasParticle() const
Returns whether there is a particle.
Defines classes to filter particles based on their trajectory.
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