35 , trackingCertificationBooked_(
false)
36 , trackingLSCertificationBooked_(
false)
38 , allPixelFEDConnected_(
true)
41 edm::LogInfo(
"TrackingCertificationInfo") <<
"TrackingCertificationInfo::Deleting TrackingCertificationInfo ";
45 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::TrackingCertificationInfo] TopFolderName_: " << TopFolderName_ << std::endl;
54 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
57 std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingGlobalQualityPSets" );
58 for (
auto meQTset : TrackingGlobalQualityMEs ) {
63 if (
verbose_)
std::cout<<
"[TrackingQualityChecker::TrackingCertificationInfo] inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
64 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
69 std::vector<edm::ParameterSet> TrackingLSQualityMEs =
pSet_.
getParameter< std::vector<edm::ParameterSet> >(
"TrackingLSQualityMEs" );
70 for (
auto meQTset : TrackingLSQualityMEs ) {
75 if (
verbose_)
std::cout<<
"[TrackingQualityChecker::TrackingCertificationInfo] inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
76 TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
87 edm::LogInfo(
"TrackingCertificationInfo") <<
"TrackingCertificationInfo::Deleting TrackingCertificationInfo ";
101 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::beginRun] starting .." << std::endl;
103 edm::LogInfo (
"TrackingCertificationInfo") <<
"TrackingCertificationInfo:: Begining of Run";
111 int nPixelFEDConnected_ = 0;
116 const int siPixelFeds = (siPixelFedIdMax-siPixelFedIdMin+1);
119 if( eSetup.
find( recordKey ) != 0) {
126 std::vector<int> FedsInIds= sumFED->m_fed_in;
127 for (
auto fedID : FedsInIds ) {
128 if ( fedID >= siPixelFedIdMin && fedID <= siPixelFedIdMax ) {
130 ++nPixelFEDConnected_;
132 else if ( fedID >= siStripFedIdMin && fedID <= siStripFedIdMax )
156 if (tracking_dir.size() > 0 ) ibooker_.
setCurrentFolder(tracking_dir+
"/EventInfo");
162 hname =
"CertificationReportMap";
163 htitle =
"Tracking Certification Summary Map";
178 for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin();
179 it != TrackingMEsMap.end(); it++) {
181 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] meQTname: " << meQTname << std::endl;
182 it->second.TrackingFlag = ibooker_.
bookFloat(
"Track"+meQTname);
183 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] " << it->first <<
" exists ? " << it->second.TrackingFlag << std::endl;
206 if (tracking_dir.size() > 0 ) ibooker_.
setCurrentFolder(tracking_dir+
"/EventInfo");
214 for (std::map<std::string, TrackingLSMEs>::iterator it =
TrackingLSMEsMap.begin();
217 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] meQTname: " << meQTname << std::endl;
218 it->second.TrackingFlag = ibooker_.
bookFloat(
"Track"+meQTname);
219 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::bookStatus] " << it->first <<
" exists ? " << it->second.TrackingFlag << std::endl;
235 edm::LogInfo(
"TrackingDaqInfo") <<
"TrackingDaqInfo::endLuminosityBlock";
248 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::dqmEndJob]" << std::endl;
250 edm::LogInfo (
"TrackingCertificationInfo") <<
"TrackingCertificationInfo:: End Run";
257 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::endRun] DONE" << std::endl;
272 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] tracking_dir: " << tracking_dir << std::endl;
273 std::vector<MonitorElement*> all_mes = igetter_.
getContents(tracking_dir+
"/EventInfo/reportSummaryContents");
282 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
285 if ( type ==
"pixel" ) {
286 it->second.TrackingFlag->Fill(val);
288 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] xbin: " << xbin <<
" val: " << val << std::endl;
289 th2d->SetBinContent(xbin+1,1,val);
293 fval = fminf(fval,val);
297 for (std::vector<MonitorElement *>::const_iterator ime = all_mes.begin();
298 ime!= all_mes.end(); ime++) {
301 if (
verbose_)
std::cout<<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] me: " << me->
getName() << std::endl;
306 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
309 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
312 if (name.find(type) != std::string::npos) {
313 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] type: " << type <<
" <---> name: " << name << std::endl;
314 it->second.TrackingFlag->Fill(val);
315 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] xbin: " << xbin <<
" val: " << val << std::endl;
317 th2d->SetBinContent(xbin+1,1,val);
321 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
324 fval = fminf(fval,val);
327 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEs] TrackingCertification: " << fval << std::endl;
337 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
339 it->second.TrackingFlag->Reset();
349 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
351 it->second.TrackingFlag->Reset();
362 for (std::map<std::string, TrackingMEs>::const_iterator it =
TrackingMEsMap.begin();
364 it->second.TrackingFlag->Fill(-1.0);
382 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
384 it->second.TrackingFlag->Fill(-1.0);
394 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] starting .." << std::endl;
403 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] tracking_dir: " << tracking_dir << std::endl;
406 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] tracking_dir: " << tracking_dir << std::endl;
407 std::vector<MonitorElement*> all_mes = igetter_.
getContents(tracking_dir+
"/EventInfo/reportSummaryContents");
411 for (std::vector<MonitorElement *>::const_iterator ime = all_mes.begin();
412 ime!= all_mes.end(); ime++) {
415 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] me: " << me->
getName() << std::endl;
419 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] val: " << val << std::endl;
421 for (std::map<std::string, TrackingLSMEs>::const_iterator it =
TrackingLSMEsMap.begin();
424 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
427 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] type: " << type << std::endl;
428 if (name.find(type) != std::string::npos) {
429 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] type: " << type <<
" <---> name: " << name << std::endl;
430 it->second.TrackingFlag->Fill(val);
433 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
438 float global_dqm_flag = 1.0;
439 std::string full_path = tracking_dir +
"/EventInfo/reportSummary";
442 if (
verbose_)
std::cout <<
"[TrackingCertificationInfo::fillTrackingCertificationMEsAtLumi] global_dqm_flag: " << global_dqm_flag << std::endl;
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
Begin Run.
void dqmEndJob(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
EndJob.
void fillDummyTrackingCertification(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
void resetTrackingCertificationMEs(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
MonitorElement * get(const std::string &path)
#define DEFINE_FWK_MODULE(type)
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 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_
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
int getNbinsY(void) const
get # of bins in Y-axis
MonitorElement * TrackingCertificationSummaryMap
MonitorElement * TrackingLSCertification
void fillDummyTrackingCertificationAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
void fillTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
bool trackingLSCertificationBooked_
double getFloatValue(void) const
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_, edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup)
End Of Luminosity.
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * TrackingCertification
void resetTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
MonitorElement * TrackingFlag
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
bool allPixelFEDConnected_
MonitorElement * TrackingFlag
bool trackingCertificationBooked_
int getNbinsX(void) const
get # of bins in X-axis
std::string TopFolderName_
virtual ~TrackingCertificationInfo()
Destructor.
MonitorElement * bookFloat(Args &&...args)
volatile std::atomic< bool > shutdown_flag false
TH2F * getTH2F(void) const
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 Reset(void)
reset ME (ie. contents, errors, etc)
void bookTrackingCertificationMEsAtLumi(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag