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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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_
 
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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 }
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:398
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:434
int deSysCount[dedefs::DEnsys]
Definition: L1TDEMON.h:66
L1TDEMON::~L1TDEMON ( )

Definition at line 66 of file L1TDEMON.cc.

66  {
67 }

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 328 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::getByLabel(), dedefs::GMT, dedefs::GMTcnd, i, edm::HandleBase::isValid(), j, phi, RPCpg::rate(), dedefs::RCT, L1DataEmulDigi::reset(), dedefs::RPC, evf::utils::sid, dedefs::SystLabel, and validate_alignment_devdb10_cfg::verbose.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 299 of file L1TDEMON.cc.

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

299  {
300 
301  if (verbose())
302  std::cout << "L1TDEMON::endJob Nevents: " << nEvt_ << "\n"
303  << std::flush;
304 
305  if (verbose()) {
306  std::cout << "[L1TDEMON] systems disagreement rate:\n\t";
307  for (int i = 0; i < DEnsys; i++)
308  printf("%4.2f ", sysrates->getBinContent(i));
309  std::cout << std::endl;
310  }
311 
312  if (verbose()) {
313  std::cout << "[L1TDEMON] verbose fill histo: ";
314  for (int i = 0; i < DEnsys; i++)
315  std::cout << deSysCount[i] << " ";
316  std::cout << std::endl;
317  }
318 
319  if (histFile_.size() != 0 && dbe)
320  dbe->save(histFile_);
321 
322  if (verbose())
323  std::cout << "L1TDEMON::endJob() end.\n" << std::flush;
324 }
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="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
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.

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.