LDMX Software
CascadeHistory.h
Go to the documentation of this file.
1
6#ifndef SIMCORE_EVENT_CASCADEHISTORY_H
7#define SIMCORE_EVENT_CASCADEHISTORY_H
8
9#include <Rtypes.h>
10
11#include <vector>
12
14
15namespace ldmx {
16
26 public:
27 CascadeHistory() = default;
28 virtual ~CascadeHistory() = default;
29
30 void clear();
31
32 void setIncidentTrackId(int trackId) { incident_track_id_ = trackId; }
33 void setTargetNucleus(int a, int z) {
34 target_a_ = a;
35 target_z_ = z;
36 }
37 void setIncidentEnergy(double energy) { incident_energy_ = energy; }
38 void setExcitationEnergy(double energy) { excitation_energy_ = energy; }
39 void setResidualNucleus(int a, int z) {
40 residual_a_ = a;
41 residual_z_ = z;
42 }
43
44 void addStep(const CascadeStep& step) { steps_.push_back(step); }
45 void addStep(CascadeStep&& step) { steps_.push_back(std::move(step)); }
46 void reserve(size_t n) { steps_.reserve(n); }
47
48 int getIncidentTrackId() const { return incident_track_id_; }
49 int getTargetA() const { return target_a_; }
50 int getTargetZ() const { return target_z_; }
51 double getIncidentEnergy() const { return incident_energy_; }
52 double getExcitationEnergy() const { return excitation_energy_; }
53 int getResidualA() const { return residual_a_; }
54 int getResidualZ() const { return residual_z_; }
55
56 size_t getNumSteps() const { return steps_.size(); }
57 bool empty() const { return steps_.empty(); }
58 const std::vector<CascadeStep>& getSteps() const { return steps_; }
59 std::vector<CascadeStep>& getSteps() { return steps_; }
60 const CascadeStep& getStep(size_t i) const { return steps_.at(i); }
61 const CascadeStep* getStepByHistoryId(int historyId) const;
62
63 // Analysis helpers
64 const CascadeStep* getIncidentStep() const;
65 std::vector<const CascadeStep*> getStepsAtGeneration(int generation) const;
66 std::vector<const CascadeStep*> getInteractingSteps() const;
67 std::vector<const CascadeStep*> getEscapedSteps() const;
68 int getMaxGeneration() const;
69 int getNumInteractions() const;
70 void print() const;
71
72 private:
73 int incident_track_id_{-1};
74 int target_a_{0};
75 int target_z_{0};
76 double incident_energy_{0.0}; // [MeV]
77 double excitation_energy_{0.0}; // [MeV]
78 int residual_a_{0};
79 int residual_z_{0};
80 std::vector<CascadeStep> steps_;
81
82 ClassDef(CascadeHistory, 1);
83};
84
85} // namespace ldmx
86
87#endif // SIMCORE_EVENT_CASCADEHISTORY_H
Data class representing a single step in the Bertini intranuclear cascade.
All CascadeSteps from a single photonuclear interaction.
Single particle state in the Bertini intranuclear cascade.
Definition CascadeStep.h:39