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";
71 std::vector<MonitorElement*> ieta_iphi_occupancy_maps;
72 std::vector<std::string> depthID;
76 for (
unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
78 if (hcalMEs[ih]->
getName() ==
"nevtot"){
84 if ( (hcalMEs[ih]->
getName().
find(
"HcalDigiTask_ieta_iphi_occupancy_map_depth") != std::string::npos)
85 &&(hcalMEs[ih]->getName().find(subdet_) != std::string::npos) ){
87 ieta_iphi_occupancy_maps.push_back(hcalMEs[ih]);
92 int position = hcalMEs[ih]->getName().find(start) + start.length();
93 int length = hcalMEs[ih]->getName().find(end) -
position;
95 depthID.push_back(hcalMEs[ih]->
getName().substr(position, length));
104 if ( hcalMEs.empty()){
105 edm::LogError(
"HcalDigisClient") <<
"No nevtot or maps histo found...";
109 edm::LogError(
"HcalDigisClient") <<
"No nevtot histoo found...";
112 if( ieta_iphi_occupancy_maps.empty()){
113 edm::LogError(
"HcalDigisClient") <<
"No maps histos found...";
122 edm::LogError(
"HcalDigisClient") <<
"normalization factor <= 0!";
128 int depths = ieta_iphi_occupancy_maps.size();
130 HistLim ietaLim(85, -42.5, 42.5);
133 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" +
str(
depth) +
"_" + subdet_;
134 book1D(ib,strtmp, ietaLim);
137 std::vector<float> sumphi(depths,0);
138 std::vector<float> sumphie(depths,0);
147 int nx = ieta_iphi_occupancy_maps[
depth-1]->getNbinsX();
148 int ny = ieta_iphi_occupancy_maps[
depth-1]->getNbinsY();
151 for (
int i = 1;
i <= nx;
i++) {
152 for (
int j = 1; j <= ny; j++) {
155 cnorm = ieta_iphi_occupancy_maps[
depth-1]->getBinContent(
i, j) / fev;
156 enorm = ieta_iphi_occupancy_maps[
depth-1]->getBinError(
i, j) / fev;
157 ieta_iphi_occupancy_maps[
depth-1]->setBinContent(
i, j, cnorm);
158 ieta_iphi_occupancy_maps[
depth-1]->setBinError(
i, j, enorm);
164 for (
int i = 1;
i <= 82;
i++) {
167 if (ieta >= 0) ieta += 1;
169 if (ieta >= -20 && ieta <= 20) {
172 if (ieta >= 40 || ieta <= -40)
179 sumphi.assign(depths,0);
180 sumphie.assign(depths,0);
182 for (
int iphi = 1; iphi <= 72; iphi++) {
184 int binIeta = ieta_iphi_occupancy_maps[
depth-1]->getTH2F()->GetXaxis()->FindBin(ieta);
185 int binIphi = ieta_iphi_occupancy_maps[
depth-1]->getTH2F()->GetYaxis()->FindBin(iphi);
187 float content = ieta_iphi_occupancy_maps[
depth-1]->getBinContent(binIeta,binIphi);
188 float econtent = ieta_iphi_occupancy_maps[
depth-1]->getBinError(binIeta,binIphi);
191 sumphie[
depth-1] += econtent*econtent;
200 strtmp =
"HcalDigiTask_occupancy_vs_ieta_depth" + depthID[
depth-1] +
"_" + subdet_;
202 int ietabin = ME->
getTH1F()->GetXaxis()->FindBin(
float(ieta));
204 if (sumphi[
depth-1]>1.
e-30){
205 cnorm = sumphi[
depth-1] / phi_factor;
206 enorm =
sqrt(sumphie[
depth-1]) / phi_factor;
217 if (!
msm_->count(name))
return nullptr;
218 else return msm_->find(name)->second;
222 std::stringstream
out;
229 for (
int i = i0;
i <= i1;
i++) {
230 for (
int j = j0; j <= j1; j++) {
244 for (
int i = 1;
i <= nx;
i++) {
245 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)
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
void setCurrentFolder(std::string const &fullpath)
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
#define DEFINE_FWK_MODULE(type)
MonitorElement * monitor(std::string name)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
std::vector< MonitorElement * > getContents(Args &&...args)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
TString getName(TString structure, int layer, TString geometry)
std::map< std::string, MonitorElement * > * msm_
double getEntries() const
get # of entries
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)
int getNbinsY() const
get # of bins in Y-axis
double getBinContent(int binx) const
get content of bin (1-D)
static int position[264][3]
std::vector< std::string > getSubdirs()
int getNbinsX() const
get # of bins in X-axis