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 <vector>
10
12#include "TObject.h"
13
14namespace ldmx {
15
25 public:
26 CascadeHistory() = default;
27 virtual ~CascadeHistory() = default;
28
29 void clear();
30
31 void setIncidentTrackId(int trackId) { incident_track_id_ = trackId; }
32 void setTargetNucleus(int a, int z) {
33 target_a_ = a;
34 target_z_ = z;
35 }
36 void setIncidentEnergy(double energy) { incident_energy_ = energy; }
37 void setExcitationEnergy(double energy) { excitation_energy_ = energy; }
38 void setResidualNucleus(int a, int z) {
39 residual_a_ = a;
40 residual_z_ = z;
41 }
42
43 void addStep(const CascadeStep& step) { steps_.push_back(step); }
44 void addStep(CascadeStep&& step) { steps_.push_back(std::move(step)); }
45 void reserve(size_t n) { steps_.reserve(n); }
46
47 int getIncidentTrackId() const { return incident_track_id_; }
48 int getTargetA() const { return target_a_; }
49 int getTargetZ() const { return target_z_; }
50 double getIncidentEnergy() const { return incident_energy_; }
51 double getExcitationEnergy() const { return excitation_energy_; }
52 int getResidualA() const { return residual_a_; }
53 int getResidualZ() const { return residual_z_; }
54
55 size_t getNumSteps() const { return steps_.size(); }
56 bool empty() const { return steps_.empty(); }
57 const std::vector<CascadeStep>& getSteps() const { return steps_; }
58 std::vector<CascadeStep>& getSteps() { return steps_; }
59 const CascadeStep& getStep(size_t i) const { return steps_.at(i); }
60 const CascadeStep* getStepByHistoryId(int historyId) const;
61
62 // Analysis helpers
63 const CascadeStep* getIncidentStep() const;
64 std::vector<const CascadeStep*> getStepsAtGeneration(int generation) const;
65 std::vector<const CascadeStep*> getInteractingSteps() const;
66 std::vector<const CascadeStep*> getEscapedSteps() const;
67 int getMaxGeneration() const;
68 int getNumInteractions() const;
69 void print() const;
70
71 private:
72 int incident_track_id_{-1};
73 int target_a_{0};
74 int target_z_{0};
75 double incident_energy_{0.0}; // [MeV]
76 double excitation_energy_{0.0}; // [MeV]
77 int residual_a_{0};
78 int residual_z_{0};
79 std::vector<CascadeStep> steps_;
80
81 ClassDef(CascadeHistory, 1);
82};
83
84} // namespace ldmx
85
86#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