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

Public Member Functions

 EBPedestalTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EBPedestalTask ()
 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 EBDigiCollection_
 
edm::InputTag EcalPnDiodeDigiCollection_
 
edm::InputTag 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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 20 of file EBPedestalTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 34 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, and prefixME_.

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

Destructor.

Definition at line 76 of file EBPedestalTask.cc.

76  {
77 
78 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 366 of file EBPedestalTask.cc.

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

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file EBPedestalTask.cc.

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

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file EBPedestalTask.cc.

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

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

Cleanup.

Definition at line 275 of file EBPedestalTask.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().

275  {
276 
277  if ( ! init_ ) return;
278 
279  if ( dqmStore_ ) {
280  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask");
281 
282  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
283 
284  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain01");
285  for ( int i = 0; i < 36; i++ ) {
287  mePedMapG01_[i] = 0;
288 #ifdef COMMON_NOISE_ANALYSIS
290  mePed3SumMapG01_[i] = 0;
292  mePed5SumMapG01_[i] = 0;
293 #endif
294  }
295 
296  }
297 
298  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
299 
300  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain06");
301  for ( int i = 0; i < 36; i++ ) {
303  mePedMapG06_[i] = 0;
304 #ifdef COMMON_NOISE_ANALYSIS
306  mePed3SumMapG06_[i] = 0;
308  mePed5SumMapG06_[i] = 0;
309 #endif
310  }
311 
312  }
313 
314  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
315 
316  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/Gain12");
317  for ( int i = 0; i < 36; i++ ) {
319  mePedMapG12_[i] = 0;
320 #ifdef COMMON_NOISE_ANALYSIS
322  mePed3SumMapG12_[i] = 0;
324  mePed5SumMapG12_[i] = 0;
325 #endif
326  }
327 
328  }
329 
330  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN");
331 
332  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
333 
334  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/Gain01");
335  for ( int i = 0; i < 36; i++ ) {
337  mePnPedMapG01_[i] = 0;
338  }
339 
340  }
341 
342  if (find(MGPAGains_.begin(), MGPAGains_.end(), 16) != MGPAGains_.end() ) {
343 
344  dqmStore_->setCurrentFolder(prefixME_ + "/EBPedestalTask/PN/Gain16");
345  for ( int i = 0; i < 36; i++ ) {
347  mePnPedMapG16_[i] = 0;
348  }
349 
350  }
351 
352  }
353 
354  init_ = false;
355 
356 }
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:2572
MonitorElement * mePed5SumMapG12_[36]
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
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:429
std::vector< int > MGPAGains_
void EBPedestalTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 358 of file EBPedestalTask.cc.

References cleanup(), enableCleanup_, and ievt_.

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

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 99 of file EBPedestalTask.cc.

99  {
100 
101 }
void EBPedestalTask::reset ( void  )
protected

Reset.

Definition at line 103 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().

103  {
104 
105  for (int i = 0; i < 36; i++) {
106  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
107  if ( mePedMapG01_[i] ) mePedMapG01_[i]->Reset();
108  }
109  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
110  if ( mePedMapG06_[i] ) mePedMapG06_[i]->Reset();
111  }
112  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
113  if ( mePedMapG12_[i] ) mePedMapG12_[i]->Reset();
114  }
115 #ifdef COMMON_NOISE_ANALYSIS
122 #endif
123  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
124  if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
125  }
126  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 12) != MGPAGainsPN_.end() ) {
127  if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
128  }
129  }
130 
131 }
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 133 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(), and DQMStore::tag().

Referenced by analyze().

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

Member Data Documentation

DQMStore* EBPedestalTask::dqmStore_
private

Definition at line 60 of file EBPedestalTask.h.

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

edm::InputTag EBPedestalTask::EBDigiCollection_
private

Definition at line 69 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

edm::InputTag EBPedestalTask::EcalPnDiodeDigiCollection_
private

Definition at line 70 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

edm::InputTag EBPedestalTask::EcalRawDataCollection_
private

Definition at line 68 of file EBPedestalTask.h.

Referenced by analyze(), and EBPedestalTask().

bool EBPedestalTask::enableCleanup_
private

Definition at line 64 of file EBPedestalTask.h.

Referenced by EBPedestalTask(), and endJob().

int EBPedestalTask::ievt_
private

Definition at line 58 of file EBPedestalTask.h.

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

bool EBPedestalTask::init_
private

Definition at line 89 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG01_[36]
private

Definition at line 78 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG06_[36]
private

Definition at line 79 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed3SumMapG12_[36]
private

Definition at line 80 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG01_[36]
private

Definition at line 82 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG06_[36]
private

Definition at line 83 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePed5SumMapG12_[36]
private

Definition at line 84 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG01_[36]
private

Definition at line 74 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG06_[36]
private

Definition at line 75 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePedMapG12_[36]
private

Definition at line 76 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePnPedMapG01_[36]
private

Definition at line 86 of file EBPedestalTask.h.

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

MonitorElement* EBPedestalTask::mePnPedMapG16_[36]
private

Definition at line 87 of file EBPedestalTask.h.

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

bool EBPedestalTask::mergeRuns_
private

Definition at line 66 of file EBPedestalTask.h.

Referenced by beginRun(), and EBPedestalTask().

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

Definition at line 71 of file EBPedestalTask.h.

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

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

Definition at line 72 of file EBPedestalTask.h.

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

std::string EBPedestalTask::prefixME_
private

Definition at line 62 of file EBPedestalTask.h.

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