CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
TrackingQualityChecker Class Reference

#include <TrackingQualityChecker.h>

Classes

struct  TrackingLSMEs
 
struct  TrackingMEs
 

Public Member Functions

void bookGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void bookLSStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillDummyGlobalStatus ()
 
void fillDummyLSStatus ()
 
void fillGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillLSStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void resetGlobalStatus ()
 
void resetLSStatus ()
 
 TrackingQualityChecker (edm::ParameterSet const &ps)
 
virtual ~TrackingQualityChecker ()
 

Private Member Functions

void fillStatusHistogram (MonitorElement *, int xbin, int ybin, float val)
 
void fillTrackingStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillTrackingStatusAtLumi (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 

Private Attributes

bool bookedTrackingGlobalStatus_
 
bool bookedTrackingLSStatus_
 
edm::ParameterSet pSet_
 
std::string TopFolderName_
 
MonitorElementTrackGlobalSummaryReportGlobal
 
MonitorElementTrackGlobalSummaryReportMap
 
std::map< std::string,
TrackingLSMEs
TrackingLSMEsMap
 
std::map< std::string,
TrackingMEs
TrackingMEsMap
 
MonitorElementTrackLSSummaryReportGlobal
 
bool verbose_
 

Detailed Description

Definition at line 21 of file TrackingQualityChecker.h.

Constructor & Destructor Documentation

TrackingQualityChecker::TrackingQualityChecker ( edm::ParameterSet const &  ps)

Definition at line 24 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, bookedTrackingLSStatus_, gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), TrackingQualityChecker::TrackingLSMEs::HistoLSDir, TrackingQualityChecker::TrackingLSMEs::HistoLSLowerCut, TrackingQualityChecker::TrackingLSMEs::HistoLSName, TrackingQualityChecker::TrackingLSMEs::HistoLSUpperCut, pSet_, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingQualityChecker::TrackingLSMEs::TrackingFlag, TrackingLSMEsMap, TrackingMEsMap, and verbose_.

24  :
25  pSet_(ps),
26  verbose_( pSet_.getUntrackedParameter<bool>("verbose",false))
27 {
28  edm::LogInfo("TrackingQualityChecker") << " Creating TrackingQualityChecker " << "\n" ;
29 
32 
33  if(!edm::Service<TkDetMap>().isAvailable()){
34  edm::LogError("TkHistoMap") <<
35  "\n------------------------------------------"
36  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
37  "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
38  "\n------------------------------------------";
39  }
40 
41  TopFolderName_ = pSet_.getUntrackedParameter<std::string>("TopFolderName","Tracking");
42 
43  TrackingMEs tracking_mes;
44  std::vector<edm::ParameterSet> TrackingGlobalQualityMEs = pSet_.getParameter< std::vector<edm::ParameterSet> >("TrackingGlobalQualityPSets" );
45  for ( auto meQTset : TrackingGlobalQualityMEs ) {
46 
47  std::string QTname = meQTset.getParameter<std::string>("QT");
48  tracking_mes.HistoDir = meQTset.getParameter<std::string>("dir");
49  tracking_mes.HistoName = meQTset.getParameter<std::string>("name");
50  if (verbose_) std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap" << std::endl;
51  TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
52  }
53  if (verbose_) std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingMEsMap" << std::endl;
54 
55  TrackingLSMEs tracking_ls_mes;
56  std::vector<edm::ParameterSet> TrackingLSQualityMEs = pSet_.getParameter< std::vector<edm::ParameterSet> >("TrackingLSQualityPSets" );
57  for ( auto meQTset : TrackingLSQualityMEs ) {
58 
59  std::string QTname = meQTset.getParameter<std::string>("QT");
60  tracking_ls_mes.HistoLSDir = meQTset.exists("LSdir") ? meQTset.getParameter<std::string>("LSdir") : "";
61  tracking_ls_mes.HistoLSName = meQTset.exists("LSname") ? meQTset.getParameter<std::string>("LSname") : "";
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.;
64  tracking_ls_mes.TrackingFlag = 0;
65 
66  if (verbose_) std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap" << std::endl;
67  TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
68  }
69  if (verbose_) std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingLSMEsMap" << std::endl;
70 
71 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TrackingMEs > TrackingMEsMap
tuple cout
Definition: gather_cfg.py:121
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
TrackingQualityChecker::~TrackingQualityChecker ( )
virtual

Definition at line 75 of file TrackingQualityChecker.cc.

75  {
76  edm::LogInfo("TrackingQualityChecker") << " Deleting TrackingQualityChecker " << "\n" ;
77 }

Member Function Documentation

void TrackingQualityChecker::bookGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 81 of file TrackingQualityChecker.cc.

References DQMStore::IBooker::book2D(), bookedTrackingGlobalStatus_, DQMStore::IBooker::bookFloat(), DQMStore::IBooker::cd(), gather_cfg::cout, TrackingUtility::getTopFolderPath(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by TrackingActionExecutor::createGlobalStatus(), and fillGlobalStatus().

81  {
82 
83  if (verbose_) std::cout << "[TrackingQualityChecker::bookGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
84 
86  ibooker.cd();
87  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus" << "\n";
88 
89  std::string tracking_dir = "";
90  TrackingUtility::getTopFolderPath(ibooker,igetter, TopFolderName_, tracking_dir);
91  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo");
92 
93  TrackGlobalSummaryReportGlobal = ibooker.bookFloat("reportSummary");
94 
95  std::string hname, htitle;
96  hname = "reportSummaryMap";
97  htitle = "Tracking Report Summary Map";
98 
99  size_t nQT = TrackingMEsMap.size();
100  if (verbose_) std::cout << "[TrackingQualityChecker::bookGlobalStatus] nQT: " << nQT << std::endl;
101  TrackGlobalSummaryReportMap = ibooker.book2D(hname, htitle, nQT,0.5,float(nQT)+0.5,1,0.5,1.5);
102  TrackGlobalSummaryReportMap->setAxisTitle("Track Quality Type", 1);
103  TrackGlobalSummaryReportMap->setAxisTitle("QTest Flag", 2);
104  size_t ibin =0;
105  for ( auto meQTset : TrackingMEsMap ) {
106  TrackGlobalSummaryReportMap->setBinLabel(ibin+1,meQTset.first);
107  ibin++;
108  }
109 
110  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo/reportSummaryContents");
111 
112  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
113  it != TrackingMEsMap.end(); it++) {
114  std::string meQTname = it->first;
115  it->second.TrackingFlag = ibooker.bookFloat("Track"+meQTname);
116  if (verbose_) std::cout << "[TrackingQualityChecker::bookGlobalStatus] " << it->first << " exists ? " << it->second.TrackingFlag << std::endl;
117  if (verbose_) std::cout << "[TrackingQualityChecker::bookGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
118  }
119 
121  ibooker.cd();
122  }
123 }
MonitorElement * TrackGlobalSummaryReportMap
void cd(void)
Definition: DQMStore.cc:266
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 setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * TrackGlobalSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static void getTopFolderPath(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string top_dir, std::string &path)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void TrackingQualityChecker::bookLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 125 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, DQMStore::IBooker::bookFloat(), DQMStore::IBooker::cd(), gather_cfg::cout, TrackingUtility::getTopFolderPath(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by TrackingActionExecutor::createLSStatus(), and fillLSStatus().

125  {
126 
127  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
128 
130  ibooker.cd();
131  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus" << "\n";
132 
133  std::string tracking_dir = "";
134  TrackingUtility::getTopFolderPath(ibooker,igetter, TopFolderName_, tracking_dir);
135  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo");
136 
137  TrackLSSummaryReportGlobal = ibooker.bookFloat("reportSummary");
138 
139  std::string hname, htitle;
140  hname = "reportSummaryMap";
141  htitle = "Tracking Report Summary Map";
142 
143 
144  if (verbose_) {
145  size_t nQT = TrackingLSMEsMap.size();
146  std::cout << "[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
147  }
148 
149  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo/reportSummaryContents");
150  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
151  it != TrackingLSMEsMap.end(); it++) {
152  std::string meQTname = it->first;
153  it->second.TrackingFlag = ibooker.bookFloat("Track"+meQTname);
154  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] " << it->first << " exists ? " << it->second.TrackingFlag << std::endl;
155  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
156  }
157 
159  ibooker.cd();
160  }
161 }
void cd(void)
Definition: DQMStore.cc:266
MonitorElement * TrackLSSummaryReportGlobal
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static void getTopFolderPath(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string top_dir, std::string &path)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::fillDummyGlobalStatus ( )

Definition at line 166 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, gather_cfg::cout, MonitorElement::Fill(), fillStatusHistogram(), MonitorElement::getNbinsX(), resetGlobalStatus(), TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by TrackingActionExecutor::fillDummyGlobalStatus(), and fillGlobalStatus().

166  {
167  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
168 
170  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
172 
174 
175  for (int ibin = 1; ibin < TrackGlobalSummaryReportMap->getNbinsX()+1; ibin++) {
177  }
178 
179  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
180  it != TrackingMEsMap.end(); it++)
181  it->second.TrackingFlag->Fill(-1.0);
182  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
183 
184  }
185 }
MonitorElement * TrackGlobalSummaryReportMap
std::map< std::string, TrackingMEs > TrackingMEsMap
void Fill(long long x)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * TrackGlobalSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 186 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, gather_cfg::cout, MonitorElement::Fill(), resetLSStatus(), TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by TrackingActionExecutor::fillDummyLSStatus(), and fillLSStatus().

186  {
187  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
188 
189  resetLSStatus();
190  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
192 
194  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
195  it != TrackingLSMEsMap.end(); it++)
196  it->second.TrackingFlag->Fill(-1.0);
197  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
198 
199  }
200 }
void Fill(long long x)
MonitorElement * TrackLSSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::fillGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 243 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, bookGlobalStatus(), DQMStore::IBooker::cd(), gather_cfg::cout, fillDummyGlobalStatus(), fillTrackingStatus(), and verbose_.

Referenced by TrackingActionExecutor::fillGlobalStatus().

243  {
244 
245  if (verbose_) std::cout << "[TrackingQualityChecker::fillGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
246  if (!bookedTrackingGlobalStatus_) bookGlobalStatus(ibooker,igetter);
247 
249  fillTrackingStatus(ibooker,igetter);
250  if (verbose_) std::cout << "[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
251  ibooker.cd();
252 }
void cd(void)
Definition: DQMStore.cc:266
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
tuple cout
Definition: gather_cfg.py:121
void TrackingQualityChecker::fillLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 254 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, bookLSStatus(), DQMStore::IBooker::cd(), gather_cfg::cout, fillDummyLSStatus(), fillTrackingStatusAtLumi(), and verbose_.

Referenced by TrackingActionExecutor::fillStatusAtLumi().

254  {
255 
256  if (verbose_) std::cout << "[TrackingQualityChecker::fillLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
257  if (!bookedTrackingLSStatus_) bookLSStatus(ibooker,igetter);
258 
260  fillTrackingStatusAtLumi(ibooker,igetter);
261  if (verbose_) std::cout << "[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
262  ibooker.cd();
263 }
void cd(void)
Definition: DQMStore.cc:266
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
tuple cout
Definition: gather_cfg.py:121
void TrackingQualityChecker::fillStatusHistogram ( MonitorElement me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 394 of file TrackingQualityChecker.cc.

References MonitorElement::DQM_KIND_TH2F, MonitorElement::getTH2F(), and MonitorElement::kind().

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

394  {
395  if (me && me->kind() == MonitorElement::DQM_KIND_TH2F) {
396  TH2F* th2d = me->getTH2F();
397  th2d->SetBinContent(xbin, ybin, val);
398  }
399  }
Kind kind(void) const
Get the type of the monitor element.
TH2F * getTH2F(void) const
void TrackingQualityChecker::fillTrackingStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 268 of file TrackingQualityChecker.cc.

References DQMStore::IBooker::cd(), gather_cfg::cout, MonitorElement::Fill(), fillStatusHistogram(), DQMStore::IGetter::getContents(), MonitorElement::getFullname(), MonitorElement::getName(), MonitorElement::getQReports(), TrackingUtility::goToDir(), if(), mergeVDriftHistosByStation::name, NULL, DQMStore::IBooker::pwd(), ntuplemaker::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillGlobalStatus().

268  {
269 
270  float gstatus = 0.0;
271 
272  ibooker.cd();
273  if (!TrackingUtility::goToDir(ibooker,igetter, TopFolderName_)) return;
274 
275 
276  int ibin = 0;
277  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
278  it != TrackingMEsMap.end(); it++) {
279 
280  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
281 
282  ibin++;
283 
284  std::string localMEdirpath = it->second.HistoDir;
285  std::string MEname = it->second.HistoName;
286 
287  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd()+"/"+localMEdirpath);
288  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] tmpMEvec: " << tmpMEvec.size() << std::endl;
289  MonitorElement* me = NULL;
290 
291  size_t nMEs = 0;
292  for ( auto ime : tmpMEvec ) {
293  std::string name = ime->getName();
294  if (verbose_) std::cout << "name: " << name << " <-- --> " << MEname << std::endl;
295  if ( name.find(MEname) != std::string::npos) {
296  me = ime;
297  nMEs++;
298  }
299  }
300  // only one ME found
301  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] nMEs: " << nMEs << std::endl;
302  if (nMEs == 1) {
303  float status = 0.;
304  for ( auto ime : tmpMEvec ) {
305  std::string name = ime->getName();
306  if (verbose_) std::cout << "name: " << name << " [" << MEname << "]" << std::endl;
307  if ( name.find(MEname) != std::string::npos) {
308  me = ime;
309  if (verbose_) std::cout << "inside the loop nQTme: " << me->getQReports().size() << "[" << ime->getFullname() << "]" << std::endl;
310  }
311  }
312  if (verbose_) std::cout << "me: " << me << "[" << me->getName() << ", " << me->getFullname() << "]" << std::endl;
313  if (!me) continue;
314  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] status: " << status << std::endl;
315  std::vector<QReport *> qt_reports = me->getQReports();
316  size_t nQTme = qt_reports.size();
317  if (verbose_) std::cout << "nQTme: " << nQTme << std::endl;
318  if (nQTme != 0) {
319  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size() << std::endl;
320  // loop on possible QTs
321  for ( auto iQT : qt_reports ) {
322  status += iQT->getQTresult();
323  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
324  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? " << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
325  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage() << std::endl;
326  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus() << std::endl;
327  }
328  status = status/float(nQTme);
329  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << status << std::endl;
330  it->second.TrackingFlag->Fill(status);
331  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
333  }
334 
335  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus << " x status: " << status << std::endl;
336  if ( status < 0. ) gstatus = -1.;
337  else gstatus += status;
338  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
339  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
340 
341  } else { // more than 1 ME w/ the same root => they need to be considered together
342  float status = 1.;
343  for ( auto ime : tmpMEvec ) {
344  float tmp_status = 1.;
345  std::string name = ime->getName();
346  if ( name.find(MEname) != std::string::npos) {
347  me = ime;
348 
349  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] status: " << status << std::endl;
350  std::vector<QReport *> qt_reports = me->getQReports();
351  size_t nQTme = qt_reports.size();
352  if (verbose_) std::cout << "nQTme: " << nQTme << "[" << name << ", " << ime->getFullname() << "]" << std::endl;
353  if (nQTme != 0) {
354  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size() << std::endl;
355  // loop on possible QTs
356  for ( auto iQT : qt_reports ) {
357  tmp_status += iQT->getQTresult();
358  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
359  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? " << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
360  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage() << std::endl;
361  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus() << std::endl;
362  }
363  tmp_status = tmp_status/float(nQTme);
364  }
365  }
366  status = fminf(tmp_status,status);
367  }
368  if ( status < 0. ) gstatus = -1.;
369  else gstatus += status;
370  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << status << std::endl;
371  it->second.TrackingFlag->Fill(status);
372  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
373 
375  }
376  }
377 
378  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus << std::endl;
379  size_t nQT = TrackingMEsMap.size();
380  if (gstatus < 1.) gstatus = -1.;
381  else gstatus = gstatus/float(nQT);
382 
383  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
385  ibooker.cd();
386 
387  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatus] DONE" << std::endl;
388 
389 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:196
const std::string & getName(void) const
get name of ME
MonitorElement * TrackGlobalSummaryReportMap
void cd(void)
Definition: DQMStore.cc:266
const std::string & pwd(void)
Definition: DQMStore.cc:282
std::map< std::string, TrackingMEs > TrackingMEsMap
#define NULL
Definition: scimark2.h:8
void Fill(long long x)
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< QReport * > getQReports(void) const
get map of QReports
MonitorElement * TrackGlobalSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
if(conf.exists("allCellsPositionCalc"))
void TrackingQualityChecker::fillTrackingStatusAtLumi ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 403 of file TrackingQualityChecker.cc.

References DQMStore::IBooker::cd(), gather_cfg::cout, MonitorElement::DQM_KIND_TH1F, MonitorElement::Fill(), DQMStore::IGetter::getContents(), MonitorElement::getMean(), MonitorElement::getName(), TrackingUtility::goToDir(), MonitorElement::kind(), mergeVDriftHistosByStation::name, NULL, DQMStore::IBooker::pwd(), ntuplemaker::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by fillLSStatus().

403  {
404 
405  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
406  float gstatus = 1.0;
407 
408  ibooker.cd();
409  if (!TrackingUtility::goToDir(ibooker,igetter, TopFolderName_)) return;
410 
411 
412  int ibin = 0;
413  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
414  it != TrackingLSMEsMap.end(); it++) {
415 
416  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
417 
418  ibin++;
419 
420  std::string localMEdirpath = it->second.HistoLSDir;
421  std::string MEname = it->second.HistoLSName;
422  float lower_cut = it->second.HistoLSLowerCut;
423  float upper_cut = it->second.HistoLSUpperCut;
424 
425  float status = 1.0;
426 
427  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd()+"/"+localMEdirpath);
428  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
429 
430  MonitorElement* me = NULL;
431 
432  size_t nMEs = 0;
433  for ( auto ime : tmpMEvec ) {
434  std::string name = ime->getName();
435  if ( name.find(MEname) != std::string::npos) {
436  me = ime;
437  nMEs++;
438  }
439  }
440  // only one ME found
441  if (nMEs == 1) {
442  for ( auto ime : tmpMEvec ) {
443  std::string name = ime->getName();
444  if ( name.find(MEname) != std::string::npos) {
445  me = ime;
446  }
447  }
448  if (!me) continue;
449 
450  if (me->kind() == MonitorElement::DQM_KIND_TH1F) {
451  float x_mean = me->getMean();
452  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << " x_mean: " << x_mean << std::endl;
453  if (x_mean <= lower_cut || x_mean > upper_cut) status = 0.0;
454  else status = 1.0;
455  }
456  } else { // more than 1 ME w/ the same root => they need to be considered together
457  for ( auto ime : tmpMEvec ) {
458  float tmp_status = 1.;
459  std::string name = ime->getName();
460  if ( name.find(MEname) != std::string::npos) {
461  me = ime;
462  if (!me) continue;
463 
464  if (me->kind() == MonitorElement::DQM_KIND_TH1F) {
465  float x_mean = me->getMean();
466  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << "[" << me->getName() << "] x_mean: " << x_mean << std::endl;
467  if (x_mean <= lower_cut || x_mean > upper_cut) tmp_status = 0.0;
468  else tmp_status = 1.0;
469  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
470  }
471  }
472  status = fminf(tmp_status,status);
473  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
474  } // loop on tmpMEvec
475  }
476  it->second.TrackingFlag->Fill(status);
477  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status << " [" << gstatus << "]" << std::endl;
478  if (status == 0.0) gstatus = -1.0;
479  else gstatus = gstatus * status;
480  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
481  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
482  }
484  ibooker.cd();
485 
486  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
487 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:196
const std::string & getName(void) const
get name of ME
void cd(void)
Definition: DQMStore.cc:266
const std::string & pwd(void)
Definition: DQMStore.cc:282
#define NULL
Definition: scimark2.h:8
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
MonitorElement * TrackLSSummaryReportGlobal
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
Kind kind(void) const
Get the type of the monitor element.
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::resetGlobalStatus ( )

Definition at line 205 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, gather_cfg::cout, NULL, MonitorElement::Reset(), HcalObjRepresent::Reset(), TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillDummyGlobalStatus().

205  {
206 
207  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
209 
212 
213  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
214  it != TrackingMEsMap.end(); it++) {
215  MonitorElement* me = it->second.TrackingFlag;
216  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName << " exist ? " << ( it->second.TrackingFlag == NULL ? "nope" : "yes" ) << " ---> " << me << std::endl;
217  me->Reset();
218  }
219  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
220 
221  }
222 }
MonitorElement * TrackGlobalSummaryReportMap
std::map< std::string, TrackingMEs > TrackingMEsMap
#define NULL
Definition: scimark2.h:8
MonitorElement * TrackGlobalSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
void Reset(std::vector< TH2F > &depth)
void Reset(void)
reset ME (ie. contents, errors, etc)
void TrackingQualityChecker::resetLSStatus ( )

Definition at line 223 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, gather_cfg::cout, NULL, MonitorElement::Reset(), HcalObjRepresent::Reset(), TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by fillDummyLSStatus().

223  {
224 
225  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
227 
229  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
230  it != TrackingLSMEsMap.end(); it++) {
231  MonitorElement* me = it->second.TrackingFlag;
232  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName << " exist ? " << ( it->second.TrackingFlag == NULL ? "nope" : "yes" ) << " ---> " << me << std::endl;
233  me->Reset();
234  }
235  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
236 
237  }
238 }
#define NULL
Definition: scimark2.h:8
MonitorElement * TrackLSSummaryReportGlobal
tuple cout
Definition: gather_cfg.py:121
void Reset(std::vector< TH2F > &depth)
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap

Member Data Documentation

bool TrackingQualityChecker::bookedTrackingGlobalStatus_
private
bool TrackingQualityChecker::bookedTrackingLSStatus_
private
edm::ParameterSet TrackingQualityChecker::pSet_
private

Definition at line 69 of file TrackingQualityChecker.h.

Referenced by TrackingQualityChecker().

std::string TrackingQualityChecker::TopFolderName_
private
MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportGlobal
private
MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportMap
private
std::map<std::string, TrackingLSMEs> TrackingQualityChecker::TrackingLSMEsMap
private
std::map<std::string, TrackingMEs> TrackingQualityChecker::TrackingMEsMap
private
MonitorElement* TrackingQualityChecker::TrackLSSummaryReportGlobal
private
bool TrackingQualityChecker::verbose_
private