LDMX Software
PhotonuclearInteraction.h
1#ifndef SIMCORE_EVENT_PHOTONUCLEARINTERACTION_H
2#define SIMCORE_EVENT_PHOTONUCLEARINTERACTION_H
3
4/*~~~~~~~~~~*/
5/* ROOT */
6/*~~~~~~~~~~*/
7
8/*~~~~~~~~~~~~~~~~*/
9/* C++ StdLib */
10/*~~~~~~~~~~~~~~~~*/
11#include <Rtypes.h>
12
13#include <map>
14#include <string>
15#include <vector>
16
17namespace ldmx {
18
34 public:
39 struct ParticleInfo {
41 int track_id_{0};
42
44 int pdg_id_{0};
45
47 double energy_{0.0};
48
50 double px_{0.0};
51 double py_{0.0};
52 double pz_{0.0};
53
55 double x_{0.0};
56 double y_{0.0};
57 double z_{0.0};
58
60 double time_{0.0};
61
63 ParticleInfo() = default;
64
66 virtual ~ParticleInfo() = default;
67
70 };
71
74
76 virtual ~PhotonuclearInteraction() = default;
77
79 void clear();
80
94 void setIncidentPhoton(int track_id, int pdg_id, double energy, double px,
95 double py, double pz, double x, double y, double z,
96 double time);
97
104
112 void setTarget(int Z, int A, const std::string& material);
113
119 int getTargetZ() const { return target_z_; }
120
126 int getTargetA() const { return target_a_; }
127
133 std::string getTargetMaterial() const { return target_material_; }
134
140 void addImmediateSecondary(const ParticleInfo& particle);
141
147 std::vector<ParticleInfo> getImmediateSecondaries() const {
149 }
150
157 return immediate_secondaries_.size();
158 }
159
169 void addDescendant(int immediate_secondary_id, int final_state_track_id);
170
178 std::map<int, std::vector<int>> getDescendantMap() const {
179 return descendant_map_;
180 }
181
188 std::vector<int> getDescendants(int immediate_secondary_id) const;
189
195 void setInteractionVolume(const std::string& volume) {
196 interaction_volume_ = volume;
197 }
198
204 std::string getInteractionVolume() const { return interaction_volume_; }
205
211 void setProcessName(const std::string& process) { process_name_ = process; }
212
218 std::string getProcessName() const { return process_name_; }
219
223 void print() const;
224
228 friend std::ostream& operator<<(std::ostream& o,
229 const PhotonuclearInteraction& pn);
230
231 private:
234
236 int target_z_{0};
237
239 int target_a_{0};
240
242 std::string target_material_{""};
243
245 std::vector<ParticleInfo> immediate_secondaries_;
246
248 std::map<int, std::vector<int>> descendant_map_;
249
251 std::string interaction_volume_{""};
252
254 std::string process_name_{""};
255
258
259}; // PhotonuclearInteraction
260
261} // namespace ldmx
262
263#endif // SIMCORE_EVENT_PHOTONUCLEARINTERACTION_H
Stores detailed information about a photonuclear interaction.
int getTargetZ() const
Get the target atomic number.
std::string target_material_
Target material name.
virtual ~PhotonuclearInteraction()=default
Destructor.
std::vector< ParticleInfo > getImmediateSecondaries() const
Get all immediate secondary particles.
friend std::ostream & operator<<(std::ostream &o, const PhotonuclearInteraction &pn)
Stream operator for printing.
void setProcessName(const std::string &process)
Set the process name.
void setInteractionVolume(const std::string &volume)
Set the volume where the interaction occurred.
void addDescendant(int immediate_secondary_id, int final_state_track_id)
Add a final state descendant track for an immediate secondary.
void print() const
Print information about this interaction.
ParticleInfo incident_photon_
Incident photon information.
void clear()
Clear the interaction data.
std::vector< int > getDescendants(int immediate_secondary_id) const
Get descendants for a specific immediate secondary.
void addImmediateSecondary(const ParticleInfo &particle)
Add an immediate secondary particle from the PN interaction.
std::string process_name_
Process name (e.g., "photonNuclear")
void setIncidentPhoton(int track_id, int pdg_id, double energy, double px, double py, double pz, double x, double y, double z, double time)
Set the incident photon information.
std::map< int, std::vector< int > > getDescendantMap() const
Get the descendant map.
std::string interaction_volume_
Volume where interaction occurred.
std::string getTargetMaterial() const
Get the target material name.
std::string getProcessName() const
Get the process name.
PhotonuclearInteraction()=default
Constructor.
void setTarget(int Z, int A, const std::string &material)
Set the target nucleus information.
int getTargetA() const
Get the target mass number.
std::vector< ParticleInfo > immediate_secondaries_
Immediate secondary particles from the cascade.
std::map< int, std::vector< int > > descendant_map_
Maps immediate secondary track ID -> final state track IDs.
std::string getInteractionVolume() const
Get the interaction volume name.
int getNumImmediateSecondaries() const
Get the number of immediate secondary particles.
ClassDef(PhotonuclearInteraction, 1)
ROOT dictionary generation.
ParticleInfo getIncidentPhoton() const
Get the incident photon information.
Stores kinematic and identity information for a particle.
ParticleInfo()=default
Default constructor.
ClassDef(ParticleInfo, 1)
ROOT dictionary generation.
virtual ~ParticleInfo()=default
Virtual destructor (required by ClassDef)