31 for (
int i = 0;
i < 2; ++
i)
32 for (
int j = 0;
j < 2; ++
j) {
33 hRecOCC_[
i][
j] =
nullptr;
34 hRecNHit_[
i][
j] =
nullptr;
35 hEng_[
i][
j] =
nullptr;
36 hEvEng_[
i][
j] =
nullptr;
37 hEnDensity_[
i][
i] =
nullptr;
38 hGoodRecNHit_[
i][
j] =
nullptr;
40 hSelEng_[
i][
j] =
nullptr;
41 hSelOCC_[
i][
j] =
nullptr;
42 hSelEnDensity_[
i][
j] =
nullptr;
45 for (
int i = 0;
i < 2; ++
i)
50 iBooker.setCurrentFolder(prefixME_ +
"/ESOccupancyTask");
55 for (
int i = 0;
i < 2; ++
i)
56 for (
int j = 0;
j < 2; ++
j) {
57 int iz = (
i == 0) ? 1 : -1;
58 sprintf(
histo,
"ES RecHit 2D Occupancy Z %d P %d", iz,
j + 1);
59 hRecOCC_[
i][
j] = iBooker.book2D(
histo,
histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
60 hRecOCC_[
i][
j]->setAxisTitle(
"Si X", 1);
61 hRecOCC_[
i][
j]->setAxisTitle(
"Si Y", 2);
64 sprintf(
histo,
"ES Energy Density Z %d P %d", iz,
j + 1);
65 hEnDensity_[
i][
j] = iBooker.book2D(
histo,
histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
66 hEnDensity_[
i][
j]->setAxisTitle(
"Si X", 1);
67 hEnDensity_[
i][
j]->setAxisTitle(
"Si Y", 2);
69 sprintf(
histo,
"ES Num of RecHits Z %d P %d", iz,
j + 1);
70 hRecNHit_[
i][
j] = iBooker.book1DD(
histo,
histo, 60, 0, 1920);
71 hRecNHit_[
i][
j]->setAxisTitle(
"# of RecHits", 1);
72 hRecNHit_[
i][
j]->setAxisTitle(
"Num of Events", 2);
74 sprintf(
histo,
"ES Num of Good RecHits Z %d P %d", iz,
j + 1);
75 hGoodRecNHit_[
i][
j] = iBooker.book1DD(
histo,
histo, 60, 0, 1920);
76 hGoodRecNHit_[
i][
j]->setAxisTitle(
"# of good RecHits", 1);
77 hGoodRecNHit_[
i][
j]->setAxisTitle(
"Num of Events", 2);
79 sprintf(
histo,
"ES RecHit Energy Z %d P %d", iz,
j + 1);
80 hEng_[
i][
j] = iBooker.book1DD(
histo,
histo, 50, 0, 0.001);
81 hEng_[
i][
j]->setAxisTitle(
"RecHit Energy", 1);
82 hEng_[
i][
j]->setAxisTitle(
"Num of ReHits", 2);
84 sprintf(
histo,
"ES Event Energy Z %d P %d", iz,
j + 1);
85 hEvEng_[
i][
j] = iBooker.book1DD(
histo,
histo, 50, 0, 0.1);
86 hEvEng_[
i][
j]->setAxisTitle(
"Event Energy", 1);
87 hEvEng_[
i][
j]->setAxisTitle(
"Num of Events", 2);
90 sprintf(
histo,
"ES RecHit Energy with selected hits Z %d P %d", iz,
j + 1);
91 hSelEng_[
i][
j] = iBooker.book1DD(
histo,
histo, 50, 0, 0.001);
92 hSelEng_[
i][
j]->setAxisTitle(
"RecHit Energy", 1);
93 hSelEng_[
i][
j]->setAxisTitle(
"Num of ReHits", 2);
95 sprintf(
histo,
"ES Occupancy with selected hits Z %d P %d", iz,
j + 1);
96 hSelOCC_[
i][
j] = iBooker.book2D(
histo,
histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
97 hSelOCC_[
i][
j]->setAxisTitle(
"Si X", 1);
98 hSelOCC_[
i][
j]->setAxisTitle(
"Si Y", 2);
100 sprintf(
histo,
"ES Energy Density with selected hits Z %d P %d", iz,
j + 1);
101 hSelEnDensity_[
i][
j] = iBooker.book2D(
histo,
histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
102 hSelEnDensity_[
i][
j]->setAxisTitle(
"Si X", 1);
103 hSelEnDensity_[
i][
j]->setAxisTitle(
"Si Y", 2);
106 hE1E2_[0] = iBooker.book2D(
"ES+ EP1 vs EP2",
"ES+ EP1 vs EP2", 50, 0, 0.1, 50, 0, 0.1);
107 hE1E2_[1] = iBooker.book2D(
"ES- EP1 vs EP2",
"ES- EP1 vs EP2", 50, 0, 0.1, 50, 0, 0.1);
111 runNum_ =
e.id().run();
115 int zside, plane, ix, iy;
116 int sum_RecHits[2][2], sum_GoodRecHits[2][2];
117 float sum_Energy[2][2];
119 for (
int i = 0;
i < 2; ++
i)
120 for (
int j = 0;
j < 2; ++
j) {
121 sum_RecHits[
i][
j] = 0;
122 sum_GoodRecHits[
i][
j] = 0;
123 sum_Energy[
i][
j] = 0;
127 if (
e.getByToken(rechittoken_, ESRecHit)) {
136 int i = (
zside == 1) ? 0 : 1;
140 sum_Energy[
i][
j] += hitItr->energy();
141 hRecOCC_[
i][
j]->Fill(ix, iy);
142 if (hitItr->energy() != 0) {
143 hEng_[
i][
j]->Fill(hitItr->energy());
144 hEnDensity_[
i][
j]->Fill(ix, iy, hitItr->energy());
146 if (hitItr->recoFlag() == 14 || hitItr->recoFlag() == 1 ||
147 (hitItr->recoFlag() <= 10 && hitItr->recoFlag() >= 5))
149 sum_GoodRecHits[
i][
j]++;
150 hSelEng_[
i][
j]->Fill(hitItr->energy());
151 hSelEnDensity_[
i][
j]->Fill(ix, iy, hitItr->energy());
152 hSelOCC_[
i][
j]->Fill(ix, iy);
156 LogWarning(
"ESOccupancyTask") <<
"RecHitCollection not available";
160 for (
int i = 0;
i < 2; ++
i)
161 for (
int j = 0;
j < 2; ++
j) {
162 hRecNHit_[
i][
j]->Fill(sum_RecHits[
i][
j]);
163 hGoodRecNHit_[
i][
j]->Fill(sum_GoodRecHits[
i][
j]);
164 hEvEng_[
i][
j]->Fill(sum_Energy[
i][
j]);
167 hRecOCC_[
i][
j]->setBinContent(40, 40, eCount_);
168 hEnDensity_[
i][
j]->setBinContent(40, 40, eCount_);
170 hSelOCC_[
i][
j]->setBinContent(40, 40, eCount_);
171 hSelEnDensity_[
i][
j]->setBinContent(40, 40, eCount_);
174 hE1E2_[0]->Fill(sum_Energy[0][0], sum_Energy[0][1]);
175 hE1E2_[1]->Fill(sum_Energy[1][0], sum_Energy[1][1]);