21 #include <g4hough/SvtxTrackMap.h>
22 #include <g4hough/SvtxTrack.h>
23 #include <g4hough/SvtxTrackState.h>
42 _trackmap_name(tracksname),
80 catch (std::exception &
e)
82 std::cout <<
PHWHERE <<
": " << e.what() << std::endl;
112 cout <<
PHWHERE <<
"PHG4TruthInfoContainer not found on node tree" << endl;
116 cout <<
PHWHERE <<
"PHG4HitContainer not found on node tree" << endl;
120 cout <<
PHWHERE <<
"SvtxTrackMap node not found on node tree" << endl;
129 bool use_reconstructed_momentum =
true;
130 bool use_truth_momentum =
false;
131 bool use_emission_momentum =
false;
133 bool use_reconstructed_point =
true;
134 bool use_approximate_point =
false;
152 double momv[3] = {0.,0.,0.};
154 if (use_reconstructed_momentum) {
158 cout <<
"RICH track projection momentum NOT FOUND; next iteration" << endl;
162 if (use_truth_momentum) {
166 cout <<
"No truth momentum found for track; next iteration" << endl;
170 if (use_emission_momentum) {
174 cout <<
"No truth momentum from emission points found for track; next iteration" << endl;
179 double momv_norm = sqrt( momv[0]*momv[0] + momv[1]*momv[1] + momv[2]*momv[2] );
180 momv[0] /= momv_norm;
181 momv[1] /= momv_norm;
182 momv[2] /= momv_norm;
186 double m_emi[3] = {0.,0.,0.};
188 if (use_reconstructed_point) {
192 cout <<
"RICH track projection position NOT FOUND; next iteration" << endl;
196 if (use_approximate_point) {
197 m_emi[0] = ((
_radius)/momv[2])*momv[0];
198 m_emi[1] = ((
_radius)/momv[2])*momv[1];
199 m_emi[2] = ((
_radius)/momv[2])*momv[2];
212 vector<float> angles;
219 for (rich_hits_iter = rich_hits_begin_end.first; rich_hits_iter != rich_hits_begin_end.second; ++rich_hits_iter)
222 PHG4Hit *hit_i = rich_hits_iter->second;
226 angles.push_back(_theta_reco);
232 long double probs[4] = {0.,0.,0.,0.};
233 double momv_magnitude = 0;
236 if ( use_reconstructed_momentum )
237 momv_magnitude = momv_norm;
238 if ( use_truth_momentum )
239 momv_magnitude = momv_norm;
240 if ( use_emission_momentum )
243 double px = particle->
get_px();
244 double py = particle->
get_py();
245 double pz = particle->
get_pz();
246 momv_magnitude = sqrt( px*px + py*py + pz*pz );
251 cout <<
"No particle ID: ParticleID::particle_probs gives no output" << endl;
279 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
280 throw std::runtime_error(
"Failed to find DST node in RICHParticleID::CreateNodes");