28 if (!
dbe_)
edm::LogError(
"HcalDigisClient") <<
"unable to get DQMStore service, upshot is no client histograms will be made";
29 msm_ =
new std::map<std::string, MonitorElement*>();
53 for (
int depth = 1; depth <= 4; depth++) {
54 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" +
str(depth) +
"_" + subdetopt;
63 std::vector<MonitorElement*> hcalMEs;
67 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
69 std::vector<std::string> fullSubPathHLTFolders =
dbe_->
getSubdirs();
70 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
71 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalDigisV/HcalDigiTask") == 0) {
74 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HB";
76 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HE";
78 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HO";
80 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HF"; }
98 std::cout <<
" Number of histos " << hcalMEs.size() << std::endl;
100 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
101 if (hcalMEs[ih]->getName() ==
"nevtot") nevtot = hcalMEs[ih];
103 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth1_" + subdet_;
104 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map1 = hcalMEs[ih];
105 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth2_" + subdet_;
106 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map2 = hcalMEs[ih];
107 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth3_" + subdet_;
108 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map3 = hcalMEs[ih];
109 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth4_" + subdet_;
110 if (hcalMEs[ih]->getName() == strtmp) ieta_iphi_occupancy_map4 = hcalMEs[ih];
115 ieta_iphi_occupancy_map1 == 0 ||
116 ieta_iphi_occupancy_map2 == 0 ||
117 ieta_iphi_occupancy_map3 == 0 ||
118 ieta_iphi_occupancy_map4 == 0
120 edm::LogError(
"HcalDigisClient") <<
"No nevtot or maps histo found...";
126 edm::LogError(
"HcalDigisClient") <<
"normalization factor <= 0!";
132 int nx = ieta_iphi_occupancy_map1->
getNbinsX();
133 int ny = ieta_iphi_occupancy_map1->
getNbinsY();
134 float sumphi_1, sumphi_2, sumphi_3, sumphi_4;
138 for (
int i = 1;
i <= nx;
i++) {
144 for (
int j = 1;
j <= ny;
j++) {
148 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth1_" + subdet_;
153 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth2_" + subdet_;
158 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth3_" + subdet_;
163 strtmp =
"HcalDigiTask_ieta_iphi_occupancy_map_depth4_" + subdet_;
171 if (ieta >= 0) ieta += 1;
173 if (ieta >= -20 && ieta <= 20) {
176 if (ieta >= 40 || ieta <= -40)
182 if (ieta >= 0) ieta -= 1;
183 double deta = double(ieta);
186 cnorm = sumphi_1 / phi_factor;
187 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth1_" + subdet_;
188 fill1D(strtmp, deta, cnorm);
190 cnorm = sumphi_2 / phi_factor;
191 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth2_" + subdet_;
192 fill1D(strtmp, deta, cnorm);
194 cnorm = sumphi_3 / phi_factor;
195 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth3_" + subdet_;
196 fill1D(strtmp, deta, cnorm);
198 cnorm = sumphi_4 / phi_factor;
199 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth4_" + subdet_;
200 fill1D(strtmp, deta, cnorm);
208 if (!
msm_->count(name))
return NULL;
209 else return msm_->find(name)->second;
213 std::stringstream
out;
220 for (
int i = i0;
i <= i1;
i++) {
221 for (
int j = j0;
j <= j1;
j++) {
234 for (
int i = 1;
i <= nx;
i++) {
235 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)