18 , m_truth_info(nullptr)
19 , m_g4particle(nullptr)
20 , m_outfile_name(
"outputData.root")
39 m_truth_info = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
42 std::cout <<
"DecayFinder: Missing node G4TruthInfo" << std::endl;
49 PHG4HitContainer* hit_container = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_MySuperDetector");
52 std::cout << __FILE__ <<
": Missing node G4TruthInfo" << std::endl;
58 iter != range.second; ++iter)
81 double shortest_distance =
DBL_MAX;
83 hit_iter != hit_range.second; ++hit_iter)
87 double hit_distance = sqrt(pow(hit_iter->second->get_x(0), 2) + pow(hit_iter->second->get_y(0), 2) + pow(hit_iter->second->get_z(0), 2));
88 if (hit_distance < shortest_distance)
91 , hit_iter->second->get_py(0)
92 , hit_iter->second->get_pz(0));
93 shortest_distance = hit_distance;
98 hit_iter != hit_range.second; ++hit_iter)
104 , hit_iter->second->get_py(0)
105 , hit_iter->second->get_pz(0));
108 double hit_diff = momentum_hit->
angle(momentum_first_hit);
110 delta_phi.push_back(hit_diff);
114 double sum = std::accumulate(delta_phi.begin(), delta_phi.end(), 0.0);
115 double mean = sum / delta_phi.size();
116 double square_sum = std::inner_product(delta_phi.begin(), delta_phi.end(), delta_phi.begin(), 0.0);
118 m_std_dev = sqrt(square_sum / delta_phi.size() - mean * mean);
146 m_tree =
new TTree(
"dRICH",
"dRICH");
147 m_tree->OptimizeBaskets();
148 m_tree->SetAutoSave(-5
e6);
151 m_tree->Branch(
"particle_PDG_ID", &
m_pdg_id,
"particle_PDG_ID/I");
152 m_tree->Branch(
"particle_track_ID", &
m_track_id,
"particle_track_ID/I");
153 m_tree->Branch(
"particle_barcode", &
m_barcode,
"particle_barcode/I");
154 m_tree->Branch(
"particle_eta", &
m_particle_eta,
"particle_eta/F");
155 m_tree->Branch(
"particle_px", &
m_particle_px,
"particle_px/F");
156 m_tree->Branch(
"particle_py", &
m_particle_py,
"particle_py/F");
157 m_tree->Branch(
"particle_pz", &
m_particle_pz,
"particle_pz/F");
158 m_tree->Branch(
"particle_pt", &
m_particle_pt,
"particle_pt/F");
159 m_tree->Branch(
"particle_p", &
m_particle_p,
"particle_p/F");
160 m_tree->Branch(
"particle_phi", &
m_particle_phi,
"particle_phi/F");
161 m_tree->Branch(
"delta_phi", &
m_delta_phi,
"delta_phi/F");
162 m_tree->Branch(
"std_dev", &
m_std_dev,
"std_dev/F");