26 const string &trackmapname)
28 , _outfile_name(filename)
29 , _trackmapname(trackmapname)
31 , _h1d_Delta_mom(nullptr)
42 _h1d_Delta_mom =
new TH1D(
"_h1d_Delta_mom",
"#frac{#Delta p}{truth p}", 100, -0.2, 0.2);
53 auto _truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
56 cout <<
PHWHERE <<
" Either PHG4TruthInfoContainer or SvtxTrackMap node not found on node tree"
65 for (
auto truth_itr = range.first; truth_itr != range.second; ++truth_itr) {
66 auto g4particle = truth_itr->second;
67 if (!g4particle)
continue;
70 for (
auto track_itr = _trackmap->begin(); track_itr != _trackmap->end(); track_itr++) {
73 std::cout <<
"ERROR CASTING PARTICLE!" << std::endl;
78 if ((track->get_truth_track_id() - g4particle->get_track_id()) == 0) {
79 TVector3 truth_mom(g4particle->get_px(), g4particle->get_py(), g4particle->get_pz());
80 TVector3 reco_mom ( track->get_px(), track->get_py(), track->get_pz());
82 _h1d_Delta_mom->Fill((reco_mom.Mag() - truth_mom.Mag()) / truth_mom.Mag());