CMS 3D CMS Logo

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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TDEMON (const edm::ParameterSet &)
 
 ~L1TDEMON ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
virtual void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
virtual void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
- 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

edm::InputTag DEsource_
 
edm::EDGetTokenT< L1DataEmulRecordDEsourceToken_
 
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 30 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(), mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and 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  hasRecord_ = true;
52 
53  if (verbose())
54  std::cout << "L1TDEMON::L1TDEMON constructor...done.\n" << std::flush;
55 
56  //set Tokens(-s)
57  DEsourceToken_ = consumes<L1DataEmulRecord>(iConfig.getParameter<edm::InputTag> ("DataEmulCompareSource"));
58 }
edm::EDGetTokenT< L1DataEmulRecord > DEsourceToken_
Definition: L1TDEMON.h:104
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int verbose()
Definition: L1TDEMON.h:53
const int DEnsys
Definition: DEtrait.h:38
int verbose_
Definition: L1TDEMON.h:52
int nEvt_
Definition: L1TDEMON.h:68
int nEvtWithSys[dedefs::DEnsys]
Definition: L1TDEMON.h:70
bool hasRecord_
Definition: L1TDEMON.h:49
std::string histFolder_
Definition: L1TDEMON.h:59
edm::InputTag DEsource_
Definition: L1TDEMON.h:48
bool m_doSys[dedefs::DEnsys]
Definition: L1TDEMON.h:76
std::string histFile_
Definition: L1TDEMON.h:56
bool runInFF_
Definition: L1TDEMON.h:65
int deSysCount[dedefs::DEnsys]
Definition: L1TDEMON.h:69
L1TDEMON::~L1TDEMON ( )

Definition at line 60 of file L1TDEMON.cc.

60  {
61 }

Member Function Documentation

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

get the comparison results

get the de candidates

— Fill histograms(me) —

bitset loop

Definition at line 294 of file L1TDEMON.cc.

References gather_cfg::cout, dedefs::CTF, TauDecayModes::dec, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, dedefs::DTtftrk, stringResolutionProvider_cfi::eta, fastmath::etaphi(), HcalObjRepresent::Fill(), objects.autophobj::float, L1DataEmulRecord::get_isComp(), L1DataEmulRecord::get_status(), edm::Event::getByToken(), L1DataEmulRecord::getColl(), L1DataEmulRecord::getNCand(), dedefs::GMT, dedefs::GMTcnd, mps_fire::i, edm::HandleBase::isValid(), RecoTauDiscriminantConfiguration::mask, RPCpg::rate(), dedefs::RCT, L1DataEmulDigi::reset(), dedefs::RPC, dedefs::SystLabel, and verbose.

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

Definition at line 288 of file L1TDEMON.cc.

288  {
289 }
void L1TDEMON::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

labeling (temporary cosmetics added here)

Implements DQMEDAnalyzer.

Definition at line 63 of file L1TDEMON.cc.

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

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

Definition at line 285 of file L1TDEMON.cc.

285  {
286 }
int L1TDEMON::verbose ( )
inlineprivate

Definition at line 53 of file L1TDEMON.h.

References verbose_.

53 {return verbose_;}
int verbose_
Definition: L1TDEMON.h:52

Member Data Documentation

edm::InputTag L1TDEMON::DEsource_
private

Definition at line 48 of file L1TDEMON.h.

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

Definition at line 104 of file L1TDEMON.h.

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

Definition at line 69 of file L1TDEMON.h.

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

Definition at line 100 of file L1TDEMON.h.

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

Definition at line 98 of file L1TDEMON.h.

MonitorElement* L1TDEMON::errordist
private

Definition at line 84 of file L1TDEMON.h.

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

Definition at line 85 of file L1TDEMON.h.

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

Definition at line 89 of file L1TDEMON.h.

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

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

Definition at line 92 of file L1TDEMON.h.

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

Definition at line 88 of file L1TDEMON.h.

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

Definition at line 99 of file L1TDEMON.h.

bool L1TDEMON::hasRecord_
private

Definition at line 49 of file L1TDEMON.h.

std::string L1TDEMON::histFile_
private

Definition at line 56 of file L1TDEMON.h.

std::string L1TDEMON::histFolder_
private

Definition at line 59 of file L1TDEMON.h.

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

Definition at line 76 of file L1TDEMON.h.

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

Definition at line 101 of file L1TDEMON.h.

bool L1TDEMON::monitorDaemon_
private

Definition at line 62 of file L1TDEMON.h.

int L1TDEMON::nEvt_
private

Definition at line 68 of file L1TDEMON.h.

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

Definition at line 70 of file L1TDEMON.h.

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

Definition at line 90 of file L1TDEMON.h.

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

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

Definition at line 93 of file L1TDEMON.h.

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

Definition at line 95 of file L1TDEMON.h.

bool L1TDEMON::runInFF_
private

Definition at line 65 of file L1TDEMON.h.

MonitorElement* L1TDEMON::sysncand[2]
private

Definition at line 83 of file L1TDEMON.h.

MonitorElement* L1TDEMON::sysrates
private

monitoring elements

Definition at line 82 of file L1TDEMON.h.

int L1TDEMON::verbose_
private

Definition at line 52 of file L1TDEMON.h.

Referenced by verbose().

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

Definition at line 91 of file L1TDEMON.h.

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

Definition at line 94 of file L1TDEMON.h.