27 if (!
dbe_)
edm::LogError(
"HcalDigisClient") <<
"unable to get DQMStore service, upshot is no client histograms will be made";
28 msm_ =
new std::map<std::string, MonitorElement*>();
52 for (
int depth = 1; depth <= 4; depth++) {
53 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" +
str(depth) +
"_" + subdetopt;
62 std::vector<MonitorElement*> hcalMEs;
66 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
68 std::vector<std::string> fullSubPathHLTFolders =
dbe_->
getSubdirs();
69 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
70 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalDigisV/HcalDigiTask") == 0) {
73 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HB";
75 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HE";
77 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HO";
79 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HF"; }
97 std::cout <<
" Number of histos " << hcalMEs.size() << std::endl;
99 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
100 if (hcalMEs[ih]->getName() ==
"nevtot") nevtot = hcalMEs[ih];
102 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth1_" + subdet_;
103 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map1 = hcalMEs[ih];
104 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth2_" + subdet_;
105 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map2 = hcalMEs[ih];
106 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth3_" + subdet_;
107 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map3 = hcalMEs[ih];
108 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth4_" + subdet_;
109 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map4 = hcalMEs[ih];
114 ieta_iphi_occupancy_map1 == 0 ||
115 ieta_iphi_occupancy_map2 == 0 ||
116 ieta_iphi_occupancy_map3 == 0 ||
117 ieta_iphi_occupancy_map4 == 0
119 edm::LogError(
"HcalDigisClient") <<
"No nevtot or maps histo found...";
125 edm::LogError(
"HcalDigisClient") <<
"normalization factor <= 0!";
131 int nx = ieta_iphi_occupancy_map1->
getNbinsX();
132 int ny = ieta_iphi_occupancy_map1->
getNbinsY();
133 float sumphi_1, sumphi_2, sumphi_3, sumphi_4;
137 for (
int i = 1;
i <= nx;
i++) {
143 for (
int j = 1;
j <= ny;
j++) {
147 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth1_" + subdet_;
152 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth2_" + subdet_;
157 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth3_" + subdet_;
162 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth4_" + subdet_;
170 if (ieta >= 0) ieta += 1;
172 if (ieta >= -20 && ieta <= 20) {
175 if (ieta >= 40 || ieta <= -40)
181 if (ieta >= 0) ieta -= 1;
182 double deta = double(ieta);
185 cnorm = sumphi_1 / phi_factor;
186 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth1_" + subdet_;
187 fill1D(strtmp, deta, cnorm);
189 cnorm = sumphi_2 / phi_factor;
190 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth2_" + subdet_;
191 fill1D(strtmp, deta, cnorm);
193 cnorm = sumphi_3 / phi_factor;
194 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth3_" + subdet_;
195 fill1D(strtmp, deta, cnorm);
197 cnorm = sumphi_4 / phi_factor;
198 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth4_" + subdet_;
199 fill1D(strtmp, deta, cnorm);
207 if (!
msm_->count(name))
return NULL;
208 else return msm_->find(name)->second;
212 std::stringstream
out;
219 for (
int i = i0;
i <= i1;
i++) {
220 for (
int j = j0;
j <= j1;
j++) {
233 for (
int i = 1;
i <= nx;
i++) {
234 for (
int j = 1;
j <= ny;
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)
std::vector< std::string > getSubdirs(void) const
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void scaleMETH2D(MonitorElement *ME, double s)
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_)
double getEntries(void) const
get # of entries
HcalDigisClient(const edm::ParameterSet &)
int getNbinsY(void) const
get # of bins in Y-axis
void fill1D(std::string name, double X, double weight=1)
void booking(std::string subdetopt)
void book1D(std::string name, int n, double min, double max)
MonitorElement * monitor(std::string name)
std::vector< MonitorElement * > getContents(const std::string &path) const
std::map< std::string, MonitorElement * > * msm_
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void setCurrentFolder(const std::string &fullpath)