28 edm::LogInfo(
"TrackingQualityChecker") <<
" Creating TrackingQualityChecker " <<
"\n" ;
35 "\n------------------------------------------"
36 "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
37 "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
38 "\n------------------------------------------";
44 std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingGlobalQualityPSets" );
45 for (
auto meQTset : TrackingGlobalQualityMEs ) {
48 tracking_mes.HistoDir = meQTset.getParameter<
std::string>(
"dir");
49 tracking_mes.HistoName = meQTset.getParameter<
std::string>(
"name");
51 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
56 std::vector<edm::ParameterSet> TrackingLSQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingLSQualityPSets" );
57 for (
auto meQTset : TrackingLSQualityMEs ) {
60 tracking_ls_mes.
HistoLSDir = meQTset.exists(
"LSdir") ? meQTset.getParameter<
std::string>(
"LSdir") :
"";
62 tracking_ls_mes.
HistoLSLowerCut = meQTset.exists(
"LSlowerCut") ? meQTset.getParameter<
double>(
"LSlowerCut") : -1.;
63 tracking_ls_mes.
HistoLSUpperCut = meQTset.exists(
"LSupperCut") ? meQTset.getParameter<
double>(
"LSupperCut") : -1.;
67 TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
76 edm::LogInfo(
"TrackingQualityChecker") <<
" Deleting TrackingQualityChecker " <<
"\n" ;
87 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus" <<
"\n";
96 hname =
"reportSummaryMap";
97 htitle =
"Tracking Report Summary Map";
112 for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
113 it != TrackingMEsMap.end(); it++) {
115 it->second.TrackingFlag = dqm_store->
bookFloat(
"Track"+meQTname);
131 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus" <<
"\n";
140 hname =
"reportSummaryMap";
141 htitle =
"Tracking Report Summary Map";
147 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
150 it->second.TrackingFlag = dqm_store->
bookFloat(
"Track"+meQTname);
176 for (std::map<std::string, TrackingMEs>::iterator it =
TrackingMEsMap.begin();
178 it->second.TrackingFlag->Fill(-1.0);
191 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
193 it->second.TrackingFlag->Fill(-1.0);
210 for (std::map<std::string, TrackingMEs>::iterator it =
TrackingMEsMap.begin();
226 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
274 for (std::map<std::string, TrackingMEs>::iterator it =
TrackingMEsMap.begin();
284 std::vector<MonitorElement*> tmpMEvec = dqm_store->
getContents(dqm_store->
pwd()+
"/"+localMEdirpath);
288 for (
auto ime : tmpMEvec ) {
290 if ( name.find(MEname) != std::string::npos) {
298 for (
auto ime : tmpMEvec ) {
300 if ( name.find(MEname) != std::string::npos) {
306 std::vector<QReport *> qt_reports = me->
getQReports();
307 size_t nQTme = qt_reports.size();
311 for (
auto iQT : qt_reports ) {
312 status += iQT->getQTresult();
316 status = status/float(nQTme);
318 it->second.TrackingFlag->Fill(status);
324 if ( status < 0. ) gstatus = -1.;
331 for (
auto ime : tmpMEvec ) {
332 float tmp_status = 1.;
334 if ( name.find(MEname) != std::string::npos) {
338 std::vector<QReport *> qt_reports = me->
getQReports();
339 size_t nQTme = qt_reports.size();
343 for (
auto iQT : qt_reports ) {
344 tmp_status += iQT->getQTresult();
348 tmp_status = tmp_status/float(nQTme);
351 status = fminf(tmp_status,status);
353 if ( status < 0. ) gstatus = -1.;
356 it->second.TrackingFlag->Fill(status);
365 if (gstatus < 1.) gstatus = -1.;
366 else gstatus = gstatus/float(nQT);
382 th2d->SetBinContent(xbin, ybin, val);
398 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
405 std::string localMEdirpath = it->second.HistoLSDir;
407 float lower_cut = it->second.HistoLSLowerCut;
408 float upper_cut = it->second.HistoLSUpperCut;
412 std::vector<MonitorElement*> tmpMEvec = dqm_store->
getContents(dqm_store->
pwd()+
"/"+localMEdirpath);
418 for (
auto ime : tmpMEvec ) {
420 if ( name.find(MEname) != std::string::npos) {
427 for (
auto ime : tmpMEvec ) {
429 if ( name.find(MEname) != std::string::npos) {
438 if (x_mean <= lower_cut || x_mean > upper_cut) status = 0.0;
442 for (
auto ime : tmpMEvec ) {
443 float tmp_status = 1.;
445 if ( name.find(MEname) != std::string::npos) {
452 if (x_mean <= lower_cut || x_mean > upper_cut) tmp_status = 0.0;
453 else tmp_status = 1.0;
457 status = fminf(tmp_status,status);
461 it->second.TrackingFlag->Fill(status);
463 if (status == 0.0) gstatus = -1.0;
464 else gstatus = gstatus *
status;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * TrackingFlag
void fillTrackingStatus(DQMStore *dqm_store)
MonitorElement * TrackGlobalSummaryReportMap
void fillDummyGlobalStatus()
static bool goToDir(DQMStore *dqm_store, std::string name)
void fillGlobalStatus(DQMStore *dqm_store)
void cd(void)
go to top directory (ie. root)
std::map< std::string, TrackingMEs > TrackingMEsMap
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)
void bookLSStatus(DQMStore *dqm_store)
virtual ~TrackingQualityChecker()
std::string TopFolderName_
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
MonitorElement * bookFloat(const char *name)
Book float.
TrackingQualityChecker(edm::ParameterSet const &ps)
MonitorElement * TrackLSSummaryReportGlobal
bool bookedTrackingGlobalStatus_
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
Kind kind(void) const
Get the type of the monitor element.
std::vector< MonitorElement * > getContents(const std::string &path) const
void bookGlobalStatus(DQMStore *dqm_store)
std::vector< QReport * > getQReports(void) const
get map of QReports
void fillTrackingStatusAtLumi(DQMStore *dqm_store)
bool bookedTrackingLSStatus_
void fillLSStatus(DQMStore *dqm_store)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * TrackGlobalSummaryReportGlobal
void Reset(std::vector< TH2F > &depth)
TH2F * getTH2F(void) const
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)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void setCurrentFolder(const std::string &fullpath)
const std::string & pwd(void) const