Process the event and make histograms or summaries.
19 {
20
22 "TargetScoringPlaneHits", target_scoring_plane_passname_));
24 "SimParticles", sim_particles_passname_)};
25
26 std::vector<int> primary_daughters;
27
28 double hard_thresh{9999.0};
29
30
31 for (auto const& it : particle_map) {
33 std::vector<int> parents_track_ids = p.
getParents();
39 for (auto const& parent_track_id : parents_track_ids) {
40 if (parent_track_id == 0) {
41 ROOT::Math::XYZVector momentum_vec(momentum[0], momentum[1],
42 momentum[2]);
46 momentum_vec.Theta() * (180 / 3.14159));
48 hard_thresh = (2500. / 4000.) * energy;
49 primary_daughters = daughters;
51 if (sphit.getTrackID() == it.first && sphit.getPosition()[2] < 0) {
53 }
54 }
55 }
56 }
57 }
58
59 std::vector<std::vector<int>> hardbrem_daughters;
60
61 for (auto const& it : particle_map) {
62 int trackid = it.first;
65 ROOT::Math::XYZVector momentum_vec(momentum[0], momentum[1], momentum[2]);
66 for (auto const& primary_daughter : primary_daughters) {
67 if (trackid == primary_daughter) {
71 }
78 momentum_vec.Theta() * (180 / 3.14159));
81 }
82 }
83 }
84 }
85
86 for (auto const& it : particle_map) {
87 int trackid = it.first;
90 ROOT::Math::XYZVector momentum_vec(momentum[0], momentum[1], momentum[2]);
91 for (const std::vector<int>& daughter_track_id : hardbrem_daughters) {
92 for (const int& daughter_id : daughter_track_id) {
93 if (trackid == daughter_id) {
99 momentum_vec.Theta() * (180 / 3.14159));
101 std::sqrt(momentum_vec.Perp2()));
102 }
103 }
104 }
105 }
106
107 return;
108}
HistogramPool histograms_
helper object for making and filling histograms
const std::vector< ContentType > & getCollection(const std::string &collectionName, const std::string &passName) const
Get a collection (std::vector) of objects from the event bus.
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class representing a simulated particle.
double getEnergy() const
Get the energy of this particle [MeV].
std::vector< int > getParents() const
Get a vector containing the track IDs of the parent particles.
std::vector< double > getVertex() const
Get a vector containing the vertex of this particle in mm.
std::vector< int > getDaughters() const
Get a vector containing the track IDs of all daughter particles.
int getPdgID() const
Get the PDG ID of this particle.
std::vector< double > getEndPoint() const
Get the end_point of this particle where it was destroyed or left the world volume [mm].
std::vector< double > getMomentum() const
Get a vector containing the momentum of this particle [MeV].
Represents a simulated tracker hit in the simulation.