LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "ParticleListAction.h"
Classes | |
struct | ParticleInfo_t |
Public Types | |
using | GeneratedParticleIndex_t = simb::GeneratedParticleIndex_t |
Public Member Functions | |
ParticleListAction (double energyCut, bool storeTrajectories=false, bool keepEMShowerDaughters=false) | |
virtual | ~ParticleListAction () |
virtual void | BeginOfEventAction (const G4Event *) |
G4UserEventAction interfaces. More... | |
virtual void | EndOfEventAction (const G4Event *) |
virtual void | PreTrackingAction (const G4Track *) |
G4UserTrackingAction interfaces. More... | |
virtual void | PostTrackingAction (const G4Track *) |
virtual void | SteppingAction (const G4Step *) |
G4UserSteppingAction interface. More... | |
void | ParticleFilter (std::unique_ptr< PositionInVolumeFilter > &&filter) |
Grabs a particle filter. More... | |
void | ResetTrackIDOffset () |
const sim::ParticleList * | GetList () const |
std::map< int, GeneratedParticleIndex_t > const & | GetPrimaryTruthMap () const |
GeneratedParticleIndex_t | GetPrimaryTruthIndex (int trackId) const |
Returns the index of primary truth (sim::NoGeneratorIndex if none). More... | |
sim::ParticleList && | YieldList () |
virtual void | Config (fhicl::ParameterSet const &) |
Override Config() to extract any necessary parameters. More... | |
virtual void | PrintConfig (std::string const &) |
Override PrintConfig() to print out current configuration. More... | |
virtual void | BeginOfRunAction (const G4Run *) |
G4UserRunAction interfaces. More... | |
virtual void | EndOfRunAction (const G4Run *) |
virtual bool | ProvidesStacking () |
virtual G4ClassificationOfNewTrack | StackClassifyNewTrack (const G4Track *) |
G4UserStackingAction interfaces. More... | |
virtual void | StackNewStage () |
virtual void | StackPrepareNewEvent () |
std::string const & | GetName () const |
void | SetName (std::string const &name) |
Static Public Member Functions | |
static int | GetCurrentTrackID () |
static int | GetCurrentPdgCode () |
static bool | isDropped (simb::MCParticle const *p) |
returns whether the specified particle has been marked as dropped More... | |
Private Member Functions | |
int | GetParentage (int trackid) const |
void | AddPointToCurrentParticle (TLorentzVector const &pos, TLorentzVector const &mom, std::string const &process) |
Adds a trajectory point to the current particle, and runs the filter. More... | |
Private Attributes | |
G4double | fenergyCut |
ParticleInfo_t | fCurrentParticle |
sim::ParticleList * | fparticleList |
G4bool | fstoreTrajectories |
Whether to store particle trajectories with each particle. More... | |
std::map< int, int > | fParentIDMap |
key is current track ID, value is parent ID More... | |
bool | fKeepEMShowerDaughters |
whether to keep EM shower secondaries, tertiaries, etc More... | |
std::unique_ptr< PositionInVolumeFilter > | fFilter |
filter for particles to be kept More... | |
std::map< int, GeneratedParticleIndex_t > | fPrimaryTruthMap |
Map: particle track ID -> index of primary information in MC truth. More... | |
Static Private Attributes | |
static int | fCurrentTrackID = sim::NoParticleId |
static int | fCurrentPdgCode = 0 |
pdg code of current particle More... | |
static int | fTrackIDOffset = 0 |
Definition at line 43 of file ParticleListAction.h.
Definition at line 46 of file ParticleListAction.h.
larg4::ParticleListAction::ParticleListAction | ( | double | energyCut, |
bool | storeTrajectories = false , |
||
bool | keepEMShowerDaughters = false |
||
) |
Definition at line 57 of file ParticleListAction.cxx.
References fParentIDMap, and fparticleList.
|
virtual |
Definition at line 73 of file ParticleListAction.cxx.
References fparticleList.
|
private |
Adds a trajectory point to the current particle, and runs the filter.
Definition at line 515 of file ParticleListAction.cxx.
References simb::MCParticle::AddTrajectoryPoint(), fCurrentParticle, fFilter, larg4::ParticleListAction::ParticleInfo_t::keep, and larg4::ParticleListAction::ParticleInfo_t::particle.
Referenced by SteppingAction().
|
virtual |
G4UserEventAction interfaces.
Reimplemented from g4b::UserAction.
Definition at line 81 of file ParticleListAction.cxx.
References larg4::ParticleListAction::ParticleInfo_t::clear(), sim::ParticleList::clear(), fCurrentParticle, fCurrentPdgCode, fCurrentTrackID, fParentIDMap, fparticleList, and sim::NoParticleId.
|
inlinevirtualinherited |
G4UserRunAction interfaces.
The following a list of methods that correspond to the available user action classes in Geant 4.0.1 and higher.
Reimplemented in larg4::VisualizationAction.
Definition at line 74 of file UserAction.h.
|
inlinevirtualinherited |
Override Config() to extract any necessary parameters.
Reimplemented in altns::ExampleAction.
Definition at line 65 of file UserAction.h.
Referenced by g4b::UserAction::UserAction().
|
virtual |
Reimplemented from g4b::UserAction.
Definition at line 453 of file ParticleListAction.cxx.
References sim::ParticleList::begin(), sim::ParticleList::end(), fparticleList, and larg4::UpdateDaughterInformation::SetParticleList().
|
inlinevirtualinherited |
|
inlinestatic |
Definition at line 96 of file ParticleListAction.h.
|
inlinestatic |
Definition at line 95 of file ParticleListAction.h.
Referenced by larg4::AuxDetReadout::ProcessHits(), larg4::LArVoxelReadout::ProcessHits(), larg4::OpFastScintillation::ProcessStep(), and larg4::OpFastScintillation::RecordPhotonsProduced().
const sim::ParticleList * larg4::ParticleListAction::GetList | ( | ) | const |
Definition at line 471 of file ParticleListAction.cxx.
References sim::ParticleList::begin(), sim::ParticleList::end(), fparticleList, fTrackIDOffset, GetPrimaryTruthIndex(), and sim::ParticleList::size().
|
inlineinherited |
Definition at line 98 of file UserAction.h.
References g4b::UserAction::myName.
Referenced by g4b::UserActionManager::PrintActionList().
|
private |
Definition at line 96 of file ParticleListAction.cxx.
References fParentIDMap, LOG_DEBUG, and sim::NoParticleId.
Referenced by PreTrackingAction().
simb::GeneratedParticleIndex_t larg4::ParticleListAction::GetPrimaryTruthIndex | ( | int | trackId | ) | const |
Returns the index of primary truth (sim::NoGeneratorIndex
if none).
Definition at line 488 of file ParticleListAction.cxx.
References evd::details::end(), GetPrimaryTruthMap(), and simb::NoGeneratedParticleIndex.
Referenced by GetList(), and larg4::LArG4::produce().
|
inline |
Returns a map of truth record information index for each of the primary particles (by track ID).
Definition at line 105 of file ParticleListAction.h.
Referenced by GetPrimaryTruthIndex().
|
static |
returns whether the specified particle has been marked as dropped
Definition at line 50 of file ParticleListAction.cxx.
References simb::MCTrajectory::empty(), and simb::MCParticle::Trajectory().
Referenced by larg4::LArG4::produce().
|
inline |
Grabs a particle filter.
Definition at line 90 of file ParticleListAction.h.
Referenced by larg4::LArG4::beginRun().
|
virtual |
Reimplemented from g4b::UserAction.
Definition at line 270 of file ParticleListAction.cxx.
References sim::ParticleList::Archive(), larg4::ParticleListAction::ParticleInfo_t::clear(), fCurrentParticle, fparticleList, fPrimaryTruthMap, larg4::ParticleListAction::ParticleInfo_t::hasParticle(), larg4::ParticleListAction::ParticleInfo_t::isPrimary(), larg4::ParticleListAction::ParticleInfo_t::keep, larg4::ParticleListAction::ParticleInfo_t::particle, simb::MCParticle::SetEndProcess(), simb::MCParticle::SetWeight(), simb::MCParticle::TrackId(), and larg4::ParticleListAction::ParticleInfo_t::truthInfoIndex().
|
virtual |
G4UserTrackingAction interfaces.
Reimplemented from g4b::UserAction.
Definition at line 120 of file ParticleListAction.cxx.
References sim::ParticleList::Add(), larg4::ParticleListAction::ParticleInfo_t::clear(), energy, fCurrentParticle, fCurrentPdgCode, fCurrentTrackID, fenergyCut, fFilter, fKeepEMShowerDaughters, fParentIDMap, fparticleList, fTrackIDOffset, GetParentage(), larg4::ParticleListAction::ParticleInfo_t::keep, sim::ParticleList::KnownParticle(), LOG_WARNING, g4b::PrimaryParticleInformation::MCParticleIndex(), simb::NoGeneratedParticleIndex, sim::NoParticleId, larg4::ParticleListAction::ParticleInfo_t::particle, simb::MCParticle::SetPolarization(), and larg4::ParticleListAction::ParticleInfo_t::truthIndex.
|
inlinevirtualinherited |
Override PrintConfig() to print out current configuration.
Reimplemented in altns::ExampleAction.
Definition at line 68 of file UserAction.h.
Referenced by g4b::UserActionManager::PrintActionList().
|
inlinevirtualinherited |
Does this UserAction do stacking? Override to return "true" if the following interfaces are implemented
Reimplemented in altns::ExampleAction.
Definition at line 90 of file UserAction.h.
Referenced by g4b::UserActionManager::PrintActionList().
|
inline |
Definition at line 98 of file ParticleListAction.h.
Referenced by larg4::LArG4::produce().
|
inlineinherited |
Definition at line 99 of file UserAction.h.
References g4b::UserAction::myName.
Referenced by g4b::UserActionFactory::GetUserAction().
|
inlinevirtualinherited |
G4UserStackingAction interfaces.
Reimplemented in altns::ExampleAction.
Definition at line 93 of file UserAction.h.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
virtual |
G4UserSteppingAction interface.
Reimplemented from g4b::UserAction.
Definition at line 303 of file ParticleListAction.cxx.
References AddPointToCurrentParticle(), energy, fCurrentParticle, fstoreTrajectories, globalTime, larg4::ParticleListAction::ParticleInfo_t::hasParticle(), LOG_DEBUG, simb::MCParticle::NumberTrajectoryPoints(), larg4::ParticleListAction::ParticleInfo_t::particle, velocity_G4, and velocity_step.
sim::ParticleList && larg4::ParticleListAction::YieldList | ( | ) |
Definition at line 498 of file ParticleListAction.cxx.
References sim::ParticleList::begin(), sim::ParticleList::end(), fparticleList, fTrackIDOffset, and sim::ParticleList::size().
Referenced by larg4::LArG4::produce().
|
private |
information about the particle currently being simulated for a single particle.
Definition at line 125 of file ParticleListAction.h.
Referenced by AddPointToCurrentParticle(), BeginOfEventAction(), PostTrackingAction(), PreTrackingAction(), and SteppingAction().
|
staticprivate |
pdg code of current particle
Definition at line 133 of file ParticleListAction.h.
Referenced by BeginOfEventAction(), and PreTrackingAction().
|
staticprivate |
track ID of the current particle, set to eve ID for EM shower particles
Definition at line 131 of file ParticleListAction.h.
Referenced by BeginOfEventAction(), and PreTrackingAction().
|
private |
The minimum energy for a particle to be included in the list.
Definition at line 123 of file ParticleListAction.h.
Referenced by PreTrackingAction().
|
private |
filter for particles to be kept
Definition at line 138 of file ParticleListAction.h.
Referenced by AddPointToCurrentParticle(), and PreTrackingAction().
|
private |
whether to keep EM shower secondaries, tertiaries, etc
Definition at line 136 of file ParticleListAction.h.
Referenced by PreTrackingAction().
|
private |
key is current track ID, value is parent ID
Definition at line 130 of file ParticleListAction.h.
Referenced by BeginOfEventAction(), GetParentage(), ParticleListAction(), and PreTrackingAction().
|
private |
The accumulated particle information for all particles in the event.
Definition at line 127 of file ParticleListAction.h.
Referenced by BeginOfEventAction(), EndOfEventAction(), GetList(), ParticleListAction(), PostTrackingAction(), PreTrackingAction(), YieldList(), and ~ParticleListAction().
|
private |
Map: particle track ID -> index of primary information in MC truth.
Definition at line 141 of file ParticleListAction.h.
Referenced by PostTrackingAction().
|
private |
Whether to store particle trajectories with each particle.
Definition at line 129 of file ParticleListAction.h.
Referenced by SteppingAction().
|
staticprivate |
offset added to track ids when running over multiple MCTruth objects.
Definition at line 134 of file ParticleListAction.h.
Referenced by GetList(), PreTrackingAction(), and YieldList().