11void CascadeHistory::clear() {
12 incident_track_id_ = -1;
18const CascadeStep* CascadeHistory::getStepByHistoryId(
int historyId)
const {
19 for (
const auto& step : steps_) {
20 if (step.getHistoryId() == historyId) {
27const CascadeStep* CascadeHistory::getIncidentStep()
const {
28 for (
const auto& step : steps_) {
29 if (step.getGeneration() == 0 && step.getParentId() == -1) {
33 return steps_.empty() ? nullptr : &steps_.front();
36std::vector<const CascadeStep*> CascadeHistory::getStepsAtGeneration(
37 int generation)
const {
38 std::vector<const CascadeStep*> result;
39 for (
const auto& step : steps_) {
40 if (step.getGeneration() == generation) {
41 result.push_back(&step);
47std::vector<const CascadeStep*> CascadeHistory::getInteractingSteps()
const {
48 std::vector<const CascadeStep*> result;
49 for (
const auto& step : steps_) {
50 if (step.didInteract()) {
51 result.push_back(&step);
57std::vector<const CascadeStep*> CascadeHistory::getEscapedSteps()
const {
58 std::vector<const CascadeStep*> result;
59 for (
const auto& step : steps_) {
60 if (step.didEscape()) {
61 result.push_back(&step);
67int CascadeHistory::getMaxGeneration()
const {
69 for (
const auto& step : steps_) {
70 if (step.getGeneration() > max_gen) {
71 max_gen = step.getGeneration();
77int CascadeHistory::getNumInteractions()
const {
79 for (
const auto& step : steps_) {
80 if (step.didInteract()) {
87void CascadeHistory::print()
const {
88 std::cout <<
"CascadeHistory: " << steps_.size() <<
" steps"
89 <<
", target A=" << target_a_ <<
" Z=" << target_z_
90 <<
", incident track=" << incident_track_id_ <<
"\n";
92 for (
const auto& step : steps_) {
93 std::cout <<
" [" << step.getHistoryId() <<
"] "
94 <<
"PDG=" << step.getPdgId() <<
" gen=" << step.getGeneration()
95 <<
" zone=" << step.getZone() <<
" E=" << step.getEnergy()
97 if (step.getParentId() >= 0) {
98 std::cout <<
" parent=" << step.getParentId();
100 if (step.didInteract()) {
101 std::cout <<
" -> " << step.getNumDaughters() <<
" daughters";
103 if (step.didEscape()) {
104 std::cout <<
" [escaped]";
Container for the complete history of a Bertini intranuclear cascade.