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.empty())
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.empty())
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");
303 TH1F* hist1 =
nullptr;
304 TH2F* hist2 =
nullptr;
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)
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< MonitorElement * > getContents(std::string const &path) const
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
const std::string & getName() const
get name of ME
void setSummaryMENames(std::map< std::string, std::string > &me_names)
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
bool readConfiguration(std::string &file_path)
void createSummary(DQMStore *dqm_store)
std::map< std::string, std::string > summaryMEMap
std::vector< std::string > getSubdirs() const
std::string const & pwd() const
MonitorElement * getSummaryME(DQMStore *dqm_store, std::string &name, std::string htype)
virtual ~SiStripSummaryCreator()
double getEntries() const
get # of entries
void cd()
go to top directory (ie. root)
void fillHistos(int ival, int istep, std::string htype, MonitorElement *me_src, MonitorElement *me)
double getBinContent(int binx) const
get content of bin (1-D)
bool getMENamesForSummary(std::map< std::string, std::string > &me_names)
void fillSummaryHistos(DQMStore *dqm_store)
int getNbinsX() const
get # of bins in X-axis
void goUp()
equivalent to "cd .."
void fillGrandSummaryHistos(DQMStore *dqm_store)
Kind kind() const
Get the type of the monitor element.