65 unsigned int nlayers_maps,
67 unsigned int nlayers_tpc,
68 unsigned int nlayers_mms)
70 , _nlayers_maps(nlayers_maps)
71 , _nlayers_intt(nlayers_intt)
72 , _nlayers_tpc(nlayers_tpc)
73 , _nlayers_mms(nlayers_mms)
75 , _trackmapname(trackmapname)
89 _tfile->SetCompressionLevel(0);
92 _ntp_info =
new TNtuple(
"ntp_info",
"event info",
94 "occ11:occ116:occ21:occ216:occ31:occ316:"
95 "gntrkall:gntrkprim:ntrk:"
96 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
101 _ntp_vertex =
new TNtuple(
"ntp_vertex",
"vertex => max truth",
102 "event:seed:vertexID:vx:vy:vz:ntracks:chi2:ndof:"
103 "gvx:gvy:gvz:gvt:gembed:gntracks:gntracksmaps:"
104 "gnembed:nfromtruth:"
105 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
110 _ntp_gpoint =
new TNtuple(
"ntp_gpoint",
"g4point => best vertex",
111 "event:seed:gvx:gvy:gvz:gvt:gntracks:gembed:"
114 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
119 _ntp_g4hit =
new TNtuple(
"ntp_g4hit",
"g4hit => best svtxcluster",
120 "event:seed:g4hitID:gx:gy:gz:gt:gpl:gedep:geta:gphi:"
122 "glayer:gtrackID:gflavor:"
125 "gfpx:gfpy:gfpz:gfx:gfy:gfz:"
126 "gembed:gprimary:nclusters:"
127 "clusID:x:y:z:eta:phi:e:adc:layer:size:"
128 "efromtruth:dphitru:detatru:dztru:drtru:"
129 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
134 _ntp_hit =
new TNtuple(
"ntp_hit",
"svtxhit => max truth",
135 "event:seed:hitID:e:adc:layer:phielem:zelem:"
136 "cellID:ecell:phibin:zbin:phi:z:"
137 "g4hitID:gedep:gx:gy:gz:gt:"
139 "gpx:gpy:gpz:gvx:gvy:gvz:gvt:"
140 "gfpx:gfpy:gfpz:gfx:gfy:gfz:"
141 "gembed:gprimary:efromtruth:"
142 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
147 _ntp_cluster =
new TNtuple(
"ntp_cluster",
"svtxcluster => max truth",
148 "event:seed:hitID:x:y:z:r:phi:eta:theta:ex:ey:ez:ephi:pez:pephi:"
149 "e:adc:maxadc:layer:phielem:zelem:size:phisize:zsize:"
151 "trackID:niter:g4hitID:gx:"
152 "gy:gz:gr:gphi:geta:gt:gtrackID:gflavor:"
153 "gpx:gpy:gpz:gvx:gvy:gvz:gvt:"
154 "gfpx:gfpy:gfpz:gfx:gfy:gfz:"
155 "gembed:gprimary:efromtruth:nparticles:"
156 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
161 _ntp_g4cluster =
new TNtuple(
"ntp_g4cluster",
"g4cluster => max truth",
162 "event:layer:gx:gy:gz:gt:gedep:gr:gphi:geta:gtrackID:gflavor:gembed:gprimary:gphisize:gzsize:gadc:nreco:x:y:z:r:phi:eta:ex:ey:ez:ephi:adc:phisize:zsize");
167 _ntp_gtrack =
new TNtuple(
"ntp_gtrack",
"g4particle => best svtxtrack",
168 "event:seed:gntracks:gnchghad:gtrackID:gflavor:gnhits:gnmaps:gnintt:gnmms:"
169 "gnintt1:gnintt2:gnintt3:gnintt4:"
170 "gnintt5:gnintt6:gnintt7:gnintt8:"
171 "gntpc:gnlmaps:gnlintt:gnltpc:gnlmms:"
172 "gpx:gpy:gpz:gpt:geta:gphi:"
174 "gfpx:gfpy:gfpz:gfx:gfy:gfz:"
176 "trackID:px:py:pz:pt:eta:phi:deltapt:deltaeta:deltaphi:"
177 "siqr:siphi:sithe:six0:siy0:tpqr:tpphi:tpthe:tpx0:tpy0:"
178 "charge:quality:chisq:ndf:nhits:layers:nmaps:nintt:ntpc:nmms:ntpc1:ntpc11:ntpc2:ntpc3:nlmaps:nlintt:nltpc:nlmms:"
179 "vertexID:vx:vy:vz:dca2d:dca2dsigma:dca3dxy:dca3dxysigma:dca3dz:dca3dzsigma:pcax:pcay:pcaz:nfromtruth:nwrong:ntrumaps:nwrongmaps:ntruintt:nwrongintt:ntrutpc:nwrongtpc:ntrumms:nwrongmms:ntrutpc1:nwrongtpc1:ntrutpc11:nwrongtpc11:ntrutpc2:nwrongtpc2:ntrutpc3:nwrongtpc3:layersfromtruth:"
180 "npedge:nredge:nbig:novlp:merr:msize:"
181 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
186 _ntp_track =
new TNtuple(
"ntp_track",
"svtxtrack => max truth",
187 "event:seed:trackID:crossing:px:py:pz:pt:eta:phi:deltapt:deltaeta:deltaphi:"
188 "siqr:siphi:sithe:six0:siy0:tpqr:tpphi:tpthe:tpx0:tpy0:"
189 "charge:quality:chisq:ndf:nhits:nmaps:nintt:ntpc:nmms:ntpc1:ntpc11:ntpc2:ntpc3:nlmaps:nlintt:nltpc:nlmms:layers:"
190 "vertexID:vx:vy:vz:dca2d:dca2dsigma:dca3dxy:dca3dxysigma:dca3dz:dca3dzsigma:pcax:pcay:pcaz:"
191 "gtrackID:singlematch:gflavor:gnhits:gnmaps:gnintt:gntpc:gnmms:gnlmaps:gnlintt:gnltpc:gnlmms:"
192 "gpx:gpy:gpz:gpt:geta:gphi:"
194 "gfpx:gfpy:gfpz:gfx:gfy:gfz:"
195 "gembed:gprimary:nfromtruth:nwrong:ntrumaps:nwrongmaps:ntruintt:nwrongintt:"
196 "ntrutpc:nwrongtpc:ntrumms:nwrongmms:ntrutpc1:nwrongtpc1:ntrutpc11:nwrongtpc11:ntrutpc2:nwrongtpc2:ntrutpc3:nwrongtpc3:layersfromtruth:"
197 "npedge:nredge:nbig:novlp:merr:msize:"
198 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
203 _ntp_gseed =
new TNtuple(
"ntp_gseed",
"seeds from truth",
204 "event:seed:ntrk:gx:gy:gz:gr:geta:gphi:"
206 "gpx:gpy:gpz:gtpt:gtphi:gteta:"
208 "gembed:gprimary:gflav:"
210 "nhittpcall:nhittpcin:nhittpcmid:nhittpcout:nclusall:nclustpc:nclusintt:nclusmaps:nclusmms");
228 std::cout <<
"SvtxEvaluator::process_event - Event = " <<
_ievent << std::endl;
245 std::cout <<
"SvtxEvaluator::process_event - Seed = " <<
_iseed << std::endl;
335 std::cout <<
"========================= SvtxEvaluator::End() ============================" << std::endl;
336 std::cout <<
" " <<
_ievent <<
" events of output written to: " <<
_filename << std::endl;
337 std::cout <<
"===========================================================================" << std::endl;
348 std::cout <<
"SvtxEvaluator::End() - Error Count: " <<
_errors << std::endl;
362 std::cout <<
"SvtxEvaluator::printInputInfo() entered" << std::endl;
368 std::cout << std::endl;
369 std::cout <<
PHWHERE <<
" INPUT FOR EVENT " <<
_ievent << std::endl;
371 std::cout << std::endl;
372 std::cout <<
"---PHG4HITS-------------" << std::endl;
375 unsigned int ig4hit = 0;
376 for (std::set<PHG4Hit*>::iterator iter = g4hits.begin();
377 iter != g4hits.end();
381 std::cout << ig4hit <<
" of " << g4hits.size();
382 std::cout <<
": PHG4Hit: " << std::endl;
387 std::cout <<
"---SVTXCLUSTERS-------------" << std::endl;
388 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
391 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
394 if (clustermap !=
nullptr)
396 unsigned int icluster = 0;
400 for (
auto iter = range.first; iter != range.second; ++iter)
403 std::cout << icluster <<
" with key " << cluster_key <<
" of " << clustermap->
size();
404 std::cout <<
": SvtxCluster: " << std::endl;
405 iter->second->identify();
411 std::cout <<
"---SVXTRACKS-------------" << std::endl;
415 unsigned int itrack = 0;
417 iter != trackmap->
end();
420 std::cout << itrack <<
" of " << trackmap->
size();
422 std::cout <<
" : SvtxTrack:" << std::endl;
424 std::cout << std::endl;
429 std::cout <<
"---SVXVERTEXES-------------" << std::endl;
433 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
437 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapRefit");
441 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapActs");
446 unsigned int ivertex = 0;
448 iter != vertexmap->
end();
451 std::cout << ivertex <<
" of " << vertexmap->
size();
453 std::cout <<
" : SvtxVertex:" << std::endl;
455 std::cout << std::endl;
467 std::cout <<
"SvtxEvaluator::printOutputInfo() entered" << std::endl;
481 std::cout << std::endl;
482 std::cout <<
PHWHERE <<
" NEW OUTPUT FOR EVENT " <<
_ievent << std::endl;
483 std::cout << std::endl;
488 float gvx = gvertex->
get_x();
489 float gvy = gvertex->get_y();
490 float gvz = gvertex->get_z();
499 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
503 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapRefit");
507 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapActs");
512 if (!vertexmap->
empty())
516 vx = vertex->
get_x();
517 vy = vertex->
get_y();
518 vz = vertex->
get_z();
522 std::cout <<
"===Vertex Reconstruction=======================" << std::endl;
523 std::cout <<
"vtrue = (" << gvx <<
"," << gvy <<
"," << gvz <<
") => vreco = (" << vx <<
"," << vy <<
"," << vz <<
")" << std::endl;
524 std::cout << std::endl;
526 std::cout <<
"===Tracking Summary============================" << std::endl;
527 unsigned int ng4hits[100] = {0};
529 for (
auto g4hit : g4hits)
531 ++ng4hits[g4hit->get_layer()];
534 TrkrHitSetContainer* hitsetmap = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
536 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
539 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
542 unsigned int nclusters[100] = {0};
543 unsigned int nhits[100] = {0};
545 ActsGeometry* tgeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
549 std::cout <<
PHWHERE <<
"No Acts geometry on node tree. Can't continue."
557 hitsetiter != all_hitsets.second;
566 hitr != hitrangei.second;
571 auto range = clustermap->getClusters(hitsetiter->first);
572 for (
auto clusIter = range.first; clusIter != range.second; ++clusIter)
574 const auto cluskey = clusIter->first;
577 nclusters[local_layer]++;
583 findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode,
"CYLINDERCELLGEOM_SVTX");
587 std::cout <<
PHWHERE <<
"ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
596 std::cout <<
"layer " << ilayer <<
": nG4hits = " << ng4hits[ilayer]
597 <<
" => nHits = " << nhits[ilayer]
598 <<
" => nClusters = " << nclusters[ilayer] << std::endl;
601 std::cout <<
"layer " << ilayer
612 std::cout <<
" => nTracks = ";
615 std::cout << trackmap->
size() << std::endl;
619 std::cout << 0 << std::endl;
625 for (
auto g4hit : g4hits)
627 std::cout << std::endl;
628 std::cout <<
"===PHG4Hit===================================" << std::endl;
629 std::cout <<
" PHG4Hit: ";
634 for (
unsigned long cluster_key : clusters)
636 std::cout <<
"===Created-SvtxCluster================" << std::endl;
637 std::cout <<
"SvtxCluster: ";
638 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
645 iter != range.second;
651 std::cout << std::endl;
653 std::cout <<
"=== Gtrack ===================================================" << std::endl;
654 std::cout <<
" PHG4Particle id = " << particle->
get_track_id() << std::endl;
656 std::cout <<
" ptrue = (";
658 std::cout << particle->
get_px();
661 std::cout << particle->
get_py();
664 std::cout << particle->
get_pz();
665 std::cout <<
")" << std::endl;
667 std::cout <<
" vtrue = (";
676 std::cout <<
")" << std::endl;
678 std::cout <<
" pt = " << sqrt(pow(particle->
get_px(), 2) + pow(particle->
get_py(), 2)) << std::endl;
679 std::cout <<
" phi = " << atan2(particle->
get_py(), particle->
get_px()) << std::endl;
680 std::cout <<
" eta = " << asinh(particle->
get_pz() / sqrt(pow(particle->
get_px(), 2) + pow(particle->
get_py(), 2))) << std::endl;
684 std::cout <<
" ---Associated-PHG4Hits-----------------------------------------" << std::endl;
685 std::set<PHG4Hit*> local_g4hits = trutheval->
all_truth_hits(particle);
686 for (
auto g4hit : local_g4hits)
688 float x = 0.5 * (g4hit->get_x(0) + g4hit->get_x(1));
689 float y = 0.5 * (g4hit->get_y(0) + g4hit->get_y(1));
690 float z = 0.5 * (g4hit->get_z(0) + g4hit->get_z(1));
692 std::cout <<
" #" << g4hit->get_hit_id() <<
" xtrue = (";
704 for (
unsigned long cluster_key : clusters)
706 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
711 float local_x = glob(0);
712 float local_y = glob(1);
713 float local_z = glob(2);
715 std::cout <<
" => #" << cluster_key;
716 std::cout <<
" xreco = (";
718 std::cout << local_x;
721 std::cout << local_y;
724 std::cout << local_z;
728 std::cout << std::endl;
731 if (trackmap && clustermap)
734 for (
auto track : tracks)
736 float px = track->get_px();
737 float py = track->get_py();
738 float pz = track->get_pz();
740 std::cout <<
"===Created-SvtxTrack==========================================" << std::endl;
741 std::cout <<
" SvtxTrack id = " << track->get_id() << std::endl;
742 std::cout <<
" preco = (";
751 std::cout <<
")" << std::endl;
752 std::cout <<
" quality = " << track->get_quality() << std::endl;
755 std::cout <<
" ---Associated-SvtxClusters-to-PHG4Hits-------------------------" << std::endl;
758 local_iter != track->end_cluster_keys();
762 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
771 std::cout <<
" #" << cluster_key <<
" xreco = (";
785 x = 0.5 * (g4hit->
get_x(0) + g4hit->
get_x(1));
786 y = 0.5 * (g4hit->
get_y(0) + g4hit->
get_y(1));
787 z = 0.5 * (g4hit->
get_z(0) + g4hit->
get_z(1));
799 std::cout <<
") => Gtrack id = " << g4hit->
get_trkid();
803 std::cout <<
" noise hit";
807 std::cout << std::endl;
813 std::cout << std::endl;
824 std::cout <<
"SvtxEvaluator::fillOutputNtuples() entered" << std::endl;
827 ActsGeometry* tgeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
830 std::cout <<
"No Acts geometry on node tree. Can't continue."
841 float nhit_tpc_all = 0;
842 float nhit_tpc_in = 0;
843 float nhit_tpc_mid = 0;
844 float nhit_tpc_out = 0;
847 float nclus_intt = 0;
848 float nclus_maps = 0;
851 for (
float&
i : nhit)
862 TrkrHitSetContainer* hitmap_in = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
867 hitsetiter != all_hitsets.second;
877 hitr != hitrangei.second;
900 findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode,
"CYLINDERCELLGEOM_SVTX");
903 std::cout <<
PHWHERE <<
"ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
910 float nhits = nhit[
layer];
911 occ11 = nhits /
nbins;
914 std::cout <<
" occ11 = " << occ11
915 <<
" nbins = " << nbins
916 <<
" nhits = " << nhits
917 <<
" layer = " << layer
924 occ116 = nhits /
nbins;
930 occ21 = nhits /
nbins;
935 occ216 = nhits /
nbins;
940 occ31 = nhits /
nbins;
945 occ316 = nhits /
nbins;
949 std::cout <<
" occ11 = " << occ11
950 <<
" occ116 = " << occ116
951 <<
" occ21 = " << occ21
952 <<
" occ216 = " << occ216
953 <<
" occ31 = " << occ31
954 <<
" occ316 = " << occ316
957 TrkrClusterContainer* clustermap_in = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
960 clustermap_in = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
965 nclus_all = clustermap_in->
size();
970 for (
auto iter_cin = range.first; iter_cin != range.second; ++iter_cin)
981 if (_nlayers_intt > 0)
1012 std::cout <<
"Filling ntp_info " << std::endl;
1018 ntrk = (float) trackmap->
size();
1024 std::cout <<
"EVENTINFO SEED: " <<
m_fSeed << std::endl;
1025 std::cout <<
"EVENTINFO NHIT: " << std::setprecision(9) << nhit_tpc_all << std::endl;
1026 std::cout <<
"EVENTINFO NTRKGEN: " << nprim << std::endl;
1027 std::cout <<
"EVENTINFO NTRKREC: " << ntrk << std::endl;
1030 occ11, occ116, occ21, occ216, occ31, occ316,
1037 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1050 std::cout <<
"Filling ntp_vertex " << std::endl;
1055 GlobalVertexMap* gvertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
1059 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
1063 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapRefit");
1067 vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMapActs");
1072 if (gvertexmap && vertexmap && truthinfo)
1075 std::map<int, unsigned int> embedvtxid_particle_count;
1076 std::map<int, unsigned int> embedvtxid_maps_particle_count;
1077 std::map<int, unsigned int> vertex_particle_count;
1081 for (
auto iter = prange.first; iter != prange.second; ++iter)
1083 const int point_id = iter->second->get_vtx_id();
1084 int gembed = truthinfo->
isEmbededVtx(iter->second->get_vtx_id());
1085 ++vertex_particle_count[point_id];
1086 ++embedvtxid_particle_count[gembed];
1094 std::set<TrkrDefs::cluskey> g4clusters = clustereval->
all_clusters_from(g4particle);
1095 unsigned int nglmaps = 0;
1111 lmaps[local_layer] = 1;
1118 nglmaps += lmaps[
i];
1127 if (gpx != 0 && gpy != 0)
1129 TVector3 gv(gpx, gpy, gpz);
1135 if (nglmaps == 3 && fabs(geta) < 1.0 && gpt > 0.5)
1137 ++embedvtxid_maps_particle_count[gembed];
1143 std::map<int, bool> embedvtxid_found;
1144 std::map<int, int> embedvtxid_vertex_id;
1145 std::map<int, PHG4VtxPoint*> embedvtxid_vertex;
1146 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
1148 const int point_id = iter->first;
1156 auto search = embedvtxid_found.find(gembed);
1157 if (search != embedvtxid_found.end())
1159 embedvtxid_vertex_id[gembed] = point_id;
1160 embedvtxid_vertex[gembed] = iter->second;
1164 if (vertex_particle_count[embedvtxid_vertex_id[gembed]] < vertex_particle_count[point_id])
1166 embedvtxid_vertex_id[gembed] = point_id;
1167 embedvtxid_vertex[gembed] = iter->second;
1170 embedvtxid_found[gembed] =
false;
1173 unsigned int ngembed = 0;
1174 for (
auto& iter : embedvtxid_found)
1176 if (iter.first >= 0)
1183 for (
auto& iter : *gvertexmap)
1193 for(
auto&
vertex : vertices)
1196 int vertexID =
vertex->get_id();
1201 float chi2 =
vertex->get_chisq();
1202 float ndof =
vertex->get_ndof();
1209 float gntracksmaps = NAN;
1210 float gnembed = NAN;
1211 float nfromtruth = NAN;
1214 const int point_id = point->
get_id();
1215 gvx = point->
get_x();
1216 gvy = point->
get_y();
1217 gvz = point->
get_z();
1218 gvt = point->
get_t();
1220 gntracks = embedvtxid_particle_count[(int) gembed];
1221 if (embedvtxid_maps_particle_count[(
int) gembed] > 0 && fabs(gvt) < 2000. && fabs(gvz) < 13.0)
1223 gntracksmaps = embedvtxid_maps_particle_count[(int) gembed];
1225 gnembed = (float) ngembed;
1227 embedvtxid_found[(int) gembed] =
true;
1250 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1258 for (std::map<int, bool>::iterator iter = embedvtxid_found.begin();
1259 iter != embedvtxid_found.end();
1262 if (embedvtxid_found[iter->first])
1276 float gembed = iter->first;
1277 float gntracks = NAN;
1278 float gntracksmaps = NAN;
1279 float gnembed = NAN;
1280 float nfromtruth = NAN;
1286 const int point_id = point->
get_id();
1287 gvx = point->
get_x();
1288 gvy = point->
get_y();
1289 gvz = point->
get_z();
1290 gvt = point->
get_t();
1292 gntracks = embedvtxid_particle_count[(int) gembed];
1293 if (embedvtxid_maps_particle_count[(
int) gembed] > 0 && fabs(gvt) < 2000 && fabs(gvz) < 13.0)
1295 gntracksmaps = embedvtxid_maps_particle_count[(int) gembed];
1297 gnembed = (float) ngembed;
1303 std::cout <<
" adding vertex data " << std::endl;
1323 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1344 std::cout <<
"Filling ntp_gpoint " << std::endl;
1354 std::map<int, unsigned int> vertex_particle_count;
1355 for (
auto iter = prange.first; iter != prange.second; ++iter)
1357 ++vertex_particle_count[iter->second->get_vtx_id()];
1360 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
1362 const int point_id = iter->first;
1371 float gvx = point->
get_x();
1372 float gvy = point->
get_y();
1373 float gvz = point->
get_z();
1375 float gntracks = vertex_particle_count[point_id];
1382 float nfromtruth = NAN;
1386 vx = vertex->
get_x();
1387 vy = vertex->
get_y();
1388 vz = vertex->
get_z();
1408 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1429 std::cout <<
"Filling ntp_g4hit " << std::endl;
1433 for (
auto g4hit : g4hits)
1437 float g4hitID = g4hit->get_hit_id();
1438 float gx = g4hit->get_avg_x();
1439 float gy = g4hit->get_avg_y();
1440 float gz = g4hit->get_avg_z();
1441 TVector3 vg4(gx, gy, gz);
1442 float gt = g4hit->get_avg_t();
1443 float gpl = g4hit->get_path_length();
1444 TVector3 vin(g4hit->get_x(0), g4hit->get_y(0), g4hit->get_z(0));
1445 TVector3 vout(g4hit->get_x(1), g4hit->get_y(1), g4hit->get_z(1));
1446 float gdphi = vin.DeltaPhi(vout);
1447 float gdz = fabs(g4hit->get_z(1) - g4hit->get_z(0));
1448 float gedep = g4hit->get_edep();
1449 float glayer = g4hit->get_layer();
1451 float gtrackID = g4hit->get_trkid();
1457 TVector3
vec(g4hit->get_avg_x(), g4hit->get_avg_y(), g4hit->get_avg_z());
1459 float gphi =
vec.Phi();
1478 if (trutheval->
get_embed(g4particle) <= 0)
1484 gflavor = g4particle->
get_pid();
1485 gpx = g4particle->
get_px();
1486 gpy = g4particle->
get_py();
1487 gpz = g4particle->
get_pz();
1505 gfpx = outerhit->
get_px(1);
1506 gfpy = outerhit->
get_py(1);
1507 gfpz = outerhit->
get_pz(1);
1508 gfx = outerhit->
get_x(1);
1509 gfy = outerhit->
get_y(1);
1510 gfz = outerhit->
get_z(1);
1513 gembed = trutheval->
get_embed(g4particle);
1514 gprimary = trutheval->
is_primary(g4particle);
1518 float nclusters = clusters.size();
1531 float local_layer = NAN;
1534 float dphitru = NAN;
1535 float detatru = NAN;
1539 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
1542 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
1549 clusID = cluster_key;
1556 TVector3
vec2(x, y, z);
1565 TrkrClusterHitAssoc* cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
1566 std::pair<std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator, std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator>
1567 hitrange = cluster_hit_map->
getHits(cluster_key);
1568 for (std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator
1569 clushititer = hitrange.first;
1570 clushititer != hitrange.second; ++clushititer)
1575 dphitru = vec2.DeltaPhi(vg4);
1576 detatru = eta -
geta;
1578 drtru = vec2.DeltaR(vg4);
1633 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1652 std::cout <<
"Filling ntp_hit " << std::endl;
1656 TrkrHitSetContainer* hitmap = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
1658 findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode,
"CYLINDERCELLGEOM_SVTX");
1659 if (!local_geom_container)
1661 std::cout <<
PHWHERE <<
"ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
1669 iter != all_hitsets.second;
1678 hitr != hitrangei.second;
1686 float hitID = hit_key;
1688 float adc = hit->
getAdc();
1693 float ecell = hit->
getAdc();
1702 PHG4TpcCylinderGeom* local_GeoLayer = local_geom_container->GetLayerCellGeom(local_layer);
1748 if (trutheval->
get_embed(g4particle) <= 0)
1755 gflavor = g4particle->
get_pid();
1756 gpx = g4particle->
get_px();
1757 gpy = g4particle->
get_py();
1758 gpz = g4particle->
get_pz();
1777 gfpx = outerhit->
get_px(1);
1778 gfpy = outerhit->
get_py(1);
1779 gfpz = outerhit->
get_pz(1);
1780 gfx = outerhit->
get_x(1);
1781 gfy = outerhit->
get_y(1);
1782 gfz = outerhit->
get_z(1);
1784 gembed = trutheval->
get_embed(g4particle);
1785 gprimary = trutheval->
is_primary(g4particle);
1794 float hit_data[] = {
1836 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
1855 std::cout <<
"check for ntp_cluster" << std::endl;
1863 std::cout <<
"Filling ntp_cluster (all of them) " << std::endl;
1866 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
1869 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
1872 TrkrClusterHitAssoc* clusterhitmap = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
1873 TrkrHitSetContainer* hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
1874 TrkrClusterIterationMapv1* _iteration_map = findNode::getClass<TrkrClusterIterationMapv1>(topNode,
"CLUSTER_ITERATION_MAP");
1879 if (clustermap !=
nullptr)
1881 std::cout <<
"got clustermap" << std::endl;
1885 std::cout <<
"no clustermap" << std::endl;
1887 if (clusterhitmap !=
nullptr)
1889 std::cout <<
"got clusterhitmap" << std::endl;
1893 std::cout <<
"no clusterhitmap" << std::endl;
1895 if (hitsets !=
nullptr)
1897 std::cout <<
"got hitsets" << std::endl;
1901 std::cout <<
"no hitsets" << std::endl;
1905 if (clustermap && clusterhitmap && hitsets)
1911 for (
auto iter = range.first; iter != range.second; ++iter)
1918 if (_iteration_map !=
nullptr)
1920 niter = _iteration_map->getIteration(cluster_key);
1922 float hitID = (float) cluster_key;
1929 TVector3
pos(x, y, z);
1930 float r = pos.Perp();
1931 float phi = pos.Phi();
1932 float eta = pos.Eta();
1933 float theta = pos.Theta();
1944 float maxadc = -999;
1950 auto para_errors = ClusErrPara.get_clusterv5_modified_error(cluster, r, cluster_key);
1954 ez = sqrt(para_errors.second);
1955 ephi = sqrt(para_errors.first);
1960 if(hitsetlayer==7||hitsetlayer==22||hitsetlayer==23||hitsetlayer==38||hitsetlayer==39) redge = 1;
1963 float adc = cluster->
getAdc();
1971 if (hitsetlayer != local_layer)
1973 std::cout <<
"WARNING hitset layer " << hitsetlayer <<
"| " << hitsetlayer2 <<
" layer " << local_layer << std::endl;
1981 std::pair<std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator, std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator>
1982 hitrange = clusterhitmap->
getHits(cluster_key);
1983 for (std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator
1984 clushititer = hitrange.first;
1985 clushititer != hitrange.second; ++clushititer)
1987 TrkrHit* hit = hitset->second->getHit(clushititer->second);
1994 sumadc += (hit->
getAdc() - 70);
1995 if ((hit->
getAdc() - 70) > maxadc)
1997 maxadc = (hit->
getAdc() - 70);
2003 if (track !=
nullptr)
2005 trackID = track->
get_id();
2039 std::cout <<
PHWHERE <<
" **** reco: layer " << local_layer << std::endl;
2040 std::cout <<
" reco cluster key " << cluster_key <<
" r " << r <<
" x " << x <<
" y " << y <<
" z " << z <<
" phi " << phi <<
" adc " << adc << std::endl;
2050 std::cout <<
"Found matching truth cluster with key " << truth_ckey <<
" for reco cluster key " << cluster_key <<
" in layer " << local_layer << std::endl;
2054 gx = truth_cluster->getX();
2055 gy = truth_cluster->getY();
2056 gz = truth_cluster->getZ();
2057 efromtruth = truth_cluster->getError(0, 0);
2059 TVector3
gpos(gx, gy, gz);
2067 gflavor = g4particle->
get_pid();
2068 gpx = g4particle->
get_px();
2069 gpy = g4particle->
get_py();
2070 gpz = g4particle->
get_pz();
2088 gfpx = outerhit->
get_px(1);
2089 gfpy = outerhit->
get_py(1);
2090 gfpz = outerhit->
get_pz(1);
2091 gfx = outerhit->
get_x(1);
2092 gfy = outerhit->
get_y(1);
2093 gfz = outerhit->
get_z(1);
2096 gembed = trutheval->
get_embed(g4particle);
2097 gprimary = trutheval->
is_primary(g4particle);
2102 std::cout <<
" truth cluster key " << truth_ckey <<
" gr " << gr <<
" gx " << gx <<
" gy " << gy <<
" gz " << gz <<
" gphi " << gphi <<
" efromtruth " << efromtruth << std::endl;
2111 float cluster_data[] = {(float)
_ievent,
2171 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
2182 std::cout <<
"Filling ntp_cluster (embedded only) " << std::endl;
2192 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
2195 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
2199 TrkrClusterHitAssoc* clusterhitmap = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
2200 TrkrHitSetContainer* hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
2201 TrkrClusterIterationMapv1* _iteration_map = findNode::getClass<TrkrClusterIterationMapv1>(topNode,
"CLUSTER_ITERATION_MAP");
2203 if (trackmap !=
nullptr && clustermap !=
nullptr && clusterhitmap !=
nullptr && hitsets !=
nullptr)
2205 for (
auto& iter : *trackmap)
2218 std::vector<TrkrDefs::cluskey>
clusters;
2222 for (
auto local_iter = siseed->begin_cluster_keys();
2223 local_iter != siseed->end_cluster_keys();
2227 clusters.push_back(cluster_key);
2233 for (
auto local_iter = tpcseed->begin_cluster_keys();
2234 local_iter != tpcseed->end_cluster_keys();
2238 clusters.push_back(cluster_key);
2243 for (
unsigned long cluster_key : clusters)
2245 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
2255 if (_iteration_map !=
nullptr)
2257 niter = _iteration_map->getIteration(cluster_key);
2264 TVector3
pos(x, y, z);
2265 float r = pos.Perp();
2266 float phi = pos.Phi();
2267 float eta = pos.Eta();
2268 float theta = pos.Theta();
2278 float maxadc = -999;
2287 ez = sqrt(para_errors.second);
2288 ephi = sqrt(para_errors.first);
2294 float adc = cluster->
getAdc();
2299 if(local_layer==7||local_layer==22||local_layer==23||local_layer==38||local_layer==39) redge = 1;
2304 std::pair<std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator, std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator>
2305 hitrange = clusterhitmap->
getHits(cluster_key);
2306 for (std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator
2307 clushititer = hitrange.first;
2308 clushititer != hitrange.second; ++clushititer)
2310 TrkrHit* hit = hitset->second->getHit(clushititer->second);
2312 if (hit->
getAdc() > maxadc)
2319 trackID = track->
get_id();
2356 std::cout <<
" Found matching truth cluster with key " << truth_ckey <<
" for reco cluster key " << cluster_key <<
" in layer " << local_layer << std::endl;
2360 gx = truth_cluster->getX();
2361 gy = truth_cluster->getY();
2362 gz = truth_cluster->getZ();
2363 efromtruth = truth_cluster->getError(0, 0);
2365 TVector3
gpos(gx, gy, gz);
2373 gflavor = g4particle->
get_pid();
2374 gpx = g4particle->
get_px();
2375 gpy = g4particle->
get_py();
2376 gpz = g4particle->
get_pz();
2393 gfpx = outerhit->
get_px(1);
2394 gfpy = outerhit->
get_py(1);
2395 gfpz = outerhit->
get_pz(1);
2396 gfx = outerhit->
get_x(1);
2397 gfy = outerhit->
get_y(1);
2398 gfz = outerhit->
get_z(1);
2401 gembed = trutheval->
get_embed(g4particle);
2402 gprimary = trutheval->
is_primary(g4particle);
2408 float cluster_data[] = {(float)
_ievent,
2468 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
2486 std::cout <<
"check for ntp_g4cluster" << std::endl;
2494 std::cout <<
"Filling ntp_g4cluster " << std::endl;
2500 iter != range.second;
2507 if (trutheval->
get_embed(g4particle) <= 0)
2515 float gembed = trutheval->
get_embed(g4particle);
2520 std::cout <<
PHWHERE <<
" PHG4Particle ID " << gtrackID <<
" gflavor " << gflavor <<
" gprimary " << gprimary << std::endl;
2524 std::map<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster> > truth_clusters = trutheval->
all_truth_clusters(g4particle);
2527 for (
const auto& [ckey, gclus] : truth_clusters)
2531 float gx = gclus->getX();
2532 float gy = gclus->getY();
2533 float gz = gclus->getZ();
2535 float gedep = gclus->getError(0, 0);
2536 float gadc = (float) gclus->getAdc();
2538 TVector3
gpos(gx, gy, gz);
2539 float gr = sqrt(gx * gx + gy * gy);
2540 float gphi = gpos.Phi();
2541 float geta = gpos.Eta();
2545 std::cout <<
PHWHERE <<
" **** truth: layer " << local_layer << std::endl;
2546 std::cout <<
" truth cluster key " << ckey <<
" gr " << gr <<
" gx " << gx <<
" gy " << gy <<
" gz " << gz
2547 <<
" gphi " << gphi <<
" gedep " << gedep <<
" gadc " << gadc << std::endl;
2550 float gphisize = gclus->getSize(1, 1);
2551 float gzsize = gclus->getSize(2, 2);
2581 TVector3
pos(x, y, z);
2582 r = sqrt(x * x + y * y);
2588 phisize = reco_cluster->getPhiSize();
2589 zsize = reco_cluster->getZSize();
2590 ez = sqrt(para_errors.second);
2591 ephi = sqrt(para_errors.first);
2594 adc = reco_cluster->getAdc();
2598 std::cout <<
" reco cluster key " << reco_ckey <<
" r " << r <<
" x " << x <<
" y " << y <<
" z " << z <<
" phi " << phi <<
" adc " << adc << std::endl;
2605 std::cout <<
" ----------- Failed to find matching reco cluster " << std::endl;
2611 float g4cluster_data[] = {(float)
_ievent,
2612 (
float) local_layer,
2659 std::cout <<
"Filling ntp_gtrack " << std::endl;
2664 GlobalVertexMap* gvertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
2665 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
2667 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
2678 Float_t gnchghad = 0;
2679 for(
auto iter = range.first; iter!= range.second; ++iter)
2685 if (trutheval->
get_embed(g4particle) <= 0)
2692 if(fabs(gflavor)==211 || fabs(gflavor)==321 || fabs(gflavor)==2212)
2699 iter != range.second;
2706 if (trutheval->
get_embed(g4particle) <= 0)
2715 std::set<TrkrDefs::cluskey> g4clusters = clustereval->
all_clusters_from(g4particle);
2717 float ng4hits = g4clusters.size();
2718 unsigned int ngmaps = 0;
2719 unsigned int ngmms = 0;
2720 unsigned int ngintt = 0;
2721 unsigned int ngintt1 = 0;
2722 unsigned int ngintt2 = 0;
2723 unsigned int ngintt3 = 0;
2724 unsigned int ngintt4 = 0;
2725 unsigned int ngintt5 = 0;
2726 unsigned int ngintt6 = 0;
2727 unsigned int ngintt7 = 0;
2728 unsigned int ngintt8 = 0;
2729 unsigned int ngtpc = 0;
2730 unsigned int nglmaps = 0;
2731 unsigned int nglintt = 0;
2732 unsigned int ngltpc = 0;
2733 unsigned int nglmms = 0;
2744 int lintt[_nlayers_intt + 1];
2745 if (_nlayers_intt > 0)
2777 lmaps[local_layer] = 1;
2840 nglmaps += lmaps[
i];
2843 if (_nlayers_intt > 0)
2847 nglintt += lintt[
i];
2871 if (gpx != 0 && gpy != 0)
2873 TVector3 gv(gpx, gpy, gpz);
2879 float gvx = vtx->
get_x();
2880 float gvy = vtx->
get_y();
2881 float gvz = vtx->
get_z();
2899 gfpx = outerhit->
get_px(1);
2900 gfpy = outerhit->
get_py(1);
2901 gfpz = outerhit->
get_pz(1);
2902 gfx = outerhit->
get_x(1);
2903 gfy = outerhit->
get_y(1);
2904 gfz = outerhit->
get_z(1);
2907 float gembed = trutheval->
get_embed(g4particle);
2912 float quality = NAN;
2915 float local_nhits = 0;
2928 unsigned int layers = 0x0;
2934 float dca2dsigma = NAN;
2935 float dca3dxy = NAN;
2936 float dca3dxysigma = NAN;
2938 float dca3dzsigma = NAN;
2945 float deltapt = NAN;
2946 float deltaeta = NAN;
2947 float deltaphi = NAN;
2952 float nfromtruth = NAN;
2954 float ntrumaps = NAN;
2955 float nwrongmaps = NAN;
2956 float ntruintt = NAN;
2957 float nwrongintt = NAN;
2958 float ntrumms = NAN;
2959 float nwrongmms = NAN;
2960 float ntrutpc = NAN;
2961 float nwrongtpc = NAN;
2962 float ntrutpc1 = NAN;
2963 float nwrongtpc1 = NAN;
2964 float ntrutpc11 = NAN;
2965 float nwrongtpc11 =NAN;
2966 float ntrutpc2 = NAN;
2967 float nwrongtpc2 = NAN;
2968 float ntrutpc3 = NAN;
2969 float nwrongtpc3 = NAN;
2970 float layersfromtruth = NAN;
2994 trackID = track->
get_id();
3011 std::vector<int> intt(_nlayers_intt, 0);
3022 if (_nlayers_intt > 0)
3047 tpphi = tpcseed->
get_phi(clustermap,tgeometry);
3049 tpx0 = tpcseed->
get_X0();
3050 tpy0 = tpcseed->
get_Y0();
3056 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
3060 maps[local_layer] = 1;
3085 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 32)
3090 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 48)
3109 TVector3
pos(x, y, z);
3110 float r = sqrt(x*x+y*y);
3119 if(cluster!=
nullptr){
3125 gphierr = sqrt(para_errors.first);
3129 if(gedge>0) npedge++;
3130 if(gphisize>=4) nbig++;
3131 if(govlp>=2) novlp++;
3135 if(local_layer==7||local_layer==22||local_layer==23||local_layer==38||local_layer==39) nredge++;
3142 siphi = silseed->
get_phi(clustermap,tgeometry);
3144 six0 = silseed->
get_X0();
3145 siy0 = silseed->
get_Y0();
3155 maps[local_layer] = 1;
3180 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 32)
3185 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 48)
3207 if (_nlayers_intt > 0)
3229 layers = nlmaps + nlintt + nltpc + nlmms;
3246 vx = vertex->
get_x();
3247 vy = vertex->
get_y();
3248 vz = vertex->
get_z();
3251 dca3dxy = dcapair.first.first;
3252 dca3dxysigma = dcapair.first.second;
3253 dca3dz = dcapair.second.first;
3254 dca3dzsigma = dcapair.second.second;
3260 TVector3
v(px, py, pz);
3270 deltapt = sqrt((CVxx * px * px + 2 * CVxy * px * py + CVyy * py * py) / (px * px + py * py));
3271 deltaeta = sqrt((CVzz * (px * px + py * py) * (px * px + py * py) + pz * (-2 * (CVxz * px + CVyz * py) * (px * px + py * py) + CVxx * px * px * pz + CVyy * py * py * pz + 2 * CVxy * px * py * pz)) / ((px * px + py * py) * (px * px + py * py) * (px * px + py * py + pz * pz)));
3272 deltaphi = sqrt((CVyy * px * px - 2 * CVxy * px * py + CVxx * py * py) / ((px * px + py * py) * (px * px + py * py)));
3273 pcax = track->
get_x();
3274 pcay = track->
get_y();
3275 pcaz = track->
get_z();
3287 ntrumaps = pair.first;
3288 nwrongmaps = pair.second;
3290 if (_nlayers_intt == 0)
3297 ntruintt = pair.first;
3298 nwrongintt = pair.second;
3307 ntrumms = pair.first;
3308 nwrongmms = pair.second;
3311 ntrutpc = pair.first;
3312 nwrongtpc = pair.second;
3314 ntrutpc1 = pair.first;
3315 nwrongtpc1 = pair.second;
3317 ntrutpc11 = pair.first;
3318 nwrongtpc11 = pair.second;
3320 ntrutpc2 = pair.first;
3321 nwrongtpc2 = pair.second;
3323 ntrutpc3 = pair.first;
3324 nwrongtpc3 = pair.first;
3448 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
3476 std::cout <<
"Filling ntp_track " << std::endl;
3483 GlobalVertexMap* gvertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
3484 TrkrClusterContainer* clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
3486 clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
3490 for (
auto& iter : *trackmap)
3499 if (crossing_int == SHRT_MAX)
3505 crossing = (float) crossing_int;
3511 float local_nhits = 0;
3520 unsigned int layers = 0x0;
3532 if (_nlayers_intt > 0)
3586 tpphi = tpcseed->
get_phi(clustermap,tgeometry);
3588 tpx0 = tpcseed->
get_X0();
3589 tpy0 = tpcseed->
get_Y0();
3594 TrkrCluster* cluster = clustermap->findCluster(cluster_key);
3599 maps[local_layer] = 1;
3625 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 32)
3629 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 48)
3641 TVector3
pos(x, y, z);
3642 float r = sqrt(x*x+y*y);
3651 if(cluster!=
nullptr){
3655 auto para_errors = ClusErrPara.get_clusterv5_modified_error(cluster,r,cluster_key);
3657 rphierr = sqrt(para_errors.first);
3661 if(pedge>0) npedge++;
3662 if(rphisize>=4) nbig++;
3663 if(rovlp>=2) novlp++;
3667 if(local_layer==7||local_layer==22||local_layer==23||local_layer==38||local_layer==39) nredge++;
3670 std::cout <<
" lay: " << local_layer
3671 <<
" pedge " << pedge
3673 <<
" nredge " << nredge
3674 <<
" rphisize " << rphisize
3676 <<
" rovlp " << rovlp
3686 siphi = silseed->
get_phi(clustermap,tgeometry);
3688 six0 = silseed->
get_X0();
3689 siy0 = silseed->
get_Y0();
3700 maps[local_layer] = 1;
3726 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 32)
3730 else if ((local_layer - (
_nlayers_maps + _nlayers_intt)) < 48)
3745 if (_nlayers_intt > 0)
3766 layers = nlmaps + nlintt + nltpc + nlmms;
3768 float dca3dxy = NAN, dca3dz = NAN,
3769 dca3dxysigma = NAN, dca3dzsigma = NAN;
3770 float dca2d = NAN, dca2dsigma = NAN;
3780 vx = vertex->
get_x();
3781 vy = vertex->
get_y();
3782 vz = vertex->
get_z();
3786 dca3dxy = dcapair.first.first;
3787 dca3dxysigma = dcapair.first.second;
3788 dca3dz = dcapair.second.first;
3789 dca3dzsigma = dcapair.second.second;
3791 float px = track->
get_px();
3792 float py = track->
get_py();
3793 float pz = track->
get_pz();
3794 TVector3
v(px, py, pz);
3796 float eta = v.Eta();
3797 float phi = v.Phi();
3804 float deltapt = sqrt((CVxx * px * px + 2 * CVxy * px * py + CVyy * py * py) / (px * px + py * py));
3805 float deltaeta = sqrt((CVzz * (px * px + py * py) * (px * px + py * py) + pz * (-2 * (CVxz * px + CVyz * py) * (px * px + py * py) + CVxx * px * px * pz + CVyy * py * py * pz + 2 * CVxy * px * py * pz)) / ((px * px + py * py) * (px * px + py * py) * (px * px + py * py + pz * pz)));
3806 float deltaphi = sqrt((CVyy * px * px - 2 * CVxy * px * py + CVxx * py * py) / ((px * px + py * py) * (px * px + py * py)));
3807 float pcax = track->
get_x();
3808 float pcay = track->
get_y();
3809 float pcaz = track->
get_z();
3814 unsigned int ngmaps = 0;
3815 unsigned int ngintt = 0;
3816 unsigned int ngmms = 0;
3817 unsigned int ngtpc = 0;
3818 unsigned int nglmaps = 0;
3819 unsigned int nglintt = 0;
3820 unsigned int nglmms = 0;
3821 unsigned int ngltpc = 0;
3842 float nfromtruth = NAN;
3844 float ntrumaps = NAN;
3845 float nwrongmaps = NAN;
3846 float ntruintt = NAN;
3847 float nwrongintt = NAN;
3848 float ntrumms = NAN;
3849 float nwrongmms = NAN;
3850 float ntrutpc = NAN;
3851 float nwrongtpc = NAN;
3852 float ntrutpc1 = NAN;
3853 float nwrongtpc1 = NAN;
3854 float ntrutpc11 = NAN;
3855 float nwrongtpc11 = NAN;
3856 float ntrutpc2 = NAN;
3857 float nwrongtpc2 = NAN;
3858 float ntrutpc3 = NAN;
3859 float nwrongtpc3 = NAN;
3860 float layersfromtruth = NAN;
3869 if (trutheval->
get_embed(g4particle) <= 0)
3883 gflavor = g4particle->
get_pid();
3885 std::set<TrkrDefs::cluskey> g4clusters = clustereval->
all_clusters_from(g4particle);
3886 ng4hits = g4clusters.size();
3887 gpx = g4particle->
get_px();
3888 gpy = g4particle->
get_py();
3889 gpz = g4particle->
get_pz();
3900 int lintt[_nlayers_intt + 1];
3901 if (_nlayers_intt > 0)
3932 lmaps[local_layer] = 1;
3958 nglmaps += lmaps[
i];
3961 if (_nlayers_intt > 0)
3965 nglintt += lintt[
i];
3983 TVector3 gv(gpx, gpy, gpz);
4000 gfpx = outerhit->
get_px(1);
4001 gfpy = outerhit->
get_py(1);
4002 gfpz = outerhit->
get_pz(1);
4003 gfx = outerhit->
get_x(1);
4004 gfy = outerhit->
get_y(1);
4005 gfz = outerhit->
get_z(1);
4007 gembed = trutheval->
get_embed(g4particle);
4008 gprimary = trutheval->
is_primary(g4particle);
4019 ntrumaps = pair.first;
4020 nwrongmaps = pair.second;
4022 if (_nlayers_intt == 0)
4029 ntruintt = pair.first;
4030 nwrongintt = pair.second;
4039 ntrumms = pair.first;
4040 nwrongmms = pair.second;
4043 ntrutpc = pair.first;
4044 nwrongtpc = pair.second;
4046 ntrutpc1 = pair.first;
4047 nwrongtpc1 = pair.second;
4049 ntrutpc11 = pair.first;
4050 nwrongtpc11 = pair.second;
4052 ntrutpc2 = pair.first;
4053 nwrongtpc2 = pair.second;
4055 ntrutpc3 = pair.first;
4056 nwrongtpc3 = pair.second;
4062 std::cout <<
" npedge " << npedge
4063 <<
" nredge " << nredge
4065 <<
" novlp "<< novlp
4094 local_nhits, nmaps, nintt, ntpc, nmms,
4095 ntpc1, ntpc11, ntpc2, ntpc3,
4096 nlmaps, nlintt, nltpc, nlmms,
4169 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
4173 std::cout <<
"ievent " <<
_ievent
4174 <<
" trackID " << trackID
4175 <<
" nhits " << local_nhits
4179 <<
" gembed " << gembed
4180 <<
" gprimary " << gprimary
4202 std::cout <<
"Filling ntp_gseed " << std::endl;
4227 float dphiprev = NAN;
4228 float detaprev = NAN;
4238 iter != range.second;
4249 std::set<PHG4Hit*> truth_hits = trutheval->
all_truth_hits(g4particle);
4250 for (
auto g4hit : truth_hits)
4252 unsigned int local_layer = g4hit->get_layer();
4259 xval[local_layer] = g4hit->get_avg_x();
4260 yval[local_layer] = g4hit->get_avg_y();
4261 zval[local_layer] = g4hit->get_avg_z();
4269 if (gx == 0 && gy == 0)
4274 TVector3 vg4(gx, gy, gz);
4279 gpx = g4particle->
get_px();
4280 gpy = g4particle->
get_py();
4281 gpz = g4particle->
get_pz();
4282 TVector3 vg4p(gpx, gpy, gpz);
4297 gembed = trutheval->
get_embed(g4particle);
4298 gprimary = trutheval->
is_primary(g4particle);
4299 gflav = g4particle->
get_pid();
4302 if (xval[
i - 1] != 0 && yval[
i - 1] != 0)
4304 TVector3 vg4prev(xval[
i - 1], yval[
i - 1], zval[
i - 1]);
4305 dphiprev = vg4.DeltaPhi(vg4prev);
4306 detaprev = geta - vg4prev.Eta();
4310 float ntrk_f = ntrk;
4312 float gseed_data[] = {_ievent_f,
4338 nhit_tpc_out, nclus_all, nclus_tpc, nclus_intt, nclus_maps, nclus_mms};
4356 TMatrixF localErr(3, 3);
4357 localErr[0][0] = 0.;
4358 localErr[0][1] = 0.;
4359 localErr[0][2] = 0.;
4360 localErr[1][0] = 0.;
4363 localErr[2][0] = 0.;
4368 ROT[0][0] = cos(clusphi);
4369 ROT[0][1] = -sin(clusphi);
4371 ROT[1][0] = sin(clusphi);
4372 ROT[1][1] = cos(clusphi);
4377 TMatrixF ROT_T(3, 3);
4378 ROT_T.Transpose(ROT);
4381 err = ROT * localErr * ROT_T;