8 #include <qautils/QAHistManagerDef.h>
22 #include <qautils/QAHistManagerDef.h>
23 #include <qautils/QAUtil.h>
50 findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode,
"CYLINDERCELLGEOM_SVTX");
53 std::cout <<
PHWHERE <<
" unable to find DST node CYLINDERCELLGEOM_SVTX" << std::endl;
57 std::vector<int> region_layer_low = {7, 23, 39};
58 std::vector<int> region_layer_high = {22, 38, 54};
61 const auto range = geomContainer->get_begin_end();
62 for (
auto iter = range.first; iter != range.second; ++iter)
66 for (
int region = 0; region < 3; ++region)
68 if (iter->first >= region_layer_low[region] && iter->first <= region_layer_high[region])
81 auto clusterContainer = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
82 if (!clusterContainer)
84 std::cout <<
PHWHERE <<
"No cluster container, bailing" << std::endl;
88 auto tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
91 std::cout <<
PHWHERE <<
"No acts geometry on node tree, bailing" << std::endl;
98 TH2 *h_totalclusters =
dynamic_cast<TH2 *
>(hm->getHisto(Form(
"%stotal_clusters",
getHistoPrefix().c_str())));
99 TH2 *h_clusterssector =
dynamic_cast<TH2 *
>(hm->getHisto(Form(
"%sncluspersector",
getHistoPrefix().c_str())));
103 TH1 *crphisize =
nullptr;
104 TH1 *czsize =
nullptr;
105 TH1 *crphierr =
nullptr;
106 TH1 *czerr =
nullptr;
107 TH1 *cedge =
nullptr;
108 TH1 *coverlap =
nullptr;
111 int hitsetkeynum = 0;
112 using HistoMap = std::map<int, HistoList>;
115 for (
auto ®ion : {0, 1, 2})
118 hist.crphisize =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%sphisize_%i",
getHistoPrefix().c_str(), region)));
119 hist.czsize =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%szsize_%i",
getHistoPrefix().c_str(), region)));
120 hist.crphierr =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%srphi_error_%i",
getHistoPrefix().c_str(), region)));
121 hist.czerr =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%sz_error_%i",
getHistoPrefix().c_str(), region)));
122 hist.cedge =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%sclusedge_%i",
getHistoPrefix().c_str(), region)));
123 hist.coverlap =
dynamic_cast<TH1 *
>(hm->getHisto(Form(
"%sclusoverlap_%i",
getHistoPrefix().c_str(), region)));
125 histos.insert(std::make_pair(region, hist));
127 auto fill = [](TH1 *
h,
float val)
128 {
if (h) h->Fill(val); };
130 float nclusperevent[24] = {0};
135 auto range = clusterContainer->getClusters(hsk);
138 if (side > 0) sector += 12;
139 for (
auto iter = range.first; iter != range.second; ++iter)
141 const auto cluskey = iter->first;
142 const auto cluster = iter->second;
144 int region =
it->second;
145 const auto hiter = histos.find(region);
146 if (hiter == histos.end())
151 fill(hiter->second.crphisize, cluster->getPhiSize());
152 fill(hiter->second.czsize, cluster->getZSize());
153 fill(hiter->second.crphierr, cluster->getRPhiError());
154 fill(hiter->second.czerr, cluster->getZError());
155 fill(hiter->second.cedge, cluster->getEdge());
156 fill(hiter->second.coverlap, cluster->getOverlap());
161 nclusperevent[sector] += numclusters;
162 h_totalclusters->Fill(hitsetkeynum, numclusters);
166 for (
int i = 0;
i < 24;
i++)
168 h_clusterssector->Fill(
i, nclusperevent[
i]);
179 TH2 *h_totalclusters =
dynamic_cast<TH2 *
>(hm->getHisto(Form(
"%snclusperrun",
getHistoPrefix().c_str())));
199 "TPC Clusters per event per run number", 10000, 23000, 33000, 1000, 0, 1000);
200 h->GetXaxis()->SetTitle(
"Run number");
201 h->GetYaxis()->SetTitle(
"Clusters per event");
202 hm->registerHisto(
h);
206 "TPC Clusters per event per sector", 24, 0, 24, 1000, 0, 1000);
207 h->GetXaxis()->SetTitle(
"Sector number");
208 h->GetYaxis()->SetTitle(
"Clusters per event");
209 hm->registerHisto(
h);
211 for (
auto ®ion : {0, 1, 2})
214 auto h =
new TH1F(Form(
"%sphisize_%i",
getHistoPrefix().c_str(), region),
215 Form(
"TPC cluster #phi size region_%i", region), 10, 0, 10);
216 h->GetXaxis()->SetTitle(
"Cluster #phi_{size}");
217 hm->registerHisto(
h);
220 auto h =
new TH1F(Form(
"%szsize_%i",
getHistoPrefix().c_str(), region),
221 Form(
"TPC cluster z size region_%i", region), 10, 0, 10);
222 h->GetXaxis()->SetTitle(
"Cluster z_{size}");
223 hm->registerHisto(
h);
226 auto h =
new TH1F(Form(
"%srphi_error_%i",
getHistoPrefix().c_str(), region),
227 Form(
"TPC r#Delta#phi error region_%i", region), 100, 0, 0.075);
228 h->GetXaxis()->SetTitle(
"r#Delta#phi error [cm]");
229 hm->registerHisto(
h);
232 auto h =
new TH1F(Form(
"%sz_error_%i",
getHistoPrefix().c_str(), region),
233 Form(
"TPC z error region_%i", region), 100, 0, 0.18);
234 h->GetXaxis()->SetTitle(
"z error [cm]");
235 hm->registerHisto(
h);
238 auto h =
new TH1F(Form(
"%sclusedge_%i",
getHistoPrefix().c_str(), region),
239 Form(
"TPC hits on edge_%i", region), 30, 0, 30);
240 h->GetXaxis()->SetTitle(
"Cluster edge");
241 hm->registerHisto(
h);
244 auto h =
new TH1F(Form(
"%sclusoverlap_%i",
getHistoPrefix().c_str(), region),
245 Form(
"TPC clus overlap_%i", region), 30, 0, 30);
246 h->GetXaxis()->SetTitle(
"Cluster overlap");
247 hm->registerHisto(
h);
253 "TPC clusters per hitsetkey", 1152, 0, 1152, 10000, 0, 10000);
254 h->GetXaxis()->SetTitle(
"Hitsetkey number");
255 h->GetYaxis()->SetTitle(
"Number of clusters");
256 hm->registerHisto(
h);