35 int evNb =
event.getEventNumber();
41 bool existsIntermediatePE =
false;
43 for (
auto chan : channels) {
45 float PE = chan.getPE();
48 hEvDisp->Fill(evNb, bar, PE);
55 }
else if (PE > peSublead) {
61 if (chan.getQualityFlag() == 0 && bar < 12 && 15 < PE && PE < 40)
62 existsIntermediatePE =
true;
65 if (existsIntermediatePE && fillNb < nEv) {
66 for (
auto chan : channels) {
67 int bar = chan.getBarID();
69 float PE = chan.getPE();
70 hEvDispPE->Fill(fillNb, bar, PE);
76 if (subleadBar == -1) {
80 hPEVsDelta[leadBar]->Fill(leadBar - subleadBar, peLead);
81 hDeltaPEVsDelta[leadBar]->Fill(leadBar - subleadBar, peLead - peSublead);
87 hPEmaxVsDelta->Fill(leadBar - subleadBar, peLead);
92void TestBeamHitAnalyzer::onProcessStart() {
93 std::cout <<
"\n\n Process starts! My analyzer should do something -- like "
101 int nPEbins = 2 * PEmax;
106 for (
int iB = 0; iB < nChannels; iB++) {
107 hPE[iB] =
new TH1F(Form(
"hPE_chan%i", iB), Form(
";PE, chan%i", iB), nPEbins,
109 hPEinClusters[iB] =
new TH1F(Form(
"hPEinClusters_chan%i", iB),
110 Form(
";PE, chan%i", iB), nPEbins, 0, PEmax);
111 hPEVsDelta[iB] =
new TH2F(Form(
"hPEVsDelta_chan%i", iB),
112 Form(
";#Delta_{barID};PE, chan%i has max PE", iB),
113 nChannels + 1, -nChannels / 2 - 0.5,
114 nChannels / 2 + 0.5, nPEbins, 0, PEmax);
115 hDeltaPEVsDelta[iB] =
new TH2F(
116 Form(
"hDeltaPEVsDelta_chan%i", iB),
117 Form(
";#Delta_{barID};#Delta_PE, chan%i has max PE", iB), nChannels + 1,
118 -nChannels / 2 - 0.5, nChannels / 2 + 0.5, nPEbins, 0, PEmax);
123 for (
int iE = 0; iE < nEv; iE++) {
124 for (
int iB = 0; iB < nChannels; iB++) {
126 new TH1F(Form(
"hCharge_chan%i_nv%i", iB, iE),
127 Form(
";time sample; Q, chan %i, ev %i [fC]", iB, iE),
128 nTimeSamp, -0.5, nTimeSamp - 0.5);
133 new TH2F(
"hPEmaxVsDelta",
";#Delta_{barID};PE, max hit", nChannels,
134 -nChannels / 2, nChannels / 2, nPEbins, 0, PEmax);
135 hEvDisp =
new TH2F(Form(
"hEvDisp_ev%i", nEv),
";Event number; Bar ID; PE",
136 nEv, 0.5, nEv + 0.5, nChannels, -0.5, nChannels - 0.5);
137 hEvDispPE =
new TH2F(
"hEvDispPEcut",
";Event number; Bar ID; PE", nEv, 0.5,
138 nEv + 0.5, nChannels, -0.5, nChannels - 0.5);