CMS 3D CMS Logo

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, TrackingLSMEsTrackingLSMEsMap
 
std::map< std::string, TrackingMEsTrackingMEsMap
 
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 22 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_.

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

Definition at line 73 of file TrackingQualityChecker.cc.

73  {
74  edm::LogInfo("TrackingQualityChecker") << " Deleting TrackingQualityChecker " << "\n" ;
75 }

Member Function Documentation

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

Definition at line 79 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().

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

123  {
124 
125  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
126 
128  ibooker.cd();
129  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus" << "\n";
130 
131  std::string tracking_dir = "";
132  TrackingUtility::getTopFolderPath(ibooker,igetter, TopFolderName_, tracking_dir);
133  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo");
134 
135  TrackLSSummaryReportGlobal = ibooker.bookFloat("reportSummary");
136 
137  std::string hname, htitle;
138  hname = "reportSummaryMap";
139  htitle = "Tracking Report Summary Map";
140 
141 
142  if (verbose_) {
143  size_t nQT = TrackingLSMEsMap.size();
144  std::cout << "[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
145  }
146 
147  ibooker.setCurrentFolder(TopFolderName_+"/EventInfo/reportSummaryContents");
148  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
149  it != TrackingLSMEsMap.end(); it++) {
150  std::string meQTname = it->first;
151  it->second.TrackingFlag = ibooker.bookFloat("Track"+meQTname);
152  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] " << it->first << " exists ? " << it->second.TrackingFlag << std::endl;
153  if (verbose_) std::cout << "[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
154  }
155 
157  ibooker.cd();
158  }
159 }
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * TrackLSSummaryReportGlobal
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
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 164 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().

164  {
165  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
166 
168  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
170 
172 
173  for (int ibin = 1; ibin < TrackGlobalSummaryReportMap->getNbinsX()+1; ibin++) {
175  }
176 
177  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
178  it != TrackingMEsMap.end(); it++)
179  it->second.TrackingFlag->Fill(-1.0);
180  if (verbose_) std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
181 
182  }
183 }
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
void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 184 of file TrackingQualityChecker.cc.

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

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

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

Definition at line 241 of file TrackingQualityChecker.cc.

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

Referenced by TrackingActionExecutor::fillGlobalStatus().

241  {
242 
243  if (verbose_) std::cout << "[TrackingQualityChecker::fillGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
244  if (!bookedTrackingGlobalStatus_) bookGlobalStatus(ibooker,igetter);
245 
247  fillTrackingStatus(ibooker,igetter);
248  if (verbose_) std::cout << "[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
249  ibooker.cd();
250 }
void cd(void)
Definition: DQMStore.cc:269
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingQualityChecker::fillLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 252 of file TrackingQualityChecker.cc.

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

Referenced by TrackingActionExecutor::fillStatusAtLumi().

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

Definition at line 392 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

392  {
393  if (me && me->kind() == MonitorElement::DQM_KIND_TH2F) {
394  TH2F* th2d = me->getTH2F();
395  th2d->SetBinContent(xbin, ybin, val);
396  }
397  }
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 266 of file TrackingQualityChecker.cc.

References DQMStore::IBooker::cd(), gather_cfg::cout, MonitorElement::Fill(), fillStatusHistogram(), objects.autophobj::float, DQMStore::IGetter::getContents(), MonitorElement::getFullname(), MonitorElement::getName(), MonitorElement::getQReports(), TrackingUtility::goToDir(), reco::if(), dataset::name, DQMStore::IBooker::pwd(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillGlobalStatus().

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

Definition at line 401 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(), dataset::name, DQMStore::IBooker::pwd(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by fillLSStatus().

401  {
402 
403  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
404  float gstatus = 1.0;
405 
406  ibooker.cd();
407  if (!TrackingUtility::goToDir(ibooker,igetter, TopFolderName_)) return;
408 
409 
410  int ibin = 0;
411  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
412  it != TrackingLSMEsMap.end(); it++) {
413 
414  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
415 
416  ibin++;
417 
418  std::string localMEdirpath = it->second.HistoLSDir;
419  std::string MEname = it->second.HistoLSName;
420  float lower_cut = it->second.HistoLSLowerCut;
421  float upper_cut = it->second.HistoLSUpperCut;
422 
423  float status = 1.0;
424 
425  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd()+"/"+localMEdirpath);
426  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
427 
428  MonitorElement* me = nullptr;
429 
430  size_t nMEs = 0;
431  for ( auto ime : tmpMEvec ) {
432  std::string name = ime->getName();
433  if ( name.find(MEname) != std::string::npos) {
434  me = ime;
435  nMEs++;
436  }
437  }
438  // only one ME found
439  if (nMEs == 1) {
440  for ( auto ime : tmpMEvec ) {
441  std::string name = ime->getName();
442  if ( name.find(MEname) != std::string::npos) {
443  me = ime;
444  }
445  }
446  if (!me) continue;
447 
448  if (me->kind() == MonitorElement::DQM_KIND_TH1F) {
449  float x_mean = me->getMean();
450  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << " x_mean: " << x_mean << std::endl;
451  if (x_mean <= lower_cut || x_mean > upper_cut) status = 0.0;
452  else status = 1.0;
453  }
454  } else { // more than 1 ME w/ the same root => they need to be considered together
455  for ( auto ime : tmpMEvec ) {
456  float tmp_status = 1.;
457  std::string name = ime->getName();
458  if ( name.find(MEname) != std::string::npos) {
459  me = ime;
460  if (!me) continue;
461 
462  if (me->kind() == MonitorElement::DQM_KIND_TH1F) {
463  float x_mean = me->getMean();
464  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << "[" << me->getName() << "] x_mean: " << x_mean << std::endl;
465  if (x_mean <= lower_cut || x_mean > upper_cut) tmp_status = 0.0;
466  else tmp_status = 1.0;
467  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
468  }
469  }
470  status = fminf(tmp_status,status);
471  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
472  } // loop on tmpMEvec
473  }
474  it->second.TrackingFlag->Fill(status);
475  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status << " [" << gstatus << "]" << std::endl;
476  if (status == 0.0) gstatus = -1.0;
477  else gstatus = gstatus * status;
478  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
479  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " [" << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
480  }
482  ibooker.cd();
483 
484  if (verbose_) std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
485 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:197
const std::string & getName(void) const
get name of ME
void cd(void)
Definition: DQMStore.cc:269
const std::string & pwd(void)
Definition: DQMStore.cc:285
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.
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::resetGlobalStatus ( )

Definition at line 203 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus().

203  {
204 
205  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] already booked ? " << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
207 
210 
211  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
212  it != TrackingMEsMap.end(); it++) {
213  MonitorElement* me = it->second.TrackingFlag;
214  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName << " exist ? " << ( it->second.TrackingFlag == nullptr ? "nope" : "yes" ) << " ---> " << me << std::endl;
215  me->Reset();
216  }
217  if (verbose_) std::cout << "[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
218 
219  }
220 }
MonitorElement * TrackGlobalSummaryReportMap
std::map< std::string, TrackingMEs > TrackingMEsMap
MonitorElement * TrackGlobalSummaryReportGlobal
void Reset(std::vector< TH2F > &depth)
void Reset(void)
reset ME (ie. contents, errors, etc)
void TrackingQualityChecker::resetLSStatus ( )

Definition at line 221 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyLSStatus().

221  {
222 
223  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] already booked ? " << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
225 
227  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin();
228  it != TrackingLSMEsMap.end(); it++) {
229  MonitorElement* me = it->second.TrackingFlag;
230  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName << " exist ? " << ( it->second.TrackingFlag == nullptr ? "nope" : "yes" ) << " ---> " << me << std::endl;
231  me->Reset();
232  }
233  if (verbose_) std::cout << "[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
234 
235  }
236 }
MonitorElement * TrackLSSummaryReportGlobal
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