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

#include <EEPedestalTask.h>

Inheritance diagram for EEPedestalTask:
edm::EDAnalyzer

Public Member Functions

 EEPedestalTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EEPedestalTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredqmStore_
 
edm::InputTag EcalPnDiodeDigiCollection_
 
edm::InputTag EcalRawDataCollection_
 
edm::InputTag EEDigiCollection_
 
bool enableCleanup_
 
int ievt_
 
bool init_
 
MonitorElementmePed3SumMapG01_ [18]
 
MonitorElementmePed3SumMapG06_ [18]
 
MonitorElementmePed3SumMapG12_ [18]
 
MonitorElementmePed5SumMapG01_ [18]
 
MonitorElementmePed5SumMapG06_ [18]
 
MonitorElementmePed5SumMapG12_ [18]
 
MonitorElementmePedMapG01_ [18]
 
MonitorElementmePedMapG06_ [18]
 
MonitorElementmePedMapG12_ [18]
 
MonitorElementmePnPedMapG01_ [18]
 
MonitorElementmePnPedMapG16_ [18]
 
bool mergeRuns_
 
std::vector< int > MGPAGains_
 
std::vector< int > MGPAGainsPN_
 
std::string prefixME_
 

Additional Inherited Members

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

Detailed Description

Definition at line 20 of file EEPedestalTask.h.

Constructor & Destructor Documentation

EEPedestalTask::EEPedestalTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file EEPedestalTask.cc.

References dqmStore_, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EEDigiCollection_, enableCleanup_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, mergeRuns_, MGPAGains_, MGPAGainsPN_, cmsCodeRules.cppFunctionSkipper::operator, and prefixME_.

33  {
34 
35  init_ = false;
36 
38 
39  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
40 
41  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
42 
43  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
44 
45  EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection");
46  EEDigiCollection_ = ps.getParameter<edm::InputTag>("EEDigiCollection");
47  EcalPnDiodeDigiCollection_ = ps.getParameter<edm::InputTag>("EcalPnDiodeDigiCollection");
48 
49  MGPAGains_.reserve(3);
50  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
51  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
52 
53  MGPAGainsPN_.reserve(2);
54  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
55  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
56 
57  for (int i = 0; i < 18; i++) {
58  mePedMapG01_[i] = 0;
59  mePedMapG06_[i] = 0;
60  mePedMapG12_[i] = 0;
61 #ifdef COMMON_NOISE_ANALYSIS
62  mePed3SumMapG01_[i] = 0;
63  mePed3SumMapG06_[i] = 0;
64  mePed3SumMapG12_[i] = 0;
65  mePed5SumMapG01_[i] = 0;
66  mePed5SumMapG06_[i] = 0;
67  mePed5SumMapG12_[i] = 0;
68 #endif
69  mePnPedMapG01_[i] = 0;
70  mePnPedMapG16_[i] = 0;
71  }
72 
73 }
edm::InputTag EcalRawDataCollection_
T getParameter(std::string const &) const
MonitorElement * mePedMapG06_[18]
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
MonitorElement * mePedMapG01_[18]
edm::InputTag EcalPnDiodeDigiCollection_
MonitorElement * mePnPedMapG16_[18]
edm::InputTag EEDigiCollection_
MonitorElement * mePed3SumMapG06_[18]
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
std::vector< int > MGPAGains_
std::string prefixME_
MonitorElement * mePed5SumMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG01_[18]
DQMStore * dqmStore_
MonitorElement * mePed3SumMapG12_[18]
EEPedestalTask::~EEPedestalTask ( )
virtual

Destructor.

Definition at line 75 of file EEPedestalTask.cc.

75  {
76 
77 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 380 of file EEPedestalTask.cc.

References ecalMGPA::adc(), EcalMGPASample::adc(), EcalEndcap, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EEDigiCollection_, MonitorElement::Fill(), EcalMGPASample::gainId(), edm::Event::getByLabel(), i, ievt_, init_, ecalpyutils::ism(), Numbers::iSM(), EEDetId::ix(), Numbers::ix0EE(), Numbers::iy0EE(), j, LogDebug, mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDataFrame::sample(), setup(), Numbers::subDet(), and Numbers::validEE().

380  {
381 
382  bool enable = false;
383  int runType[18];
384  for (int i=0; i<18; i++) runType[i] = -1;
385 
387 
388  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
389 
390  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
391 
392  if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
393 
394  int ism = Numbers::iSM( *dcchItr, EcalEndcap );
395 
396  runType[ism-1] = dcchItr->getRunType();
397 
398  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
399  dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) enable = true;
400 
401  }
402 
403  } else {
404 
405  edm::LogWarning("EEPedestalTask") << EcalRawDataCollection_ << " not available";
406 
407  }
408 
409  if ( ! enable ) return;
410 
411  if ( ! init_ ) this->setup();
412 
413  ievt_++;
414 
416 
417  if ( e.getByLabel(EEDigiCollection_, digis) ) {
418 
419  int need = digis->size();
420  LogDebug("EEPedestalTask") << "event " << ievt_ << " digi collection size " << need;
421 
422  float xmap01[18][50][50];
423  float xmap06[18][50][50];
424  float xmap12[18][50][50];
425 
426  for ( int ism = 1; ism <= 18; ism++ ) {
427  for ( int ix = 1; ix <= 50; ix++ ) {
428  for ( int iy = 1; iy <= 50; iy++ ) {
429 
430  xmap01[ism-1][ix-1][iy-1] = 0.;
431  xmap06[ism-1][ix-1][iy-1] = 0.;
432  xmap12[ism-1][ix-1][iy-1] = 0.;
433 
434  }
435  }
436  }
437 
438  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
439 
440  EEDetId id = digiItr->id();
441 
442  int ix = id.ix();
443  int iy = id.iy();
444 
445  int ism = Numbers::iSM( id );
446 
447  if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
448 
449  float xix = ix - 0.5;
450  float xiy = iy - 0.5;
451 
452  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
453  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
454 
455  EEDataFrame dataframe = (*digiItr);
456 
457  for (int i = 0; i < 10; i++) {
458 
459  int adc = dataframe.sample(i).adc();
460 
461  MonitorElement* mePedMap = 0;
462 
463  if ( dataframe.sample(i).gainId() == 1 ) mePedMap = mePedMapG12_[ism-1];
464  if ( dataframe.sample(i).gainId() == 2 ) mePedMap = mePedMapG06_[ism-1];
465  if ( dataframe.sample(i).gainId() == 3 ) mePedMap = mePedMapG01_[ism-1];
466 
467  float xval = float(adc);
468 
469  if ( mePedMap ) mePedMap->Fill(xix, xiy, xval);
470 
471  if ( dataframe.sample(i).gainId() == 1 ) xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
472  if ( dataframe.sample(i).gainId() == 2 ) xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
473  if ( dataframe.sample(i).gainId() == 3 ) xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
474 
475  }
476 
477  xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
478  xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
479  xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
480 
481  }
482 
483  // to be re-done using the 3x3 & 5x5 Selectors (if faster)
484 
485 #ifdef COMMON_NOISE_ANALYSIS
486  for ( int ism = 1; ism <= 18; ism++ ) {
487  for ( int ix = 1; ix <= 50; ix++ ) {
488  for ( int iy = 1; iy <= 50; iy++ ) {
489 
490  int xix = ix + Numbers::ix0EE(ism);
491  int xiy = iy + Numbers::iy0EE(ism);
492 
493  if ( ism >= 1 && ism <= 9 ) xix = 101 - xix;
494 
495  if ( ! Numbers::validEE(ism, xix, xiy) ) continue;
496 
497  float xix = ix - 0.5;
498  float xiy = iy - 0.5;
499 
500  float x3val01;
501  float x3val06;
502  float x3val12;
503 
504  if ( ix >= 2 && ix <= 49 && iy >= 2 && iy <= 49 ) {
505 
506  x3val01 = 0.;
507  x3val06 = 0.;
508  x3val12 = 0.;
509  for ( int i = -1; i <= +1; i++ ) {
510  for ( int j = -1; j <= +1; j++ ) {
511 
512  x3val01 = x3val01 + xmap01[ism-1][ix-1+i][iy-1+j];
513  x3val06 = x3val06 + xmap06[ism-1][ix-1+i][iy-1+j];
514  x3val12 = x3val12 + xmap12[ism-1][ix-1+i][iy-1+j];
515 
516  }
517  }
518  x3val01 = x3val01 / 9.;
519  x3val06 = x3val06 / 9.;
520  x3val12 = x3val12 / 9.;
521  if ( mePed3SumMapG01_[ism-1] && x3val01 != 0. ) mePed3SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val01);
522  if ( mePed3SumMapG06_[ism-1] && x3val06 != 0. ) mePed3SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val06);
523  if ( mePed3SumMapG12_[ism-1] && x3val12 != 0. ) mePed3SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val12);
524 
525  }
526 
527  float x5val01;
528  float x5val06;
529  float x5val12;
530 
531  if ( ix >= 3 && ix <= 48 && iy >= 3 && iy <= 48 ) {
532 
533  x5val01 = 0.;
534  x5val06 = 0.;
535  x5val12 = 0.;
536  for ( int i = -2; i <= +2; i++ ) {
537  for ( int j = -2; j <= +2; j++ ) {
538 
539  x5val01 = x5val01 + xmap01[ism-1][ix-1+i][iy-1+j];
540  x5val06 = x5val06 + xmap06[ism-1][ix-1+i][iy-1+j];
541  x5val12 = x5val12 + xmap12[ism-1][ix-1+i][iy-1+j];
542 
543  }
544  }
545  x5val01 = x5val01 / 25.;
546  x5val06 = x5val06 / 25.;
547  x5val12 = x5val12 / 25.;
548  if ( mePed5SumMapG01_[ism-1] && x5val01 != 0. ) mePed5SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val01);
549  if ( mePed5SumMapG06_[ism-1] && x5val06 != 0. ) mePed5SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val06);
550  if ( mePed5SumMapG12_[ism-1] && x5val12 != 0. ) mePed5SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val12);
551 
552  }
553 
554  }
555  }
556  }
557 #endif
558 
559  } else {
560 
561  edm::LogWarning("EEPedestalTask") << EEDigiCollection_ << " not available";
562 
563  }
564 
566 
567  if ( e.getByLabel(EcalPnDiodeDigiCollection_, pns) ) {
568 
569  int nep = pns->size();
570  LogDebug("EEPedestalTask") << "event " << ievt_ << " pns collection size " << nep;
571 
572  for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
573 
574  if ( Numbers::subDet( pnItr->id() ) != EcalEndcap ) continue;
575 
576  int ism = Numbers::iSM( pnItr->id() );
577 
578  int num = pnItr->id().iPnId();
579 
580  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
581  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
582 
583  for (int i = 0; i < 50; i++) {
584 
585  int adc = pnItr->sample(i).adc();
586 
587  MonitorElement* mePNPed = 0;
588 
589  if ( pnItr->sample(i).gainId() == 0 ) mePNPed = mePnPedMapG01_[ism-1];
590  if ( pnItr->sample(i).gainId() == 1 ) mePNPed = mePnPedMapG16_[ism-1];
591 
592  float xval = float(adc);
593 
594  if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
595 
596  }
597 
598  }
599 
600  } else {
601 
602  edm::LogWarning("EEPedestalTask") << EcalPnDiodeDigiCollection_ << " not available";
603 
604  }
605 
606 }
int adc(sample_type sample)
get the ADC sample (12 bits)
#define LogDebug(id)
edm::InputTag EcalRawDataCollection_
MonitorElement * mePedMapG06_[18]
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
int ix() const
Definition: EEDetId.h:71
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePedMapG01_[18]
static int iy0EE(const int ism)
Definition: Numbers.cc:987
void setup(void)
Setup.
edm::InputTag EcalPnDiodeDigiCollection_
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:28
MonitorElement * mePnPedMapG16_[18]
int gainId() const
get the gainId (2 bits)
edm::InputTag EEDigiCollection_
void Fill(long long x)
static int iSM(const int ism, const EcalSubdetector subdet)
Definition: Numbers.cc:222
MonitorElement * mePed3SumMapG06_[18]
int j
Definition: DBlmapReader.cc:9
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
MonitorElement * mePed5SumMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
long long int num
Definition: procUtils.cc:71
MonitorElement * mePed5SumMapG01_[18]
static int ix0EE(const int ism)
Definition: Numbers.cc:952
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:136
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:1005
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
MonitorElement * mePed3SumMapG12_[18]
int adc() const
get the ADC sample (12 bits)
void EEPedestalTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file EEPedestalTask.cc.

References dqmStore_, ievt_, prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

79  {
80 
81  ievt_ = 0;
82 
83  if ( dqmStore_ ) {
84  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
85  dqmStore_->rmdir(prefixME_ + "/EEPedestalTask");
86  }
87 
88 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
std::string prefixME_
DQMStore * dqmStore_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void EEPedestalTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file EEPedestalTask.cc.

References Numbers::initGeometry(), mergeRuns_, and reset().

90  {
91 
92  Numbers::initGeometry(c, false);
93 
94  if ( ! mergeRuns_ ) this->reset();
95 
96 }
void reset(void)
Reset.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:45
void EEPedestalTask::cleanup ( void  )
protected

Cleanup.

Definition at line 289 of file EEPedestalTask.cc.

References dqmStore_, spr::find(), edm::getName(), i, init_, mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, MGPAGains_, MGPAGainsPN_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

289  {
290 
291  if ( ! init_ ) return;
292 
293  if ( dqmStore_ ) {
294  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
295 
296  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
297 
298  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain01");
299  for ( int i = 0; i < 18; i++ ) {
301  mePedMapG01_[i] = 0;
302 #ifdef COMMON_NOISE_ANALYSIS
304  mePed3SumMapG01_[i] = 0;
306  mePed5SumMapG01_[i] = 0;
307 #endif
308  }
309 
310  }
311 
312  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
313 
314  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain06");
315  for ( int i = 0; i < 18; i++ ) {
317  mePedMapG06_[i] = 0;
318 #ifdef COMMON_NOISE_ANALYSIS
320  mePed3SumMapG06_[i] = 0;
322  mePed5SumMapG06_[i] = 0;
323 #endif
324  }
325 
326  }
327 
328  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
329 
330  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain12");
331  for ( int i = 0; i < 18; i++ ) {
333  mePedMapG12_[i] = 0;
334 #ifdef COMMON_NOISE_ANALYSIS
336  mePed3SumMapG12_[i] = 0;
338  mePed5SumMapG12_[i] = 0;
339 #endif
340  }
341 
342  }
343 
344  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
345 
346  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
347 
348  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain01");
349  for ( int i = 0; i < 18; i++ ) {
351  mePnPedMapG01_[i] = 0;
352  }
353 
354  }
355 
356  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
357 
358  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain16");
359  for ( int i = 0; i < 18; i++ ) {
361  mePnPedMapG16_[i] = 0;
362  }
363 
364  }
365 
366  }
367 
368  init_ = false;
369 
370 }
MonitorElement * mePedMapG06_[18]
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
MonitorElement * mePedMapG01_[18]
MonitorElement * mePnPedMapG16_[18]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void removeElement(const std::string &name)
Definition: DQMStore.cc:2353
MonitorElement * mePed3SumMapG06_[18]
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
std::vector< int > MGPAGains_
std::string prefixME_
MonitorElement * mePed5SumMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG01_[18]
DQMStore * dqmStore_
MonitorElement * mePed3SumMapG12_[18]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void EEPedestalTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 372 of file EEPedestalTask.cc.

References cleanup(), enableCleanup_, and ievt_.

372  {
373 
374  edm::LogInfo("EEPedestalTask") << "analyzed " << ievt_ << " events";
375 
376  if ( enableCleanup_ ) this->cleanup();
377 
378 }
void cleanup(void)
Cleanup.
void EEPedestalTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file EEPedestalTask.cc.

98  {
99 
100 }
void EEPedestalTask::reset ( void  )
protected

Reset.

Definition at line 102 of file EEPedestalTask.cc.

References spr::find(), i, mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, MGPAGains_, MGPAGainsPN_, and MonitorElement::Reset().

Referenced by beginRun().

102  {
103 
104  for (int i = 0; i < 18; i++) {
105  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
106  if ( mePedMapG01_[i] ) mePedMapG01_[i]->Reset();
107  }
108  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
109  if ( mePedMapG06_[i] ) mePedMapG06_[i]->Reset();
110  }
111  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
112  if ( mePedMapG12_[i] ) mePedMapG12_[i]->Reset();
113  }
114 #ifdef COMMON_NOISE_ANALYSIS
121 #endif
122  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
123  if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
124  }
125  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
126  if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
127  }
128  }
129 
130 }
MonitorElement * mePedMapG06_[18]
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
MonitorElement * mePedMapG01_[18]
MonitorElement * mePnPedMapG16_[18]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * mePed3SumMapG06_[18]
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
std::vector< int > MGPAGains_
MonitorElement * mePed5SumMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG01_[18]
MonitorElement * mePed3SumMapG12_[18]
void Reset(void)
reset ME (ie. contents, errors, etc)
void EEPedestalTask::setup ( void  )
protected

Setup.

Definition at line 132 of file EEPedestalTask.cc.

References DQMStore::bookProfile(), DQMStore::bookProfile2D(), dqmStore_, spr::find(), i, init_, Numbers::ix0EE(), Numbers::iy0EE(), mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, MGPAGains_, MGPAGainsPN_, mergeVDriftHistosByStation::name, prefixME_, Numbers::sEE(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and DQMStore::tag().

Referenced by analyze().

132  {
133 
134  init_ = true;
135 
136  std::string name;
137  std::stringstream GainN, GN;
138 
139  if ( dqmStore_ ) {
140  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
141 
142  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
143 
144  GainN.str("");
145  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
146  GN.str("");
147  GN << "G" << std::setw(2) << std::setfill('0') << 1;
148 
149  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/" + GainN.str());
150  for (int i = 0; i < 18; i++) {
151  name = "EEPT pedestal " + Numbers::sEE(i+1) + " " + GN.str();
152  mePedMapG01_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
153  mePedMapG01_[i]->setAxisTitle("ix", 1);
154  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG01_[i]->setAxisTitle("101-ix", 1);
155  mePedMapG01_[i]->setAxisTitle("iy", 2);
156  dqmStore_->tag(mePedMapG01_[i], i+1);
157 
158 #ifdef COMMON_NOISE_ANALYSIS
159  name = "EEPT pedestal 3sum " + Numbers::sEE(i+1) + " " + GN.str();
160  mePed3SumMapG01_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
161  mePed3SumMapG01_[i]->setAxisTitle("ix", 1);
162  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG01_[i]->setAxisTitle("101-ix", 1);
163  mePed3SumMapG01_[i]->setAxisTitle("iy", 2);
164  dqmStore_->tag(mePed3SumMapG01_[i], i+1);
165 
166  name = "EEPT pedestal 5sum " + Numbers::sEE(i+1) + " " + GN.str();
167  mePed5SumMapG01_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
168  mePed5SumMapG01_[i]->setAxisTitle("ix", 1);
169  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG01_[i]->setAxisTitle("101-ix", 1);
170  mePed5SumMapG01_[i]->setAxisTitle("iy", 2);
171  dqmStore_->tag(mePed5SumMapG01_[i], i+1);
172 #endif
173  }
174 
175  }
176 
177  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
178 
179  GainN.str("");
180  GainN << "Gain" << std::setw(2) << std::setfill('0') << 6;
181  GN.str("");
182  GN << "G" << std::setw(2) << std::setfill('0') << 6;
183 
184  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/" + GainN.str());
185  for (int i = 0; i < 18; i++) {
186  name = "EEPT pedestal " + Numbers::sEE(i+1) + " " + GN.str();
187  mePedMapG06_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
188  mePedMapG06_[i]->setAxisTitle("ix", 1);
189  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG06_[i]->setAxisTitle("101-ix", 1);
190  mePedMapG06_[i]->setAxisTitle("iy", 2);
191  dqmStore_->tag(mePedMapG06_[i], i+1);
192 
193 #ifdef COMMON_NOISE_ANALYSIS
194  name = "EEPT pedestal 3sum " + Numbers::sEE(i+1) + " " + GN.str();
195  mePed3SumMapG06_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
196  mePed3SumMapG06_[i]->setAxisTitle("ix", 1);
197  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG06_[i]->setAxisTitle("101-ix", 1);
198  mePed3SumMapG06_[i]->setAxisTitle("iy", 2);
199  dqmStore_->tag(mePed3SumMapG06_[i], i+1);
200 
201  name = "EEPT pedestal 5sum " + Numbers::sEE(i+1) + " " + GN.str();
202  mePed5SumMapG06_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
203  mePed5SumMapG06_[i]->setAxisTitle("ix", 1);
204  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG06_[i]->setAxisTitle("101-ix", 1);
205  mePed5SumMapG06_[i]->setAxisTitle("iy", 2);
206  dqmStore_->tag(mePed5SumMapG06_[i], i+1);
207 #endif
208  }
209 
210  }
211 
212  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
213 
214  GainN.str("");
215  GainN << "Gain" << std::setw(2) << std::setfill('0') << 12;
216  GN.str("");
217  GN << "G" << std::setw(2) << std::setfill('0') << 12;
218 
219  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/" + GainN.str());
220  for (int i = 0; i < 18; i++) {
221  name = "EEPT pedestal " + Numbers::sEE(i+1) + " " + GN.str();
222  mePedMapG12_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
223  mePedMapG12_[i]->setAxisTitle("ix", 1);
224  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG12_[i]->setAxisTitle("101-ix", 1);
225  mePedMapG12_[i]->setAxisTitle("iy", 2);
226  dqmStore_->tag(mePedMapG12_[i], i+1);
227 
228 #ifdef COMMON_NOISE_ANALYSIS
229  name = "EEPT pedestal 3sum " + Numbers::sEE(i+1) + " " + GN.str();
230  mePed3SumMapG12_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
231  mePed3SumMapG12_[i]->setAxisTitle("ix", 1);
232  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG12_[i]->setAxisTitle("101-ix", 1);
233  mePed3SumMapG12_[i]->setAxisTitle("iy", 2);
234  dqmStore_->tag(mePed3SumMapG12_[i], i+1);
235 
236  name = "EEPT pedestal 5sum " + Numbers::sEE(i+1) + " " + GN.str();
237  mePed5SumMapG12_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
238  mePed5SumMapG12_[i]->setAxisTitle("ix", 1);
239  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG12_[i]->setAxisTitle("101-ix", 1);
240  mePed5SumMapG12_[i]->setAxisTitle("iy", 2);
241  dqmStore_->tag(mePed5SumMapG12_[i], i+1);
242 #endif
243  }
244 
245  }
246 
247  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
248 
249  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
250 
251  GainN.str("");
252  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
253  GN.str("");
254  GN << "G" << std::setw(2) << std::setfill('0') << 1;
255 
256  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/" + GainN.str());
257  for (int i = 0; i < 18; i++) {
258  name = "EEPDT PNs pedestal " + Numbers::sEE(i+1) + " " + GN.str();
259  mePnPedMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
260  mePnPedMapG01_[i]->setAxisTitle("channel", 1);
261  mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
262  dqmStore_->tag(mePnPedMapG01_[i], i+1);
263  }
264 
265  }
266 
267  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
268 
269  GainN.str("");
270  GainN << "Gain" << std::setw(2) << std::setfill('0') << 16;
271  GN.str("");
272  GN << "G" << std::setw(2) << std::setfill('0') << 16;
273 
274  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/" + GainN.str());
275  for (int i = 0; i < 18; i++) {
276  name = "EEPDT PNs pedestal " + Numbers::sEE(i+1) + " " + GN.str();
277  mePnPedMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
278  mePnPedMapG16_[i]->setAxisTitle("channel", 1);
279  mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
280  dqmStore_->tag(mePnPedMapG16_[i], i+1);
281  }
282 
283  }
284 
285  }
286 
287 }
MonitorElement * mePedMapG06_[18]
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
MonitorElement * mePedMapG01_[18]
static int iy0EE(const int ism)
Definition: Numbers.cc:987
static std::string sEE(const int ism)
Definition: Numbers.cc:205
MonitorElement * mePnPedMapG16_[18]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1151
MonitorElement * mePed3SumMapG06_[18]
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
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:828
std::vector< int > MGPAGains_
std::string prefixME_
MonitorElement * mePed5SumMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG01_[18]
static int ix0EE(const int ism)
Definition: Numbers.cc:952
DQMStore * dqmStore_
MonitorElement * mePed3SumMapG12_[18]
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:232
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:972

Member Data Documentation

DQMStore* EEPedestalTask::dqmStore_
private

Definition at line 60 of file EEPedestalTask.h.

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

edm::InputTag EEPedestalTask::EcalPnDiodeDigiCollection_
private

Definition at line 70 of file EEPedestalTask.h.

Referenced by analyze(), and EEPedestalTask().

edm::InputTag EEPedestalTask::EcalRawDataCollection_
private

Definition at line 68 of file EEPedestalTask.h.

Referenced by analyze(), and EEPedestalTask().

edm::InputTag EEPedestalTask::EEDigiCollection_
private

Definition at line 69 of file EEPedestalTask.h.

Referenced by analyze(), and EEPedestalTask().

bool EEPedestalTask::enableCleanup_
private

Definition at line 64 of file EEPedestalTask.h.

Referenced by EEPedestalTask(), and endJob().

int EEPedestalTask::ievt_
private

Definition at line 58 of file EEPedestalTask.h.

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

bool EEPedestalTask::init_
private

Definition at line 89 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed3SumMapG01_[18]
private

Definition at line 78 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed3SumMapG06_[18]
private

Definition at line 79 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed3SumMapG12_[18]
private

Definition at line 80 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed5SumMapG01_[18]
private

Definition at line 82 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed5SumMapG06_[18]
private

Definition at line 83 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePed5SumMapG12_[18]
private

Definition at line 84 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePedMapG01_[18]
private

Definition at line 74 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePedMapG06_[18]
private

Definition at line 75 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePedMapG12_[18]
private

Definition at line 76 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePnPedMapG01_[18]
private

Definition at line 86 of file EEPedestalTask.h.

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

MonitorElement* EEPedestalTask::mePnPedMapG16_[18]
private

Definition at line 87 of file EEPedestalTask.h.

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

bool EEPedestalTask::mergeRuns_
private

Definition at line 66 of file EEPedestalTask.h.

Referenced by beginRun(), and EEPedestalTask().

std::vector<int> EEPedestalTask::MGPAGains_
private

Definition at line 71 of file EEPedestalTask.h.

Referenced by cleanup(), EEPedestalTask(), reset(), and setup().

std::vector<int> EEPedestalTask::MGPAGainsPN_
private

Definition at line 72 of file EEPedestalTask.h.

Referenced by cleanup(), EEPedestalTask(), reset(), and setup().

std::string EEPedestalTask::prefixME_
private

Definition at line 62 of file EEPedestalTask.h.

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