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
EcalBarrelMonitorModule Class Reference

#include <EcalBarrelMonitorModule.h>

Inheritance diagram for EcalBarrelMonitorModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalBarrelMonitorModule (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EcalBarrelMonitorModule ()
 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
< EBDigiCollection
EBDigiCollection_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
edm::EDGetTokenT
< EcalRecHitCollection
EcalRecHitCollection_
 
edm::EDGetTokenT
< EcalTrigPrimDigiCollection
EcalTrigPrimDigiCollection_
 
bool enableCleanup_
 
bool enableEventDisplay_
 
int evtNumber_
 
int evtType_
 
bool fixedRunNumber_
 
bool fixedRunType_
 
int ievt_
 
bool init_
 
bool isPhysics_
 
MonitorElementmeEBDCC_
 
MonitorElementmeEBdigis_ [2]
 
MonitorElementmeEBhits_ [2]
 
MonitorElementmeEBtpdigis_ [2]
 
MonitorElementmeEvent_ [36]
 
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 EcalBarrelMonitorModule.h.

Constructor & Destructor Documentation

EcalBarrelMonitorModule::EcalBarrelMonitorModule ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file EcalBarrelMonitorModule.cc.

References gather_cfg::cout, debug_, EBDigiCollection_, EcalRawDataCollection_, EcalRecHitCollection_, EcalTrigPrimDigiCollection_, enableCleanup_, enableEventDisplay_, evtNumber_, evtType_, fixedRunNumber_, fixedRunType_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, meEBDCC_, meEBdigis_, meEBhits_, meEBtpdigis_, 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 Barrel 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  EBDigiCollection_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBDigiCollection"));
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 EcalBarrel 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  meEBDCC_ = 0;
115 
116  for (int i = 0; i < 2; i++) {
117  meEBdigis_[i] = 0;
118  meEBhits_[i] = 0;
119  meEBtpdigis_[i] = 0;
120  }
121 
122  for (int i = 0; i < 36; 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< EBDigiCollection > EBDigiCollection_
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > EcalTrigPrimDigiCollection_
MonitorElement * meEBtpdigis_[2]
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
tuple cout
Definition: gather_cfg.py:121
EcalBarrelMonitorModule::~EcalBarrelMonitorModule ( )
virtual

Destructor.

Definition at line 128 of file EcalBarrelMonitorModule.cc.

128  {
129 
130 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 367 of file EcalBarrelMonitorModule.cc.

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, counter, EBDigiCollection_, EcalBarrel, EcalRawDataCollection_, EcalRecHitCollection_, EcalTrigPrimDigiCollection_, enableEventDisplay_, edm::EventID::event(), evtNumber_, evtType_, MonitorElement::Fill(), fixedRunNumber_, fixedRunType_, edm::Event::getByToken(), i, EBDetId::ic(), edm::EventBase::id(), ievt_, init_, Numbers::initGeometry(), ecalpyutils::ism(), Numbers::iSM(), isPhysics_, LogDebug, meEBDCC_, meEBdigis_, meEBhits_, meEBtpdigis_, meEvent_, meEvt_, meEvtType_, meRun_, meRunType_, meStatus_, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, edm::EventID::run(), runNumber_, runType_, setup(), Numbers::subDet(), and verbose_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file EcalBarrelMonitorModule.cc.

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

132  {
133 
134  if ( debug_ ) std::cout << "EcalBarrelMonitorModule: 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:2730
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EcalBarrelMonitorModule::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 151 of file EcalBarrelMonitorModule.cc.

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

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

Cleanup.

Definition at line 289 of file EcalBarrelMonitorModule.cc.

References dqmStore_, enableCleanup_, enableEventDisplay_, MonitorElement::getName(), i, init_, meEBDCC_, meEBdigis_, meEBhits_, meEBtpdigis_, meEvent_, meEvt_, meEvtType_, meRun_, meRunType_, meStatus_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

289  {
290 
291  if ( ! enableCleanup_ ) return;
292 
293  if ( dqmStore_ ) {
294 
295  dqmStore_->setCurrentFolder(prefixME_ + "/EcalInfo");
296 
298  meStatus_ = 0;
299 
301  meRun_ = 0;
302 
304  meEvt_ = 0;
305 
307  meRunType_ = 0;
308 
310  meEvtType_ = 0;
311 
313  meEBDCC_ = 0;
314 
315  for (int i = 0; i < 2; i++) {
316 
317  if ( meEBdigis_[i] ) dqmStore_->removeElement( meEBdigis_[i]->getName() );
318  meEBdigis_[i] = 0;
319 
320  if ( meEBhits_[i] ) dqmStore_->removeElement( meEBhits_[i]->getName() );
321  meEBhits_[i] = 0;
322 
323  if ( meEBtpdigis_[i] ) dqmStore_->removeElement( meEBtpdigis_[i]->getName() );
324  meEBtpdigis_[i] = 0;
325 
326  }
327 
328  if ( enableEventDisplay_ ) {
329 
330  dqmStore_->setCurrentFolder(prefixME_ + "/EcalEvent");
331 
332  for (int i = 0; i < 36; i++) {
333 
334  if ( meEvent_[i] ) dqmStore_->removeElement( meEvent_[i]->getName() );
335  meEvent_[i] = 0;
336 
337  }
338 
339  }
340 
341  }
342 
343  init_ = false;
344 
345 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meEBtpdigis_[2]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EcalBarrelMonitorModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 347 of file EcalBarrelMonitorModule.cc.

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

347  {
348 
349  if ( debug_ ) std::cout << "EcalBarrelMonitorModule: endJob, ievt = " << ievt_ << std::endl;
350 
351  if ( dqmStore_ ) {
352  meStatus_ = dqmStore_->get(prefixME_ + "/EcalInfo/STATUS");
353  meRun_ = dqmStore_->get(prefixME_ + "/EcalInfo/RUN");
354  meEvt_ = dqmStore_->get(prefixME_ + "/EcalInfo/EVT");
355  }
356 
357  // end-of-run
358  if ( meStatus_ ) meStatus_->Fill(2);
359 
360  if ( meRun_ ) meRun_->Fill(runNumber_);
361  if ( meEvt_ ) meEvt_->Fill(evtNumber_);
362 
363  if ( init_ ) this->cleanup();
364 
365 }
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:1623
tuple cout
Definition: gather_cfg.py:121
void EcalBarrelMonitorModule::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file EcalBarrelMonitorModule.cc.

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

159  {
160 
161  if ( debug_ ) std::cout << "EcalBarrelMonitorModule: 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 EcalBarrelMonitorModule::reset ( void  )
protected

Reset.

Definition at line 171 of file EcalBarrelMonitorModule.cc.

References enableEventDisplay_, i, meEBDCC_, meEBdigis_, meEBhits_, meEBtpdigis_, meEvent_, meEvtType_, and MonitorElement::Reset().

Referenced by beginRun().

171  {
172 
173  if ( meEvtType_ ) meEvtType_->Reset();
174 
175  if ( meEBDCC_ ) meEBDCC_->Reset();
176 
177  for (int i = 0; i < 2; i++) {
178  if ( meEBdigis_[i] ) meEBdigis_[i]->Reset();
179 
180  if ( meEBhits_[i] ) meEBdigis_[i]->Reset();
181 
182  if ( meEBtpdigis_[i] ) meEBtpdigis_[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 * meEBtpdigis_[2]
void Reset(void)
reset ME (ie. contents, errors, etc)
void EcalBarrelMonitorModule::setup ( void  )
protected

Setup.

Definition at line 193 of file EcalBarrelMonitorModule.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_, EcalDCCHeaderBlock::LASER_DELAY_SCAN, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_POWER_SCAN, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, meEBDCC_, meEBdigis_, meEBhits_, meEBtpdigis_, 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::sEB(), 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  meEBDCC_ = dqmStore_->book1D("EBMM DCC", "EBMM DCC", 36, 1, 37.);
248  for (int i = 0; i < 36; i++) {
249  meEBDCC_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
250  }
251 
252  meEBdigis_[0] = dqmStore_->book1D("EBMM digi number", "EBMM digi number", 100, 0., 3000.);
253 
254  meEBdigis_[1] = dqmStore_->bookProfile("EBMM digi number profile", "EBMM digi number profile", 36, 1, 37., 1700, 0., 1701., "s");
255  for (int i = 0; i < 36; i++) {
256  meEBdigis_[1]->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
257  }
258 
259  meEBhits_[0] = dqmStore_->book1D("EBMM hit number", "EBMM hit number", 100, 0., 3000.);
260 
261  meEBhits_[1] = dqmStore_->bookProfile("EBMM hit number profile", "EBMM hit number profile", 36, 1, 37., 1700, 0., 1701., "s");
262  for (int i = 0; i < 36; i++) {
263  meEBhits_[1]->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
264  }
265 
266  meEBtpdigis_[0] = dqmStore_->book1D("EBMM TP digi number", "EBMM TP digi number", 100, 0., 2449.);
267 
268  meEBtpdigis_[1] = dqmStore_->bookProfile("EBMM TP digi number profile", "EBMM TP digi number profile", 36, 1, 37., 68, 0., 69., "s");
269  for (int i = 0; i < 36; i++) {
270  meEBtpdigis_[1]->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
271  }
272 
273  if ( enableEventDisplay_ ) {
274  dqmStore_->setCurrentFolder(prefixME_ + "/EcalEvent");
275  for (int i = 0; i < 36; i++) {
276  name = "EBMM event " + Numbers::sEB(i+1);
277  meEvent_[i] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
278  meEvent_[i]->setAxisTitle("ieta", 1);
279  meEvent_[i]->setAxisTitle("iphi", 2);
280  dqmStore_->tag(meEvent_[i], i+1);
281  if ( meEvent_[i] ) meEvent_[i]->setResetMe(true);
282  }
283  }
284 
285  }
286 
287 }
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:872
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
MonitorElement * meEBtpdigis_[2]
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:1186
void setResetMe(bool)
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:779
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584

Member Data Documentation

bool EcalBarrelMonitorModule::debug_
private

Definition at line 81 of file EcalBarrelMonitorModule.h.

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

DQMStore* EcalBarrelMonitorModule::dqmStore_
private

Definition at line 85 of file EcalBarrelMonitorModule.h.

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

edm::EDGetTokenT<EBDigiCollection> EcalBarrelMonitorModule::EBDigiCollection_
private

Definition at line 76 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

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

Definition at line 75 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

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

Definition at line 77 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

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

Definition at line 78 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

bool EcalBarrelMonitorModule::enableCleanup_
private

Definition at line 89 of file EcalBarrelMonitorModule.h.

Referenced by cleanup(), and EcalBarrelMonitorModule().

bool EcalBarrelMonitorModule::enableEventDisplay_
private
int EcalBarrelMonitorModule::evtNumber_
private

Definition at line 62 of file EcalBarrelMonitorModule.h.

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

int EcalBarrelMonitorModule::evtType_
private

Definition at line 65 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

bool EcalBarrelMonitorModule::fixedRunNumber_
private

Definition at line 67 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

bool EcalBarrelMonitorModule::fixedRunType_
private

Definition at line 69 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

int EcalBarrelMonitorModule::ievt_
private

Definition at line 73 of file EcalBarrelMonitorModule.h.

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

bool EcalBarrelMonitorModule::init_
private

Definition at line 109 of file EcalBarrelMonitorModule.h.

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

bool EcalBarrelMonitorModule::isPhysics_
private

Definition at line 71 of file EcalBarrelMonitorModule.h.

Referenced by analyze().

MonitorElement* EcalBarrelMonitorModule::meEBDCC_
private

Definition at line 101 of file EcalBarrelMonitorModule.h.

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

MonitorElement* EcalBarrelMonitorModule::meEBdigis_[2]
private

Definition at line 103 of file EcalBarrelMonitorModule.h.

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

MonitorElement* EcalBarrelMonitorModule::meEBhits_[2]
private

Definition at line 104 of file EcalBarrelMonitorModule.h.

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

MonitorElement* EcalBarrelMonitorModule::meEBtpdigis_[2]
private

Definition at line 105 of file EcalBarrelMonitorModule.h.

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

MonitorElement* EcalBarrelMonitorModule::meEvent_[36]
private

Definition at line 107 of file EcalBarrelMonitorModule.h.

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

MonitorElement* EcalBarrelMonitorModule::meEvt_
private
MonitorElement* EcalBarrelMonitorModule::meEvtType_
private

Definition at line 99 of file EcalBarrelMonitorModule.h.

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

bool EcalBarrelMonitorModule::mergeRuns_
private

Definition at line 91 of file EcalBarrelMonitorModule.h.

Referenced by beginRun(), and EcalBarrelMonitorModule().

MonitorElement* EcalBarrelMonitorModule::meRun_
private
MonitorElement* EcalBarrelMonitorModule::meRunType_
private

Definition at line 98 of file EcalBarrelMonitorModule.h.

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

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

Definition at line 87 of file EcalBarrelMonitorModule.h.

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

int EcalBarrelMonitorModule::runNumber_
private

Definition at line 61 of file EcalBarrelMonitorModule.h.

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

int EcalBarrelMonitorModule::runType_
private

Definition at line 64 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().

bool EcalBarrelMonitorModule::verbose_
private

Definition at line 80 of file EcalBarrelMonitorModule.h.

Referenced by analyze(), and EcalBarrelMonitorModule().