LDMX Software
CascadeStep.cxx
Go to the documentation of this file.
1
6
7#include <cmath>
8
9namespace ldmx {
10
11void CascadeStep::clear() {
12 history_id_ = -1;
13 parent_id_ = -1;
14 pdg_id_ = 0;
15 px_ = py_ = pz_ = energy_ = 0;
16 x_ = y_ = z_ = 0;
17 generation_ = 0;
18 zone_ = 0;
19 daughter_ids_.clear();
20 target_pdg_id_ = 0;
21 interacted_ = false;
22 escaped_ = false;
23 stage_ = CascadeStage::UNKNOWN;
24}
25
26double CascadeStep::getKineticEnergy() const {
27 double mass = getMass();
28 return energy_ - mass;
29}
30
31double CascadeStep::getMass() const {
32 double p2 = px_ * px_ + py_ * py_ + pz_ * pz_;
33 double m2 = energy_ * energy_ - p2;
34 return (m2 > 0) ? std::sqrt(m2) : 0;
35}
36
37} // namespace ldmx
Data class representing a single step in the Bertini intranuclear cascade.