57 auto geom_container = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_MVTX");
60 std::cout <<
PHWHERE <<
" unable to find DST node CYLINDERGEOM_MVTX" << std::endl;
65 const auto range = geom_container->get_begin_end();
66 for (
auto iter = range.first; iter != range.second; ++iter)
81 auto h =
new TH1F(Form(
"%sdrphi_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX r#Delta#phi_{cluster-truth} layer_%i",
layer), 100, -2
e-3, 2
e-3);
82 h->GetXaxis()->SetTitle(
"r#Delta#phi_{cluster-truth} (cm)");
88 auto h =
new TH1F(Form(
"%srphi_error_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX r#Delta#phi error layer_%i",
layer), 100, 0, 2
e-3);
89 h->GetXaxis()->SetTitle(
"r#Delta#phi error (cm)");
95 auto h =
new TH1F(Form(
"%sphi_pulls_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX #Delta#phi_{cluster-truth}/#sigma#phi layer_%i",
layer), 100, -3, 3);
96 h->GetXaxis()->SetTitle(
"#Delta#phi_{cluster-truth}/#sigma#phi");
102 auto h =
new TH1F(Form(
"%sdz_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX #Deltaz_{cluster-truth} layer_%i",
layer), 100, -3
e-3, 3
e-3);
103 h->GetXaxis()->SetTitle(
"#Deltaz_{cluster-truth} (cm)");
104 hm->registerHisto(
h);
110 h->GetXaxis()->SetTitle(
"z error (cm)");
111 hm->registerHisto(
h);
116 auto h =
new TH1F(Form(
"%sz_pulls_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX #Deltaz_{cluster-truth}/#sigmaz layer_%i",
layer), 100, -3, 3);
117 h->GetXaxis()->SetTitle(
"#Deltaz_{cluster-truth}/#sigmaz");
118 hm->registerHisto(
h);
123 auto h =
new TH1F(Form(
"%sclus_size_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX cluster size layer_%i",
layer), 20, 0, 20);
124 h->GetXaxis()->SetTitle(
"csize");
125 hm->registerHisto(
h);
130 auto h =
new TH1F(Form(
"%sclus_size_phi_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX cluster size (#phi) layer_%i",
layer), 10, 0, 10);
131 h->GetXaxis()->SetTitle(
"csize_{#phi}");
132 hm->registerHisto(
h);
137 auto h =
new TH1F(Form(
"%sclus_size_z_%i",
get_histo_prefix().c_str(),
layer), Form(
"MVTX cluster size (z) layer_%i",
layer), 10, 0, 10);
138 h->GetXaxis()->SetTitle(
"csize_{z}");
139 hm->registerHisto(
h);
160 return std::string(
"h_") +
Name() + std::string(
"_");
166 m_hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
169 std::cout <<
PHWHERE <<
" ERROR: Can't find TrkrHitSetContainer." << std::endl;
173 m_surfmaps = findNode::getClass<ActsSurfaceMaps>(topNode,
"ActsSurfaceMaps");
176 std::cout <<
PHWHERE <<
"Error: can't find Acts surface maps"
181 m_tGeometry = findNode::getClass<ActsTrackingGeometry>(topNode,
"ActsTrackingGeometry");
184 std::cout <<
PHWHERE <<
"No acts tracking geometry, exiting."
189 m_cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
192 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_CLUSTER" << std::endl;
196 m_cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
199 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_CLUSTERHITASSOC" << std::endl;
203 m_hit_truth_map = findNode::getClass<TrkrHitTruthAssoc>(topNode,
"TRKR_HITTRUTHASSOC");
206 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_HITTRUTHASSOC" << std::endl;
210 m_g4hits_mvtx = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_MVTX");
213 std::cout <<
PHWHERE <<
" unable to find DST node G4HIT_MVTX" << std::endl;
230 TH1* drphi =
nullptr;
231 TH1* rphi_error =
nullptr;
232 TH1* phi_pulls =
nullptr;
235 TH1* z_error =
nullptr;
236 TH1* z_pulls =
nullptr;
238 TH1* csize =
nullptr;
239 TH1* csize_phi =
nullptr;
240 TH1* csize_z =
nullptr;
243 using HistogramMap = std::map<int, HistogramList>;
244 HistogramMap histograms;
250 h.rphi_error =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%srphi_error_%i",
get_histo_prefix().c_str(),
layer)));
251 h.phi_pulls =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sphi_pulls_%i",
get_histo_prefix().c_str(),
layer)));
254 h.z_error =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sz_error_%i",
get_histo_prefix().c_str(),
layer)));
255 h.z_pulls =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sz_pulls_%i",
get_histo_prefix().c_str(),
layer)));
257 h.csize =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_%i",
get_histo_prefix().c_str(),
layer)));
258 h.csize_phi =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_phi_%i",
get_histo_prefix().c_str(),
layer)));
259 h.csize_z =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_z_%i",
get_histo_prefix().c_str(),
layer)));
261 histograms.insert(std::make_pair(
layer, h));
266 for (
auto hitsetitr = hitsetrange.first;
267 hitsetitr != hitsetrange.second;
271 for (
auto clusterIter = range.first; clusterIter != range.second; ++clusterIter)
274 const auto& key = clusterIter->first;
276 const auto& cluster = clusterIter->second;
283 const auto z_cluster = global(2);
284 const auto phi_cluster = (float) std::atan2(global(1), global(0));
285 const auto phi_error = cluster->getRPhiError() / r_cluster;
286 const auto z_error = cluster->getZError();
292 const auto x_truth = QAG4Util::interpolate<&PHG4Hit::get_x>(g4hits, r_cluster);
293 const auto y_truth = QAG4Util::interpolate<&PHG4Hit::get_y>(g4hits, r_cluster);
294 const auto z_truth = QAG4Util::interpolate<&PHG4Hit::get_z>(g4hits, r_cluster);
295 const auto phi_truth = std::atan2(y_truth, x_truth);
298 const auto dz = z_cluster - z_truth;
302 const auto hiter = histograms.find(
layer);
303 if (hiter == histograms.end())
continue;
306 auto fill = [](TH1*
h,
float value) {
if( h ) h->Fill(
value ); };
307 fill(hiter->second.drphi, r_cluster * dphi);
308 fill(hiter->second.rphi_error, r_cluster * phi_error);
309 fill(hiter->second.phi_pulls, dphi / phi_error);
312 fill(hiter->second.dz,
dz);
313 fill(hiter->second.z_error, z_error);
314 fill(hiter->second.z_pulls,
dz / z_error);
319 fill(hiter->second.csize, std::distance(hit_range.first, hit_range.second));
323 for (
auto hit_iter = hit_range.first; hit_iter != hit_range.second; ++hit_iter)
325 const auto& hit_key = hit_iter->second;
330 fill(hiter->second.csize_phi, phibins.size());
331 fill(hiter->second.csize_z, zbins.size());
344 for (
auto iter = range.first; iter != range.second; ++iter)
347 const auto& hit_key = iter->second;
354 for (
auto truth_iter = g4hit_map.begin(); truth_iter != g4hit_map.end(); ++truth_iter)
357 const auto g4hit_key = truth_iter->second.second;
363 if (g4hit) out.insert(g4hit);