38 ,
bool _fill_clusverbose
39 ,
bool _fill_SvUnMatched
41 : m_ismatcher { _ismatcher }
45 , m_fill_SvUnmatched { _fill_SvUnMatched }
47 m_TCEval.ismatcher = m_ismatcher;
51 h2_G4_nPixelsPhi =
new TH2D(
"G4_nPixelsPhi",
"PHG4 Emb Tracks; cluster pixel width Phi; layer",
52 100, -0.5, 99.5, 56, -0.5, 55.5);
53 h2_G4_nPixelsZ =
new TH2D(
"G4_nPixelsZ",
"PHG4 Emb Tracks; cluster pixel width Z; layer",
54 100, -0.5, 99.5, 56, -0.5, 55.5);
55 h2_Sv_nPixelsPhi =
new TH2D(
"Sv_nPixelsPhi",
"Svtx Reco Tracks; cluster pixel width Phi; layer",
56 100, -0.5, 99.5, 56, -0.5, 55.5);
57 h2_Sv_nPixelsZ =
new TH2D(
"Sv_nPixelsZ",
"Svtx Reco Tracks; cluster pixel width Z; layer",
58 100, -0.5, 99.5, 56, -0.5, 55.5);
60 m_ttree =
new TTree(
"T",
"Tracks (and sometimes clusters)");
62 m_ttree->Branch(
"event", &nevent);
63 m_ttree->Branch(
"nphg4_part", &nphg4_part);
64 m_ttree->Branch(
"centrality", ¢rality);
65 m_ttree->Branch(
"ntrackmatches", &ntrackmatches);
66 m_ttree->Branch(
"nphg4", &nphg4);
67 m_ttree->Branch(
"nsvtx", &nsvtx);
69 m_ttree ->Branch(
"trackid" , &
b_trackid );
70 m_ttree ->Branch(
"is_G4track" , &b_is_g4track );
71 m_ttree ->Branch(
"is_Svtrack" , &b_is_Svtrack );
72 m_ttree ->Branch(
"is_matched" , &b_is_matched );
74 m_ttree ->Branch(
"trkpt" , &b_trkpt );
75 m_ttree ->Branch(
"trketa" , &b_trketa );
76 m_ttree ->Branch(
"trkphi" , &b_trkphi );
78 m_ttree ->Branch(
"nclus" , &b_nclus );
79 m_ttree ->Branch(
"nclustpc" , &b_nclustpc );
80 m_ttree ->Branch(
"nclusmvtx" , &b_nclusmvtx );
81 m_ttree ->Branch(
"nclusintt" , &b_nclusintt );
82 m_ttree ->Branch(
"matchrat" , &b_matchrat );
83 m_ttree ->Branch(
"matchrat_intt" , &b_matchrat_intt );
84 m_ttree ->Branch(
"matchrat_mvtx" , &b_matchrat_mvtx );
85 m_ttree ->Branch(
"matchrat_tpc" , &b_matchrat_tpc );
88 m_ttree ->Branch(
"clus_match" , &b_clusmatch );
89 m_ttree ->Branch(
"clus_x" , &b_clus_x );
90 m_ttree ->Branch(
"clus_y" , &b_clus_y );
91 m_ttree ->Branch(
"clus_z" , &b_clus_z );
92 m_ttree ->Branch(
"clus_r" , &b_clus_r );
93 m_ttree ->Branch(
"clus_layer" , &b_clus_layer );
97 m_ttree ->Branch(
"clus_lphi" , &b_clus_lphi );
98 m_ttree ->Branch(
"clus_lphisize" , &b_clus_lphisize );
99 m_ttree ->Branch(
"clus_lz" , &b_clus_lz );
100 m_ttree ->Branch(
"clus_lzsize" , &b_clus_lzsize );
103 m_ttree ->Branch(
"phibins" , &b_phibins );
104 m_ttree ->Branch(
"phibins_cut" , &b_phibins_cut );
105 m_ttree ->Branch(
"zbins" , &b_zbins );
106 m_ttree ->Branch(
"zbins_cut" , &b_zbins_cut );
108 m_ttree ->Branch(
"phibinsE" , &b_phibinsE );
109 m_ttree ->Branch(
"phibinsE_cut" , &b_phibinsE_cut );
110 m_ttree ->Branch(
"zbinsE" , &b_zbinsE );
111 m_ttree ->Branch(
"zbinsE_cut" , &b_zbinsE_cut );
125 std::cout <<
" Beginning FillClusMatchTree " << std::endl;
155 std::cout <<
PHWHERE <<
" DST node is missing, quitting" << std::endl;
156 std::cerr <<
PHWHERE <<
" DST node is missing, quitting" << std::endl;
157 throw std::runtime_error(
"Failed to find DST node in FillClusMatchTree::createNodes");
161 m_PHG4ClusHitVerb = findNode::getClass<ClusHitsVerbose>(topNode,
"Trkr_TruthClusHitsVerbose");
163 std::cout <<
" Found truth cluster hits verbose " << std::endl;
165 std::cout <<
" Did not find truth cluster hits verbose " << std::endl;
168 m_SvtxClusHitVerb = findNode::getClass<ClusHitsVerbose>(topNode,
"Trkr_SvtxClusHitsVerbose");
170 std::cout <<
" Found Svtx cluster hits verbose " << std::endl;
172 std::cout <<
" Did not find Svtx cluster hits verbose " << std::endl;
177 std::cout <<
PHWHERE <<
" Cannot find node TRKR_EMBRECOMATCHCONTAINER on node tree; quitting " << std::endl;
178 std::cerr <<
PHWHERE <<
" Cannot find node TRKR_EMBRECOMATCHCONTAINER on node tree; quitting " << std::endl;
179 throw std::runtime_error(
" Cannot find node TRKR_EMBRECOMATCHCONTAINER on node tree; quitting");
192 std::cout <<
"Could not locate G4TruthInfo node when running "
193 <<
"\"TruthRecoTrackMatching\" module." << std::endl;
197 m_SvtxTrackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
200 std::cout <<
"Could not locate SvtxTrackMap node when running "
201 <<
"\"TruthRecoTrackMatching\" module." << std::endl;
206 "TRKR_TRUTHTRACKCONTAINER");
209 std::cout <<
"Could not locate TRKR_TRUTHTRACKCONTAINER node when running "
210 <<
"\"TruthRecoTrackMatching\" module." << std::endl;
221 if (
Verbosity()>5) cout <<
" FillClusMatchTree::process_event() " << endl;
234 for (
auto iter = range.first; iter != range.second; ++iter) {
235 auto& cluster = iter->second;
244 for (
auto iter = range.first; iter != range.second; ++iter) {
245 auto& cluster = iter->second;
254 iter != range.second; ++iter)
268 unsigned int g4_trkid = match->idTruthTrack();
269 int sv_trkid = match->idRecoTrack();
286 b_trketa = g4trk->getPseudoRapidity();
312 for (
auto& clus : clusters) {
343 for (
auto& clus : clusters) {
349 for (
auto& clus : clusters) {
368 b_trketa = g4trk->getPseudoRapidity();
425 std::cout <<
"To do: "
426 <<
" (1) number of truth tracks and total number of mvtx and ratio " << std::endl
427 <<
" (2) ditto for reco tracks " << std::endl;
431 double n_in_PHG4_tracks {0.};
437 double n_in_PHG4_clusters {0.};
441 for (
auto r = range.first;
r != range.second; ++
r) {
442 n_in_PHG4_clusters += 1.;
449 double n_in_SVTX_tracks {0.};
455 double n_in_SVTX_clusters {0.};
459 for (
auto r = range.first;
r != range.second; ++
r) {
460 n_in_SVTX_clusters += 1.;
464 std::cout << Form(
"MVTX"
465 "\nPHG4: Tracks(%.0f) Clusters In tracks(%.0f) Total (%.0f)"
466 "\n ave. per track: %6.3f ratio in all tracks: %6.2f"
467 , n_PHG4_tracks, n_in_PHG4_tracks, n_in_PHG4_clusters
468 , (n_in_PHG4_tracks/n_PHG4_tracks), (n_in_PHG4_tracks/n_in_PHG4_clusters))
471 "\nSVTX: Tracks(%.0f) Clusters In tracks(%.0f) Total (%.0f)"
472 "\n ave. per track: %6.3f ratio in all tracks: %6.2f"
473 , n_SVTX_tracks, n_in_SVTX_tracks, n_in_SVTX_clusters
474 , (n_in_SVTX_tracks/n_SVTX_tracks), (n_in_SVTX_tracks/n_in_SVTX_clusters))
481 if (
Verbosity()>2) std::cout <<
PHWHERE <<
": ending FillClusMatchTree" << std::endl;
494 if (tag !=
"" &&
b_clus_x.size()>0) {
530 auto x = clus.
gloc[0];
531 auto y = clus.
gloc[1];
532 auto r = pow(
x*
x+
y*
y,0.5);
546 auto& key = clus.
ckey;
553 b_zbins .push_back(zdat.first);