56 auto geom_container = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_INTT");
59 std::cout <<
PHWHERE <<
" unable to find DST node CYLINDERGEOM_INTT" << std::endl;
64 const auto range = geom_container->get_begin_end();
65 for (
auto iter = range.first; iter != range.second; ++iter)
80 auto h =
new TH1F(Form(
"%sdrphi_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT r#Delta#phi_{cluster-truth} layer_%i",
layer), 100, -1
e-2, 1
e-2);
81 h->GetXaxis()->SetTitle(
"r#Delta#phi_{cluster-truth} (cm)");
87 auto h =
new TH1F(Form(
"%srphi_error_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT r#Delta#phi error layer_%i",
layer), 100, 0, 1
e-2);
88 h->GetXaxis()->SetTitle(
"r#Delta#phi error (cm)");
94 auto h =
new TH1F(Form(
"%sphi_pulls_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT #Delta#phi_{cluster-truth}/#sigma#phi layer_%i",
layer), 100, -3, 3);
95 h->GetXaxis()->SetTitle(
"#Delta#phi_{cluster-truth}/#sigma#phi");
101 auto h =
new TH1F(Form(
"%sdz_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT #Deltaz_{cluster-truth} layer_%i",
layer), 100, -2.5, 2.5);
102 h->GetXaxis()->SetTitle(
"#Deltaz_{cluster-truth} (cm)");
103 hm->registerHisto(
h);
109 h->GetXaxis()->SetTitle(
"z error (cm)");
110 hm->registerHisto(
h);
115 auto h =
new TH1F(Form(
"%sz_pulls_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT #Deltaz_{cluster-truth}/#sigmaz layer_%i",
layer), 100, -3, 3);
116 h->GetXaxis()->SetTitle(
"#Deltaz_{cluster-truth}/#sigmaz");
117 hm->registerHisto(
h);
122 auto h =
new TH1F(Form(
"%sclus_size_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT cluster size layer_%i",
layer), 10, 0, 10);
123 h->GetXaxis()->SetTitle(
"csize");
124 hm->registerHisto(
h);
129 auto h =
new TH1F(Form(
"%sclus_size_phi_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT cluster size (#phi) layer_%i",
layer), 10, 0, 10);
130 h->GetXaxis()->SetTitle(
"csize_{#phi}");
131 hm->registerHisto(
h);
136 auto h =
new TH1F(Form(
"%sclus_size_z_%i",
get_histo_prefix().c_str(),
layer), Form(
"INTT cluster size (z) layer_%i",
layer), 10, 0, 10);
137 h->GetXaxis()->SetTitle(
"csize_{z}");
138 hm->registerHisto(
h);
160 return std::string(
"h_") +
Name() + std::string(
"_");
166 m_surfmaps = findNode::getClass<ActsSurfaceMaps>(topNode,
"ActsSurfaceMaps");
169 std::cout <<
PHWHERE <<
"Error: can't find Acts surface maps"
174 m_tGeometry = findNode::getClass<ActsTrackingGeometry>(topNode,
"ActsTrackingGeometry");
177 std::cout <<
PHWHERE <<
"No acts tracking geometry, exiting."
182 m_hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
185 std::cout <<
PHWHERE <<
" ERROR: Can't find TrkrHitSetContainer." << std::endl;
188 m_cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
191 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_CLUSTER" << std::endl;
195 m_cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
198 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_CLUSTERHITASSOC" << std::endl;
202 m_hit_truth_map = findNode::getClass<TrkrHitTruthAssoc>(topNode,
"TRKR_HITTRUTHASSOC");
205 std::cout <<
PHWHERE <<
" unable to find DST node TRKR_HITTRUTHASSOC" << std::endl;
209 m_g4hits_intt = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_INTT");
212 std::cout <<
PHWHERE <<
" unable to find DST node G4HIT_INTT" << std::endl;
229 TH1* drphi =
nullptr;
230 TH1* rphi_error =
nullptr;
231 TH1* phi_pulls =
nullptr;
234 TH1* z_error =
nullptr;
235 TH1* z_pulls =
nullptr;
237 TH1* csize =
nullptr;
238 TH1* csize_phi =
nullptr;
239 TH1* csize_z =
nullptr;
242 using HistogramMap = std::map<int, HistogramList>;
243 HistogramMap histograms;
249 h.rphi_error =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%srphi_error_%i",
get_histo_prefix().c_str(),
layer)));
250 h.phi_pulls =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sphi_pulls_%i",
get_histo_prefix().c_str(),
layer)));
253 h.z_error =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sz_error_%i",
get_histo_prefix().c_str(),
layer)));
254 h.z_pulls =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sz_pulls_%i",
get_histo_prefix().c_str(),
layer)));
256 h.csize =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_%i",
get_histo_prefix().c_str(),
layer)));
257 h.csize_phi =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_phi_%i",
get_histo_prefix().c_str(),
layer)));
258 h.csize_z =
dynamic_cast<TH1*
>(hm->getHisto(Form(
"%sclus_size_z_%i",
get_histo_prefix().c_str(),
layer)));
260 histograms.insert(std::make_pair(
layer, h));
265 for (
auto hitsetitr = hitsetrange.first;
266 hitsetitr != hitsetrange.second;
270 for (
auto clusterIter = range.first; clusterIter != range.second; ++clusterIter)
273 const auto& key = clusterIter->first;
275 const auto& cluster = clusterIter->second;
282 const auto z_cluster = global(2);
283 const auto phi_cluster = (float) std::atan2(global(1), global(0));
284 const auto phi_error = cluster->getRPhiError() / r_cluster;
285 const auto z_error = cluster->getZError();
291 const auto x_truth = QAG4Util::interpolate<&PHG4Hit::get_x>(g4hits, r_cluster);
292 const auto y_truth = QAG4Util::interpolate<&PHG4Hit::get_y>(g4hits, r_cluster);
293 const auto z_truth = QAG4Util::interpolate<&PHG4Hit::get_z>(g4hits, r_cluster);
294 const auto phi_truth = std::atan2(y_truth, x_truth);
297 const auto dz = z_cluster - z_truth;
301 const auto hiter = histograms.find(
layer);
302 if (hiter == histograms.end())
continue;
305 auto fill = [](TH1*
h,
float value) {
if( h ) h->Fill(
value ); };
306 fill(hiter->second.drphi, r_cluster * dphi);
307 fill(hiter->second.rphi_error, r_cluster * phi_error);
308 fill(hiter->second.phi_pulls, dphi / phi_error);
310 fill(hiter->second.dz,
dz);
311 fill(hiter->second.z_error, z_error);
312 fill(hiter->second.z_pulls,
dz / z_error);
317 fill(hiter->second.csize, std::distance(hit_range.first, hit_range.second));
321 for (
auto hit_iter = hit_range.first; hit_iter != hit_range.second; ++hit_iter)
323 const auto& hit_key = hit_iter->second;
328 fill(hiter->second.csize_phi, phibins.size());
329 fill(hiter->second.csize_z, zbins.size());
343 for (
auto iter = range.first; iter != range.second; ++iter)
346 const auto& hit_key = iter->second;
353 for (
auto truth_iter = g4hit_map.begin(); truth_iter != g4hit_map.end(); ++truth_iter)
356 const auto g4hit_key = truth_iter->second.second;
362 if (g4hit) out.insert(g4hit);