CMS 3D CMS Logo

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

#include <L1TDEMON.h>

Inheritance diagram for L1TDEMON:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TDEMON (const edm::ParameterSet &)
 
 ~L1TDEMON ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void endJob ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

int verbose ()
 

Private Attributes

DQMStoredbe
 
edm::InputTag DEsource_
 
edm::EDGetTokenT
< L1DataEmulRecord
DEsourceToken_
 
int deSysCount [dedefs::DEnsys]
 
MonitorElementdeword [dedefs::DEnsys]
 
MonitorElementdword [dedefs::DEnsys]
 
MonitorElementerrordist
 
MonitorElementerrortype [dedefs::DEnsys]
 
MonitorElementeta [dedefs::DEnsys]
 
MonitorElementetaData [dedefs::DEnsys]
 
MonitorElementetaphi [dedefs::DEnsys]
 
MonitorElementeword [dedefs::DEnsys]
 
bool hasRecord_
 
std::string histFile_
 
std::string histFolder_
 
bool m_doSys [dedefs::DEnsys]
 
MonitorElementmasked [dedefs::DEnsys]
 
bool monitorDaemon_
 
int nEvt_
 
int nEvtWithSys [dedefs::DEnsys]
 
MonitorElementphi [dedefs::DEnsys]
 
MonitorElementphiData [dedefs::DEnsys]
 
MonitorElementrnkData [dedefs::DEnsys]
 
bool runInFF_
 
MonitorElementsysncand [2]
 
MonitorElementsysrates
 monitoring elements More...
 
int verbose_
 
MonitorElementx3 [dedefs::DEnsys]
 
MonitorElementx3Data [dedefs::DEnsys]
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 28 of file L1TDEMON.h.

Constructor & Destructor Documentation

L1TDEMON::L1TDEMON ( const edm::ParameterSet iConfig)
explicit

Definition at line 7 of file L1TDEMON.cc.

References gather_cfg::cout, dedefs::DEnsys, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, NULL, cppFunctionSkipper::operator, AlCaHLTBitMon_QueryRunRegistry::string, and validate_alignment_devdb10_cfg::verbose.

7  {
8 
9  verbose_ = iConfig.getUntrackedParameter<int> ("VerboseFlag", 0);
10 
11  if (verbose())
12  std::cout << "L1TDEMON::L1TDEMON()...\n" << std::flush;
13 
14  DEsource_ = iConfig.getParameter<edm::InputTag> ("DataEmulCompareSource");
15  histFolder_ = iConfig.getUntrackedParameter<std::string> ("HistFolder",
16  "L1TEMU");
17  histFile_ = iConfig.getUntrackedParameter<std::string> ("HistFile", "");
18 
19  runInFF_ = iConfig.getUntrackedParameter<bool> ("RunInFilterFarm", false);
20  if (verbose())
21  std::cout << "Filter farm run setting? " << runInFF_ << "\n"
22  << std::flush;
23 
24  if (iConfig.getUntrackedParameter<bool> ("disableROOToutput", true))
25  histFile_ = "";
26 
27  if (histFile_.size() != 0) {
28  edm::LogInfo("OutputRootFile")
29  << "L1TEmulator Monitoring histograms will be saved to "
30  << histFile_.c_str() << std::endl;
31  }
32 
33  // copied from HardwareValidation/L1Comparator
34  // check on size are done there
35  std::vector<unsigned int> dosys(0, DEnsys);
36  dosys = iConfig.getUntrackedParameter<std::vector<unsigned int> > (
37  "COMPARE_COLLS", dosys);
38 
39  for (int i = 0; i < DEnsys; i++) {
40  m_doSys[i] = dosys[i];
41  }
42 
43  //
44 
45  nEvt_ = 0;
46  for (int i = 0; i < DEnsys; i++) {
47  deSysCount[i] = 0;
48  nEvtWithSys[i] = 0;
49  }
50 
51  dbe = NULL;
52  if (iConfig.getUntrackedParameter<bool> ("DQMStore", false)) {
54  dbe->setVerbose(0);
55  }
56 
57  if (dbe != NULL)
58  dbe->setCurrentFolder(histFolder_);
59 
60  hasRecord_ = true;
61 
62  if (verbose())
63  std::cout << "L1TDEMON::L1TDEMON constructor...done.\n" << std::flush;
64 
65  //set Tokens(-s)
66  DEsourceToken_ = consumes<L1DataEmulRecord>(iConfig.getParameter<edm::InputTag> ("DataEmulCompareSource"));
67 }
edm::EDGetTokenT< L1DataEmulRecord > DEsourceToken_
Definition: L1TDEMON.h:101
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int verbose()
Definition: L1TDEMON.h:49
int i
Definition: DBlmapReader.cc:9
const int DEnsys
Definition: DEtrait.h:38
int verbose_
Definition: L1TDEMON.h:48
int nEvt_
Definition: L1TDEMON.h:65
DQMStore * dbe
Definition: L1TDEMON.h:58
#define NULL
Definition: scimark2.h:8
int nEvtWithSys[dedefs::DEnsys]
Definition: L1TDEMON.h:67
bool hasRecord_
Definition: L1TDEMON.h:45
void setVerbose(unsigned level)
Definition: DQMStore.cc:548
std::string histFolder_
Definition: L1TDEMON.h:55
edm::InputTag DEsource_
Definition: L1TDEMON.h:44
bool m_doSys[dedefs::DEnsys]
Definition: L1TDEMON.h:73
tuple cout
Definition: gather_cfg.py:121
std::string histFile_
Definition: L1TDEMON.h:52
bool runInFF_
Definition: L1TDEMON.h:62
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
int deSysCount[dedefs::DEnsys]
Definition: L1TDEMON.h:66
L1TDEMON::~L1TDEMON ( )

Definition at line 69 of file L1TDEMON.cc.

69  {
70 }

Member Function Documentation

void L1TDEMON::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
protectedvirtual

get the comparison results

get the de candidates

— Fill histograms(me) —

bitset loop

Implements edm::EDAnalyzer.

Definition at line 331 of file L1TDEMON.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, dedefs::DTtftrk, eta(), fastmath::etaphi(), HcalObjRepresent::Fill(), edm::Event::getByToken(), dedefs::GMT, dedefs::GMTcnd, i, edm::HandleBase::isValid(), j, phi, RPCpg::rate(), dedefs::RCT, L1DataEmulDigi::reset(), dedefs::RPC, dedefs::SystLabel, and validate_alignment_devdb10_cfg::verbose.

331  {
332 
333  if (!hasRecord_)
334  return;
335 
336  if (verbose())
337  std::cout << "L1TDEMON::analyze() start\n" << std::flush;
338 
339  nEvt_++;
340 
343  iEvent.getByToken(DEsourceToken_, deRecord);
344 
345  if (!deRecord.isValid()) {
346  edm::LogInfo("DataNotFound")
347  << "Cannot find L1DataEmulRecord with label "
348  << DEsource_.label()
349  << " Please verify that comparator was successfully executed."
350  << " Emulator DQM will be skipped!" << std::endl;
351  hasRecord_ = false;
352  return;
353  }
354 
355  bool deMatch[DEnsys];
356  deRecord->get_status(deMatch);
357  if (verbose()) {
358  std::cout << "[L1TDEMON] verbose sys match?: ";
359  for (int i = 0; i < DEnsys; i++)
360  std::cout << deMatch[i] << " ";
361  std::cout << std::endl;
362  }
363 
364  bool isComp[DEnsys];
365  for (int i = 0; i < DEnsys; i++)
366  isComp[i] = deRecord->get_isComp(i);
367  if (verbose()) {
368  std::cout << "[L1TDEMON] verbose dosys?: ";
369  for (int i = 0; i < DEnsys; i++)
370  std::cout << isComp[i];
371  std::cout << std::endl;
372  }
373 
374  int DEncand[DEnsys][2];
375  for (int i = 0; i < DEnsys; i++)
376  for (int j = 0; j < 2; j++)
377  DEncand[i][j] = deRecord->getNCand(i, j);
378 
379  if (verbose()) {
380  std::cout << "[L1TDEMON] ncands d: ";
381  for (int i = 0; i < DEnsys; i++)
382  std::cout << DEncand[i][0] << " ";
383  std::cout << "\n[L1TDEMON] ncands e: ";
384  for (int i = 0; i < DEnsys; i++)
385  std::cout << DEncand[i][1] << " ";
386  std::cout << std::endl;
387  }
388 
389  const int nullVal = L1DataEmulDigi().reset();
390 
392  L1DEDigiCollection deColl;
393  deColl = deRecord->getColl();
394 
395  // global counters
396  int hasSys[DEnsys] = { 0 };
397  for (L1DEDigiCollection::const_iterator it = deColl.begin(); it
398  != deColl.end(); it++)
399  if (!it->empty())
400  hasSys[it->sid()]++;
401  for (int i = 0; i < DEnsys; i++) {
402  if (!hasSys[i])
403  continue;
404  nEvtWithSys[i]++;
405  if (deMatch[i])
406  deSysCount[i]++;
407  }
408 
409  if (verbose()) {
410  std::cout << "[L1TDEMON] digis: \n";
411  for (L1DEDigiCollection::const_iterator it = deColl.begin(); it
412  != deColl.end(); it++)
413  std::cout << "\t" << *it << std::endl;
414  }
415 
417 
418  // global, sub-systems d|e match, ncands
419  for (int i = 0; i < DEnsys; i++) {
420 
421  // skip if system disabled
422  if (!m_doSys[i]) {
423  continue;
424  }
425 
426  if (!isComp[i])
427  continue;
428 
429  for (int j = 0; j < 2; j++)
430  sysncand[j]->Fill(i, DEncand[i][j]);
431 
432  //sysrates->Fill(i,(int)!deMatch[i]);
433  int ibin = i + 1;
434  double rate = nEvtWithSys[i] ? (nEvtWithSys[i] - 1. * deSysCount[i])
435  / nEvtWithSys[i] : 0.;
436  sysrates->setBinContent(ibin, rate);
437 
438  if (verbose()) {
439  std::cout << "[L1TDEMON] analyze "
440  << " sysid:" << i
441  << " nEvt:" << nEvt_
442  << " match?" << deMatch[i]
443  << " ncands:" << hasSys[i]
444  << " nevtwsys:" << nEvtWithSys[i]
445  << " nevtgood:" << deSysCount[i]
446  << " rate:" << sysrates->getBinContent(ibin)
447  << "\n";
448 
449  if (rate > 1)
450  std::cout << "problem, error rate for " << SystLabel[i]
451  << " is " << sysrates->getBinContent(ibin) << std::endl;
452  }
453  }
454 
455  // container for subsystem's leading candidate
456  const int ncorr = 3;
457  float LeadCandVal[DEnsys][ncorr] = { { (float) nullVal } };
458  for (int i = 0; i < DEnsys; i++)
459  for (int j = 0; j < ncorr; j++)
460  LeadCandVal[i][j] = nullVal;
461 
462  // d|e candidate loop
463  for (L1DEDigiCollection::const_iterator it = deColl.begin(); it
464  != deColl.end(); it++) {
465 
466  int sid = it->sid();
467  int cid = it->cid();
468 
469  if (it->empty())
470  continue;
471  assert(isComp[sid]);
472 
473  int type = it->type();
474  double phiv = it->x1();
475  double etav = it->x2();
476  double x3v = it->x3();
477 
478  float rankarr[2];
479  it->rank(rankarr);
480  float rnkv = rankarr[0];
481 
482  double wei = 1.;
483 
484  unsigned int mask = (~0x0);
485 
486  if (sid == RCT) {
487  //if(cid!=RCTem) continue;
488  //if(cid!=RCTrgn) continue;
489  }
490  // if(sid==GCT) {
491  // // For the moment just include EM and jet objects, energy sums being debugged in the expert DQM first.
492  // if(cid!=GCTisolaem &&
493  // cid!=GCTnoisoem &&
494  // cid!=GCTcenjets &&
495  // cid!=GCTforjets &&
496  // cid!=GCTtaujets) continue;
497  // }
498  if (sid == DTP) {
499  //tbd cols:th,ph; plots per wheel
500  //if(it->x3()!=0) continue;
501  }
502  if (sid == GMT) {
503  //select gmt cands only for GMT sys
504  if (cid != GMTcnd)
505  continue;
506  //masking: gres -- I.Mikulec: mask bits 0,5,16,21,22,23
507  //mask = (~(0x0e10021));
508  }
509  if (sid == DTF) {
510  if (cid != DTtftrk)
511  continue;
512  }
513  if (sid == RPC || sid == CTF || sid == RPC) {
514  //select mu regional cands only for dtf,ctf,rpc
515  //if(cid!=MUrtf) continue;
516  //masking: gres dttf only -- I.Mikulec: lowest 16 bits only
517  //if(sid==DTF) mask = 0xffff;
518  }
519 
520  errordist ->Fill(type);
521  errortype[sid]->Fill(type);
522 
523  // skip next if running in filter farm
524  if (runInFF_)
525  continue;
526 
527  //exclude agreeing cands
528  wei = 1.;
529  if (!type)
530  wei = 0.;
531  if (etav != nullVal && phiv != nullVal)
532  etaphi[sid]->Fill(etav, phiv, wei);
533  if (etav != nullVal)
534  eta[sid]->Fill(etav, wei);
535  if (phiv != nullVal)
536  phi[sid]->Fill(phiv, wei);
537  if (sid == DTP)
538  if (x3v != nullVal)
539  x3[sid]->Fill(x3v, wei);
540 
541  unsigned int word[2];
542  it->data(word);
543  std::bitset < 32 > dbits(word[0]);
544  std::bitset < 32 > ebits(word[1]);
545  unsigned int dexor = ((word[0]) ^ (word[1]));
546  //disagreeing bits
547  std::bitset < 32 > debits(dexor);
548  //disagreeing bits after masking
549  std::bitset < 32 > dembits(((dexor) & (mask)));
550 
551  if (verbose())
552  std::cout << "l1demon" << " sid:" << sid << " cid:" << cid << "\n"
553  << " data:0x" << std::hex << word[0] << std::dec
554  << " bitset:" << dbits << "\n" << " emul:0x" << std::hex
555  << word[1] << std::dec << " bitset:" << ebits << "\n"
556  << " xor:0x" << std::hex << dexor << std::dec
557  << " bitset:" << debits << " bitset:"
558  << ((dbits) ^ (ebits)) << "\n" << std::flush;
559 
561  for (int ibit = 0; ibit < 32; ibit++) {
562  wei = 1.;
563  //comparison gives no info if there's only 1 candidate
564  if (type == 3 || type == 4)
565  wei = 0.;
566  if (dbits[ibit])
567  dword[sid]->Fill(ibit, wei);
568  if (ebits[ibit])
569  eword[sid]->Fill(ibit, wei);
570  if (debits[ibit])
571  deword[sid]->Fill(ibit, wei);
572  //if(dembits[ibit])masked[sid]->Fill(ibit,wei);
573  }
574 
575  //exclude e-only cands (only data)
576  wei = 1.;
577  if (type == 4)
578  wei = 0.;
579  if (etav != nullVal)
580  etaData[sid]->Fill(etav, wei);
581  if (phiv != nullVal)
582  phiData[sid]->Fill(phiv, wei);
583  if (sid == DTP)
584  if (x3v != nullVal)
585  x3Data[sid]->Fill(x3v, wei);
586  rnkData[sid]->Fill(rnkv, wei);
587 
588  //correlations: store leading candidate
589  if (type == 4)
590  continue; //exclude e-only cands
591  bool islead = false;
592  if (rnkv > LeadCandVal[sid][2])
593  islead = true;
594  else if (rnkv == LeadCandVal[sid][2]) {
595  if (phiv > LeadCandVal[sid][0])
596  islead = true;
597  else if (phiv == LeadCandVal[sid][0])
598  if (etav > LeadCandVal[sid][1])
599  islead = true;
600  }
601 
602  if (islead) {
603  LeadCandVal[sid][0] = phiv;
604  LeadCandVal[sid][1] = etav;
605  LeadCandVal[sid][2] = rnkv;
606  }
607 
608  }//close loop over dedigi-cands
609 
610 
611 
612  if (verbose())
613  std::cout << "L1TDEMON::analyze() end.\n" << std::flush;
614 
615 }
MonitorElement * rnkData[dedefs::DEnsys]
Definition: L1TDEMON.h:92
type
Definition: HCALResponse.h:21
edm::EDGetTokenT< L1DataEmulRecord > DEsourceToken_
Definition: L1TDEMON.h:101
int verbose()
Definition: L1TDEMON.h:49
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
const int DEnsys
Definition: DEtrait.h:38
int nEvt_
Definition: L1TDEMON.h:65
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:79
int nEvtWithSys[dedefs::DEnsys]
Definition: L1TDEMON.h:67
void Fill(long long x)
MonitorElement * phi[dedefs::DEnsys]
Definition: L1TDEMON.h:87
MonitorElement * x3[dedefs::DEnsys]
Definition: L1TDEMON.h:88
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool hasRecord_
Definition: L1TDEMON.h:45
MonitorElement * dword[dedefs::DEnsys]
Definition: L1TDEMON.h:95
int j
Definition: DBlmapReader.cc:9
MonitorElement * sysncand[2]
Definition: L1TDEMON.h:80
MonitorElement * etaData[dedefs::DEnsys]
Definition: L1TDEMON.h:89
MonitorElement * x3Data[dedefs::DEnsys]
Definition: L1TDEMON.h:91
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * sysrates
monitoring elements
Definition: L1TDEMON.h:79
edm::InputTag DEsource_
Definition: L1TDEMON.h:44
bool m_doSys[dedefs::DEnsys]
Definition: L1TDEMON.h:73
MonitorElement * eword[dedefs::DEnsys]
Definition: L1TDEMON.h:96
MonitorElement * deword[dedefs::DEnsys]
Definition: L1TDEMON.h:97
MonitorElement * eta[dedefs::DEnsys]
Definition: L1TDEMON.h:86
std::string const & label() const
Definition: InputTag.h:42
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
double rate(double x)
Definition: Constants.cc:3
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * errordist
Definition: L1TDEMON.h:81
MonitorElement * phiData[dedefs::DEnsys]
Definition: L1TDEMON.h:90
MonitorElement * etaphi[dedefs::DEnsys]
Definition: L1TDEMON.h:85
tuple cout
Definition: gather_cfg.py:121
MonitorElement * errortype[dedefs::DEnsys]
Definition: L1TDEMON.h:82
bool runInFF_
Definition: L1TDEMON.h:62
int deSysCount[dedefs::DEnsys]
Definition: L1TDEMON.h:66
void L1TDEMON::beginJob ( void  )
protectedvirtual

labeling (temporary cosmetics added here)

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file L1TDEMON.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, eta(), fastmath::etaphi(), dedefs::ETP, dedefs::GCT, dedefs::GLT, dedefs::GMT, dedefs::HTP, i, j, dedefs::LTC, cppFunctionSkipper::operator, phi, dedefs::RCT, dedefs::RPC, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, dedefs::SystLabel, dedefs::SystLabelExt, and validate_alignment_devdb10_cfg::verbose.

72  {
73 
74  if (verbose())
75  std::cout << "L1TDEMON::beginJob() start\n" << std::flush;
76 
77  DQMStore* dbe = 0;
78  dbe = edm::Service<DQMStore>().operator->();
79  if (dbe) {
81  // dbe->rmdir(histFolder_);
82  }
83 
84  //physical values disabled now, waiting for scale procedure
85  //const double tpi = 6.2832;
86  //const double amin= -0.5;
87  //const double amax=tpi+0.5;
88 
89  // ETP, HTP, RCT, GCT, DTP, DTF, CTP, CTF, RPC,LTC, GMT,GLT
90  int phiNBins[DEnsys] = { 71 , 71 , 18 ,18 , 12, 255, 160, 255, 144, 0, 255,0};
91  double phiMinim[DEnsys] = { 0.5, 0.5, -0.5,-0.5,-0.5, 0, -0.5, 0, -0.5, 0, 0,0};
92  double phiMaxim[DEnsys] = { 71.5, 71.5, 17.5,17.5,11.5, 255,159.5, 255, 143.5, 0, 255,0};
93 
94  int etaNBins[DEnsys] = { 35 , 35 , 22 ,22 , 5, 20, 120, 20, 64, 0, 20,0};
95  double etaMinim[DEnsys] = {-17.5,-17.5, -0.5,-0.5,-2.5, 0, -0.5, 0, -0.5, 0, 0,0};
96  double etaMaxim[DEnsys] = { 17.5, 17.5, 21.5,21.5, 2.5, 63,119.5, 63, 63.5, 0, 63,0};
97 
98  int x3NBins [DEnsys] = { 0, 0, 7, 0, 4, 0, 0, 0, 0, 0, 0,0};
99  double x3Minim [DEnsys] = { 0, 0, -0.5, 0, 0.5, 0, 0, 0, 0, 0, 0,0};
100  double x3Maxim [DEnsys] = { 0, 0, 6.5, 0, 4.5, 0, 0, 0, 0, 0, 0,0};
101 
102  int rnkNBins[DEnsys] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0};
103  double rnkMinim[DEnsys] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0};
104  double rnkMaxim[DEnsys] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0};
105  //assume for
106  for (int i = 0; i < DEnsys; i++) {
107  rnkNBins[i] = 63;
108  rnkMinim[i] = 0.5;
109  rnkMaxim[i] = 63.5;
110  }//rank 0x3f->63
111  rnkNBins[DTP] = 7;
112  rnkMinim[DTP] = -0.5;
113  rnkMaxim[DTP] = 6.5; //rank 0-6
114  rnkNBins[CTP] = 16;
115  rnkMinim[CTP] = -0.5;
116  rnkMaxim[CTP] = 15.5; //quality 0-15
117 
118  /*--notes
119  RCT: global index ieta (0-21)=[22,-0.5,21.5] , iphi (0-17)=[18,-0.5,17.5]; card (0-6)
120  GCT: phi index (0-17); eta = -6 to -0, +0 to +6. Sign is bit 3, 1 means -ve Z, 0 means +ve Z -> 0.17
121  DTP: usc 0..11; uwh -2..2; ust 1..4;
122  CTP: rank is quality 0..15
123  */
124 
125  if (dbe) {
126 
127  if (!runInFF_)
129 
130  for (int j = 0; j < 2; j++) {
131  std::string lbl("sysncand");
132  lbl += (j == 0 ? "Data" : "Emul");
133  sysncand[j]
134  = dbe->book1D(lbl.data(), lbl.data(), DEnsys, 0, DEnsys);
135  }
136 
137  sysrates = dbe->book1D("sysrates", "sysrates", DEnsys, 0, DEnsys);
138  const int nerr = 5;
139  errordist = dbe->book1D("errorflag", "errorflag", nerr, 0, nerr);
140 
141  for (int j = 0; j < DEnsys; j++) {
142 
143  // skip if system disabled
144  if (!m_doSys[j]) {
145  continue;
146  }
147 
148  if (!runInFF_) {
150  std::string(histFolder_ + "/" + SystLabelExt[j]));
151  }
152 
153  std::string lbl("");
154  lbl.clear();
155  lbl += SystLabel[j];
156  lbl += "ErrorFlag";
157  errortype[j] = dbe->book1D(lbl.data(), lbl.data(), nerr, 0, nerr);
158 
159  // skip next histos if running in filter farm
160  if (runInFF_) {
161  continue;
162  }
163 
164  //
165  lbl.clear();
166  lbl += SystLabel[j];
167  lbl += "eta";
168  eta[j] = dbe->book1D(lbl.data(), lbl.data(), etaNBins[j],
169  etaMinim[j], etaMaxim[j]);
170  lbl.clear();
171  lbl += SystLabel[j];
172  lbl += "phi";
173  phi[j] = dbe->book1D(lbl.data(), lbl.data(), phiNBins[j],
174  phiMinim[j], phiMaxim[j]);
175  lbl.clear();
176  lbl += SystLabel[j];
177  lbl += "x3";
178  x3[j] = dbe->book1D(lbl.data(), lbl.data(), x3NBins[j], x3Minim[j],
179  x3Maxim[j]);
180  lbl.clear();
181  lbl += SystLabel[j];
182  lbl += "etaphi";
183  etaphi[j] = dbe->book2D(lbl.data(), lbl.data(), etaNBins[j],
184  etaMinim[j], etaMaxim[j], phiNBins[j], phiMinim[j],
185  phiMaxim[j]);
186  //
187  lbl.clear();
188  lbl += SystLabel[j];
189  lbl += "eta";
190  lbl += "Data";
191  etaData[j] = dbe->book1D(lbl.data(), lbl.data(), etaNBins[j],
192  etaMinim[j], etaMaxim[j]);
193  lbl.clear();
194  lbl += SystLabel[j];
195  lbl += "phi";
196  lbl += "Data";
197  phiData[j] = dbe->book1D(lbl.data(), lbl.data(), phiNBins[j],
198  phiMinim[j], phiMaxim[j]);
199  lbl.clear();
200  lbl += SystLabel[j];
201  lbl += "x3";
202  lbl += "Data";
203  x3Data[j] = dbe->book1D(lbl.data(), lbl.data(), x3NBins[j],
204  x3Minim[j], x3Maxim[j]);
205  lbl.clear();
206  lbl += SystLabel[j];
207  lbl += "rank";
208  lbl += "Data";
209  rnkData[j] = dbe->book1D(lbl.data(), lbl.data(), rnkNBins[j],
210  rnkMinim[j], rnkMaxim[j]);
211 
212  const int nbit = (j == GLT) ? 128 : 32;
213  lbl.clear();
214  lbl += SystLabel[j];
215  lbl += "dword";
216  dword[j] = dbe->book1D(lbl.data(), lbl.data(), nbit, 0, nbit);
217  lbl.clear();
218  lbl += SystLabel[j];
219  lbl += "eword";
220  eword[j] = dbe->book1D(lbl.data(), lbl.data(), nbit, 0, nbit);
221  lbl.clear();
222  lbl += SystLabel[j];
223  lbl += "deword";
224  deword[j] = dbe->book1D(lbl.data(), lbl.data(), nbit, 0, nbit);
225  //lbl.clear();
226  //lbl+=SystLabel[j];lbl+="masked";
227  //masked[j] = dbe->book1D(lbl.data(),lbl.data(),nbit,0,nbit);
228  }
229  }
230 
231 
233  for (int i = 0; i < DEnsys; i++) {
234  sysrates ->setBinLabel(i + 1, SystLabel[i]);
235  sysncand[0]->setBinLabel(i + 1, SystLabel[i]);
236  sysncand[1]->setBinLabel(i + 1, SystLabel[i]);
237  }
238  const int nerr = 5;
239  std::string errLabel[nerr] = { "Agree", "Loc. Agree", "L.Disagree",
240  "Data only", "Emul only" };
241  for (int j = 0; j < nerr; j++) {
242  errordist->setBinLabel(j + 1, errLabel[j]);
243  }
244  for (int i = 0; i < DEnsys; i++) {
245 
246  // skip if system disabled
247  if (!m_doSys[i]) {
248  continue;
249  }
250 
251  for (int j = 0; j < nerr; j++) {
252 
253  errortype[i]->setBinLabel(j + 1, errLabel[j]);
254  }
255  }
256 
257  // done if running in filter farm
258  if (runInFF_)
259  return;
260 
261  for (int i = 0; i < DEnsys; i++) {
262 
263  // skip if system disabled
264  if (!m_doSys[i]) {
265  continue;
266  }
267 
268  etaphi[i]->setAxisTitle("eta", 1);
269  etaphi[i]->setAxisTitle("phi", 2);
270  eta[i]->setAxisTitle("eta");
271  phi[i]->setAxisTitle("phi");
272  x3[i]->setAxisTitle("x3");
273  etaData[i]->setAxisTitle("eta");
274  phiData[i]->setAxisTitle("phi");
275  x3Data[i]->setAxisTitle("x3");
276  rnkData[i]->setAxisTitle("rank");
277  dword[i]->setAxisTitle("trigger data word bit");
278  eword[i]->setAxisTitle("trigger data word bit");
279  deword[i]->setAxisTitle("trigger data word bit");
280  //masked [i]->setAxisTitle("trigger data word bit");
281  }
282 
283 
284  // assertions/temporary
285  assert(ETP == 0);
286  assert(HTP == 1);
287  assert(RCT == 2);
288  assert(GCT == 3);
289  assert(DTP == 4);
290  assert(DTF == 5);
291  assert(CTP == 6);
292  assert(CTF == 7);
293  assert(RPC == 8);
294  assert(LTC == 9);
295  assert(GMT == 10);
296  assert(GLT == 11);
297 
298  if (verbose())
299  std::cout << "L1TDEMON::beginJob() end.\n" << std::flush;
300 }
MonitorElement * rnkData[dedefs::DEnsys]
Definition: L1TDEMON.h:92
int verbose()
Definition: L1TDEMON.h:49
int i
Definition: DBlmapReader.cc:9
const std::string SystLabelExt[DEnsys]
Definition: DEtrait.h:50
const int DEnsys
Definition: DEtrait.h:38
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
DQMStore * dbe
Definition: L1TDEMON.h:58
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)
MonitorElement * phi[dedefs::DEnsys]
Definition: L1TDEMON.h:87
MonitorElement * x3[dedefs::DEnsys]
Definition: L1TDEMON.h:88
MonitorElement * dword[dedefs::DEnsys]
Definition: L1TDEMON.h:95
int j
Definition: DBlmapReader.cc:9
MonitorElement * sysncand[2]
Definition: L1TDEMON.h:80
MonitorElement * etaData[dedefs::DEnsys]
Definition: L1TDEMON.h:89
MonitorElement * x3Data[dedefs::DEnsys]
Definition: L1TDEMON.h:91
std::string histFolder_
Definition: L1TDEMON.h:55
MonitorElement * sysrates
monitoring elements
Definition: L1TDEMON.h:79
bool m_doSys[dedefs::DEnsys]
Definition: L1TDEMON.h:73
MonitorElement * eword[dedefs::DEnsys]
Definition: L1TDEMON.h:96
MonitorElement * deword[dedefs::DEnsys]
Definition: L1TDEMON.h:97
MonitorElement * eta[dedefs::DEnsys]
Definition: L1TDEMON.h:86
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
MonitorElement * errordist
Definition: L1TDEMON.h:81
MonitorElement * phiData[dedefs::DEnsys]
Definition: L1TDEMON.h:90
MonitorElement * etaphi[dedefs::DEnsys]
Definition: L1TDEMON.h:85
tuple cout
Definition: gather_cfg.py:121
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * errortype[dedefs::DEnsys]
Definition: L1TDEMON.h:82
bool runInFF_
Definition: L1TDEMON.h:62
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void L1TDEMON::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 302 of file L1TDEMON.cc.

References gather_cfg::cout, dedefs::DEnsys, i, and validate_alignment_devdb10_cfg::verbose.

302  {
303 
304  if (verbose())
305  std::cout << "L1TDEMON::endJob Nevents: " << nEvt_ << "\n"
306  << std::flush;
307 
308  if (verbose()) {
309  std::cout << "[L1TDEMON] systems disagreement rate:\n\t";
310  for (int i = 0; i < DEnsys; i++)
311  printf("%4.2f ", sysrates->getBinContent(i));
312  std::cout << std::endl;
313  }
314 
315  if (verbose()) {
316  std::cout << "[L1TDEMON] verbose fill histo: ";
317  for (int i = 0; i < DEnsys; i++)
318  std::cout << deSysCount[i] << " ";
319  std::cout << std::endl;
320  }
321 
322  if (histFile_.size() != 0 && dbe)
323  dbe->save(histFile_);
324 
325  if (verbose())
326  std::cout << "L1TDEMON::endJob() end.\n" << std::flush;
327 }
int verbose()
Definition: L1TDEMON.h:49
int i
Definition: DBlmapReader.cc:9
const int DEnsys
Definition: DEtrait.h:38
int nEvt_
Definition: L1TDEMON.h:65
DQMStore * dbe
Definition: L1TDEMON.h:58
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
MonitorElement * sysrates
monitoring elements
Definition: L1TDEMON.h:79
double getBinContent(int binx) const
get content of bin (1-D)
tuple cout
Definition: gather_cfg.py:121
std::string histFile_
Definition: L1TDEMON.h:52
int deSysCount[dedefs::DEnsys]
Definition: L1TDEMON.h:66
int L1TDEMON::verbose ( )
inlineprivate

Definition at line 49 of file L1TDEMON.h.

References verbose_.

49 {return verbose_;}
int verbose_
Definition: L1TDEMON.h:48

Member Data Documentation

DQMStore* L1TDEMON::dbe
private

Definition at line 58 of file L1TDEMON.h.

edm::InputTag L1TDEMON::DEsource_
private

Definition at line 44 of file L1TDEMON.h.

edm::EDGetTokenT<L1DataEmulRecord> L1TDEMON::DEsourceToken_
private

Definition at line 101 of file L1TDEMON.h.

int L1TDEMON::deSysCount[dedefs::DEnsys]
private

Definition at line 66 of file L1TDEMON.h.

MonitorElement* L1TDEMON::deword[dedefs::DEnsys]
private

Definition at line 97 of file L1TDEMON.h.

MonitorElement* L1TDEMON::dword[dedefs::DEnsys]
private

Definition at line 95 of file L1TDEMON.h.

MonitorElement* L1TDEMON::errordist
private

Definition at line 81 of file L1TDEMON.h.

MonitorElement* L1TDEMON::errortype[dedefs::DEnsys]
private

Definition at line 82 of file L1TDEMON.h.

MonitorElement* L1TDEMON::eta[dedefs::DEnsys]
private

Definition at line 86 of file L1TDEMON.h.

MonitorElement* L1TDEMON::etaData[dedefs::DEnsys]
private

Definition at line 89 of file L1TDEMON.h.

MonitorElement* L1TDEMON::etaphi[dedefs::DEnsys]
private

Definition at line 85 of file L1TDEMON.h.

MonitorElement* L1TDEMON::eword[dedefs::DEnsys]
private

Definition at line 96 of file L1TDEMON.h.

bool L1TDEMON::hasRecord_
private

Definition at line 45 of file L1TDEMON.h.

std::string L1TDEMON::histFile_
private

Definition at line 52 of file L1TDEMON.h.

std::string L1TDEMON::histFolder_
private

Definition at line 55 of file L1TDEMON.h.

bool L1TDEMON::m_doSys[dedefs::DEnsys]
private

Definition at line 73 of file L1TDEMON.h.

MonitorElement* L1TDEMON::masked[dedefs::DEnsys]
private

Definition at line 98 of file L1TDEMON.h.

bool L1TDEMON::monitorDaemon_
private

Definition at line 59 of file L1TDEMON.h.

int L1TDEMON::nEvt_
private

Definition at line 65 of file L1TDEMON.h.

int L1TDEMON::nEvtWithSys[dedefs::DEnsys]
private

Definition at line 67 of file L1TDEMON.h.

MonitorElement* L1TDEMON::phi[dedefs::DEnsys]
private

Definition at line 87 of file L1TDEMON.h.

MonitorElement* L1TDEMON::phiData[dedefs::DEnsys]
private

Definition at line 90 of file L1TDEMON.h.

MonitorElement* L1TDEMON::rnkData[dedefs::DEnsys]
private

Definition at line 92 of file L1TDEMON.h.

bool L1TDEMON::runInFF_
private

Definition at line 62 of file L1TDEMON.h.

MonitorElement* L1TDEMON::sysncand[2]
private

Definition at line 80 of file L1TDEMON.h.

MonitorElement* L1TDEMON::sysrates
private

monitoring elements

Definition at line 79 of file L1TDEMON.h.

int L1TDEMON::verbose_
private

Definition at line 48 of file L1TDEMON.h.

Referenced by verbose().

MonitorElement* L1TDEMON::x3[dedefs::DEnsys]
private

Definition at line 88 of file L1TDEMON.h.

MonitorElement* L1TDEMON::x3Data[dedefs::DEnsys]
private

Definition at line 91 of file L1TDEMON.h.