33 , trackingCertificationBooked_(
false)
34 , trackingLSCertificationBooked_(
false)
36 , allPixelFEDConnected_(
true)
40 edm::LogInfo(
"TrackingCertificationInfo") <<
"TrackingCertificationInfo::Deleting TrackingCertificationInfo ";
44 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::TrackingCertificationInfo] TopFolderName_: " << TopFolderName_ << std::endl;
53 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
56 std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingGlobalQualityPSets" );
57 for (
auto meQTset : TrackingGlobalQualityMEs ) {
62 if (
verbose_)
std::cout<<
"[TrackingQualityChecker::TrackingCertificationInfo] inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
63 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
68 std::vector<edm::ParameterSet> TrackingLSQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingLSQualityMEs" );
69 for (
auto meQTset : TrackingLSQualityMEs ) {
74 if (
verbose_)
std::cout<<
"[TrackingQualityChecker::TrackingCertificationInfo] inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
75 TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
86 edm::LogInfo(
"TrackingCertificationInfo") <<
"TrackingCertificationInfo::Deleting TrackingCertificationInfo ";
100 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::beginRun] starting .." << std::endl;
102 edm::LogInfo (
"TrackingCertificationInfo") <<
"TrackingCertificationInfo:: Begining of Run";
110 int nPixelFEDConnected_ = 0;
115 const int siPixelFeds = (siPixelFedIdMax-siPixelFedIdMin+1);
120 runInfoRec->get(sumFED);
124 std::vector<int> FedsInIds= sumFED->
m_fed_in;
125 for (
auto fedID : FedsInIds ) {
126 if ( fedID >= siPixelFedIdMin && fedID <= siPixelFedIdMax ) {
128 ++nPixelFEDConnected_;
130 else if ( fedID >= siStripFedIdMin && fedID <= siStripFedIdMax )
154 if (!tracking_dir.empty() ) ibooker_.
setCurrentFolder(tracking_dir+
"/EventInfo");
160 hname =
"CertificationReportMap";
161 htitle =
"Tracking Certification Summary Map";
176 for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
177 it != TrackingMEsMap.end(); it++) {
179 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] meQTname: " << meQTname << std::endl;
180 it->second.TrackingFlag = ibooker_.
bookFloat(
"Track"+meQTname);
181 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] " << it->first <<
" exists ? " << it->second.TrackingFlag << std::endl;
204 if (!tracking_dir.empty() ) ibooker_.
setCurrentFolder(tracking_dir+
"/EventInfo");
212 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
215 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] meQTname: " << meQTname << std::endl;
216 it->second.TrackingFlag = ibooker_.
bookFloat(
"Track"+meQTname);
217 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] " << it->first <<
" exists ? " << it->second.TrackingFlag << std::endl;
233 edm::LogInfo(
"TrackingDaqInfo") <<
"TrackingDaqInfo::endLuminosityBlock";
246 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::dqmEndJob]" << std::endl;
248 edm::LogInfo (
"TrackingCertificationInfo") <<
"TrackingCertificationInfo:: End Run";
255 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::endRun] DONE" << std::endl;
270 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] tracking_dir: " << tracking_dir << std::endl;
271 std::vector<MonitorElement*> all_mes = igetter_.
getContents(tracking_dir+
"/EventInfo/reportSummaryContents");
280 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
283 if ( type ==
"pixel" ) {
284 it->second.TrackingFlag->Fill(val);
286 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] xbin: " << xbin <<
" val: " << val << std::endl;
287 th2d->SetBinContent(xbin+1,1,val);
291 fval = fminf(fval,val);
295 for (std::vector<MonitorElement *>::const_iterator ime = all_mes.begin();
296 ime!= all_mes.end(); ime++) {
299 if (
verbose_)
std::cout<<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] me: " << me->
getName() << std::endl;
304 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
307 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
310 if (name.find(type) != std::string::npos) {
311 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] type: " << type <<
" <---> name: " << name << std::endl;
312 it->second.TrackingFlag->Fill(val);
313 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] xbin: " << xbin <<
" val: " << val << std::endl;
315 th2d->SetBinContent(xbin+1,1,val);
319 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
322 fval = fminf(fval,val);
325 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] TrackingCertification: " << fval << std::endl;
335 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
337 it->second.TrackingFlag->Reset();
347 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
349 it->second.TrackingFlag->Reset();
360 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
362 it->second.TrackingFlag->Fill(-1.0);
380 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
382 it->second.TrackingFlag->Fill(-1.0);
392 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] starting .." << std::endl;
401 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] tracking_dir: " << tracking_dir << std::endl;
404 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] tracking_dir: " << tracking_dir << std::endl;
405 std::vector<MonitorElement*> all_mes = igetter_.
getContents(tracking_dir+
"/EventInfo/reportSummaryContents");
409 for (std::vector<MonitorElement *>::const_iterator ime = all_mes.begin();
410 ime!= all_mes.end(); ime++) {
413 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] me: " << me->
getName() << std::endl;
417 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] val: " << val << std::endl;
419 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
422 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
425 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] type: " << type << std::endl;
426 if (name.find(type) != std::string::npos) {
427 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] type: " << type <<
" <---> name: " << name << std::endl;
428 it->second.TrackingFlag->Fill(val);
431 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
436 float global_dqm_flag = 1.0;
437 std::string full_path = tracking_dir +
"/EventInfo/reportSummary";
440 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] global_dqm_flag: " << global_dqm_flag << std::endl;
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::optional< T > tryToGet() const
void dqmEndJob(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
EndJob.
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Begin Run.
void fillDummyTrackingCertification(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
double getFloatValue() const
~TrackingCertificationInfo() override
Destructor.
void resetTrackingCertificationMEs(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
#define DEFINE_FWK_MODULE(type)
void beginJob() override
BeginJob.
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)
const std::string & getName() const
get name of ME
void fillTrackingCertificationMEs(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
TrackingCertificationInfo(const edm::ParameterSet &ps)
Constructor.
std::vector< std::string > SubDetFolder
void bookTrackingCertificationMEs(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
edm::ESHandle< SiStripDetCabling > detCabling_
unsigned long long m_cacheID_
MonitorElement * TrackingCertificationSummaryMap
void setCurrentFolder(std::string const &fullpath)
MonitorElement * TrackingLSCertification
void fillDummyTrackingCertificationAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
std::vector< int > m_fed_in
void fillTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
bool trackingLSCertificationBooked_
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * TrackingCertification
std::vector< MonitorElement * > getContents(Args &&...args)
MonitorElement * get(std::string const &path)
void resetTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
MonitorElement * TrackingFlag
MonitorElement * book2D(Args &&...args)
bool allPixelFEDConnected_
int getNbinsY() const
get # of bins in Y-axis
MonitorElement * TrackingFlag
bool trackingCertificationBooked_
std::string TopFolderName_
int getNbinsX() const
get # of bins in X-axis
MonitorElement * bookFloat(Args &&...args)
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)
Kind kind() const
Get the type of the monitor element.
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
End Of Luminosity.
void bookTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)