25 msm_ =
new std::map<std::string, MonitorElement*>();
32 std::vector<MonitorElement*> hcalMEs;
35 std::vector<std::string> fullPathHLTFolders = ig.
getSubdirs();
36 for (
unsigned int i = 0;
i < fullPathHLTFolders.size();
i++) {
38 std::vector<std::string> fullSubPathHLTFolders = ig.
getSubdirs();
39 for (
unsigned int j = 0;
j < fullSubPathHLTFolders.size();
j++) {
40 if (strcmp(fullSubPathHLTFolders[
j].c_str(),
"HcalDigisV/HcalDigiTask") == 0) {
44 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HB";
46 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HE";
48 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HO";
50 edm::LogError(
"HcalDigisClient") <<
"Error in HcalDigisEndjob! HF";
64 std::vector<MonitorElement*> ieta_iphi_occupancy_maps;
65 std::vector<std::string> depthID;
69 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
70 if (hcalMEs[ih]->
getName() ==
"nevtot") {
76 if ((hcalMEs[ih]->
getName().
find(
"HcalDigiTask_ieta_iphi_occupancy_map_depth") != std::string::npos) &&
77 (hcalMEs[ih]->getName().find(subdet_) != std::string::npos)) {
78 ieta_iphi_occupancy_maps.push_back(hcalMEs[ih]);
83 int position = hcalMEs[ih]->getName().find(start) + start.length();
84 int length = hcalMEs[ih]->getName().find(end) -
position;
86 depthID.push_back(hcalMEs[ih]->
getName().substr(position, length));
92 if (hcalMEs.empty()) {
93 edm::LogError(
"HcalDigisClient") <<
"No nevtot or maps histo found...";
97 edm::LogError(
"HcalDigisClient") <<
"No nevtot histoo found...";
100 if (ieta_iphi_occupancy_maps.empty()) {
101 edm::LogError(
"HcalDigisClient") <<
"No maps histos found...";
108 edm::LogError(
"HcalDigisClient") <<
"normalization factor <= 0!";
114 int depths = ieta_iphi_occupancy_maps.size();
116 HistLim ietaLim(85, -42.5, 42.5);
119 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" +
str(
depth) +
"_" + subdet_;
120 book1D(ib, strtmp, ietaLim);
123 std::vector<float> sumphi(depths, 0);
124 std::vector<float> sumphie(depths, 0);
131 int nx = ieta_iphi_occupancy_maps[
depth - 1]->getNbinsX();
132 int ny = ieta_iphi_occupancy_maps[
depth - 1]->getNbinsY();
134 for (
int i = 1;
i <= nx;
i++) {
135 for (
int j = 1;
j <= ny;
j++) {
137 cnorm = ieta_iphi_occupancy_maps[
depth - 1]->getBinContent(
i,
j) / fev;
138 enorm = ieta_iphi_occupancy_maps[
depth - 1]->getBinError(
i,
j) / fev;
139 ieta_iphi_occupancy_maps[
depth - 1]->setBinContent(
i,
j, cnorm);
140 ieta_iphi_occupancy_maps[
depth - 1]->setBinError(
i,
j, enorm);
146 for (
int i = 1;
i <= 82;
i++) {
151 if (ieta >= -20 && ieta <= 20) {
154 if (ieta >= 40 || ieta <= -40)
161 sumphi.assign(depths, 0);
162 sumphie.assign(depths, 0);
164 for (
int iphi = 1; iphi <= 72; iphi++) {
166 int binIeta = ieta_iphi_occupancy_maps[
depth - 1]->getTH2F()->GetXaxis()->FindBin(ieta);
167 int binIphi = ieta_iphi_occupancy_maps[
depth - 1]->getTH2F()->GetYaxis()->FindBin(iphi);
169 float content = ieta_iphi_occupancy_maps[
depth - 1]->getBinContent(binIeta, binIphi);
170 float econtent = ieta_iphi_occupancy_maps[
depth - 1]->getBinError(binIeta, binIphi);
173 sumphie[
depth - 1] += econtent * econtent;
182 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" + depthID[
depth - 1] +
"_" + subdet_;
184 int ietabin = ME->
getTH1F()->GetXaxis()->FindBin(
float(ieta));
186 if (sumphi[
depth - 1] > 1.
e-30) {
187 cnorm = sumphi[
depth - 1] / phi_factor;
188 enorm =
sqrt(sumphie[
depth - 1]) / phi_factor;
199 if (!
msm_->count(name))
202 return msm_->find(name)->second;
206 std::stringstream
out;
213 for (
int i = i0;
i <= i1;
i++) {
214 for (
int j = j0;
j <= j1;
j++) {
228 for (
int i = 1;
i <= nx;
i++) {
229 for (
int j = 1;
j <= ny;
j++) {
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, MonitorElement * > * msm_
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setCurrentFolder(std::string const &fullpath)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
#define DEFINE_FWK_MODULE(type)
virtual TH1F * getTH1F() const
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
HcalDigisClient(const edm::ParameterSet &)
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
~HcalDigisClient() override
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getEntries() const
get # of entries
virtual double getBinContent(int binx) const
get content of bin (1-D)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
TString getName(TString structure, int layer, TString geometry)
MonitorElement * monitor(std::string name)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
T getParameter(std::string const &) const
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
static int position[264][3]
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)