42 int simHitsEndjob(
const std::vector<MonitorElement *> &hcalMEs);
46 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
47 nTimes_(iConfig.getParameter<
int>(
"TimeSlices")),
48 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {}
72 std::vector<MonitorElement *> hgcalMEs;
73 std::vector<std::string> fullDirPath = ig.
getSubdirs();
75 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
79 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
81 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
86 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
89 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
98 std::vector<MonitorElement *> energy_[6];
99 std::vector<MonitorElement *> EtaPhi_Plus_, EtaPhi_Minus_;
100 std::vector<MonitorElement *> HitOccupancy_Plus_, HitOccupancy_Minus_;
103 std::ostringstream
name;
106 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++) {
107 for (
int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
110 name <<
"energy_time_" << itimeslice <<
"_layer_" << ilayer;
111 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
112 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
113 energy_[itimeslice].push_back(hgcalMEs[ih]);
117 nevent = energy_[itimeslice].at(ilayer)->getEntries();
118 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
119 for (
int i = 1;
i <= nbinsx;
i++) {
120 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i) /
nevent;
121 energy_[itimeslice].at(ilayer)->setBinContent(
i, binValue);
127 name <<
"EtaPhi_Plus_"
128 <<
"layer_" << ilayer;
129 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
130 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
131 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
136 name <<
"EtaPhi_Minus_"
137 <<
"layer_" << ilayer;
138 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
139 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
140 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
144 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
145 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
146 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
147 for (
int i = 1;
i <= nbinsx; ++
i) {
148 for (
int j = 1;
j <= nbinsy; ++
j) {
149 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
150 EtaPhi_Plus_.at(ilayer)->setBinContent(
i,
j, binValue);
154 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
155 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
156 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
157 for (
int i = 1;
i <= nbinsx; ++
i) {
158 for (
int j = 1;
j <= nbinsy; ++
j) {
159 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
160 EtaPhi_Minus_.at(ilayer)->setBinContent(
i,
j, binValue);
166 name <<
"HitOccupancy_Plus_layer_" << ilayer;
167 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
168 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
169 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
173 name <<
"HitOccupancy_Minus_layer_" << ilayer;
174 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
175 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
176 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
180 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
181 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
182 for (
int i = 1;
i <= nbinsx; ++
i) {
183 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
184 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
187 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
188 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
189 for (
int i = 1;
i <= nbinsx; ++
i) {
190 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
191 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
197 name <<
"MeanHitOccupancy_Plus";
198 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
199 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
200 MeanHitOccupancy_Plus_ = hgcalMEs[ih];
201 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
202 double meanVal = HitOccupancy_Plus_.at(ilayer)->
getMean();
210 name <<
"MeanHitOccupancy_Minus";
211 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
212 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
213 MeanHitOccupancy_Minus_ = hgcalMEs[ih];
214 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
215 double meanVal = HitOccupancy_Minus_.at(ilayer)->
getMean();