10 edm::LogInfo(
"SiStripSummaryCreator") <<
" Creating SiStripSummaryCreator " 15 edm::LogInfo(
"SiStripSummaryCreator") <<
" Deleting SiStripSummaryCreator " 24 std::cout <<
"SiStripSummaryCreator::readConfiguration: Failed to read Summary configuration parameters!! ";
29 std::cout <<
"SiStripSummaryCreator::readConfiguration: Failed to read Summary configuration parameters!! ";
37 for (std::map<std::string, std::string>::const_iterator
isum = me_names.begin();
isum != me_names.end();
isum++) {
52 if ((*it).find(
"module_") == std::string::npos)
72 std::map<std::string, MonitorElement*> MEMap;
84 if ((*it).find(
"module_") == std::string::npos)
90 for (std::vector<MonitorElement*>::const_iterator im =
contents.begin(); im !=
contents.end(); im++) {
95 if (name_i.find(
name) == std::string::npos)
97 std::map<std::string, MonitorElement*>::iterator iPos = MEMap.find(
name);
100 if (iPos == MEMap.end()) {
102 MEMap.insert(std::pair<std::string, MonitorElement*>(
name,
me));
118 std::map<std::string, MonitorElement*> MEMap;
121 if ((
dir_name.find(
"SiStrip") == 0) || (
dir_name.find(
"Collector") == 0) || (
dir_name.find(
"MechanicalView") == 0) ||
132 if (
isum->second ==
"sum" ||
isum->second ==
"sum")
133 summary_name =
"Summary_" +
isum->first;
135 summary_name =
"Summary_Mean" +
isum->first;
138 for (std::vector<std::string>::const_iterator
it =
subdirs.begin();
it !=
subdirs.end();
it++) {
142 for (std::vector<MonitorElement*>::const_iterator im =
contents.begin(); im !=
contents.end(); im++) {
147 if (name_i.find((summary_name)) != std::string::npos) {
148 std::map<std::string, MonitorElement*>::iterator iPos = MEMap.find(
name);
150 if (iPos == MEMap.end()) {
151 if (htype ==
"sum" || htype ==
"Sum") {
156 MEMap.insert(std::pair<std::string, MonitorElement*>(
name,
me));
159 if (htype ==
"sum" || htype ==
"Sum") {
180 if (
dname.find(
'_') != std::string::npos)
182 if (htype ==
"sum" && htype ==
"Sum") {
183 sum_name =
"Summary" +
name +
"__" +
dname;
184 tag_name =
"Summary" +
name;
186 sum_name =
"Summary_Mean" +
name +
"__" +
dname;
187 tag_name =
"Summary_Mean" +
name;
191 for (std::vector<MonitorElement*>::const_iterator im =
contents.begin(); im !=
contents.end(); im++) {
196 if (me_name.find(sum_name) == 0) {
199 TH1* hist1 =
me->getTH1();
207 std::map<int, std::string>
tags;
212 if (htype ==
"mean" || htype ==
"Mean") {
219 tags.emplace(ibin, subdir_name);
221 }
else if (htype ==
"bin-by-bin" || htype ==
"Bin-by-Bin") {
226 for (
auto const* s_me : s_contents) {
230 if (s_me_name.find(
name) == 0 || s_me_name.find(tag_name) == 0) {
231 int ibin = s_me->getNbinsX();
233 tags.emplace(
nBins - ibin / 2, subdir_name);
240 }
else if (htype ==
"sum" || htype ==
"Sum") {
245 for (
auto* s_me : s_contents) {
249 if (s_me_name.find(
name) == std::string::npos)
252 TH1F* hist1 = s_me->getTH1F();
254 nBins = s_me->getNbinsX();
256 sum_name, sum_name,
nBins, hist1->GetXaxis()->GetXmin(), hist1->GetXaxis()->GetXmax());
266 TH1F*
hist =
me->getTH1F();
268 if (
name.find(
"NoisyStrips") != std::string::npos)
269 hist->GetYaxis()->SetTitle(
"Noisy Strips (%)");
271 hist->GetYaxis()->SetTitle(
name.c_str());
276 hist->LabelsOption(
"uv");
285 TH1F* hist1 =
nullptr;
286 TH2F* hist2 =
nullptr;
288 hist1 =
me->getTH1F();
290 hist2 =
me->getTH2F();
294 if (htype ==
"mean" || htype ==
"Mean") {
295 if (hist2 &&
name.find(
"NoisyStrips") != std::string::npos) {
299 float binEntry = entries /
nbins;
300 for (
int k = 1;
k <
nbins + 1;
k++) {
303 if (noisy >= binEntry * 0.5 || dead >= binEntry * 0.5)
306 bad = bad * 100.0 /
nbins;
311 }
else if (htype ==
"bin-by-bin" || htype ==
"Bin-by-Bin") {
312 for (
int k = 1;
k <
nbins + 1;
k++) {
315 }
else if (htype ==
"sum" || htype ==
"Sum") {
317 for (
int k = 1;
k <
nbins + 1;
k++) {
319 me->setBinContent(
k,
val);
bool getFrequencyForSummary(int &u_freq)
void setSummaryMENames(std::map< std::string, std::string > &me_names)
void getDocument(std::string filepath)
std::string pwd() override
bool readConfiguration(std::string const &file_path)
void fillSummaryHistos(DQMStore &dqm_store)
virtual double getEntries() const
get # of entries
std::map< std::string, std::string > summaryMEs_
Log< level::Info, false > LogInfo
virtual ~SiStripSummaryCreator()
void fillHistos(int ival, int istep, std::string htype, MonitorElement *me_src, MonitorElement *me)
MonitorElement * getSummaryME(DQMStore &dqm_store, std::string &name, std::string htype)
const std::string & getName() const
get name of ME
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)
virtual int getNbinsX() const
get # of bins in X-axis
void fillGrandSummaryHistos(DQMStore &dqm_store)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void createSummary(DQMStore &dqm_store)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const