28 " Creating SiStripQualityChecker " <<
"\n" ;
32 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TIB",
"TIB"));
33 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TOB",
"TOB"));
34 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TECF",
"TEC/PLUS"));
35 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TECB",
"TEC/MINUS"));
36 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TIDF",
"TID/PLUS"));
37 SubDetFolderMap.insert(std::pair<std::string, std::string>(
"TIDB",
"TID/MINUS"));
42 "\n------------------------------------------"
43 "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
44 "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
45 "\n------------------------------------------";
55 " Deleting SiStripQualityChecker " <<
"\n" ;
66 if (strip_dir.size() == 0) strip_dir =
"SiStrip";
73 hname =
"detFractionReportMap";
74 htitle =
"SiStrip Report for Good Detector Fraction";
78 hname =
"sToNReportMap";
79 htitle =
"SiStrip Report for Signal-to-Noise";
87 hname =
"reportSummaryMap";
88 htitle =
"SiStrip Report Summary Map";
97 for (std::map<std::string, std::string>::const_iterator it =
SubDetFolderMap.begin();
108 else if (det ==
"TECB") local_mes.
detectorTag =
"TEC-";
109 else if (det ==
"TIDF") local_mes.
detectorTag =
"TID+";
110 else if (det ==
"TIDB") local_mes.
detectorTag =
"TID-";
114 me_name =
"SiStrip_" + det;
117 me_name =
"SiStrip_DetFraction_" + det;
120 me_name =
"SiStrip_SToNFlag_" + det;
122 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
134 for (std::map<std::string, SubDetMEs>::const_iterator it =
SubDetMEsMap.begin();
157 for (std::map<std::string, SubDetMEs>::const_iterator it =
SubDetMEsMap.begin();
187 unsigned int xbin = 0;
188 float global_flag = 0;
195 for (std::map<std::string, SubDetMEs>::const_iterator it =
SubDetMEsMap.begin();
198 std::map<std::string, std::string>::const_iterator cPos =
SubDetFolderMap.find(det);
201 if (!dqm_store->
dirExists(dname))
continue;
202 dqm_store->
cd(dname);
209 global_flag = global_flag/xbin*1.0;
218 SubDetMEs& mes,
unsigned int xbin,
float& gflag) {
221 if (status_flag < 1)
return;
223 std::vector<std::string> subDirVec = dqm_store->
getSubdirs();
225 unsigned int ybin = 0;
228 float tot_ston_stat = 0;
230 for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
231 ic != subDirVec.end(); ic++) {
233 if (dname.find(
"BadModuleList") != std::string::npos)
continue;
234 std::vector<MonitorElement*> meVec;
236 dqm_store->
cd((*ic));
242 int lnum = atoi(dname.substr(dname.find_last_of(
"_")+1).c_str());
243 ndet = cabling->connectedNumber(mes.
detectorTag, lnum);
247 for (std::vector<MonitorElement*>::const_iterator it = meVec.begin();
248 it != meVec.end(); it++) {
251 std::vector<QReport *> reports = me->
getQReports();
253 if (reports.size() == 0)
continue;
256 if( name.find(
"Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
258 if (reports[0]->getQTresult() == -1) {
267 float eff_fac = 1 - (errdet*1.0/ndet);
274 tot_errdet += errdet;
275 tot_ston_stat += ston_stat;
277 dqm_store->
cd((*ic));
280 float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
282 float tot_ston_fac = tot_ston_stat/ybin;
284 if (tot_ston_fac < 0){
287 gflag =
std::min(tot_eff_fac,tot_ston_fac);
296 std::ostringstream det_summary_str;
297 for (std::map<std::string, SubDetMEs>::const_iterator it =
SubDetMEsMap.begin();
300 det_summary_str << std::setprecision(4);
301 det_summary_str << std::setiosflags(std::ios::fixed);
303 det_summary_str <<
" Printing Status for " << det <<
" : " << std::endl;
307 float fval1, fval2, fval3;
308 fval1 = fval2 = fval3 = -1.0;
312 if (sval.size() > 0) fval1 = atof(sval.c_str());
314 if (sval.size() > 0) fval2 = atof(sval.c_str());
316 if (sval.size() > 0) fval3 = atof(sval.c_str());
318 det_summary_str << std::setw(7) <<
" % of good detectors " << fval1
319 <<
" SToN Flag " << fval2
320 <<
" Summary Flag " << fval3 << std::endl;
329 std::map<uint32_t,uint16_t> bad_modules;
330 for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin();
331 it != layer_mes.end(); it++) {
334 std::vector<QReport *> qreports = me->
getQReports();
335 if (qreports.size() == 0)
continue;
337 std::vector<DQMChannel> bad_channels_me;
339 bad_channels_me = qreports[0]->getBadChannels();
342 bad_channels_me = qreports[0]->getBadChannels();
343 lname = name.substr(name.find(
"TkHMap_")+7);
344 lname = lname.substr(lname.find(
"_T")+1);
347 for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++){
348 int xval = (*it).getBinX();
349 int yval = (*it).getBinY();
351 std::map<uint32_t,uint16_t>::iterator iPos = bad_modules.find(detId);
353 if (iPos != bad_modules.end()){
361 std::ostringstream detid_str;
365 std::string thisMEpath = currentdir.substr( 0 , currentdir.rfind(
"/" ) ) +
"/BadModuleList/" + detid_str.str() ;
372 flag = atoi ( val_str.c_str() );
378 bad_modules.insert(std::pair<uint32_t,uint16_t>(detId,flag));
382 for(std::map<uint32_t,uint16_t>::const_iterator it = bad_modules.begin();
383 it != bad_modules.end(); it++) {
384 uint32_t detId = it->first;
385 uint16_t
flag = it->second;
386 std::map<uint32_t,uint16_t>::iterator iPos =
badModuleList.find(detId);
390 badModuleList.insert(std::pair<uint32_t,uint16_t>(detId,flag));
393 errdet = bad_modules.size();
401 th2d->SetBinContent(xbin, ybin, val);
422 uint32_t detId = it->first;
425 if (!dqm_store->
dirExists(subdet_folder)) {
426 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(
"MechanicalView")+14);
427 if (!dqm_store->
dirExists(subdet_folder))
continue;
429 std::string bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
432 std::ostringstream detid_str;
434 std::string full_path = bad_module_folder +
"/" + detid_str.str();
437 else me = dqm_store->
bookInt(detid_str.str());
438 me->
Fill(it->second);
471 +
"lumiErrorFraction";
475 float global_fraction = 0.0;
477 for (
int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
479 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(label);
481 float fraction = 1.0 - th1->GetBinContent(ibin);
482 global_fraction += fraction;
484 iPos->second.DetFraction ->
Fill(fraction);
485 iPos->second.SToNFlag ->
Fill(-1.0);
486 iPos->second.SummaryFlag ->
Fill(fraction);
489 global_fraction = global_fraction/dets;
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, const edm::EventSetup &eSetup)
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
MonitorElement * SToNFlag
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void bookStatus(DQMStore *dqm_store)
void fillDetectorStatusAtLumi(DQMStore *dqm_store)
std::vector< std::string > getSubdirs(void) const
void fillDetectorStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
static void getMEValue(MonitorElement *me, std::string &val)
std::map< std::string, std::string > SubDetFolderMap
void cd(void)
go to top directory (ie. root)
MonitorElement * SummaryFlag
void getModuleStatus(DQMStore *dqm_store, std::vector< MonitorElement * > &layer_mes, int &errdet)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
tuple currentdir
parse figure configuration if found
void initialiseBadModuleList()
MonitorElement * bookFloat(const char *name)
Book float.
SiStripQualityChecker(edm::ParameterSet const &ps)
int getNbinsY(void) const
get # of bins in Y-axis
std::map< std::string, SubDetMEs > SubDetMEsMap
uint32_t getDetFromBin(int layer, int ix, int iy) const
virtual ~SiStripQualityChecker()
void fillFaultyModuleStatus(DQMStore *dqm_store, const edm::EventSetup &eSetup)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< MonitorElement * > getContents(const std::string &path) const
MonitorElement * DetFractionReportMap
bool dirExists(const std::string &path) const
true if directory exists
std::vector< QReport * > getQReports(void) const
get map of QReports
static int getMEStatus(MonitorElement *me)
T const * product() const
TH1F * getTH1F(void) const
void fillStatusAtLumi(DQMStore *dqm_store)
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
int getNbinsX(void) const
get # of bins in X-axis
static const int STATUS_OK
std::map< uint32_t, uint16_t > badModuleList
void Reset(std::vector< TH2F > &depth)
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void fillSubDetStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
static bool goToDir(DQMStore *dqm_store, std::string name)
MonitorElement * DetFraction
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
const std::string & pwd(void) const