15 #ifndef GARG4ParticleListAction_h 16 #define GARG4ParticleListAction_h 21 #include "nug4/G4Base/UserAction.h" 22 #include "nug4/ParticleNavigation/ParticleList.h" 24 #include "Geant4/globals.hh" 48 void clear() { particle =
nullptr; keep =
false; }
60 bool storeTrajectories =
false,
61 bool keepEMShowerDaughters =
false,
67 virtual void BeginOfEventAction(
const G4Event*);
68 virtual void EndOfEventAction (
const G4Event*);
69 virtual void PreTrackingAction (
const G4Track*);
70 virtual void PostTrackingAction(
const G4Track*);
71 virtual void SteppingAction (
const G4Step* );
84 std::map<int, size_t> TrackIDToMCTruthIndexMap()
const;
87 sim::ParticleList* GetList()
const;
90 sim::ParticleList&& YieldList();
99 int GetParentage(
int trackid)
const;
117 std::unique_ptr<PositionInVolumeFilter>
fFilter;
120 void AddPointToCurrentParticle(TLorentzVector
const&
pos,
121 TLorentzVector
const& mom,
130 #endif // GARG4ParticleListAction_h
bool keepParticle() const
Rerturns whether there is a particle known to be kept.
void ResetTrackIDOffset()
static int GetTrackIDOffset()
std::map< int, int > fParentIDMap
key is current track ID, value is parent ID
std::unique_ptr< PositionInVolumeFilter > fFilter
filter for particles to be kept
ParticleInfo_t fCurrentParticle
std::string fEMShowerDaughterMatRegex
if keeping EM shower daughters, save only in media matching this
G4bool fstoreTrajectories
Whether to store particle trajectories with each particle.
std::map< int, size_t > fTrackIDToMCTruthIndex
map track ID to index of MCTruth in input list
void clear()
Resets the information (does not release memory it does not own)
Code to link reconstructed objects back to the MC truth information.
static int fTrackIDOffset
General GArSoft Utilities.
sim::ParticleList * fParticleList
bool fKeepEMShowerDaughters
whether to keep EM shower secondaries, tertiaries, etc
void ParticleFilter(std::unique_ptr< PositionInVolumeFilter > &&filter)
Grabs a particle filter.
static int fCurrentTrackID
static int GetCurrentTrackID()
bool hasParticle() const
Returns whether there is a particle.