33 #define LogError(exp) std::cout << "ERROR: " << __FILE__ << ": " << __LINE__ << ": " << exp << "\n"
34 #define LogWarning(exp) std::cout << "WARNING: " << __FILE__ << ": " << __LINE__ << ": " << exp << "\n"
44 , _outfile_name(filename)
45 , _trackmapname(trackmapname)
48 , _eval_tree_tracks(nullptr)
49 , _eval_tree_vertex(nullptr)
50 , _h2d_Delta_mom_vs_truth_mom(nullptr)
51 , _h2d_Delta_mom_vs_truth_eta(nullptr)
52 , _truth_container(nullptr)
90 const string xyz[3] = {
"x",
"y",
"z"};
93 for (
int i = 0; i < 3; i++)
95 string bname = iter->first +
"_" + xyz[i];
96 string bdef = bname +
"/F";
99 for (
int i = 0; i < 3; i++)
101 string bname = iter->first +
"_p" + xyz[i];
102 string bdef = bname +
"/F";
105 for (
int i = 0; i < 3; i++)
107 string bname = iter->first +
"_proj_" + xyz[i];
108 string bdef = bname +
"/F";
111 for (
int i = 0; i < 3; i++)
113 string bname = iter->first +
"_proj_p" + xyz[i];
114 string bdef = bname +
"/F";
119 "#frac{#Delta p}{truth p} vs. truth #eta", 54, -4.5, +4.5, 1000, -1,
123 "#frac{#Delta p}{truth p} vs. truth p", 41, -0.5, 40.5, 1000, -1,
198 LogError(
"_truth_container not found!");
212 truth_itr != range.second; ++truth_itr)
236 std::cout <<
"ERROR CASTING PARTICLE!" << std::endl;
284 TVector3 reco_mom(
px,
py,
pz);
290 for (
int k = 0;
k < 3;
k++)
292 for (
int j = 0; j <
nproj; j++)
305 map<string, int>::const_iterator iter =
m_ProjectionNameMap.find(trkstates->second->get_name());
310 proj[0][iter->second] = trkstates->second->get_x();
311 proj[1][iter->second] = trkstates->second->get_y();
312 proj[2][iter->second] = trkstates->second->get_z();
313 proj_p[0][iter->second] = trkstates->second->get_px();
314 proj_p[1][iter->second] = trkstates->second->get_py();
315 proj_p[2][iter->second] = trkstates->second->get_pz();
317 string nodename =
"G4HIT_" + trkstates->second->get_name();
321 cout <<
"could not find " << nodename << endl;
332 if (iter->second >=
nproj)
334 cout <<
"bad index: " << iter->second << endl;
337 ref[0][iter->second] = hit_iter->second->get_x(0);
338 ref[1][iter->second] = hit_iter->second->get_y(0);
339 ref[2][iter->second] = hit_iter->second->get_z(0);
340 ref_p[0][iter->second] = hit_iter->second->get_px(0);
341 ref_p[1][iter->second] = hit_iter->second->get_py(0);
342 ref_p[2][iter->second] = hit_iter->second->get_pz(0);
365 LogError(
"_truth_container not found!");
409 int best_n_match = -1;
410 map<PHG4VtxPoint *, int> vertex_match_map;
427 int n_match = ++vertex_match_map[vtx];
429 if (n_match > best_n_match)
431 best_n_match = n_match;
437 gvx = best_vtx->get_x();
438 gvy = best_vtx->get_y();
439 gvz = best_vtx->get_z();
440 gvt = best_vtx->get_t();
507 cout <<
PHWHERE <<
" PHG4TruthInfoContainer node not found on node tree"
512 _trackmap = findNode::getClass<SvtxTrackMap>(topNode,
517 cout <<
PHWHERE <<
"SvtxTrackMap node with name "
519 <<
" not found on node tree"
524 _vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
527 cout <<
PHWHERE <<
"SvtxTrackMap node with name SvtxVertexMap not found on node tree. Will not build the vertex eval tree"