41 #define LogDebug(exp) std::cout<<"DEBUG: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
42 #define LogError(exp) std::cout<<"ERROR: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
43 #define LogWarning(exp) std::cout<<"WARNING: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
52 m_lout_clusterQA(nullptr),
53 m_lout_tracking(nullptr),
64 for (
int il = 0; il <
NLAYER; il++)
98 int chipColor[] = {kBlue, kRed, kGreen+2, kMagenta+2};
106 h1d_nevents =
new TH1D(
"h1d_nevents",
";;Nevts", 6, -.5, 5.5);
108 "# hits/layer;layer;Counts", 6, -.5, 5.5);
110 "# clusters/layer;layer;Counts", 6, -.5, 5.5);
112 "cluster map;cluster_map;Counts", 16, -.5, 15.5);
118 for (
int il = 0; il <
NLAYER; il++)
120 h2f_hit_map[il] =
new TH2F(Form(
"h2d_hit_map_l%i", il),
121 ";col [px];row [px]",
125 h2f_clu_xz[il] =
new TH2F(Form(
"h2d_clu_xz_l%i", il),
131 ";#DeltaZ (cm);Counts/30 #mum",
137 ";#DeltaX (cm);Counts/30 #mum",
142 h1d_clu_size[il] =
new TH1D(Form(
"h1d_clu_size_l%i", il),
143 ";cluster size [px];Counts", 100, -.5, 99.5);
146 ";cluster size phi [px];Counts", 100, -.5, 99.5);
149 ";cluster size z [px];Counts", 100, -.5, 99.5);
167 htrk =
new TH1D(
"htrk",
";trks / event", 16, -0.5, 15.5);
168 htrk_clus =
new TH1D(
"htrk_clus",
";#cluster/track;Counts", 10, -.5, 9.5);
169 htrk_cut =
new TH1D(
"htrk_cut",
";trks / event", 16, -0.5, 15.5);
170 htrk_cut_clus =
new TH1D(
"htrk_cut_clus",
";#cluster/track;Counts", 5, -.5, 4.5);
176 for (
int il = 0; il < 4; il++)
178 htrk_dx[il] =
new TH1D(Form(
"htrk_dx_l%i", il),
182 htrk_dz[il] =
new TH1D(Form(
"htrk_dz_l%i", il),
186 htrk_cut_dx[il] =
new TH1D(Form(
"htrk_cut_dx_l%i", il),
187 ";track dx [pixels]",
190 htrk_cut_dz[il] =
new TH1D(Form(
"htrk_cut_dz_l%i", il),
201 ";track chi2/ndf in x vs y",
205 ";track chi2/ndf in z vs y",
209 ";track chi2/ndf in x vs y",
213 ";track chi2/ndf in z vs y",
242 std::cout <<
"AnaMvtxTestBeam2019::process_event()" << std::endl;
258 unsigned int n_hits = 0;
260 for (
auto hitsetitr = hitsetrange.first;
261 hitsetitr != hitsetrange.second;
264 auto hitset = hitsetitr->second;
271 std::cout <<
"layer: " <<
layer <<
" stave: " \
272 << stave <<
" chip: " << chip << std::endl;
278 auto hitrangei = hitset->getHits();
279 for (
auto hitr = hitrangei.first;
280 hitr != hitrangei.second;
294 std::cout << __PRETTY_FUNCTION__ \
296 <<
" > Nhits " << n_hits << std::endl;
303 std::cout <<
"-- Looping over clusters." << std::endl;
308 int n_clu_per_layer[
NLAYER] = {0};
309 float mean_clu_x[
NLAYER] = {0.};
310 float mean_clu_z[
NLAYER] = {0.};
314 for (
auto iter_clus = clus_range.first;
315 iter_clus != clus_range.second;
318 auto clus = iter_clus->second;
319 auto ckey = clus->getClusKey();
324 if ((lyr < 0) || (lyr > 3))
continue;
330 h2f_clu_xz[lyr]->Fill(clus->getZ(), clus->getX());
332 n_clu_per_layer[lyr]++;
333 mean_clu_z[lyr] += clus->getZ();
334 mean_clu_x[lyr] += clus->getX();
337 m_LyrClusMap.insert(std::make_pair(lyr, clus));
342 for (
int ilyr = 0; ilyr <
NLAYER; ++ilyr)
344 if (n_clu_per_layer[ilyr] > 0)
346 mean_clu_z[ilyr] /= (float)n_clu_per_layer[ilyr];
347 mean_clu_x[ilyr] /= (float)n_clu_per_layer[ilyr];
350 h1d_clu_mean_dx[ilyr]->Fill(mean_clu_x[ilyr] - mean_clu_x[m_ref_align_stave]);
351 clu_map |= ( 1 << ilyr );
358 std::cout <<
"-- evnt: " <<
m_ievent << std::endl;
359 std::cout <<
"-- Nhits: " << n_hits << std::endl;
360 std::cout <<
"-- Nclus: " << n_clus << std::endl;
361 std::cout <<
"-- m_LyrClusMap.size(): " << m_LyrClusMap.size() << std::endl;
374 std::vector<unsigned int> use_layers;
375 use_layers.push_back(3);
376 use_layers.push_back(2);
377 use_layers.push_back(0);
378 use_layers.push_back(1);
382 htrk->Fill(tracklist.size());
385 for (
unsigned int i = 0;
i < tracklist.size();
i++)
387 htrk_clus->Fill(tracklist.at(
i).ClusterList.size());
391 if (tracklist.at(
i).chi2_xy < 5 && tracklist.at(
i).chi2_zy < 5)
399 for (
unsigned int j = 0;
j < tracklist.at(
i).ClusterList.size();
j++)
401 auto ckey = tracklist.at(
i).ClusterList.at(
j)->getClusKey();
404 if ((lyr < 0) || (lyr >= 4))
406 std::cout <<
PHWHERE <<
" WARNING: bad layer from track cluster. lyr:" << lyr << std::endl;
410 htrk_dx[lyr]->Fill(tracklist.at(
i).dx.at(
j));
411 htrk_dz[lyr]->Fill(tracklist.at(
i).dz.at(
j));
413 if (tracklist.at(
i).chi2_xy < 5 && tracklist.at(
i).chi2_zy < 5)
459 m_hits = findNode::getClass<TrkrHitSetContainerv1>(topNode,
"TRKR_HITSET");
462 std::cout <<
PHWHERE <<
" HITSETS node was not found on node tree" << std::endl;
466 m_clusters = findNode::getClass<TrkrClusterContainerv1>(topNode,
"TRKR_CLUSTER");
469 std::cout <<
PHWHERE <<
" TRKR_CLUSTER node not found on node tree" << std::endl;
484 return (y1 - y0) / (x1 -
x0);