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)
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
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]);
T getUntrackedParameter(std::string const &, T const &) const
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
void analyze(const edm::Event &, const edm::EventSetup &) override
ESOccupancyTask(const edm::ParameterSet &ps)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
Log< level::Warning, false > LogWarning
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)