15 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
40 std::vector<MonitorElement *> hcalMEs;
42 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
43 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
45 edm::LogInfo(
"HitsValidationHcal") <<
"fullPath: " << fullPathHLTFolders[
i];
48 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
49 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
51 edm::LogInfo(
"HitsValidationHcal") <<
"fullSub: " << fullSubPathHLTFolders[
j];
53 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
56 edm::LogInfo(
"HitsValidationHcal") <<
"hltMES size : " << hcalMEs.size();
70 MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()];
74 char name[40], name1[40],
name2[40], name3[40], name4[40];
78 Time_weighteden[
k] =
nullptr;
79 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
80 sprintf(name1,
"Energy_%s", detdivision[
k].c_str());
81 sprintf(
name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
82 if (strcmp(hcalMEs[ih]->
getName().c_str(), name1) == 0) {
85 if (strcmp(hcalMEs[ih]->
getName().c_str(),
name2) == 0) {
86 Time_weighteden[
k] = hcalMEs[ih];
92 for (
unsigned int j = 0;
j < divisions.size();
j++) {
93 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
94 sprintf(
name,
"HcalHitE%s%s",
time[
i].c_str(), divisions[
j].c_str());
95 if (strcmp(hcalMEs[ih]->
getName().c_str(),
name) == 0) {
96 Occupancy_map[
i][
j] = hcalMEs[ih];
102 for (
unsigned int k = 0;
k < divisions.size();
k++) {
103 HitEnergyvsieta[
k] =
nullptr;
104 HitTimevsieta[
k] =
nullptr;
105 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
106 sprintf(name3,
"HcalHitEta%s", divisions[
k].c_str());
107 sprintf(name4,
"HcalHitTimeAEta%s", divisions[
k].c_str());
108 if (strcmp(hcalMEs[ih]->
getName().c_str(), name3) == 0) {
109 HitEnergyvsieta[
k] = hcalMEs[ih];
111 if (strcmp(hcalMEs[ih]->
getName().c_str(), name4) == 0) {
112 HitTimevsieta[
k] = hcalMEs[ih];
125 float hitenergy[divisions.size()], hittime[divisions.size()];
128 for (
int dettype = 0; dettype <
nType1; dettype++) {
129 int nx1 =
Energy[dettype]->getNbinsX();
130 for (
int i = 0;
i <= nx1;
i++) {
131 en[dettype] =
Energy[dettype]->getBinContent(
i) / fev;
132 Energy[dettype]->setBinContent(
i, en[dettype]);
134 int nx2 = Time_weighteden[dettype]->
getNbinsX();
135 for (
int i = 0;
i <= nx2;
i++) {
141 for (
unsigned int dettype = 0; dettype < divisions.size(); dettype++) {
142 int nx1 = HitEnergyvsieta[dettype]->
getNbinsX();
143 for (
int i = 0;
i <= nx1;
i++) {
144 hitenergy[dettype] = HitEnergyvsieta[dettype]->
getBinContent(
i) / fev;
147 int nx2 = HitTimevsieta[dettype]->
getNbinsX();
148 for (
int i = 0;
i <= nx2;
i++) {
149 hittime[dettype] = HitTimevsieta[dettype]->
getBinContent(
i) / fev;
154 for (
int itime = 0; itime <
nTime; itime++) {
155 for (
unsigned int det = 0; det < divisions.size(); det++) {
156 int ny = Occupancy_map[itime][det]->
getNbinsY();
157 int nx = Occupancy_map[itime][det]->
getNbinsX();
158 for (
int i = 1;
i < nx + 1;
i++) {
159 for (
int j = 1;
j < ny + 1;
j++) {
180 std::vector<std::string> divisions;
185 sprintf(name1,
"HC%d",
depth);
190 sprintf(name1,
"HB%d",
depth);
195 sprintf(name1,
"HE%d+z",
depth);
197 sprintf(name1,
"HE%d-z",
depth);
203 sprintf(name1,
"HO%d",
depth);
208 for (
int k = 0;
k < 4; ++
k) {
210 sprintf(name1,
"HF%s%d+z", hfty1[
k].c_str(),
depth);
212 sprintf(name1,
"HF%s%d-z", hfty1[
k].c_str(),
depth);