41 std::vector<MonitorElement *> hcalMEs;
43 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
44 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
46 edm::LogInfo(
"HitsValidationHcal") <<
"fullPath: " << fullPathHLTFolders[
i];
49 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
50 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
52 edm::LogInfo(
"HitsValidationHcal") <<
"fullSub: " << fullSubPathHLTFolders[
j];
54 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
57 edm::LogInfo(
"HitsValidationHcal") <<
"hltMES size : " << hcalMEs.size();
71 MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()];
75 char name[40], name1[40],
name2[40], name3[40], name4[40];
79 Time_weighteden[
k] =
nullptr;
80 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
81 sprintf(name1,
"Energy_%s", detdivision[
k].c_str());
82 sprintf(name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
83 if (strcmp(hcalMEs[ih]->
getName().c_str(), name1) == 0) {
84 Energy[
k] = hcalMEs[ih];
86 if (strcmp(hcalMEs[ih]->
getName().c_str(), name2) == 0) {
87 Time_weighteden[
k] = hcalMEs[ih];
93 for (
unsigned int j = 0;
j < divisions.size();
j++) {
94 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
95 sprintf(name,
"HcalHitE%s%s", time[
i].c_str(), divisions[
j].c_str());
96 if (strcmp(hcalMEs[ih]->
getName().c_str(), name) == 0) {
97 Occupancy_map[
i][
j] = hcalMEs[ih];
103 for (
unsigned int k = 0;
k < divisions.size();
k++) {
104 HitEnergyvsieta[
k] =
nullptr;
105 HitTimevsieta[
k] =
nullptr;
106 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
107 sprintf(name3,
"HcalHitEta%s", divisions[
k].c_str());
108 sprintf(name4,
"HcalHitTimeAEta%s", divisions[
k].c_str());
109 if (strcmp(hcalMEs[ih]->
getName().c_str(), name3) == 0) {
110 HitEnergyvsieta[
k] = hcalMEs[ih];
112 if (strcmp(hcalMEs[ih]->
getName().c_str(), name4) == 0) {
113 HitTimevsieta[
k] = hcalMEs[ih];
126 float hitenergy[divisions.size()], hittime[divisions.size()];
127 float fev =
float(nevent);
129 for (
int dettype = 0; dettype <
nType1; dettype++) {
131 for (
int i = 0;
i <= nx1;
i++) {
135 int nx2 = Time_weighteden[dettype]->
getNbinsX();
136 for (
int i = 0;
i <= nx2;
i++) {
142 for (
unsigned int dettype = 0; dettype < divisions.size(); dettype++) {
143 int nx1 = HitEnergyvsieta[dettype]->
getNbinsX();
144 for (
int i = 0;
i <= nx1;
i++) {
145 hitenergy[dettype] = HitEnergyvsieta[dettype]->
getBinContent(
i) / fev;
148 int nx2 = HitTimevsieta[dettype]->
getNbinsX();
149 for (
int i = 0;
i <= nx2;
i++) {
150 hittime[dettype] = HitTimevsieta[dettype]->
getBinContent(
i) / fev;
155 for (
int itime = 0; itime <
nTime; itime++) {
156 for (
unsigned int det = 0; det < divisions.size(); det++) {
157 int ny = Occupancy_map[itime][det]->
getNbinsY();
158 int nx = Occupancy_map[itime][det]->
getNbinsX();
159 for (
int i = 1;
i < nx + 1;
i++) {
160 for (
int j = 1;
j < ny + 1;
j++) {
161 cont[itime][det] = Occupancy_map[itime][det]->
getBinContent(
i,
j) / fev;
181 std::vector<std::string> divisions;
186 sprintf(name1,
"HC%d",
depth);
191 sprintf(name1,
"HB%d",
depth);
196 sprintf(name1,
"HE%d+z",
depth);
198 sprintf(name1,
"HE%d-z",
depth);
204 sprintf(name1,
"HO%d", depth);
209 for (
int k = 0;
k < 4; ++
k) {
211 sprintf(name1,
"HF%s%d+z", hfty1[
k].c_str(),
depth);
213 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
virtual int getNbinsY() const
get # of bins in Y-axis
std::vector< MonitorElement * > getContents(Args &&...args)
int SimHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
~HcalSimHitsClient() override
std::vector< std::string > getHistogramTypes()
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
#define DEFINE_FWK_MODULE(type)
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getEntries() const
get # of entries
const HcalDDDRecConstants * hcons
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
virtual double getBinContent(int binx) const
get content of bin (1-D)
TString getName(TString structure, int layer, TString geometry)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int getMaxDepth(const int &type) const
HcalSimHitsClient(const edm::ParameterSet &)
cont
load Luminosity info ##
void setCurrentFolder(std::string const &fullpath)
std::vector< std::string > getSubdirs()