42 std::vector<MonitorElement *> hcalMEs;
44 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
45 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
47 edm::LogInfo(
"HitsValidationHcal") <<
"fullPath: " << fullPathHLTFolders[
i];
50 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
51 for (
unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
53 edm::LogInfo(
"HitsValidationHcal") <<
"fullSub: " << fullSubPathHLTFolders[j];
55 if (strcmp(fullSubPathHLTFolders[j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
58 edm::LogInfo(
"HitsValidationHcal") <<
"hltMES size : " << hcalMEs.size();
72 MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()];
76 char name[40], name1[40], name2[40], name3[40], name4[40];
80 Time_weighteden[
k] =
nullptr;
81 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
82 sprintf(name1,
"Energy_%s", detdivision[
k].c_str());
83 sprintf(name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
84 if (strcmp(hcalMEs[ih]->
getName().c_str(), name1) == 0) {
85 Energy[
k] = hcalMEs[ih];
87 if (strcmp(hcalMEs[ih]->
getName().c_str(), name2) == 0) {
88 Time_weighteden[
k] = hcalMEs[ih];
94 for (
unsigned int j = 0; j < divisions.size(); j++) {
95 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
96 sprintf(name,
"HcalHitE%s%s", time[
i].c_str(), divisions[j].c_str());
97 if (strcmp(hcalMEs[ih]->
getName().c_str(), name) == 0) {
98 Occupancy_map[
i][j] = hcalMEs[ih];
104 for (
unsigned int k = 0;
k < divisions.size();
k++) {
105 HitEnergyvsieta[
k] =
nullptr;
106 HitTimevsieta[
k] =
nullptr;
107 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
108 sprintf(name3,
"HcalHitEta%s", divisions[
k].c_str());
109 sprintf(name4,
"HcalHitTimeAEta%s", divisions[
k].c_str());
110 if (strcmp(hcalMEs[ih]->
getName().c_str(), name3) == 0) {
111 HitEnergyvsieta[
k] = hcalMEs[ih];
113 if (strcmp(hcalMEs[ih]->
getName().c_str(), name4) == 0) {
114 HitTimevsieta[
k] = hcalMEs[ih];
125 float cont[
nTime][divisions.size()];
127 float hitenergy[divisions.size()], hittime[divisions.size()];
128 float fev =
float(nevent);
130 for (
int dettype = 0; dettype <
nType1; dettype++) {
132 for (
int i = 0;
i <= nx1;
i++) {
136 int nx2 = Time_weighteden[dettype]->
getNbinsX();
137 for (
int i = 0;
i <= nx2;
i++) {
143 for (
unsigned int dettype = 0; dettype < divisions.size(); dettype++) {
144 int nx1 = HitEnergyvsieta[dettype]->
getNbinsX();
145 for (
int i = 0;
i <= nx1;
i++) {
146 hitenergy[dettype] = HitEnergyvsieta[dettype]->
getBinContent(
i) / fev;
149 int nx2 = HitTimevsieta[dettype]->
getNbinsX();
150 for (
int i = 0;
i <= nx2;
i++) {
151 hittime[dettype] = HitTimevsieta[dettype]->
getBinContent(
i) / fev;
156 for (
int itime = 0; itime <
nTime; itime++) {
157 for (
unsigned int det = 0; det < divisions.size(); det++) {
158 int ny = Occupancy_map[itime][det]->
getNbinsY();
159 int nx = Occupancy_map[itime][det]->
getNbinsX();
160 for (
int i = 1;
i < nx + 1;
i++) {
161 for (
int j = 1; j < ny + 1; j++) {
162 cont[itime][det] = Occupancy_map[itime][det]->
getBinContent(
i, j) / fev;
182 std::vector<std::string> divisions;
187 sprintf(name1,
"HC%d",
depth);
192 sprintf(name1,
"HB%d",
depth);
197 sprintf(name1,
"HE%d+z",
depth);
199 sprintf(name1,
"HE%d-z",
depth);
205 sprintf(name1,
"HO%d", depth);
210 for (
int k = 0;
k < 4; ++
k) {
212 sprintf(name1,
"HF%s%d+z", hfty1[
k].c_str(),
depth);
214 sprintf(name1,
"HF%s%d-z", hfty1[
k].c_str(),
depth);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &run, edm::EventSetup const &c) override
void setBinContent(int binx, double content)
set content of bin (1-D)
int SimHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
void setCurrentFolder(std::string const &fullpath)
~HcalSimHitsClient() override
std::vector< std::string > getHistogramTypes()
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
#define DEFINE_FWK_MODULE(type)
const HcalDDDRecConstants * hcons
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< MonitorElement * > getContents(Args &&...args)
TString getName(TString structure, int layer, TString geometry)
double getEntries() const
get # of entries
int getMaxDepth(const int &type) const
int getNbinsY() const
get # of bins in Y-axis
double getBinContent(int binx) const
get content of bin (1-D)
HcalSimHitsClient(const edm::ParameterSet &)
std::vector< std::string > getSubdirs()
int getNbinsX() const
get # of bins in X-axis