18 edm::LogError(
"HcalSimHitsClient") <<
"unable to get DQMStore service, upshot is no client histograms will be made";
21 if (dbe_) dbe_->setVerbose(0);
28 if (dbe_) dbe_->setCurrentFolder(
dirName_);
59 std::vector<MonitorElement*> hcalMEs;
62 for (
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
66 std::vector<std::string> fullSubPathHLTFolders =
dbe_->
getSubdirs();
67 for (
unsigned int j=0;
j<fullSubPathHLTFolders.size();
j++) {
71 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalHitsV/SimHitsValidationHcal") == 0) {
90 std::string divisions[
nType]={
"HB0",
"HB1",
"HE0+z",
"HE1+z",
"HE2+z",
"HE0-z",
"HE1-z",
91 "HE2-z",
"HO0",
"HFL0+z",
"HFS0+z",
"HFL1+z",
"HFS1+z",
92 "HFL2+z",
"HFS2+z",
"HFL3+z",
"HFS3+z",
"HFL0-z",
"HFS0-z",
93 "HFL1-z",
"HFS1-z",
"HFL2-z",
"HFS2-z",
"HFL3-z",
"HFS3-z"};
97 char name[40], name1[40], name2[40], name3[40], name4[40];
101 Time_weighteden[
k] = 0;
102 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
103 sprintf (name1,
"Energy_%s", detdivision[
k].c_str());
104 sprintf (name2,
"Time_Enweighted_%s", detdivision[
k].c_str());
105 if (strcmp(hcalMEs[ih]->getName().c_str(), name1) == 0) {
106 Energy[
k] = hcalMEs[ih];
108 if (strcmp(hcalMEs[ih]->getName().c_str(), name2) == 0) {
109 Time_weighteden[
k] = hcalMEs[ih];
116 Occupancy_map[
i][
j]= 0;
117 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
118 sprintf (name,
"HcalHitE%s%s", time[
i].c_str(),divisions[
j].c_str());
119 if (strcmp(hcalMEs[ih]->getName().c_str(), name) == 0) {
120 Occupancy_map[
i][
j]= hcalMEs[ih];
127 HitEnergyvsieta[
k]= 0;
129 for (
unsigned int ih=0; ih<hcalMEs.size(); ih++) {
130 sprintf (name3,
"HcalHitEta%s",divisions[
k].c_str());
131 sprintf (name4,
"HcalHitTimeAEta%s",divisions[
k].c_str());
132 if (strcmp(hcalMEs[ih]->getName().c_str(), name3) == 0) {
133 HitEnergyvsieta[
k]= hcalMEs[ih];
135 if (strcmp(hcalMEs[ih]->getName().c_str(), name4) == 0) {
136 HitTimevsieta[
k]= hcalMEs[ih];
149 float fev = float(nevent);
151 for (
int dettype=0; dettype<
nType1; dettype++) {
153 for (
int i=0;
i<=nx1;
i++) {
157 int nx2= Time_weighteden[dettype]->
getNbinsX();
158 for (
int i=0;
i<=nx2;
i++) {
166 for (
int dettype=0; dettype<
nType; dettype++) {
167 if (HitEnergyvsieta[dettype] != 0) {
168 int nx1=HitEnergyvsieta[dettype]->
getNbinsX();
169 for (
int i=0;
i<=nx1;
i++) {
170 hitenergy[dettype]= HitEnergyvsieta[dettype]->
getBinContent(
i)/fev;
173 int nx2= HitTimevsieta[dettype]->
getNbinsX();
174 for (
int i=0;
i<=nx2;
i++) {
181 for (
int itime=0; itime<
nTime; itime++) {
182 for (
int det=0; det<
nType;det++) {
183 if (Occupancy_map[itime][det] != 0) {
184 int ny= Occupancy_map[itime][det]->
getNbinsY();
185 int nx= Occupancy_map[itime][det]->
getNbinsX();
186 for (
int i=1;
i<nx+1;
i++) {
187 for (
int j=1;
j<ny+1;
j++) {
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)
virtual void runClient_()
std::vector< std::string > getSubdirs(void) const
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int SimHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
double getEntries(void) const
get # of entries
virtual void endRun(const edm::Run &run, const edm::EventSetup &c)
int getNbinsY(void) const
get # of bins in Y-axis
std::vector< MonitorElement * > getContents(const std::string &path) const
virtual void beginJob(void)
virtual ~HcalSimHitsClient()
double getBinContent(int binx) const
get content of bin (1-D)
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HcalSimHitsClient(const edm::ParameterSet &)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
int getNbinsX(void) const
get # of bins in X-axis
void setCurrentFolder(const std::string &fullpath)