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;
67 edm::LogVerbatim(
"HcalDigisClient") <<
" Number of histos " << hcalMEs.size();
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]);
84 int length = hcalMEs[ih]->getName().find(
end) -
position;
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_;
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++) {
162 sumphie.assign(
depths, 0);
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;
189 ME->setBinContent(ietabin, cnorm);
190 ME->setBinError(ietabin, enorm);
206 std::stringstream
out;
213 for (
int i = i0;
i <=
i1;
i++) {
214 for (
int j = j0;
j <= j1;
j++) {
215 sum +=
ME->getBinContent(
i,
j);
223 int nx =
ME->getNbinsX();
224 int ny =
ME->getNbinsY();
228 for (
int i = 1;
i <= nx;
i++) {
229 for (
int j = 1;
j <= ny;
j++) {
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
std::map< std::string, MonitorElement * > * msm_
virtual void setCurrentFolder(std::string const &fullpath)
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
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 &)
T getUntrackedParameter(std::string const &, T const &) const
~HcalDigisClient() override
int HcalDigisEndjob(const std::vector< MonitorElement *> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
#define DEFINE_FWK_MODULE(type)
virtual double getEntries() const
get # of entries
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
MonitorElement * monitor(std::string name)
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
static int position[264][3]
std::string getName(const G4String &)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const