35 if (!event.
exists(inputCol_, inputPassName_)) {
36 ldmx_log(info) <<
"No cluster collection " << inputCol_ <<
"_"
37 << inputPassName_ <<
" found. Skipping analysis of event";
48 int nClusters = clusters.size();
50 for (
auto cluster : clusters) {
52 int nHits = cluster.getNHits();
60 float PE = cluster.getPE();
62 hPEinClusters[seed]->Fill(PE);
75 hDeltaCentroids->Fill(
76 fabs(clusters[idx].getCentroid() - clusters[idx - 1].getCentroid()));
78 clusters[idx - 1].getSeed(),
79 fabs(clusters[idx].getCentroid() - clusters[idx - 1].getCentroid()));
93 hN3N2->Fill(n2hit, n3hit);
94 hN3N1->Fill(n1hit, n3hit);
95 hN2N1->Fill(n1hit, n2hit);
97 hNClusters->Fill(nClusters);
99 hNHits->Fill(3 * n3hit + 2 * n2hit + n1hit);
104void TestBeamClusterAnalyzer::onProcessStart() {
105 std::cout <<
"\n\n Process starts! My analyzer should do something -- like "
112 int nPEbins = 0.25 * PEmax;
117 for (
int iB = 0; iB < nChannels; iB++) {
118 hPEinHits[iB] =
new TH1F(Form(
"hPE_chan%i", iB), Form(
";PE, chan%i", iB),
120 hPEinClusters[iB] =
new TH1F(Form(
"hPEinClusters_chan%i", iB),
121 Form(
";PE, chan%i", iB), nPEbins, 0, PEmax);
125 new TH2F(
"hDeltaVsSeed",
";BarID_{seed};#Delta_{centroid}", nChannels + 1,
126 -0.5, nChannels - 0.5, 5 * nChannels, 0, nChannels);
128 hDeltaCentroids =
new TH1F(
"hDeltaCentroids",
";#Delta_{centroid}",
129 5 * nChannels, -0.5, nChannels - 0.5);
131 hNHits =
new TH1F(
"hNHits",
"Number of hits in the event; N_{hits}; Events",
133 hNClusters =
new TH1F(
"hNClusters",
134 "Number of clusters in the event; N_{clusters}; Events",
147 "hN3N2",
"Number of 3-hit vs 2-hit clusters; N_{2-hit};N_{3-hit}; Events",
148 nCl, -0.5, nCl - 0.5, nCl, -0.5, nCl - 0.5);
150 "hN3N1",
"Number of 3-hit vs 1-hit clusters; N_{1-hit};N_{3-hit}; Events",
151 nCl, -0.5, nCl - 0.5, nCl, -0.5, nCl - 0.5);
153 "hN2N1",
"Number of 2-hit vs 1-hit clusters; N_{1-hit};N_{2-hit}; Events",
154 nCl, -0.5, nCl - 0.5, nCl, -0.5, nCl - 0.5);
bool exists(const std::string &name, const std::string &passName="", bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.