26 msm_ =
new std::map<std::string, MonitorElement*>();
39 std::vector<MonitorElement*> hcalMEs;
42 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
43 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
45 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
46 for (
unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
47 if (strcmp(fullSubPathHLTFolders[j].c_str(),
"HcalDigisV/HcalDigiTask") == 0) {
51 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HB";
53 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HE";
55 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HO";
57 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HF"; }
70 std::vector<MonitorElement*> ieta_iphi_occupancy_maps;
71 std::vector<std::string> depthID;
75 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
77 if (hcalMEs[ih]->getName() ==
"nevtot"){
83 if ( (hcalMEs[ih]->getName().
find(
"HcalDigiTask_ieta_iphi_occupancy_map_depth") != std::string::npos)
84 &&(hcalMEs[ih]->getName().find(subdet_) != std::string::npos) ){
86 ieta_iphi_occupancy_maps.push_back(hcalMEs[ih]);
91 int position = hcalMEs[ih]->getName().find(start) + start.length();
92 int length = hcalMEs[ih]->getName().find(end) -
position;
94 depthID.push_back(hcalMEs[ih]->getName().substr(position, length));
103 if ( hcalMEs.size() == 0){
104 edm::LogError(
"HcalDigisClient") <<
"No nevtot or maps histo found...";
108 edm::LogError(
"HcalDigisClient") <<
"No nevtot histoo found...";
111 if( ieta_iphi_occupancy_maps.size() < 1){
112 edm::LogError(
"HcalDigisClient") <<
"No maps histos found...";
121 edm::LogError(
"HcalDigisClient") <<
"normalization factor <= 0!";
127 int depths = ieta_iphi_occupancy_maps.size();
129 HistLim ietaLim(85, -42.5, 42.5);
132 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" +
str(
depth) +
"_" + subdet_;
133 book1D(ib,strtmp, ietaLim);
136 std::vector<float> sumphi;
145 int nx = ieta_iphi_occupancy_maps[
depth-1]->getNbinsX();
146 int ny = ieta_iphi_occupancy_maps[
depth-1]->getNbinsY();
149 for (
int i = 1;
i <= nx;
i++) {
150 for (
int j = 1; j <= ny; j++) {
153 cnorm = ieta_iphi_occupancy_maps[
depth-1]->getBinContent(
i, j) / fev;
154 enorm = ieta_iphi_occupancy_maps[
depth-1]->getBinError(
i, j) / fev;
155 ieta_iphi_occupancy_maps[
depth-1]->setBinContent(
i, j, cnorm);
156 ieta_iphi_occupancy_maps[
depth-1]->setBinError(
i, j, enorm);
162 for (
int i = 1;
i <= 82;
i++) {
165 if (ieta >= 0) ieta += 1;
167 if (ieta >= -20 && ieta <= 20) {
170 if (ieta >= 40 || ieta <= -40)
179 for (
int iphi = 1; iphi <= 72; iphi++) {
181 int binIeta = ieta_iphi_occupancy_maps[
depth-1]->getTH2F()->GetXaxis()->FindBin(ieta);
182 int binIphi = ieta_iphi_occupancy_maps[
depth-1]->getTH2F()->GetYaxis()->FindBin(iphi);
184 float content = ieta_iphi_occupancy_maps[
depth-1]->getBinContent(binIeta,binIphi);
191 double deta = double(ieta);
195 cnorm = sumphi[
depth-1] / phi_factor;
196 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" + depthID[
depth-1] +
"_" + subdet_;
197 fill1D(strtmp, deta, cnorm);
205 if (!
msm_->count(name))
return NULL;
206 else return msm_->find(name)->second;
210 std::stringstream
out;
217 for (
int i = i0;
i <= i1;
i++) {
218 for (
int j = j0; j <= j1; j++) {
232 for (
int i = 1;
i <= nx;
i++) {
233 for (
int j = 1; j <= ny; j++) {
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)
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
double getEntries(void) const
get # of entries
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
HcalDigisClient(const edm::ParameterSet &)
int getNbinsY(void) const
get # of bins in Y-axis
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
void fill1D(std::string name, double X, double weight=1)
MonitorElement * monitor(std::string name)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
std::map< std::string, MonitorElement * > * msm_
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
double getBinContent(int binx) const
get content of bin (1-D)
static int position[264][3]
int getNbinsX(void) const
get # of bins in X-axis