62 std::cout <<
PHWHERE <<
" DST node is missing, quitting" << std::endl;
63 throw std::runtime_error(
"Failed to find DST node in FillTruthRecoMatchMap::createNodes");
69 std::cout <<
PHWHERE <<
" Cannot find node TRKR_EMBRECOMATCHCONTAINER on node tree; quitting " << std::endl;
70 throw std::runtime_error(
" Cannot find node TRKR_EMBRECOMATCHCONTAINER on node tree; quitting");
105 std::cout <<
" FillTruthRecoMatchMap::process_event() " << std::endl;
123 const int gtrackID = match->idTruthTrack();
124 const unsigned int id_reco = match->idRecoTrack();
125 const unsigned short n_match = match->nClustersMatched();
126 const unsigned short n_truth = match->nClustersTruth();
127 const unsigned short n_reco = match->nClustersReco();
131 if (map_TtoR.find(gtrackID) == map_TtoR.end())
135 auto &entry_TtoR = map_TtoR[
gtrackID];
136 float weight_TtoR = (float) n_match + (
float) n_truth / 100.;
137 if (entry_TtoR.find(weight_TtoR) == entry_TtoR.end())
139 entry_TtoR[weight_TtoR] = {id_reco};
143 entry_TtoR[weight_TtoR].insert(id_reco);
148 if (map_RtoT.find(id_reco) == map_RtoT.end())
152 auto &entry_RtoT = map_RtoT[id_reco];
153 float weight_RtoT = (float) n_match + (
float) n_reco / 100.;
154 if (entry_RtoT.find(weight_RtoT) == entry_RtoT.end())
156 entry_RtoT[weight_RtoT] = {gtrackID};
160 entry_RtoT[weight_RtoT].insert(gtrackID);
165 printf(
"EmbRecoMatch: gtrackID(%2i) id_reco(%2i) nclusters:match(%i),gtrack(%2i),reco(%2i)\n",
166 gtrackID, (
int) id_reco, (
int) n_match, (
int) n_truth, (
int) n_reco);
167 printf(
" -> in SvtxPHG4ParticleMap {id_reco->{weight->id_true}} = {%2i->{%5.2f->%2i}}\n",
168 (
int) id_reco, weight_RtoT, (
int) gtrackID);
169 printf(
" -> in PHG4ParticleSvtxMap {id_true->{weight->id_reco}} = {%2i->{%5.2f->%2i}}\n",
170 gtrackID, weight_TtoR, (
int) id_reco);
175 for (
auto &
entry : map_TtoR)
179 for (
auto &
entry : map_RtoT)
186 std::cout <<
PHWHERE <<
" Print out: " << std::endl
187 <<
" Contents of SvtxPHG4ParticleMap (node \"RecoToPHG4ParticleMap\")" << std::endl
188 <<
" and PHG4ParticleSvtxMap (node \"PHG4ParticleToRecoMap\")" << std::endl;
190 std::cout <<
" --BEGIN-- Contents of SvtxPHG4ParticleMap: " << std::endl;
193 printf(
" { %2i ", (
int) iter.first);
194 auto n_matches = iter.second.size();
195 long unsigned int cnt_matches = 0;
196 for (
const auto &matches : iter.second)
198 if (cnt_matches == 0)
200 printf(
"-> { %5.2f -> ", matches.first);
204 printf(
" -> { %5.2f -> ", matches.first);
206 auto size = matches.second.size();
207 long unsigned int i = 0;
208 for (
auto id_true : matches.second)
220 if (cnt_matches < (n_matches - 1))
231 std::cout <<
" --END-- Contents of SvtxPHG4ParticleMap: " << std::endl
234 std::cout <<
" --BEGIN-- Contents of PHG4ParticleToRecoMap: " << std::endl;
237 printf(
" { %2i ", iter.first);
238 auto n_matches = iter.second.size();
239 long unsigned int cnt_matches = 0;
240 for (
const auto &matches : iter.second)
242 if (cnt_matches == 0)
244 printf(
"-> { %5.2f -> ", matches.first);
248 printf(
" -> { %5.2f -> ", matches.first);
250 auto size = matches.second.size();
251 long unsigned int i = 0;
252 for (
auto id_reco : matches.second)
264 if (cnt_matches < (n_matches - 1))
275 std::cout <<
" --END-- Contents of SvtxPHG4ParticleMap: " << std::endl