3 #include <qautils/QAHistManagerDef.h>
56 std::cout << __PRETTY_FUNCTION__ <<
" Fatal Error : missing " <<
m_trackMapName << std::endl;
63 std::cout << __PRETTY_FUNCTION__ <<
" Fatal Error : missing " <<
m_vertexMapName << std::endl;
67 m_truthInfo = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
70 std::cout << __PRETTY_FUNCTION__ <<
" Fatal Error : missing G4TruthInfo" << std::endl;
85 "Normalization;Items;Count", 10, .5, 10.5);
87 h->GetXaxis()->SetBinLabel(i++,
"Event");
88 h->GetXaxis()->SetBinLabel(i++,
"Vertex");
89 h->GetXaxis()->SetBinLabel(i++,
"MVTXTrackOnVertex");
90 h->GetXaxis()->LabelsOption(
"v");
95 "Vertex Resolution at gvz (x);gvz [cm];<vx> - <gvx> [cm]", 100, -10., 10., 500, -0.005, 0.005);
99 "Vertex Resolution at gvz (y);gvz [cm];<vy> - <gvy> [cm]", 100, -10., 10., 500, -0.005, 0.005);
103 "Vertex Resolution at gvz (z);gvz [cm];<vz> - <gvz> [cm]", 100, -10., 10., 500, -0.005, 0.005);
109 "ntracks Distribution;Number of Tracks;Count", 200, 0.5, 200.5);
114 "ntracks Distribution (#geq 2 MVTX);Number of Tracks;Count", 200, 0.5, 200.5);
119 "gntracks Distribution;Number of gTracks;Count", 200, 0.5, 200.5);
124 "gntracksmaps Distribution;Number of gTracksMaps;Count", 200, 0.5, 200.5);
129 "gvz Distribution;gvz Position [cm]", 300, -15., 15.);
134 "SvtxVertex Count per Event;Number of SvtxVertex", 50, -0.5, 49.5);
148 std::cout <<
"QAG4SimulationVertex::process_event() entered" << std::endl;
157 TH1D *h_norm =
dynamic_cast<TH1D *
>(hm->
getHisto(
160 h_norm->Fill(
"Event", 1);
206 int n_recoSvtxVertex = 0;
210 std::map<int, unsigned int> embedvtxid_particle_count;
211 std::map<int, unsigned int> embedvtxid_maps_particle_count;
212 std::map<int, unsigned int> vertex_particle_count;
213 for (
auto iter = prange.first; iter != prange.second; ++iter)
215 const int point_id = iter->second->get_vtx_id();
217 ++vertex_particle_count[point_id];
218 ++embedvtxid_particle_count[gembed];
223 std::set<TrkrDefs::cluskey> g4clusters = clustereval->
all_clusters_from(g4particle);
225 unsigned int nglmaps = 0;
260 if (gpx != 0 && gpy != 0)
262 TVector3 gv(gpx, gpy, gpz);
267 if (nglmaps == 3 && fabs(geta) < 1.0 && gpt > 0.5)
268 ++embedvtxid_maps_particle_count[gembed];
272 std::map<int, bool> embedvtxid_found;
273 std::map<int, int> embedvtxid_vertex_id;
274 std::map<int, PHG4VtxPoint *> embedvtxid_vertex;
275 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
277 const int point_id = iter->first;
279 if (gembed <= 0)
continue;
281 auto search = embedvtxid_found.find(gembed);
282 if (search != embedvtxid_found.end())
284 embedvtxid_vertex_id[gembed] = point_id;
285 embedvtxid_vertex[gembed] = iter->second;
289 if (vertex_particle_count[embedvtxid_vertex_id[gembed]] < vertex_particle_count[point_id])
291 embedvtxid_vertex_id[gembed] = point_id;
292 embedvtxid_vertex[gembed] = iter->second;
295 embedvtxid_found[gembed] =
false;
298 unsigned int ngembed = 0;
299 for (std::map<int, bool>::iterator iter = embedvtxid_found.begin();
300 iter != embedvtxid_found.end();
303 if (iter->first >= 0 || iter->first != iter->first)
continue;
325 float gntracksmaps = NAN;
327 h_ntracks->Fill(ntracks);
329 int ntracks_with_cuts = 0;
355 const auto &cluster_key = *cluster_iter;
365 std::cout <<
"QAG4SimulationTracking::process_event - unkown tracker ID = " << trackerID <<
" from cluster " << cluster_key << std::endl;
372 const auto &cluster_key = *cluster_iter;
383 h_ntracks_cuts->Fill(ntracks_with_cuts);
387 const int point_id = point->
get_id();
388 gvx = point->
get_x();
389 gvy = point->
get_y();
390 gvz = point->
get_z();
391 gvt = point->
get_t();
396 gntracks = embedvtxid_particle_count[(int) gembed];
398 h_gntracks->Fill(gntracks);
400 if (embedvtxid_maps_particle_count[(
int) gembed] > 0 && fabs(gvt) < 2000. && fabs(gvz) < 13.0)
401 gntracksmaps = embedvtxid_maps_particle_count[(int) gembed];
403 h_gntracksmaps->Fill(gntracksmaps);
404 h_norm->Fill(
"MVTXTrackOnVertex", gntracksmaps);
406 float vx_res = vx - gvx;
407 float vy_res = vy - gvy;
408 float vz_res = vz - gvz;
410 h_vxRes_gvz->Fill(gvz, vx_res);
411 h_vyRes_gvz->Fill(gvz, vy_res);
412 h_vzRes_gvz->Fill(gvz, vz_res);
414 h_recoSvtxVertex->Fill(n_recoSvtxVertex);
415 h_norm->Fill(
"Vertex", n_recoSvtxVertex);
422 m_truthContainer = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
425 std::cout <<
"QAG4SimulationTracking::load_nodes - Fatal Error - "
426 <<
"unable to find DST node "
427 <<
"G4TruthInfo" << std::endl;