47 std::vector<MonitorElement*> hcalMEs;
49 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
50 for (
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
52 edm::LogInfo(
"HitsValidationHcal") <<
"fullPath: " << fullPathHLTFolders[
i];
55 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
56 for (
unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
60 if (strcmp(fullSubPathHLTFolders[j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
78 MonitorElement *HitEnergyvsieta[divisions.size()], *HitTimevsieta[divisions.size()];
82 char name[40], name1[40], name2[40], name3[40], name4[40];
86 Time_weighteden[
k] = 0;
87 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
88 sprintf (name1,
"Energy_%s", detdivision[
k].c_str());
89 sprintf (name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
90 if (strcmp(hcalMEs[ih]->getName().c_str(), name1) == 0) {
91 Energy[
k] = hcalMEs[ih];
93 if (strcmp(hcalMEs[ih]->getName().c_str(), name2) == 0) {
94 Time_weighteden[
k] = hcalMEs[ih];
100 for (
unsigned int j=0; j<divisions.size();j++) {
101 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
102 sprintf (name,
"HcalHitE%s%s", time[
i].c_str(),divisions[j].c_str());
103 if (strcmp(hcalMEs[ih]->getName().c_str(), name) == 0) {
104 Occupancy_map[
i][j]= hcalMEs[ih];
110 for (
unsigned int k=0;
k<divisions.size();
k++) {
111 HitEnergyvsieta[
k]= 0;
113 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
114 sprintf (name3,
"HcalHitEta%s",divisions[
k].c_str());
115 sprintf (name4,
"HcalHitTimeAEta%s",divisions[
k].c_str());
116 if (strcmp(hcalMEs[ih]->getName().c_str(), name3) == 0) {
117 HitEnergyvsieta[
k]= hcalMEs[ih];
119 if (strcmp(hcalMEs[ih]->getName().c_str(), name4) == 0) {
120 HitTimevsieta[
k]= hcalMEs[ih];
130 float cont[
nTime][divisions.size()];
132 float hitenergy[divisions.size()], hittime[divisions.size()];
133 float fev =
float(nevent);
135 for (
int dettype=0; dettype<
nType1; dettype++) {
137 for (
int i=0;
i<=nx1;
i++) {
141 int nx2= Time_weighteden[dettype]->
getNbinsX();
142 for (
int i=0;
i<=nx2;
i++) {
148 for (
unsigned int dettype=0; dettype<divisions.size(); dettype++) {
149 int nx1=HitEnergyvsieta[dettype]->
getNbinsX();
150 for (
int i=0;
i<=nx1;
i++) {
151 hitenergy[dettype]= HitEnergyvsieta[dettype]->
getBinContent(
i)/fev;
154 int nx2= HitTimevsieta[dettype]->
getNbinsX();
155 for (
int i=0;
i<=nx2;
i++) {
161 for (
int itime=0; itime<
nTime; itime++) {
162 for (
unsigned int det=0; det<divisions.size(); det++) {
163 int ny= Occupancy_map[itime][det]->
getNbinsY();
164 int nx= Occupancy_map[itime][det]->
getNbinsX();
165 for (
int i=1;
i<nx+1;
i++) {
166 for (
int j=1; j<ny+1; j++) {
167 cont[itime][det] = Occupancy_map[itime][det]->
getBinContent(
i,j)/fev;
188 std::vector<std::string > divisions;
193 sprintf (name1,
"HC%d",
depth);
198 sprintf (name1,
"HB%d",
depth);
203 sprintf (name1,
"HE%d+z",
depth);
205 sprintf (name1,
"HE%d-z",
depth);
211 sprintf (name1,
"HO%d", depth);
216 for (
int k=0;
k<4; ++
k) {
218 sprintf (name1,
"HF%s%d+z", hfty1[
k].c_str(),
depth);
220 sprintf (name1,
"HF%s%d-z", hfty1[
k].c_str(),
depth);
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
#define DEFINE_FWK_MODULE(type)
int SimHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
double getEntries(void) const
get # of entries
std::vector< std::string > getHistogramTypes()
int getNbinsY(void) const
get # of bins in Y-axis
virtual void beginRun(edm::Run const &run, edm::EventSetup const &c)
const HcalDDDRecConstants * hcons
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
virtual ~HcalSimHitsClient()
int getMaxDepth(const int &type) const
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
double getBinContent(int binx) const
get content of bin (1-D)
HcalSimHitsClient(const edm::ParameterSet &)
int getNbinsX(void) const
get # of bins in X-axis