|
LDMX Software
|
Tracks detailed information about photonuclear interactions. More...
#include <PhotonuclearTracker.h>
Public Member Functions | |
| PhotonuclearTracker (const std::string &name, framework::config::Parameters ¶meters) | |
| Constructor. | |
| virtual | ~PhotonuclearTracker ()=default |
| Destructor. | |
| std::vector< TYPE > | getTypes () override |
| Get the types of actions this class handles. | |
| void | BeginOfEventAction (const G4Event *event) override |
| Called at the beginning of each event. | |
| void | EndOfEventAction (const G4Event *event) override |
| Called at the end of each event. | |
| void | stepping (const G4Step *step) override |
| Called after each simulation step. | |
| void | PreUserTrackingAction (const G4Track *track) override |
| Called before tracking a new track. | |
| void | PostUserTrackingAction (const G4Track *track) override |
| Called after tracking a track. | |
| std::vector< ldmx::PhotonuclearInteraction > | getInteractions () const |
| Get the collection of PN interactions for this event. | |
Public Member Functions inherited from simcore::UserAction | |
| UserAction (const std::string &name, framework::config::Parameters ¶meters) | |
| Constructor. | |
| DECLARE_FACTORY (UserAction, std::shared_ptr< UserAction >, const std::string &, framework::config::Parameters &) | |
| factory for user actions | |
| virtual | ~UserAction ()=default |
| Destructor. | |
| virtual void | BeginOfRunAction (const G4Run *) |
| Method called at the beginning of a run. | |
| virtual void | EndOfRunAction (const G4Run *) |
| Method called at the end of a run. | |
| virtual G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *, const G4ClassificationOfNewTrack &cl) |
| Method called when a track is updated. | |
| virtual void | NewStage () |
| Method called at the beginning of a new stage. | |
| virtual void | PrepareNewEvent () |
| Method called at the beginning of a new event. | |
Static Public Member Functions | |
| static PhotonuclearTracker * | get () |
| Get the current PhotonuclearTracker instance. | |
Private Member Functions | |
| void | extractTargetInfo (const G4Step *step, int &Z, int &A, std::string &material) |
| Extract target nucleus information from the current step. | |
| ldmx::PhotonuclearInteraction::ParticleInfo | createParticleInfo (const G4Track *track) |
| Create a ParticleInfo struct from a G4Track. | |
Private Attributes | |
| std::vector< ldmx::PhotonuclearInteraction > | pn_interactions_ |
| Collection of PN interactions in this event. | |
| std::map< int, int > | secondary_to_pn_index_ |
| Maps secondary track ID -> index in pn_interactions_ Used to quickly find which PN interaction a secondary belongs to. | |
| std::map< int, int > | descendant_ancestry_ |
| Maps descendant track ID -> immediate secondary track ID Propagates through the genealogy to trace back to the original PN secondary. | |
Static Private Attributes | |
| static PhotonuclearTracker * | instance = nullptr |
| Static pointer to the current instance. | |
Additional Inherited Members | |
Protected Member Functions inherited from simcore::UserAction | |
| UserEventInformation * | getEventInfo () const |
| Get a handle to the event information. | |
| const std::map< int, ldmx::SimParticle > & | getCurrentParticleMap () const |
| Get the current particle map. | |
Protected Attributes inherited from simcore::UserAction | |
| std::string | name_ {""} |
| Name of the UserAction. | |
| framework::config::Parameters | parameters_ |
| The set of parameters used to configure this class. | |
| mutable::framework::logging::logger | the_log_ |
the logging channel user actions can use ldmx_log with | |
Tracks detailed information about photonuclear interactions.
This UserAction captures comprehensive details about photonuclear (PN) interactions during simulation, including:
The tracker operates by:
The collected interactions are saved to the event bus as a vector: "PhotonuclearInteractions"
Definition at line 52 of file PhotonuclearTracker.h.
| simcore::PhotonuclearTracker::PhotonuclearTracker | ( | const std::string & | name, |
| framework::config::Parameters & | parameters ) |
Constructor.
| name | Name of this user action |
| parameters | Configuration parameters |
Definition at line 18 of file PhotonuclearTracker.cxx.
References instance.
|
overridevirtual |
Called at the beginning of each event.
Clears the interaction collection and ancestry maps for the new event.
| event | Geant4 event object |
Reimplemented from simcore::UserAction.
Definition at line 24 of file PhotonuclearTracker.cxx.
References descendant_ancestry_, pn_interactions_, and secondary_to_pn_index_.
|
private |
Create a ParticleInfo struct from a G4Track.
| track | Geant4 track |
Definition at line 182 of file PhotonuclearTracker.cxx.
Referenced by stepping().
|
overridevirtual |
Called at the end of each event.
Final cleanup and validation of collected data.
| event | Geant4 event object |
Reimplemented from simcore::UserAction.
Definition at line 31 of file PhotonuclearTracker.cxx.
References pn_interactions_.
|
private |
Extract target nucleus information from the current step.
| step | Current Geant4 step |
| Z | Output: atomic number |
| A | Output: mass number |
| material | Output: material name |
Definition at line 168 of file PhotonuclearTracker.cxx.
Referenced by stepping().
|
inlinestatic |
Get the current PhotonuclearTracker instance.
Definition at line 139 of file PhotonuclearTracker.h.
References instance.
|
inline |
Get the collection of PN interactions for this event.
Definition at line 130 of file PhotonuclearTracker.h.
References pn_interactions_.
|
inlineoverridevirtual |
Get the types of actions this class handles.
Implements simcore::UserAction.
Definition at line 73 of file PhotonuclearTracker.h.
|
overridevirtual |
Called after tracking a track.
Records final state particles when tracks complete, building the descendant map for PN interactions.
| track | Current Geant4 track |
Reimplemented from simcore::UserAction.
Definition at line 137 of file PhotonuclearTracker.cxx.
References descendant_ancestry_, pn_interactions_, and secondary_to_pn_index_.
|
overridevirtual |
Called before tracking a new track.
Propagates ancestry information for descendants of PN secondaries.
| track | Current Geant4 track |
Reimplemented from simcore::UserAction.
Definition at line 120 of file PhotonuclearTracker.cxx.
References descendant_ancestry_.
|
overridevirtual |
Called after each simulation step.
Detects PN interactions by examining secondaries created in the step. When a PN interaction is found, captures all details and initializes genealogy tracking.
| step | Current Geant4 step |
Reimplemented from simcore::UserAction.
Definition at line 36 of file PhotonuclearTracker.cxx.
References ldmx::PhotonuclearInteraction::addImmediateSecondary(), createParticleInfo(), descendant_ancestry_, extractTargetInfo(), pn_interactions_, secondary_to_pn_index_, ldmx::PhotonuclearInteraction::setIncidentPhoton(), ldmx::PhotonuclearInteraction::setInteractionVolume(), ldmx::PhotonuclearInteraction::setProcessName(), and ldmx::PhotonuclearInteraction::setTarget().
|
private |
Maps descendant track ID -> immediate secondary track ID Propagates through the genealogy to trace back to the original PN secondary.
Definition at line 173 of file PhotonuclearTracker.h.
Referenced by BeginOfEventAction(), PostUserTrackingAction(), PreUserTrackingAction(), and stepping().
|
staticprivate |
Static pointer to the current instance.
Definition at line 176 of file PhotonuclearTracker.h.
Referenced by get(), and PhotonuclearTracker().
|
private |
Collection of PN interactions in this event.
Definition at line 164 of file PhotonuclearTracker.h.
Referenced by BeginOfEventAction(), EndOfEventAction(), getInteractions(), PostUserTrackingAction(), and stepping().
|
private |
Maps secondary track ID -> index in pn_interactions_ Used to quickly find which PN interaction a secondary belongs to.
Definition at line 168 of file PhotonuclearTracker.h.
Referenced by BeginOfEventAction(), PostUserTrackingAction(), and stepping().