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++) {
49 std::vector<std::string> subdirs = dqm_store.
getSubdirs();
51 for (std::vector<std::string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) {
52 if ((*it).find(
"module_") == std::string::npos)
59 for (std::vector<std::string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) {
72 std::map<std::string, MonitorElement*> MEMap;
73 std::vector<std::string> subdirs = dqm_store.
getSubdirs();
83 for (std::vector<std::string>::const_iterator it = subdirs.begin(); it != subdirs.end(); it++) {
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) ||
122 (dir_name.find(
"FU") == 0))
124 std::vector<std::string> subdirs = dqm_store.
getSubdirs();
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") {
162 fillHistos(0, ibinStep,
"bin-by-bin", me_i, me);
180 if (dname.find(
"_") != std::string::npos)
181 dname.insert(dname.find(
"_"),
"_");
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;
210 std::vector<std::string> subdirs = dqm_store.
getSubdirs();
212 if (htype ==
"mean" || htype ==
"Mean") {
213 nBins = subdirs.size();
214 me = dqm_store.
book1D(sum_name, sum_name, nBins, 0.5, nBins + 0.5);
216 for (
auto const& subdir : subdirs) {
217 std::string subdir_name = subdir.substr(subdir.find_last_of(
"/") + 1);
219 tags.emplace(ibin, subdir_name);
221 }
else if (htype ==
"bin-by-bin" || htype ==
"Bin-by-Bin") {
222 for (
auto const& subdir : subdirs) {
223 dqm_store.
cd(subdir);
224 std::string subdir_name = subdir.substr(subdir.find_last_of(
"/") + 1);
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);
239 me = dqm_store.
book1D(sum_name, sum_name, nBins, 0.5, nBins + 0.5);
240 }
else if (htype ==
"sum" || htype ==
"Sum") {
241 for (
auto const& subdir : subdirs) {
242 dqm_store.
cd(subdir);
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());
268 if (name.find(
"NoisyStrips") != std::string::npos)
269 hist->GetYaxis()->SetTitle(
"Noisy Strips (%)");
271 hist->GetYaxis()->SetTitle(name.c_str());
273 for (
auto const& [
bin,
label] : tags) {
274 hist->GetXaxis()->SetBinLabel(
bin,
label.c_str());
276 hist->LabelsOption(
"uv");
285 TH1F* hist1 =
nullptr;
286 TH2F* hist2 =
nullptr;
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++) {
bool getFrequencyForSummary(int &u_freq)
virtual TH2F * getTH2F() const
void goUp()
equivalent to "cd .."
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
virtual TH1F * getTH1F() const
std::vector< MonitorElement * > getContents(std::string const &path) const
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
void setSummaryMENames(std::map< std::string, std::string > &me_names)
std::string const & pwd() const
void cd()
go to top directory (ie. root)
bool readConfiguration(std::string const &file_path)
void fillSummaryHistos(DQMStore &dqm_store)
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)
std::map< std::string, std::string > summaryMEs_
virtual ~SiStripSummaryCreator()
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
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)
std::vector< std::string > getSubdirs() const
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
void fillGrandSummaryHistos(DQMStore &dqm_store)
void createSummary(DQMStore &dqm_store)
virtual TH1 * getTH1() const