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

#include <EBPedestalTask.h>

Inheritance diagram for EBPedestalTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

DQMStoredqmStore_
 
edm::EDGetTokenT
< EBDigiCollection
EBDigiCollection_
 
edm::EDGetTokenT
< EcalPnDiodeDigiCollection
EcalPnDiodeDigiCollection_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
bool enableCleanup_
 
int ievt_
 
bool init_
 
MonitorElementmePed3SumMapG01_ [36]
 
MonitorElementmePed3SumMapG06_ [36]
 
MonitorElementmePed3SumMapG12_ [36]
 
MonitorElementmePed5SumMapG01_ [36]
 
MonitorElementmePed5SumMapG06_ [36]
 
MonitorElementmePed5SumMapG12_ [36]
 
MonitorElementmePedMapG01_ [36]
 
MonitorElementmePedMapG06_ [36]
 
MonitorElementmePedMapG12_ [36]
 
MonitorElementmePnPedMapG01_ [36]
 
MonitorElementmePnPedMapG16_ [36]
 
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
 
- 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 21 of file EBPedestalTask.h.

Constructor & Destructor Documentation

EBPedestalTask::EBPedestalTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 32 of file EBPedestalTask.cc.

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

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

Destructor.

Definition at line 74 of file EBPedestalTask.cc.

74  {
75 
76 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 364 of file EBPedestalTask.cc.

References ecalMGPA::adc(), EcalMGPASample::adc(), EBDigiCollection_, EcalBarrel, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, MonitorElement::Fill(), EcalMGPASample::gainId(), edm::Event::getByToken(), i, EBDetId::ic(), ievt_, init_, ecalpyutils::ism(), Numbers::iSM(), j, LogDebug, mePed3SumMapG01_, mePed3SumMapG06_, mePed3SumMapG12_, mePed5SumMapG01_, mePed5SumMapG06_, mePed5SumMapG12_, mePedMapG01_, mePedMapG06_, mePedMapG12_, mePnPedMapG01_, mePnPedMapG16_, pileupDistInMC::num, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_STD, environment_file_cff::runType, EcalDataFrame::sample(), setup(), and Numbers::subDet().

364  {
365 
366  bool enable = false;
367  int runType[36];
368  for (int i=0; i<36; i++) runType[i] = -1;
369 
371 
372  if ( e.getByToken(EcalRawDataCollection_, dcchs) ) {
373 
374  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
375 
376  if ( Numbers::subDet( *dcchItr ) != EcalBarrel ) continue;
377 
378  int ism = Numbers::iSM( *dcchItr, EcalBarrel );
379 
380  runType[ism-1] = dcchItr->getRunType();
381 
382  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
383  dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) enable = true;
384 
385  }
386 
387  } else {
388 
389  edm::LogWarning("EBPedestalTask") << "EcalRawDataCollection not available";
390 
391  }
392 
393  if ( ! enable ) return;
394 
395  if ( ! init_ ) this->setup();
396 
397  ievt_++;
398 
400 
401  if ( e.getByToken(EBDigiCollection_, digis) ) {
402 
403  int nebd = digis->size();
404  LogDebug("EBPedestalTask") << "event " << ievt_ << " digi collection size " << nebd;
405 
406  float xmap01[36][85][20];
407  float xmap06[36][85][20];
408  float xmap12[36][85][20];
409 
410  for ( int ism = 1; ism <= 36; ism++ ) {
411  for ( int ie = 1; ie <= 85; ie++ ) {
412  for ( int ip = 1; ip <= 20; ip++ ) {
413 
414  xmap01[ism-1][ie-1][ip-1] = 0.;
415  xmap06[ism-1][ie-1][ip-1] = 0.;
416  xmap12[ism-1][ie-1][ip-1] = 0.;
417 
418  }
419  }
420  }
421 
422  for ( EBDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
423 
424  EBDetId id = digiItr->id();
425 
426  int ic = id.ic();
427  int ie = (ic-1)/20 + 1;
428  int ip = (ic-1)%20 + 1;
429 
430  int ism = Numbers::iSM( id );
431 
432  float xie = ie - 0.5;
433  float xip = ip - 0.5;
434 
435  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
436  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
437 
438  EBDataFrame dataframe = (*digiItr);
439 
440  for (int i = 0; i < 10; i++) {
441 
442  int adc = dataframe.sample(i).adc();
443 
444  MonitorElement* mePedMap = 0;
445 
446  if ( dataframe.sample(i).gainId() == 1 ) mePedMap = mePedMapG12_[ism-1];
447  if ( dataframe.sample(i).gainId() == 2 ) mePedMap = mePedMapG06_[ism-1];
448  if ( dataframe.sample(i).gainId() == 3 ) mePedMap = mePedMapG01_[ism-1];
449 
450  float xval = float(adc);
451 
452  if ( mePedMap ) mePedMap->Fill(xie, xip, xval);
453 
454  if ( dataframe.sample(i).gainId() == 1 ) xmap12[ism-1][ie-1][ip-1] = xmap12[ism-1][ie-1][ip-1] + xval;
455  if ( dataframe.sample(i).gainId() == 2 ) xmap06[ism-1][ie-1][ip-1] = xmap06[ism-1][ie-1][ip-1] + xval;
456  if ( dataframe.sample(i).gainId() == 3 ) xmap01[ism-1][ie-1][ip-1] = xmap01[ism-1][ie-1][ip-1] + xval;
457 
458  }
459 
460  xmap12[ism-1][ie-1][ip-1]=xmap12[ism-1][ie-1][ip-1]/10.;
461  xmap06[ism-1][ie-1][ip-1]=xmap06[ism-1][ie-1][ip-1]/10.;
462  xmap01[ism-1][ie-1][ip-1]=xmap01[ism-1][ie-1][ip-1]/10.;
463 
464  }
465 
466  // to be re-done using the 3x3 & 5x5 Selectors (if faster)
467 
468 #ifdef COMMON_NOISE_ANALYSIS
469  for ( int ism = 1; ism <= 36; ism++ ) {
470  for ( int ie = 1; ie <= 85; ie++ ) {
471  for ( int ip = 1; ip <= 20; ip++ ) {
472 
473  float xie = ie - 0.5;
474  float xip = ip - 0.5;
475 
476  float x3val01;
477  float x3val06;
478  float x3val12;
479 
480  if ( ie >= 2 && ie <= 84 && ip >= 2 && ip <= 19 ) {
481 
482  x3val01 = 0.;
483  x3val06 = 0.;
484  x3val12 = 0.;
485  for ( int i = -1; i <= +1; i++ ) {
486  for ( int j = -1; j <= +1; j++ ) {
487 
488  x3val01 = x3val01 + xmap01[ism-1][ie-1+i][ip-1+j];
489  x3val06 = x3val06 + xmap06[ism-1][ie-1+i][ip-1+j];
490  x3val12 = x3val12 + xmap12[ism-1][ie-1+i][ip-1+j];
491 
492  }
493  }
494  x3val01 = x3val01 / 9.;
495  x3val06 = x3val06 / 9.;
496  x3val12 = x3val12 / 9.;
497  if ( mePed3SumMapG01_[ism-1] && x3val01 != 0. ) mePed3SumMapG01_[ism-1]->Fill(xie, xip, x3val01);
498  if ( mePed3SumMapG06_[ism-1] && x3val06 != 0. ) mePed3SumMapG06_[ism-1]->Fill(xie, xip, x3val06);
499  if ( mePed3SumMapG12_[ism-1] && x3val12 != 0. ) mePed3SumMapG12_[ism-1]->Fill(xie, xip, x3val12);
500 
501  }
502 
503  float x5val01;
504  float x5val06;
505  float x5val12;
506 
507  if ( ie >= 3 && ie <= 83 && ip >= 3 && ip <= 18 ) {
508 
509  x5val01 = 0.;
510  x5val06 = 0.;
511  x5val12 = 0.;
512  for ( int i = -2; i <= +2; i++ ) {
513  for ( int j = -2; j <= +2; j++ ) {
514 
515  x5val01 = x5val01 + xmap01[ism-1][ie-1+i][ip-1+j];
516  x5val06 = x5val06 + xmap06[ism-1][ie-1+i][ip-1+j];
517  x5val12 = x5val12 + xmap12[ism-1][ie-1+i][ip-1+j];
518 
519  }
520  }
521  x5val01 = x5val01 / 25.;
522  x5val06 = x5val06 / 25.;
523  x5val12 = x5val12 / 25.;
524  if ( mePed5SumMapG01_[ism-1] && x5val01 != 0. ) mePed5SumMapG01_[ism-1]->Fill(xie, xip, x5val01);
525  if ( mePed5SumMapG06_[ism-1] && x5val06 != 0. ) mePed5SumMapG06_[ism-1]->Fill(xie, xip, x5val06);
526  if ( mePed5SumMapG12_[ism-1] && x5val12 != 0. ) mePed5SumMapG12_[ism-1]->Fill(xie, xip, x5val12);
527 
528  }
529 
530  }
531  }
532  }
533 #endif
534 
535  } else {
536 
537  edm::LogWarning("EBPedestalTask") << "EBDigiCollection not available";
538 
539  }
540 
542 
543  if ( e.getByToken(EcalPnDiodeDigiCollection_, pns) ) {
544 
545  int nep = pns->size();
546  LogDebug("EBPedestalTask") << "event " << ievt_ << " pns collection size " << nep;
547 
548  for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
549 
550  if ( Numbers::subDet( pnItr->id() ) != EcalBarrel ) continue;
551 
552  int ism = Numbers::iSM( pnItr->id() );
553 
554  int num = pnItr->id().iPnId();
555 
556  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
557  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
558 
559  for (int i = 0; i < 50; i++) {
560 
561  int adc = pnItr->sample(i).adc();
562 
563  MonitorElement* mePNPed = 0;
564 
565  if ( pnItr->sample(i).gainId() == 0 ) mePNPed = mePnPedMapG01_[ism-1];
566  if ( pnItr->sample(i).gainId() == 1 ) mePNPed = mePnPedMapG16_[ism-1];
567 
568  float xval = float(adc);
569 
570  if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
571 
572  }
573 
574  }
575 
576  } else {
577 
578  edm::LogWarning("EBPedestalTask") << "EcalPnDiodeDigiCollection not available";
579 
580  }
581 
582 }
int adc(sample_type sample)
get the ADC sample (12 bits)
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePed3SumMapG12_[36]
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePedMapG06_[36]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * mePed3SumMapG01_[36]
MonitorElement * mePed5SumMapG01_[36]
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
int gainId() const
get the gainId (2 bits)
void Fill(long long x)
void setup(void)
Setup.
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
int j
Definition: DBlmapReader.cc:9
MonitorElement * mePed5SumMapG12_[36]
MonitorElement * mePed3SumMapG06_[36]
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
MonitorElement * mePedMapG12_[36]
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:46
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * mePed5SumMapG06_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
MonitorElement * mePedMapG01_[36]
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:142
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int adc() const
get the ADC sample (12 bits)
void EBPedestalTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file EBPedestalTask.cc.

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

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file EBPedestalTask.cc.

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

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

Cleanup.

Definition at line 273 of file EBPedestalTask.cc.

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

Referenced by endJob().

273  {
274 
275  if ( ! init_ ) return;
276 
277  if ( dqmStore_ ) {
278  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask");
279 
280  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
281 
282  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain01");
283  for ( int i = 0; i < 36; i++ ) {
284  if ( mePedMapG01_[i] ) dqmStore_->removeElement( mePedMapG01_[i]->getName() );
285  mePedMapG01_[i] = 0;
286 #ifdef COMMON_NOISE_ANALYSIS
287  if ( mePed3SumMapG01_[i] ) dqmStore_->removeElement( mePed3SumMapG01_[i]->getName() );
288  mePed3SumMapG01_[i] = 0;
289  if ( mePed5SumMapG01_[i] ) dqmStore_->removeElement( mePed5SumMapG01_[i]->getName() );
290  mePed5SumMapG01_[i] = 0;
291 #endif
292  }
293 
294  }
295 
296  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
297 
298  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain06");
299  for ( int i = 0; i < 36; i++ ) {
300  if ( mePedMapG06_[i] ) dqmStore_->removeElement( mePedMapG06_[i]->getName() );
301  mePedMapG06_[i] = 0;
302 #ifdef COMMON_NOISE_ANALYSIS
303  if ( mePed3SumMapG06_[i] ) dqmStore_->removeElement( mePed3SumMapG06_[i]->getName() );
304  mePed3SumMapG06_[i] = 0;
305  if ( mePed5SumMapG06_[i] ) dqmStore_->removeElement( mePed5SumMapG06_[i]->getName() );
306  mePed5SumMapG06_[i] = 0;
307 #endif
308  }
309 
310  }
311 
312  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
313 
314  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain12");
315  for ( int i = 0; i < 36; i++ ) {
316  if ( mePedMapG12_[i] ) dqmStore_->removeElement( mePedMapG12_[i]->getName() );
317  mePedMapG12_[i] = 0;
318 #ifdef COMMON_NOISE_ANALYSIS
319  if ( mePed3SumMapG12_[i] ) dqmStore_->removeElement( mePed3SumMapG12_[i]->getName() );
320  mePed3SumMapG12_[i] = 0;
321  if ( mePed5SumMapG12_[i] ) dqmStore_->removeElement( mePed5SumMapG12_[i]->getName() );
322  mePed5SumMapG12_[i] = 0;
323 #endif
324  }
325 
326  }
327 
328  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN");
329 
330  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
331 
332  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/Gain01");
333  for ( int i = 0; i < 36; i++ ) {
334  if ( mePnPedMapG01_[i]) dqmStore_->removeElement( mePnPedMapG01_[i]->getName() );
335  mePnPedMapG01_[i] = 0;
336  }
337 
338  }
339 
340  if (find(MGPAGains_.begin(), MGPAGains_.end(), 16) != MGPAGains_.end() ) {
341 
342  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/Gain16");
343  for ( int i = 0; i < 36; i++ ) {
344  if ( mePnPedMapG16_[i]) dqmStore_->removeElement( mePnPedMapG16_[i]->getName() );
345  mePnPedMapG16_[i] = 0;
346  }
347 
348  }
349 
350  }
351 
352  init_ = false;
353 
354 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePed3SumMapG12_[36]
MonitorElement * mePedMapG06_[36]
MonitorElement * mePed3SumMapG01_[36]
MonitorElement * mePed5SumMapG01_[36]
std::string prefixME_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * mePed5SumMapG12_[36]
MonitorElement * mePed3SumMapG06_[36]
MonitorElement * mePedMapG12_[36]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG06_[36]
MonitorElement * mePedMapG01_[36]
DQMStore * dqmStore_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
std::vector< int > MGPAGains_
void EBPedestalTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 356 of file EBPedestalTask.cc.

References cleanup(), enableCleanup_, and ievt_.

356  {
357 
358  edm::LogInfo("EBPedestalTask") << "analyzed " << ievt_ << " events";
359 
360  if ( enableCleanup_ ) this->cleanup();
361 
362 }
void cleanup(void)
Cleanup.
void EBPedestalTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file EBPedestalTask.cc.

97  {
98 
99 }
void EBPedestalTask::reset ( void  )
protected

Reset.

Definition at line 101 of file EBPedestalTask.cc.

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

Referenced by beginRun().

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

Setup.

Definition at line 131 of file EBPedestalTask.cc.

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

Referenced by analyze().

131  {
132 
133  init_ = true;
134 
136  std::stringstream GainN, GN;
137 
138  if ( dqmStore_ ) {
139  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask");
140 
141  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
142 
143  GainN.str("");
144  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
145  GN.str("");
146  GN << "G" << std::setw(2) << std::setfill('0') << 1;
147 
148  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/" + GainN.str());
149  for (int i = 0; i < 36; i++) {
150  name = "EBPT pedestal " + Numbers::sEB(i+1) + " " + GN.str();
151  mePedMapG01_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
152  mePedMapG01_[i]->setAxisTitle("ieta", 1);
153  mePedMapG01_[i]->setAxisTitle("iphi", 2);
154  dqmStore_->tag(mePedMapG01_[i], i+1);
155 #ifdef COMMON_NOISE_ANALYSIS
156  name = "EBPT pedestal 3sum " + Numbers::sEB(i+1) + " " + GN.str();
157  mePed3SumMapG01_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
158  mePed3SumMapG01_[i]->setAxisTitle("ieta", 1);
159  mePed3SumMapG01_[i]->setAxisTitle("iphi", 2);
160  dqmStore_->tag(mePed3SumMapG01_[i], i+1);
161  name = "EBPT pedestal 5sum " + Numbers::sEB(i+1) + " " + GN.str();
162  mePed5SumMapG01_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
163  mePed5SumMapG01_[i]->setAxisTitle("ieta", 1);
164  mePed5SumMapG01_[i]->setAxisTitle("iphi", 2);
165  dqmStore_->tag(mePed5SumMapG01_[i], i+1);
166 #endif
167  }
168 
169  }
170 
171  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
172 
173  GainN.str("");
174  GainN << "Gain" << std::setw(2) << std::setfill('0') << 6;
175  GN.str("");
176  GN << "G" << std::setw(2) << std::setfill('0') << 6;
177 
178  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/" + GainN.str());
179  for (int i = 0; i < 36; i++) {
180  name = "EBPT pedestal " + Numbers::sEB(i+1) + " " + GN.str();
181  mePedMapG06_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
182  mePedMapG06_[i]->setAxisTitle("ieta", 1);
183  mePedMapG06_[i]->setAxisTitle("iphi", 2);
184  dqmStore_->tag(mePedMapG06_[i], i+1);
185 #ifdef COMMON_NOISE_ANALYSIS
186  name = "EBPT pedestal 3sum " + Numbers::sEB(i+1) + " " + GN.str();
187  mePed3SumMapG06_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
188  mePed3SumMapG06_[i]->setAxisTitle("ieta", 1);
189  mePed3SumMapG06_[i]->setAxisTitle("iphi", 2);
190  dqmStore_->tag(mePed3SumMapG06_[i], i+1);
191  name = "EBPT pedestal 5sum " + Numbers::sEB(i+1) + " " + GN.str();
192  mePed5SumMapG06_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
193  mePed5SumMapG06_[i]->setAxisTitle("ieta", 1);
194  mePed5SumMapG06_[i]->setAxisTitle("iphi", 2);
195  dqmStore_->tag(mePed5SumMapG06_[i], i+1);
196 #endif
197  }
198 
199  }
200 
201  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
202 
203  GainN.str("");
204  GainN << "Gain" << std::setw(2) << std::setfill('0') << 12;
205  GN.str("");
206  GN << "G" << std::setw(2) << std::setfill('0') << 12;
207 
208  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/" + GainN.str());
209  for (int i = 0; i < 36; i++) {
210  name = "EBPT pedestal " + Numbers::sEB(i+1) + " " + GN.str();
211  mePedMapG12_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
212  mePedMapG12_[i]->setAxisTitle("ieta", 1);
213  mePedMapG12_[i]->setAxisTitle("iphi", 2);
214  dqmStore_->tag(mePedMapG12_[i], i+1);
215 #ifdef COMMON_NOISE_ANALYSIS
216  name = "EBPT pedestal 3sum " + Numbers::sEB(i+1) + " " + GN.str();
217  mePed3SumMapG12_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
218  mePed3SumMapG12_[i]->setAxisTitle("ieta", 1);
219  mePed3SumMapG12_[i]->setAxisTitle("iphi", 2);
220  dqmStore_->tag(mePed3SumMapG12_[i], i+1);
221  name = "EBPT pedestal 5sum " + Numbers::sEB(i+1) + " " + GN.str();
222  mePed5SumMapG12_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096., "s");
223  mePed5SumMapG12_[i]->setAxisTitle("ieta", 1);
224  mePed5SumMapG12_[i]->setAxisTitle("iphi", 2);
225  dqmStore_->tag(mePed5SumMapG12_[i], i+1);
226 #endif
227  }
228  }
229 
230 
231  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN");
232 
233  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
234 
235  GainN.str("");
236  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
237  GN.str("");
238  GN << "G" << std::setw(2) << std::setfill('0') << 1;
239 
240  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/" + GainN.str());
241  for (int i = 0; i < 36; i++) {
242  name = "EBPDT PNs pedestal " + Numbers::sEB(i+1) + " " + GN.str();
243  mePnPedMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
244  mePnPedMapG01_[i]->setAxisTitle("channel", 1);
245  mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
246  dqmStore_->tag(mePnPedMapG01_[i], i+1);
247  }
248 
249  }
250 
251  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
252 
253  GainN.str("");
254  GainN << "Gain" << std::setw(2) << std::setfill('0') << 16;
255  GN.str("");
256  GN << "G" << std::setw(2) << std::setfill('0') << 16;
257 
258  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/" + GainN.str());
259  for (int i = 0; i < 36; i++) {
260  name = "EBPDT PNs pedestal " + Numbers::sEB(i+1) + " " + GN.str();
261  mePnPedMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
262  mePnPedMapG16_[i]->setAxisTitle("channel", 1);
263  mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
264  dqmStore_->tag(mePnPedMapG16_[i], i+1);
265  }
266 
267  }
268 
269  }
270 
271 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePed3SumMapG12_[36]
MonitorElement * mePedMapG06_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
MonitorElement * mePed3SumMapG01_[36]
MonitorElement * mePed5SumMapG01_[36]
std::string prefixME_
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:1509
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
MonitorElement * mePed5SumMapG12_[36]
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
MonitorElement * mePed3SumMapG06_[36]
MonitorElement * mePedMapG12_[36]
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG06_[36]
MonitorElement * mePedMapG01_[36]
DQMStore * dqmStore_
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
std::vector< int > MGPAGains_
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:1330

Member Data Documentation

DQMStore* EBPedestalTask::dqmStore_
private

Definition at line 61 of file EBPedestalTask.h.

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

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

Definition at line 70 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

edm::EDGetTokenT<EcalPnDiodeDigiCollection> EBPedestalTask::EcalPnDiodeDigiCollection_
private

Definition at line 71 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

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

Definition at line 69 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

bool EBPedestalTask::enableCleanup_
private

Definition at line 65 of file EBPedestalTask.h.

Referenced by EBPedestalTask(), and endJob().

int EBPedestalTask::ievt_
private

Definition at line 59 of file EBPedestalTask.h.

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

bool EBPedestalTask::init_
private

Definition at line 90 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG01_[36]
private

Definition at line 79 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG06_[36]
private

Definition at line 80 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG12_[36]
private

Definition at line 81 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG01_[36]
private

Definition at line 83 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG06_[36]
private

Definition at line 84 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG12_[36]
private

Definition at line 85 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG01_[36]
private

Definition at line 75 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG06_[36]
private

Definition at line 76 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG12_[36]
private

Definition at line 77 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePnPedMapG01_[36]
private

Definition at line 87 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePnPedMapG16_[36]
private

Definition at line 88 of file EBPedestalTask.h.

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

bool EBPedestalTask::mergeRuns_
private

Definition at line 67 of file EBPedestalTask.h.

Referenced by beginRun(), and EBPedestalTask().

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

Definition at line 72 of file EBPedestalTask.h.

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

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

Definition at line 73 of file EBPedestalTask.h.

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

std::string EBPedestalTask::prefixME_
private

Definition at line 63 of file EBPedestalTask.h.

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