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 Attributes
EcalEndcapMonitorModule Class Reference

#include <EcalEndcapMonitorModule.h>

Inheritance diagram for EcalEndcapMonitorModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalEndcapMonitorModule (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EcalEndcapMonitorModule ()
 Destructor. More...
 
- 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

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
void reset (void)
 Reset. More...
 
void setup (void)
 Setup. More...
 
- 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 Attributes

bool debug_
 
DQMStoredqmStore_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
edm::EDGetTokenT
< EcalRecHitCollection
EcalRecHitCollection_
 
edm::EDGetTokenT
< EcalTrigPrimDigiCollection
EcalTrigPrimDigiCollection_
 
edm::EDGetTokenT
< EEDigiCollection
EEDigiCollection_
 
bool enableCleanup_
 
bool enableEventDisplay_
 
int evtNumber_
 
int evtType_
 
bool fixedRunNumber_
 
bool fixedRunType_
 
int ievt_
 
bool init_
 
bool isPhysics_
 
MonitorElementmeEEDCC_
 
MonitorElementmeEEdigis_ [2]
 
MonitorElementmeEEhits_ [2]
 
MonitorElementmeEEtpdigis_ [2]
 
MonitorElementmeEvent_ [18]
 
MonitorElementmeEvt_
 
MonitorElementmeEvtType_
 
bool mergeRuns_
 
MonitorElementmeRun_
 
MonitorElementmeRunType_
 
MonitorElementmeStatus_
 
std::string prefixME_
 
int runNumber_
 
int runType_
 
bool verbose_
 

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 23 of file EcalEndcapMonitorModule.h.

Constructor & Destructor Documentation

EcalEndcapMonitorModule::EcalEndcapMonitorModule ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file EcalEndcapMonitorModule.cc.

References gather_cfg::cout, debug_, EcalRawDataCollection_, EcalRecHitCollection_, EcalTrigPrimDigiCollection_, EEDigiCollection_, enableCleanup_, enableEventDisplay_, evtNumber_, evtType_, fixedRunNumber_, fixedRunType_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, meEEDCC_, meEEdigis_, meEEhits_, meEEtpdigis_, meEvent_, meEvt_, meEvtType_, mergeRuns_, meRun_, meRunType_, meStatus_, prefixME_, runNumber_, runType_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

27  {
28 
29  // verbose switch
30  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
31 
32  if ( verbose_ ) {
33  std::cout << std::endl;
34  std::cout << " *** Ecal Endcap Generic Monitor ***" << std::endl;
35  std::cout << std::endl;
36  }
37 
38  init_ = false;
39 
40  EcalRawDataCollection_ = consumes<EcalRawDataCollection>(ps.getParameter<edm::InputTag>("EcalRawDataCollection"));
41  EEDigiCollection_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEDigiCollection"));
42  EcalRecHitCollection_ = consumes<EcalRecHitCollection>(ps.getParameter<edm::InputTag>("EcalRecHitCollection"));
43  EcalTrigPrimDigiCollection_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollection"));
44 
45  // this should come from the event header
46  runNumber_ = ps.getUntrackedParameter<int>("runNumber", 0);
47 
48  fixedRunNumber_ = false;
49  if ( runNumber_ != 0 ) fixedRunNumber_ = true;
50 
51  if ( fixedRunNumber_ ) {
52  if ( verbose_ ) {
53  std::cout << " fixed Run Number = " << runNumber_ << std::endl;
54  }
55  }
56 
57  // this should come from the event header
58  evtNumber_ = 0;
59 
60  // this should come from the EcalEndcap event header
61  runType_ = ps.getUntrackedParameter<int>("runType", -1);
63 
64  fixedRunType_ = false;
65  if ( runType_ != -1 ) fixedRunType_ = true;
66 
67  if ( fixedRunType_) {
68  if ( verbose_ ) {
69  std::cout << " fixed Run Type = " << runType_ << std::endl;
70  }
71  }
72 
73  // debug switch
74  debug_ = ps.getUntrackedParameter<bool>("debug", false);
75 
76  if ( debug_ ) {
77  if ( verbose_ ) {
78  std::cout << " debug switch is ON" << std::endl;
79  }
80  } else {
81  if ( verbose_ ) {
82  std::cout << " debug switch is OFF" << std::endl;
83  }
84  }
85 
86  // prefixME path
87  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
88 
89  // enableCleanup switch
90  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
91 
92  // mergeRuns switch
93  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
94 
95  if ( enableCleanup_ ) {
96  if ( verbose_ ) {
97  std::cout << " enableCleanup switch is ON" << std::endl;
98  }
99  } else {
100  if ( verbose_ ) {
101  std::cout << " enableCleanup switch is OFF" << std::endl;
102  }
103  }
104 
105  // EventDisplay switch
106  enableEventDisplay_ = ps.getUntrackedParameter<bool>("enableEventDisplay", false);
107 
108  meStatus_ = 0;
109  meRun_ = 0;
110  meEvt_ = 0;
111  meRunType_ = 0;
112  meEvtType_ = 0;
113 
114  meEEDCC_ = 0;
115 
116  for (int i = 0; i < 2; i++) {
117  meEEdigis_[i] = 0;
118  meEEhits_[i] = 0;
119  meEEtpdigis_[i] = 0;
120  }
121 
122  for (int i = 0; i < 18; i++) {
123  meEvent_[i] = 0;
124  }
125 
126 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< EcalTrigPrimDigiCollection > EcalTrigPrimDigiCollection_
MonitorElement * meEEtpdigis_[2]
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
EcalEndcapMonitorModule::~EcalEndcapMonitorModule ( )
virtual

Destructor.

Definition at line 128 of file EcalEndcapMonitorModule.cc.

128  {
129 
130 }

Member Function Documentation

void EcalEndcapMonitorModule::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 368 of file EcalEndcapMonitorModule.cc.

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, counter, EcalEndcap, EcalRawDataCollection_, EcalRecHitCollection_, EcalTrigPrimDigiCollection_, EEDigiCollection_, enableEventDisplay_, edm::EventID::event(), evtNumber_, evtType_, MonitorElement::Fill(), fixedRunNumber_, fixedRunType_, edm::Event::getByToken(), i, edm::EventBase::id(), ievt_, init_, Numbers::initGeometry(), ecalpyutils::ism(), Numbers::iSM(), isPhysics_, EEDetId::ix(), LogDebug, meEEDCC_, meEEdigis_, meEEhits_, meEEtpdigis_, meEvent_, meEvt_, meEvtType_, meRun_, meRunType_, meStatus_, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, edm::EventID::run(), runNumber_, runType_, setup(), Numbers::subDet(), and verbose_.

368  {
369 
371 
372  if ( ! init_ ) this->setup();
373 
374  ievt_++;
375 
376  LogDebug("EcalEndcapMonitorModule") << "processing event " << ievt_;
377 
378  if ( ! fixedRunNumber_ ) runNumber_ = e.id().run();
379 
380  evtNumber_ = e.id().event();
381 
383 
384  if ( e.getByToken(EcalRawDataCollection_, dcchs) ) {
385 
386  if ( dcchs->size() == 0 ) {
387  LogDebug("EcalEndcapMonitorModule") << "EcalRawDataCollection is empty";
388  return;
389  }
390 
391  int neec = 0;
392 
393  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
394 
395  if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
396 
397  neec++;
398 
399  }
400 
401  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
402 
403  if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
404 
405  if ( meEEDCC_ ) meEEDCC_->Fill(Numbers::iSM( *dcchItr, EcalEndcap )+0.5);
406 
407  if ( ! fixedRunNumber_ ) {
408  runNumber_ = dcchItr->getRunNumber();
409  }
410 
411  evtNumber_ = dcchItr->getLV1();
412 
413  if ( ! fixedRunType_ ) {
414  runType_ = dcchItr->getRunType();
415  evtType_ = runType_;
416  }
417 
418  if ( evtType_ < 0 || evtType_ > 22 ) evtType_ = -1;
419  if ( meEvtType_ ) meEvtType_->Fill(evtType_+0.5, 1./neec);
420 
421  }
422 
423  LogDebug("EcalEndcapMonitorModule") << "event: " << ievt_ << " DCC headers collection size: " << neec;
424 
425  } else {
426 
427  if ( evtType_ < 0 || evtType_ > 22 ) evtType_ = -1;
428  if ( meEvtType_ ) meEvtType_->Fill(evtType_+0.5, 1./18.);
429 
430  edm::LogWarning("EcalEndcapMonitorModule") << "EcalRawDataCollection not available";
431 
432  }
433 
434  isPhysics_ = false;
441 
443 
444  if ( ievt_ == 1 ) {
445  LogDebug("EcalEndcapMonitorModule") << "processing run " << runNumber_;
446  // begin-of-run
447  if ( meStatus_ ) meStatus_->Fill(0);
448  } else {
449  // running
450  if ( meStatus_ ) meStatus_->Fill(1);
451  }
452 
453  if ( meRun_ ) meRun_->Fill(runNumber_);
454  if ( meEvt_ ) meEvt_->Fill(evtNumber_);
455 
457 
458  if ( e.getByToken(EEDigiCollection_, digis) ) {
459 
460  int need = digis->size();
461  LogDebug("EcalEndcapMonitorModule") << "event " << ievt_ << " digi collection size " << need;
462 
463  int counter[18] = { 0 };
464 
465  if ( meEEdigis_[0] ) {
466  if ( isPhysics_ ) meEEdigis_[0]->Fill(float(need));
467  }
468 
469  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
470 
471  EEDetId id = digiItr->id();
472 
473  int ism = Numbers::iSM( id );
474 
475  counter[ism-1]++;
476 
477  }
478 
479  for (int i = 0; i < 18; i++) {
480 
481  if ( meEEdigis_[1] ) {
482  if ( isPhysics_ ) meEEdigis_[1]->Fill(i+1+0.5, counter[i]);
483  }
484 
485  }
486 
487  } else {
488 
489  edm::LogWarning("EcalEndcapMonitorModule") << "EEDigiCollection not available";
490 
491  }
492 
494 
495  if ( e.getByToken(EcalRecHitCollection_, hits) ) {
496 
497  int neeh = hits->size();
498  LogDebug("EcalEndcapMonitorModule") << "event " << ievt_ << " hits collection size " << neeh;
499 
500  if ( meEEhits_[0] ) {
501  if ( isPhysics_ ) meEEhits_[0]->Fill(float(neeh));
502  }
503 
504  int counter[18] = { 0 };
505 
506  for ( EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr ) {
507 
508  EEDetId id = hitItr->id();
509 
510  int ix = id.ix();
511  int iy = id.iy();
512 
513  int ism = Numbers::iSM( id );
514 
515  counter[ism-1]++;
516 
517  if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
518 
519  float xix = ix - 0.5;
520  float xiy = iy - 0.5;
521 
522  float xval = hitItr->energy();
523 
524  if ( enableEventDisplay_ ) {
525 
526  if ( xval >= 10 ) {
527  if ( meEvent_[ism-1] ) meEvent_[ism-1]->Fill(xix, xiy, xval);
528  }
529 
530  }
531 
532  }
533 
534  for (int i = 0; i < 18; i++) {
535 
536  if ( meEEhits_[1] ) {
537  if ( isPhysics_ ) meEEhits_[1]->Fill(i+1+0.5, counter[i]);
538  }
539 
540  }
541 
542  } else {
543 
544  edm::LogWarning("EcalEndcapMonitorModule") << "EcalRecHitCollection not available";
545 
546  }
547 
549 
550  if ( e.getByToken(EcalTrigPrimDigiCollection_, tpdigis) ) {
551 
552  int neetpd = 0;
553  int counter[18] = { 0 };
554 
555  for ( EcalTrigPrimDigiCollection::const_iterator tpdigiItr = tpdigis->begin(); tpdigiItr != tpdigis->end(); ++tpdigiItr ) {
556 
557  EcalTrigTowerDetId idt = tpdigiItr->id();
558 
559  if ( Numbers::subDet( idt ) != EcalEndcap ) continue;
560 
561  int ismt = Numbers::iSM( idt );
562 
563  neetpd++;
564  counter[ismt-1]++;
565 
566  }
567 
568  LogDebug("EcalEndcapMonitorModule") << "event " << ievt_ << " TP digi collection size " << neetpd;
569  if ( meEEtpdigis_[0] ) {
570  if ( isPhysics_ ) meEEtpdigis_[0]->Fill(float(neetpd));
571  }
572 
573  for (int i = 0; i < 18; i++) {
574 
575  if ( meEEtpdigis_[1] ) {
576  if ( isPhysics_ ) meEEtpdigis_[1]->Fill(i+1+0.5, counter[i]);
577  }
578 
579  }
580 
581  } else {
582 
583  edm::LogWarning("EcalEndcapMonitorModule") << "EcalTrigPrimDigiCollection not available";
584 
585  }
586 
587 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
int ix() const
Definition: EEDetId.h:76
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< EcalTrigPrimDigiCollection > EcalTrigPrimDigiCollection_
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
MonitorElement * meEEtpdigis_[2]
void Fill(long long x)
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
edm::EventID id() const
Definition: EventBase.h:56
static std::atomic< unsigned int > counter
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:142
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void EcalEndcapMonitorModule::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file EcalEndcapMonitorModule.cc.

References gather_cfg::cout, debug_, dqmStore_, enableEventDisplay_, ievt_, cppFunctionSkipper::operator, prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

132  {
133 
134  if ( debug_ ) std::cout << "EcalEndcapMonitorModule: beginJob" << std::endl;
135 
136  ievt_ = 0;
137 
139 
140  if ( dqmStore_ ) {
141  dqmStore_->setCurrentFolder(prefixME_ + "/EcalInfo");
142  dqmStore_->rmdir(prefixME_ + "/EcalInfo");
143  if ( enableEventDisplay_ ) {
144  dqmStore_->setCurrentFolder(prefixME_ + "/EcalEvent");
145  dqmStore_->rmdir(prefixME_ + "/EcalEvent");
146  }
147  }
148 
149 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2731
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void EcalEndcapMonitorModule::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 151 of file EcalEndcapMonitorModule.cc.

References gather_cfg::cout, debug_, mergeRuns_, and reset().

151  {
152 
153  if ( debug_ ) std::cout << "EcalEndcapMonitorModule: beginRun" << std::endl;
154 
155  if ( ! mergeRuns_ ) this->reset();
156 
157 }
tuple cout
Definition: gather_cfg.py:121
void EcalEndcapMonitorModule::cleanup ( void  )
protected

Cleanup.

Definition at line 290 of file EcalEndcapMonitorModule.cc.

References dqmStore_, enableCleanup_, enableEventDisplay_, MonitorElement::getName(), i, init_, meEEDCC_, meEEdigis_, meEEhits_, meEEtpdigis_, meEvent_, meEvt_, meEvtType_, meRun_, meRunType_, meStatus_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

290  {
291 
292  if ( ! enableCleanup_ ) return;
293 
294  if ( dqmStore_ ) {
295 
296  dqmStore_->setCurrentFolder(prefixME_ + "/EcalInfo");
297 
299  meStatus_ = 0;
300 
302  meRun_ = 0;
303 
305  meEvt_ = 0;
306 
308  meRunType_ = 0;
309 
311  meEvtType_ = 0;
312 
314  meEEDCC_ = 0;
315 
316  for (int i = 0; i < 2; i++) {
317 
318  if ( meEEdigis_[i] ) dqmStore_->removeElement( meEEdigis_[i]->getName() );
319  meEEdigis_[i] = 0;
320 
321  if ( meEEhits_[i] ) dqmStore_->removeElement( meEEhits_[i]->getName() );
322  meEEhits_[i] = 0;
323 
324  if ( meEEtpdigis_[i] ) dqmStore_->removeElement( meEEtpdigis_[i]->getName() );
325  meEEtpdigis_[i] = 0;
326 
327  }
328 
329  if ( enableEventDisplay_ ) {
330 
331  dqmStore_->setCurrentFolder(prefixME_ + "/EcalEvent");
332 
333  for (int i = 0; i < 18; i++) {
334 
335  if ( meEvent_[i] ) dqmStore_->removeElement( meEvent_[i]->getName() );
336  meEvent_[i] = 0;
337 
338  }
339 
340  }
341 
342  }
343 
344  init_ = false;
345 
346 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEEtpdigis_[2]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2773
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void EcalEndcapMonitorModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 348 of file EcalEndcapMonitorModule.cc.

References cleanup(), gather_cfg::cout, debug_, dqmStore_, evtNumber_, MonitorElement::Fill(), DQMStore::get(), ievt_, init_, meEvt_, meRun_, meStatus_, prefixME_, and runNumber_.

348  {
349 
350  if ( debug_ ) std::cout << "EcalEndcapMonitorModule: endJob, ievt = " << ievt_ << std::endl;
351 
352  if ( dqmStore_ ) {
353  meStatus_ = dqmStore_->get(prefixME_ + "/EcalInfo/STATUS");
354  meRun_ = dqmStore_->get(prefixME_ + "/EcalInfo/RUN");
355  meEvt_ = dqmStore_->get(prefixME_ + "/EcalInfo/EVT");
356  }
357 
358  // end-of-run
359  if ( meStatus_ ) meStatus_->Fill(2);
360 
361  if ( meRun_ ) meRun_->Fill(runNumber_);
362  if ( meEvt_ ) meEvt_->Fill(evtNumber_);
363 
364  if ( init_ ) this->cleanup();
365 
366 }
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
tuple cout
Definition: gather_cfg.py:121
void EcalEndcapMonitorModule::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file EcalEndcapMonitorModule.cc.

References gather_cfg::cout, debug_, evtNumber_, MonitorElement::Fill(), meEvt_, meRun_, meStatus_, and runNumber_.

159  {
160 
161  if ( debug_ ) std::cout << "EcalEndcapMonitorModule: endRun" << std::endl;
162 
163  // end-of-run
164  if ( meStatus_ ) meStatus_->Fill(2);
165 
166  if ( meRun_ ) meRun_->Fill(runNumber_);
167  if ( meEvt_ ) meEvt_->Fill(evtNumber_);
168 
169 }
void Fill(long long x)
tuple cout
Definition: gather_cfg.py:121
void EcalEndcapMonitorModule::reset ( void  )
protected

Reset.

Definition at line 171 of file EcalEndcapMonitorModule.cc.

References enableEventDisplay_, i, meEEDCC_, meEEdigis_, meEEhits_, meEEtpdigis_, meEvent_, meEvtType_, and MonitorElement::Reset().

Referenced by beginRun().

171  {
172 
173  if ( meEvtType_ ) meEvtType_->Reset();
174 
175  if ( meEEDCC_ ) meEEDCC_->Reset();
176 
177  for (int i = 0; i < 2; i++) {
178  if ( meEEdigis_[i] ) meEEdigis_[i]->Reset();
179 
180  if ( meEEhits_[i] ) meEEhits_[i]->Reset();
181 
182  if ( meEEtpdigis_[i] ) meEEtpdigis_[i]->Reset();
183  }
184 
185  if ( enableEventDisplay_ ) {
186  for (int i = 0; i < 18; i++) {
187  if ( meEvent_[i] ) meEvent_[i]->Reset();
188  }
189  }
190 
191 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meEEtpdigis_[2]
void Reset(void)
reset ME (ie. contents, errors, etc)
void EcalEndcapMonitorModule::setup ( void  )
protected

Setup.

Definition at line 193 of file EcalEndcapMonitorModule.cc.

References EcalDCCHeaderBlock::BEAMH2, EcalDCCHeaderBlock::BEAMH4, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), DQMStore::bookProfile(), EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, dqmStore_, enableEventDisplay_, MonitorElement::Fill(), EcalDCCHeaderBlock::HALO_GLOBAL, EcalDCCHeaderBlock::HALO_LOCAL, i, init_, Numbers::ix0EE(), Numbers::iy0EE(), EcalDCCHeaderBlock::LASER_DELAY_SCAN, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_POWER_SCAN, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, meEEDCC_, meEEdigis_, meEEhits_, meEEtpdigis_, meEvent_, meEvt_, meEvtType_, meRun_, meRunType_, meStatus_, EcalDCCHeaderBlock::MTCC, mergeVDriftHistosByStation::name, EcalDCCHeaderBlock::PEDESTAL_25NS_SCAN, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, prefixME_, Numbers::sEE(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), MonitorElement::setResetMe(), AlCaHLTBitMon_QueryRunRegistry::string, DQMStore::tag(), EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, and EcalDCCHeaderBlock::TESTPULSE_SCAN_MEM.

Referenced by analyze().

193  {
194 
195  init_ = true;
196 
197  if ( dqmStore_ ) {
198  dqmStore_->setCurrentFolder(prefixME_ + "/EcalInfo");
199 
200  meStatus_ = dqmStore_->bookInt("STATUS");
201 
202  meRun_ = dqmStore_->bookInt("RUN");
203  meEvt_ = dqmStore_->bookInt("EVT");
204 
205  meRunType_ = dqmStore_->bookInt("RUNTYPE");
206  meEvtType_ = dqmStore_->book1D("EVTTYPE", "EVTTYPE", 31, -1., 30.);
207  meEvtType_->setAxisTitle("number of events", 2);
208  meEvtType_->setBinLabel(1, "UNKNOWN", 1);
219  meEvtType_->setBinLabel(2+EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, "PEDESTAL_OFFSET_SCAN", 1);
232  }
233 
234  // unknown
235  if ( meStatus_ ) meStatus_->Fill(-1);
236 
237  if ( meRun_ ) meRun_->Fill(-1);
238  if ( meEvt_ ) meEvt_->Fill(-1);
239 
240  if ( meRunType_ ) meRunType_->Fill(-1);
241 
243 
244  if ( dqmStore_ ) {
245  dqmStore_->setCurrentFolder(prefixME_ + "/EcalInfo");
246 
247  meEEDCC_ = dqmStore_->book1D("EEMM DCC", "EEMM DCC", 18, 1, 19.);
248  for (int i = 0; i < 18; i++) {
249  meEEDCC_->setBinLabel(i+1, Numbers::sEE(i+1).c_str(), 1);
250  }
251 
252  meEEdigis_[0] = dqmStore_->book1D("EEMM digi number", "EEMM digi number", 100, 0., 3000.);
253 
254  meEEdigis_[1] = dqmStore_->bookProfile("EEMM digi number profile", "EEMM digi number profile", 18, 1, 19., 850, 0., 851., "s");
255  for (int i = 0; i < 18; i++) {
256  meEEdigis_[1]->setBinLabel(i+1, Numbers::sEE(i+1).c_str(), 1);
257  }
258 
259  meEEhits_[0] = dqmStore_->book1D("EEMM hit number", "EEMM hit number", 100, 0., 3000.);
260 
261  meEEhits_[1] = dqmStore_->bookProfile("EEMM hit number profile", "EEMM hit number profile", 18, 1, 19., 850, 0., 851., "s");
262  for (int i = 0; i < 18; i++) {
263  meEEhits_[1]->setBinLabel(i+1, Numbers::sEE(i+1).c_str(), 1);
264  }
265 
266  meEEtpdigis_[0] = dqmStore_->book1D("EEMM TP digi number", "EEMM TP digi number", 100, 0., 1585.);
267 
268  meEEtpdigis_[1] = dqmStore_->bookProfile("EEMM TP digi number profile", "EEMM TP digi number profile", 18, 1, 19., 34, 0., 35., "s");
269  for (int i = 0; i < 18; i++) {
270  meEEtpdigis_[1]->setBinLabel(i+1, Numbers::sEE(i+1).c_str(), 1);
271  }
272 
273  if ( enableEventDisplay_ ) {
274  dqmStore_->setCurrentFolder(prefixME_ + "/EcalEvent");
275  for (int i = 0; i < 18; i++) {
276  name = "EEMM event " + Numbers::sEE(i+1);
277  meEvent_[i] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
278  meEvent_[i]->setAxisTitle("ix", 1);
279  if ( i+1 >= 1 && i+1 <= 9 ) meEvent_[i]->setAxisTitle("101-ix", 1);
280  meEvent_[i]->setAxisTitle("iy", 2);
281  dqmStore_->tag(meEvent_[i], i+1);
282  if ( meEvent_[i] ) meEvent_[i]->setResetMe(true);
283  }
284  }
285 
286  }
287 
288 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
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 * meEEtpdigis_[2]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1510
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1187
void setResetMe(bool)
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:780
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:1001
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585

Member Data Documentation

bool EcalEndcapMonitorModule::debug_
private

Definition at line 81 of file EcalEndcapMonitorModule.h.

Referenced by beginJob(), beginRun(), EcalEndcapMonitorModule(), endJob(), and endRun().

DQMStore* EcalEndcapMonitorModule::dqmStore_
private

Definition at line 85 of file EcalEndcapMonitorModule.h.

Referenced by beginJob(), cleanup(), endJob(), and setup().

edm::EDGetTokenT<EcalRawDataCollection> EcalEndcapMonitorModule::EcalRawDataCollection_
private

Definition at line 75 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

edm::EDGetTokenT<EcalRecHitCollection> EcalEndcapMonitorModule::EcalRecHitCollection_
private

Definition at line 77 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

edm::EDGetTokenT<EcalTrigPrimDigiCollection> EcalEndcapMonitorModule::EcalTrigPrimDigiCollection_
private

Definition at line 78 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

edm::EDGetTokenT<EEDigiCollection> EcalEndcapMonitorModule::EEDigiCollection_
private

Definition at line 76 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

bool EcalEndcapMonitorModule::enableCleanup_
private

Definition at line 89 of file EcalEndcapMonitorModule.h.

Referenced by cleanup(), and EcalEndcapMonitorModule().

bool EcalEndcapMonitorModule::enableEventDisplay_
private
int EcalEndcapMonitorModule::evtNumber_
private

Definition at line 62 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), EcalEndcapMonitorModule(), endJob(), and endRun().

int EcalEndcapMonitorModule::evtType_
private

Definition at line 65 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

bool EcalEndcapMonitorModule::fixedRunNumber_
private

Definition at line 67 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

bool EcalEndcapMonitorModule::fixedRunType_
private

Definition at line 69 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

int EcalEndcapMonitorModule::ievt_
private

Definition at line 73 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), beginJob(), and endJob().

bool EcalEndcapMonitorModule::init_
private

Definition at line 109 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), endJob(), and setup().

bool EcalEndcapMonitorModule::isPhysics_
private

Definition at line 71 of file EcalEndcapMonitorModule.h.

Referenced by analyze().

MonitorElement* EcalEndcapMonitorModule::meEEDCC_
private

Definition at line 101 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

MonitorElement* EcalEndcapMonitorModule::meEEdigis_[2]
private

Definition at line 103 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

MonitorElement* EcalEndcapMonitorModule::meEEhits_[2]
private

Definition at line 104 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

MonitorElement* EcalEndcapMonitorModule::meEEtpdigis_[2]
private

Definition at line 105 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

MonitorElement* EcalEndcapMonitorModule::meEvent_[18]
private

Definition at line 107 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

MonitorElement* EcalEndcapMonitorModule::meEvt_
private
MonitorElement* EcalEndcapMonitorModule::meEvtType_
private

Definition at line 99 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), reset(), and setup().

bool EcalEndcapMonitorModule::mergeRuns_
private

Definition at line 91 of file EcalEndcapMonitorModule.h.

Referenced by beginRun(), and EcalEndcapMonitorModule().

MonitorElement* EcalEndcapMonitorModule::meRun_
private
MonitorElement* EcalEndcapMonitorModule::meRunType_
private

Definition at line 98 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), cleanup(), EcalEndcapMonitorModule(), and setup().

MonitorElement* EcalEndcapMonitorModule::meStatus_
private
std::string EcalEndcapMonitorModule::prefixME_
private

Definition at line 87 of file EcalEndcapMonitorModule.h.

Referenced by beginJob(), cleanup(), EcalEndcapMonitorModule(), endJob(), and setup().

int EcalEndcapMonitorModule::runNumber_
private

Definition at line 61 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), EcalEndcapMonitorModule(), endJob(), and endRun().

int EcalEndcapMonitorModule::runType_
private

Definition at line 64 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().

bool EcalEndcapMonitorModule::verbose_
private

Definition at line 80 of file EcalEndcapMonitorModule.h.

Referenced by analyze(), and EcalEndcapMonitorModule().