14 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
39 std::vector<MonitorElement *> hcalMEs;
41 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
42 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
44 edm::LogInfo(
"HitsValidationHcal") <<
"fullPath: " << fullPathHLTFolders[
i];
47 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
48 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
50 edm::LogInfo(
"HitsValidationHcal") <<
"fullSub: " << fullSubPathHLTFolders[
j];
52 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
55 edm::LogInfo(
"HitsValidationHcal") <<
"hltMES size : " << hcalMEs.size();
69 MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()];
73 char name[40], name1[40],
name2[40], name3[40], name4[40];
77 Time_weighteden[
k] =
nullptr;
78 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
79 sprintf(name1,
"Energy_%s", detdivision[
k].c_str());
80 sprintf(
name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
81 if (strcmp(hcalMEs[ih]->
getName().c_str(), name1) == 0) {
84 if (strcmp(hcalMEs[ih]->
getName().c_str(),
name2) == 0) {
85 Time_weighteden[
k] = hcalMEs[ih];
91 for (
unsigned int j = 0;
j < divisions.size();
j++) {
92 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
93 sprintf(
name,
"HcalHitE%s%s",
time[
i].c_str(), divisions[
j].c_str());
94 if (strcmp(hcalMEs[ih]->
getName().c_str(),
name) == 0) {
95 Occupancy_map[
i][
j] = hcalMEs[ih];
101 for (
unsigned int k = 0;
k < divisions.size();
k++) {
102 HitEnergyvsieta[
k] =
nullptr;
103 HitTimevsieta[
k] =
nullptr;
104 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
105 sprintf(name3,
"HcalHitEta%s", divisions[
k].c_str());
106 sprintf(name4,
"HcalHitTimeAEta%s", divisions[
k].c_str());
107 if (strcmp(hcalMEs[ih]->
getName().c_str(), name3) == 0) {
108 HitEnergyvsieta[
k] = hcalMEs[ih];
110 if (strcmp(hcalMEs[ih]->
getName().c_str(), name4) == 0) {
111 HitTimevsieta[
k] = hcalMEs[ih];
124 float hitenergy[divisions.size()], hittime[divisions.size()];
127 for (
int dettype = 0; dettype <
nType1; dettype++) {
128 int nx1 =
Energy[dettype]->getNbinsX();
129 for (
int i = 0;
i <= nx1;
i++) {
130 en[dettype] =
Energy[dettype]->getBinContent(
i) / fev;
131 Energy[dettype]->setBinContent(
i, en[dettype]);
133 int nx2 = Time_weighteden[dettype]->
getNbinsX();
134 for (
int i = 0;
i <= nx2;
i++) {
140 for (
unsigned int dettype = 0; dettype < divisions.size(); dettype++) {
141 int nx1 = HitEnergyvsieta[dettype]->
getNbinsX();
142 for (
int i = 0;
i <= nx1;
i++) {
143 hitenergy[dettype] = HitEnergyvsieta[dettype]->
getBinContent(
i) / fev;
146 int nx2 = HitTimevsieta[dettype]->
getNbinsX();
147 for (
int i = 0;
i <= nx2;
i++) {
148 hittime[dettype] = HitTimevsieta[dettype]->
getBinContent(
i) / fev;
153 for (
int itime = 0; itime <
nTime; itime++) {
154 for (
unsigned int det = 0; det < divisions.size(); det++) {
155 int ny = Occupancy_map[itime][det]->
getNbinsY();
156 int nx = Occupancy_map[itime][det]->
getNbinsX();
157 for (
int i = 1;
i < nx + 1;
i++) {
158 for (
int j = 1;
j < ny + 1;
j++) {
179 std::vector<std::string> divisions;
184 sprintf(name1,
"HC%d",
depth);
189 sprintf(name1,
"HB%d",
depth);
194 sprintf(name1,
"HE%d+z",
depth);
196 sprintf(name1,
"HE%d-z",
depth);
202 sprintf(name1,
"HO%d",
depth);
207 for (
int k = 0;
k < 4; ++
k) {
209 sprintf(name1,
"HF%s%d+z", hfty1[
k].c_str(),
depth);
211 sprintf(name1,
"HF%s%d-z", hfty1[
k].c_str(),
depth);