13 " Creating SiStripSummaryCreator " <<
"\n" ;
22 " Deleting SiStripSummaryCreator " <<
"\n" ;
33 std::cout <<
"SiStripSummaryCreator::readConfiguration: Failed to read Summary configuration parameters!! ";
38 std::cout <<
"SiStripSummaryCreator::readConfiguration: Failed to read Summary configuration parameters!! ";
49 for (std::map<std::string,std::string>::const_iterator
isum = me_names.begin();
60 std::vector<std::string> subdirs = dqm_store->
getSubdirs();
62 for (std::vector<std::string>::const_iterator it = subdirs.begin();
63 it != subdirs.end(); it++) {
64 if ( (*it).find(
"module_") == std::string::npos)
continue;
70 for (std::vector<std::string>::const_iterator it = subdirs.begin();
71 it != subdirs.end(); it++) {
84 std::map<std::string, MonitorElement*> MEMap;
85 std::vector<std::string> subdirs = dqm_store->
getSubdirs();
86 if (subdirs.size() ==0)
return;
89 for (std::map<std::string,std::string>::const_iterator
isum =
summaryMEMap.begin();
95 for (std::vector<std::string>::const_iterator it = subdirs.begin();
96 it != subdirs.end(); it++) {
97 if ( (*it).find(
"module_") == std::string::npos)
continue;
102 for (std::vector<MonitorElement *>::const_iterator im = contents.begin();
103 im != contents.end(); im++) {
107 if (name_i.find(name) == std::string::npos)
continue;
108 std::map<std::string, MonitorElement*>::iterator iPos = MEMap.find(name);
111 if (iPos == MEMap.end()){
113 MEMap.insert(std::pair<std::string, MonitorElement*>(name, me));
114 }
else me = iPos->second;
127 std::map<std::string, MonitorElement*> MEMap;
130 if ((dir_name.find(
"SiStrip") == 0) ||
131 (dir_name.find(
"Collector") == 0) ||
132 (dir_name.find(
"MechanicalView") == 0) ||
133 (dir_name.find(
"FU") == 0) )
return;
134 std::vector<std::string> subdirs = dqm_store->
getSubdirs();
135 if (subdirs.size() == 0)
return;;
136 for (std::map<std::string,std::string>::const_iterator
isum =
summaryMEMap.begin();
140 if (
isum->second ==
"sum" ||
isum->second ==
"sum")
141 summary_name =
"Summary_" +
isum->first;
143 summary_name =
"Summary_Mean" +
isum->first;
146 for (std::vector<std::string>::const_iterator it = subdirs.begin();
147 it != subdirs.end(); it++) {
151 for (std::vector<MonitorElement *>::const_iterator im = contents.begin();
152 im != contents.end(); im++) {
156 if (name_i.find((summary_name)) != std::string::npos) {
158 std::map<std::string, MonitorElement*>::iterator iPos = MEMap.find(name);
160 if (iPos == MEMap.end()) {
161 if (htype ==
"sum" || htype ==
"Sum") {
166 MEMap.insert(std::pair<std::string, MonitorElement*>(name, me));
167 }
else me = iPos->second;
168 if (htype ==
"sum" || htype ==
"Sum") {
171 fillHistos(0, ibinStep,
"bin-by-bin", me_i, me);
190 if (dname.find(
"_") != std::string::npos) dname.insert(dname.find(
"_"),
"_");
191 if (htype ==
"sum" && htype ==
"Sum") {
192 sum_name =
"Summary" + name +
"__" +
dname;
193 tag_name =
"Summary" +
name;
195 sum_name =
"Summary_Mean" + name +
"__" +
dname;
196 tag_name =
"Summary_Mean" +
name;
200 for (std::vector<MonitorElement *>::const_iterator im = contents.begin();
201 im != contents.end(); im++) {
205 if (me_name.find(sum_name) == 0) {
209 TH1* hist1 = me->
getTH1();
217 std::map<int, std::string>
tags;
220 std::vector<std::string> subdirs = dqm_store->
getSubdirs();
222 if (htype ==
"mean" || htype ==
"Mean" ) {
223 nBins = subdirs.size();
224 me = dqm_store->
book1D(sum_name,sum_name,nBins,0.5,nBins+0.5);
226 for (std::vector<std::string>::const_iterator it = subdirs.begin();
227 it != subdirs.end(); it++) {
228 std::string subdir_name = (*it).substr((*it).find_last_of(
"/")+1);
230 tags.insert(std::pair<int,std::string>(ibin, (subdir_name)));
232 }
else if (htype ==
"bin-by-bin" || htype ==
"Bin-by-Bin") {
233 for (std::vector<std::string>::const_iterator it = subdirs.begin();
234 it != subdirs.end(); it++) {
236 std::string subdir_name = (*it).substr((*it).find_last_of(
"/")+1);
237 std::vector<MonitorElement*> s_contents = dqm_store->
getContents(dqm_store->
pwd());
238 for (std::vector<MonitorElement *>::const_iterator iv = s_contents.begin();
239 iv != s_contents.end(); iv++) {
243 if (s_me_name.find(name) == 0 || s_me_name.find(tag_name) == 0) {
246 tags.insert(std::pair<int,std::string>(nBins-ibin/2, (subdir_name)));
252 me = dqm_store->
book1D(sum_name,sum_name,nBins,0.5,nBins+0.5);
253 }
else if (htype ==
"sum" || htype ==
"Sum") {
254 for (std::vector<std::string>::const_iterator it = subdirs.begin();
255 it != subdirs.end(); it++) {
257 std::vector<MonitorElement*> s_contents = dqm_store->
getContents(dqm_store->
pwd());
259 for (std::vector<MonitorElement *>::const_iterator iv = s_contents.begin();
260 iv != s_contents.end(); iv++) {
264 if (s_me_name.find(name) == std::string::npos)
continue;
269 me = dqm_store->
book1D(sum_name,sum_name,nBins,
270 hist1->GetXaxis()->GetXmin(),hist1->GetXaxis()->GetXmax());
280 && (htype !=
"sum" || htype !=
"Sum")) {
283 if (name.find(
"NoisyStrips") != std::string::npos) hist->GetYaxis()->SetTitle(
"Noisy Strips (%)");
284 else hist->GetYaxis()->SetTitle(name.c_str());
286 for (std::map<int,std::string>::const_iterator ic = tags.begin();
287 ic != tags.end(); ic++) {
288 hist->GetXaxis()->SetBinLabel(ic->first, (ic->second).c_str());
290 hist->LabelsOption(
"uv");
311 if (htype ==
"mean" || htype ==
"Mean" ) {
312 if (hist2 && name.find(
"NoisyStrips") != std::string::npos) {
316 float binEntry = entries/
nbins;
317 for (
int k=1;
k<nbins+1;
k++) {
321 if (noisy >= binEntry*0.5 || dead >= binEntry*0.5) bad++;
323 bad = bad*100.0/
nbins;
327 }
else if (htype ==
"bin-by-bin" || htype ==
"Bin-by-Bin") {
328 for (
int k=1;
k<nbins+1;
k++) {
331 }
else if (htype ==
"sum" || htype ==
"Sum") {
333 for (
int k=1;
k<nbins+1;
k++) {
bool getFrequencyForSummary(int &u_freq)
const std::string & getName(void) const
get name of ME
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > getSubdirs(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
void cd(void)
go to top directory (ie. root)
void setSummaryMENames(std::map< std::string, std::string > &me_names)
double getEntries(void) const
get # of entries
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
bool readConfiguration(std::string &file_path)
void createSummary(DQMStore *dqm_store)
Kind kind(void) const
Get the type of the monitor element.
std::map< std::string, std::string > summaryMEMap
std::vector< MonitorElement * > getContents(const std::string &path) const
MonitorElement * getSummaryME(DQMStore *dqm_store, std::string &name, std::string htype)
virtual ~SiStripSummaryCreator()
void fillHistos(int ival, int istep, std::string htype, MonitorElement *me_src, MonitorElement *me)
TH1F * getTH1F(void) const
double getBinContent(int binx) const
get content of bin (1-D)
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)
int getNbinsX(void) const
get # of bins in X-axis
void goUp(void)
equivalent to "cd .."
void fillSummaryHistos(DQMStore *dqm_store)
TH2F * getTH2F(void) const
void fillGrandSummaryHistos(DQMStore *dqm_store)
const std::string & pwd(void) const