35 int digisEndjob(
const std::vector<MonitorElement *> &hcalMEs);
39 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
40 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {}
62 std::vector<MonitorElement *> hgcalMEs;
63 std::vector<std::string> fullDirPath = ig.
getSubdirs();
65 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
69 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
71 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
75 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
78 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
87 std::vector<MonitorElement *> charge_;
88 std::vector<MonitorElement *> DigiOccupancy_XY_;
89 std::vector<MonitorElement *> ADC_;
90 std::vector<MonitorElement *> DigiOccupancy_Plus_;
91 std::vector<MonitorElement *> DigiOccupancy_Minus_;
92 std::vector<MonitorElement *> MeanDigiOccupancy_Plus_;
93 std::vector<MonitorElement *> MeanDigiOccupancy_Minus_;
94 std::ostringstream
name;
98 for (
int ilayer = 0; ilayer <
layers_; ilayer++) {
101 name <<
"charge_layer_" << ilayer;
102 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
103 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
104 charge_.push_back(hgcalMEs[ih]);
107 nevent = charge_.at(ilayer)->getEntries();
108 nbinsx = charge_.at(ilayer)->getNbinsX();
109 for (
int i = 1;
i <= nbinsx;
i++) {
110 double binValue = charge_.at(ilayer)->getBinContent(
i) /
nevent;
111 charge_.at(ilayer)->setBinContent(
i, binValue);
116 name <<
"DigiOccupancy_XY_"
117 <<
"layer_" << ilayer;
118 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
119 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
120 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
124 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
125 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
126 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
127 for (
int i = 1;
i <= nbinsx; ++
i) {
128 for (
int j = 1;
j <= nbinsy; ++
j) {
129 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i,
j) /
nevent;
130 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i,
j, binValue);
136 name <<
"ADC_layer_" << ilayer;
137 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
138 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
139 ADC_.push_back(hgcalMEs[ih]);
143 nevent = ADC_.at(ilayer)->getEntries();
144 nbinsx = ADC_.at(ilayer)->getNbinsX();
145 for (
int i = 1;
i <= nbinsx; ++
i) {
146 double binValue = ADC_.at(ilayer)->getBinContent(
i) /
nevent;
147 ADC_.at(ilayer)->setBinContent(
i, binValue);
152 name <<
"DigiOccupancy_Plus_layer_" << ilayer;
153 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
154 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
155 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
160 name <<
"DigiOccupancy_Minus_layer_" << ilayer;
161 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
162 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
163 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
168 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
169 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
170 for (
int i = 1;
i <= nbinsx; ++
i) {
171 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
172 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
175 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
176 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
177 for (
int i = 1;
i <= nbinsx; ++
i) {
178 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
179 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
185 name <<
"SUMOfDigiOccupancy_Plus";
186 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
187 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
188 MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
189 unsigned indx = MeanDigiOccupancy_Plus_.size() - 1;
190 for (
int ilayer = 0; ilayer < (
int)
layers_; ++ilayer) {
191 double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
192 MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
199 name <<
"SUMOfDigiOccupancy_Plus";
200 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
201 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
202 MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
203 unsigned indx = MeanDigiOccupancy_Minus_.size() - 1;
204 for (
int ilayer = 0; ilayer < (
int)
layers_; ++ilayer) {
205 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
206 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer + 1, meanVal);