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

#include <EBTestPulseTask.h>

Inheritance diagram for EBTestPulseTask:
edm::EDAnalyzer

Public Member Functions

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

float amplitudeThreshold_
 
DQMStoredqmStore_
 
edm::InputTag EBDigiCollection_
 
edm::InputTag EcalPnDiodeDigiCollection_
 
edm::InputTag EcalRawDataCollection_
 
edm::InputTag EcalUncalibratedRecHitCollection_
 
bool enableCleanup_
 
int ievt_
 
bool init_
 
MonitorElementmeAmplMapG01_ [36]
 
MonitorElementmeAmplMapG06_ [36]
 
MonitorElementmeAmplMapG12_ [36]
 
MonitorElementmePnAmplMapG01_ [36]
 
MonitorElementmePnAmplMapG16_ [36]
 
MonitorElementmePnPedMapG01_ [36]
 
MonitorElementmePnPedMapG16_ [36]
 
bool mergeRuns_
 
MonitorElementmeShapeMapG01_ [36]
 
MonitorElementmeShapeMapG06_ [36]
 
MonitorElementmeShapeMapG12_ [36]
 
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 21 of file EBTestPulseTask.h.

Constructor & Destructor Documentation

EBTestPulseTask::EBTestPulseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file EBTestPulseTask.cc.

References dqmStore_, EBDigiCollection_, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EcalUncalibratedRecHitCollection_, enableCleanup_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, meAmplMapG01_, meAmplMapG06_, meAmplMapG12_, mePnAmplMapG01_, mePnAmplMapG16_, mePnPedMapG01_, mePnPedMapG16_, mergeRuns_, meShapeMapG01_, meShapeMapG06_, meShapeMapG12_, 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  EcalUncalibratedRecHitCollection_ = ps.getParameter<edm::InputTag>("EcalUncalibratedRecHitCollection");
50 
51  MGPAGains_.reserve(3);
52  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
53  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
54 
55  MGPAGainsPN_.reserve(2);
56  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
57  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
58 
59  for (int i = 0; i < 36; i++) {
60  meShapeMapG01_[i] = 0;
61  meAmplMapG01_[i] = 0;
62  meShapeMapG06_[i] = 0;
63  meAmplMapG06_[i] = 0;
64  meShapeMapG12_[i] = 0;
65  meAmplMapG12_[i] = 0;
66  mePnAmplMapG01_[i] = 0;
67  mePnPedMapG01_[i] = 0;
68  mePnAmplMapG16_[i] = 0;
69  mePnPedMapG16_[i] = 0;
70  }
71 
72 
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meAmplMapG06_[36]
int i
Definition: DBlmapReader.cc:9
DQMStore * dqmStore_
MonitorElement * meShapeMapG06_[36]
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
MonitorElement * meShapeMapG12_[36]
MonitorElement * meShapeMapG01_[36]
edm::InputTag EcalRawDataCollection_
MonitorElement * meAmplMapG12_[36]
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
std::vector< int > MGPAGainsPN_
edm::InputTag EBDigiCollection_
edm::InputTag EcalUncalibratedRecHitCollection_
edm::InputTag EcalPnDiodeDigiCollection_
std::vector< int > MGPAGains_
std::string prefixME_
EBTestPulseTask::~EBTestPulseTask ( )
virtual

Destructor.

Definition at line 75 of file EBTestPulseTask.cc.

75  {
76 
77 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 352 of file EBTestPulseTask.cc.

References ecalMGPA::adc(), EcalMGPASample::adc(), EBDigiCollection_, EcalBarrel, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EcalUncalibratedRecHitCollection_, MonitorElement::Fill(), edm::Event::getByLabel(), i, EBDetId::ic(), ievt_, init_, ecalpyutils::ism(), Numbers::iSM(), LogDebug, meAmplMapG01_, meAmplMapG06_, meAmplMapG12_, mePnAmplMapG01_, mePnAmplMapG16_, mePnPedMapG01_, mePnPedMapG16_, meShapeMapG01_, meShapeMapG06_, meShapeMapG12_, environment_file_cff::runType, EcalDataFrame::sample(), setup(), Numbers::subDet(), EcalDCCHeaderBlock::TESTPULSE_GAP, and EcalDCCHeaderBlock::TESTPULSE_MGPA.

352  {
353 
354  bool enable = false;
355  int runType[36];
356  for (int i=0; i<36; i++) runType[i] = -1;
357  int mgpaGain[36];
358  for (int i=0; i<36; i++) mgpaGain[i] = -1;
359 
361 
362  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
363 
364  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
365 
366  if ( Numbers::subDet( *dcchItr ) != EcalBarrel ) continue;
367 
368  int ism = Numbers::iSM( *dcchItr, EcalBarrel );
369 
370  runType[ism-1] = dcchItr->getRunType();
371  mgpaGain[ism-1] = dcchItr->getMgpaGain();
372 
373  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
374  dcchItr->getRunType() == EcalDCCHeaderBlock::TESTPULSE_GAP ) enable = true;
375 
376  }
377 
378  } else {
379 
380  edm::LogWarning("EBTestPulseTask") << EcalRawDataCollection_ << " not available";
381 
382  }
383 
384  if ( ! enable ) return;
385 
386  if ( ! init_ ) this->setup();
387 
388  ievt_++;
389 
391 
392  if ( e.getByLabel(EBDigiCollection_, digis) ) {
393 
394  int nebd = digis->size();
395  LogDebug("EBTestPulseTask") << "event " << ievt_ << " digi collection size " << nebd;
396 
397  for ( EBDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
398 
399  EBDetId id = digiItr->id();
400 
401  int ic = id.ic();
402 
403  int ism = Numbers::iSM( id );
404 
405  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
406  runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_GAP ) ) continue;
407 
408  EBDataFrame dataframe = (*digiItr);
409 
410  for (int i = 0; i < 10; i++) {
411 
412  int adc = dataframe.sample(i).adc();
413 
414  MonitorElement* meShapeMap = 0;
415 
416  if ( mgpaGain[ism-1] == 3 ) meShapeMap = meShapeMapG01_[ism-1];
417  if ( mgpaGain[ism-1] == 2 ) meShapeMap = meShapeMapG06_[ism-1];
418  if ( mgpaGain[ism-1] == 1 ) meShapeMap = meShapeMapG12_[ism-1];
419 
420  float xval = float(adc);
421 
422  if ( meShapeMap ) meShapeMap->Fill(ic - 0.5, i + 0.5, xval);
423 
424  }
425 
426  }
427 
428  } else {
429 
430  edm::LogWarning("EBTestPulseTask") << EBDigiCollection_ << " not available";
431 
432  }
433 
435 
437 
438  int neh = hits->size();
439  LogDebug("EBTestPulseTask") << "event " << ievt_ << " hits collection size " << neh;
440 
441  for ( EcalUncalibratedRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr ) {
442 
443  EBDetId id = hitItr->id();
444 
445  int ic = id.ic();
446  int ie = (ic-1)/20 + 1;
447  int ip = (ic-1)%20 + 1;
448 
449  int ism = Numbers::iSM( id );
450 
451  float xie = ie - 0.5;
452  float xip = ip - 0.5;
453 
454  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
455  runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_GAP ) ) continue;
456 
457  MonitorElement* meAmplMap = 0;
458 
459  if ( mgpaGain[ism-1] == 3 ) meAmplMap = meAmplMapG01_[ism-1];
460  if ( mgpaGain[ism-1] == 2 ) meAmplMap = meAmplMapG06_[ism-1];
461  if ( mgpaGain[ism-1] == 1 ) meAmplMap = meAmplMapG12_[ism-1];
462 
463  float xval = hitItr->amplitude();
464  if ( xval <= 0. ) xval = 0.0;
465 
466 // if ( mgpaGain[ism-1] == 3 ) xval = xval * 1./12.;
467 // if ( mgpaGain[ism-1] == 2 ) xval = xval * 1./ 2.;
468 // if ( mgpaGain[ism-1] == 1 ) xval = xval * 1./ 1.;
469 
470  if ( meAmplMap ) meAmplMap->Fill(xie, xip, xval);
471 
472  }
473 
474  } else {
475 
476  edm::LogWarning("EBTestPulseTask") << EcalUncalibratedRecHitCollection_ << " not available";
477 
478  }
479 
481 
482  if ( e.getByLabel(EcalPnDiodeDigiCollection_, pns) ) {
483 
484  int nep = pns->size();
485  LogDebug("EBTestPulseTask") << "event " << ievt_ << " pns collection size " << nep;
486 
487  for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
488 
489  if ( Numbers::subDet( pnItr->id() ) != EcalBarrel ) continue;
490 
491  int ism = Numbers::iSM( pnItr->id() );
492 
493  int num = pnItr->id().iPnId();
494 
495  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
496  runType[ism-1] == EcalDCCHeaderBlock::TESTPULSE_GAP ) ) continue;
497 
498  float xvalped = 0.;
499 
500  for (int i = 0; i < 4; i++) {
501 
502  int adc = pnItr->sample(i).adc();
503 
504  MonitorElement* mePNPed = 0;
505 
506  if ( pnItr->sample(i).gainId() == 0 ) mePNPed = mePnPedMapG01_[ism-1];
507  if ( pnItr->sample(i).gainId() == 1 ) mePNPed = mePnPedMapG16_[ism-1];
508 
509  float xval = float(adc);
510 
511  if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
512 
513  xvalped = xvalped + xval;
514 
515  }
516 
517  xvalped = xvalped / 4;
518 
519  float xvalmax = 0.;
520 
521  MonitorElement* mePN = 0;
522 
523  for (int i = 0; i < 50; i++) {
524 
525  int adc = pnItr->sample(i).adc();
526 
527  float xval = float(adc);
528 
529  if ( xval >= xvalmax ) xvalmax = xval;
530 
531  }
532 
533  xvalmax = xvalmax - xvalped;
534 
535  if ( pnItr->sample(0).gainId() == 0 ) mePN = mePnAmplMapG01_[ism-1];
536  if ( pnItr->sample(0).gainId() == 1 ) mePN = mePnAmplMapG16_[ism-1];
537 
538  if ( mePN ) mePN->Fill(num - 0.5, xvalmax);
539 
540  }
541 
542  } else {
543 
544  edm::LogWarning("EBTestPulseTask") << EcalPnDiodeDigiCollection_ << " not available";
545 
546  }
547 
548 }
int adc(sample_type sample)
get the ADC sample (12 bits)
#define LogDebug(id)
MonitorElement * meAmplMapG06_[36]
int i
Definition: DBlmapReader.cc:9
MonitorElement * meShapeMapG06_[36]
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:30
void setup(void)
Setup.
void Fill(long long x)
MonitorElement * meShapeMapG12_[36]
MonitorElement * meShapeMapG01_[36]
edm::InputTag EcalRawDataCollection_
MonitorElement * meAmplMapG12_[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
MonitorElement * mePnPedMapG01_[36]
long long int num
Definition: procUtils.cc:71
MonitorElement * mePnPedMapG16_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
edm::InputTag EBDigiCollection_
edm::InputTag EcalUncalibratedRecHitCollection_
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:145
edm::InputTag EcalPnDiodeDigiCollection_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
int adc() const
get the ADC sample (12 bits)
void EBTestPulseTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file EBTestPulseTask.cc.

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

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file EBTestPulseTask.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:50
void EBTestPulseTask::cleanup ( void  )
protected

Cleanup.

Definition at line 268 of file EBTestPulseTask.cc.

References dqmStore_, spr::find(), edm::getName(), i, init_, meAmplMapG01_, meAmplMapG06_, meAmplMapG12_, mePnAmplMapG01_, mePnAmplMapG16_, mePnPedMapG01_, mePnPedMapG16_, meShapeMapG01_, meShapeMapG06_, meShapeMapG12_, MGPAGains_, MGPAGainsPN_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

268  {
269 
270  if ( ! init_ ) return;
271 
272  if ( dqmStore_ ) {
273  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask");
274 
275  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
276 
277  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain01");
278  for (int i = 0; i < 36; i++) {
280  meShapeMapG01_[i] = 0;
282  meAmplMapG01_[i] = 0;
283  }
284 
285  }
286 
287  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
288 
289  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain06");
290  for (int i = 0; i < 36; i++) {
292  meShapeMapG06_[i] = 0;
294  meAmplMapG06_[i] = 0;
295  }
296 
297  }
298 
299  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
300 
301  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain12");
302  for (int i = 0; i < 36; i++) {
304  meShapeMapG12_[i] = 0;
306  meAmplMapG12_[i] = 0;
307  }
308 
309  }
310 
311  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN");
312 
313  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
314 
315  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/Gain01");
316  for (int i = 0; i < 36; i++) {
318  mePnAmplMapG01_[i] = 0;
320  mePnPedMapG01_[i] = 0;
321  }
322 
323  }
324 
325 
326  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
327 
328  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/Gain16");
329  for (int i = 0; i < 36; i++) {
331  mePnAmplMapG16_[i] = 0;
333  mePnPedMapG16_[i] = 0;
334  }
335 
336  }
337 
338  }
339 
340  init_ = false;
341 
342 }
MonitorElement * meAmplMapG06_[36]
int i
Definition: DBlmapReader.cc:9
DQMStore * dqmStore_
MonitorElement * meShapeMapG06_[36]
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * meShapeMapG12_[36]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * meShapeMapG01_[36]
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
MonitorElement * meAmplMapG12_[36]
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
std::vector< int > MGPAGainsPN_
std::vector< int > MGPAGains_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::string prefixME_
void EBTestPulseTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 344 of file EBTestPulseTask.cc.

References cleanup(), enableCleanup_, and ievt_.

344  {
345 
346  edm::LogInfo("EBTestPulseTask") << "analyzed " << ievt_ << " events";
347 
348  if ( enableCleanup_ ) this->cleanup();
349 
350 }
void cleanup(void)
Cleanup.
void EBTestPulseTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file EBTestPulseTask.cc.

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

Reset.

Definition at line 102 of file EBTestPulseTask.cc.

References spr::find(), i, meAmplMapG01_, meAmplMapG06_, meAmplMapG12_, mePnAmplMapG01_, mePnAmplMapG16_, mePnPedMapG01_, mePnPedMapG16_, meShapeMapG01_, meShapeMapG06_, meShapeMapG12_, MGPAGains_, MGPAGainsPN_, and MonitorElement::Reset().

Referenced by beginRun().

102  {
103 
104  for (int i = 0; i < 36; i++) {
105  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
106  if ( meShapeMapG01_[i] ) meShapeMapG01_[i]->Reset();
107  if ( meAmplMapG01_[i] ) meAmplMapG01_[i]->Reset();
108  }
109  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
110  if ( meShapeMapG06_[i] ) meShapeMapG06_[i]->Reset();
111  if ( meAmplMapG06_[i] ) meAmplMapG06_[i]->Reset();
112  }
113  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
114  if ( meShapeMapG12_[i] ) meShapeMapG12_[i]->Reset();
115  if ( meAmplMapG12_[i] ) meAmplMapG12_[i]->Reset();
116  }
117  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
118  if ( mePnAmplMapG01_[i] ) mePnAmplMapG01_[i]->Reset();
119  if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
120  }
121  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
122  if ( mePnAmplMapG16_[i] ) mePnAmplMapG16_[i]->Reset();
123  if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
124  }
125  }
126 
127 }
MonitorElement * meAmplMapG06_[36]
int i
Definition: DBlmapReader.cc:9
MonitorElement * meShapeMapG06_[36]
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * meShapeMapG12_[36]
MonitorElement * meShapeMapG01_[36]
MonitorElement * meAmplMapG12_[36]
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
std::vector< int > MGPAGainsPN_
std::vector< int > MGPAGains_
void Reset(void)
reset ME (ie. contents, errors, etc)
void EBTestPulseTask::setup ( void  )
protected

Setup.

Definition at line 129 of file EBTestPulseTask.cc.

References DQMStore::bookProfile(), DQMStore::bookProfile2D(), dqmStore_, spr::find(), i, init_, meAmplMapG01_, meAmplMapG06_, meAmplMapG12_, mePnAmplMapG01_, mePnAmplMapG16_, mePnPedMapG01_, mePnPedMapG16_, meShapeMapG01_, meShapeMapG06_, meShapeMapG12_, MGPAGains_, MGPAGainsPN_, mergeVDriftHistosByStation::name, prefixME_, Numbers::sEB(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and DQMStore::tag().

Referenced by analyze().

129  {
130 
131  init_ = true;
132 
133  std::string name;
134  std::stringstream GainN, GN;
135 
136  if ( dqmStore_ ) {
137  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask");
138 
139  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
140 
141  GainN.str("");
142  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
143  GN.str("");
144  GN << "G" << std::setw(2) << std::setfill('0') << 1;
145 
146  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/" + GainN.str());
147  for (int i = 0; i < 36; i++) {
148  name = "EBTPT shape " + Numbers::sEB(i+1) + " " + GN.str();
149  meShapeMapG01_[i] = dqmStore_->bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096., "s");
150  meShapeMapG01_[i]->setAxisTitle("channel", 1);
151  meShapeMapG01_[i]->setAxisTitle("sample", 2);
152  meShapeMapG01_[i]->setAxisTitle("amplitude", 3);
153  dqmStore_->tag(meShapeMapG01_[i], i+1);
154 
155  name = "EBTPT amplitude " + Numbers::sEB(i+1) + " " + GN.str(),
156  meAmplMapG01_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12., "s");
157  meAmplMapG01_[i]->setAxisTitle("ieta", 1);
158  meAmplMapG01_[i]->setAxisTitle("iphi", 2);
159  dqmStore_->tag(meAmplMapG01_[i], i+1);
160  }
161 
162  }
163 
164  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
165 
166  GainN.str("");
167  GainN << "Gain" << std::setw(2) << std::setfill('0') << 6;
168  GN.str("");
169  GN << "G" << std::setw(2) << std::setfill('0') << 6;
170 
171  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/" + GainN.str());
172  for (int i = 0; i < 36; i++) {
173  name = "EBTPT shape " + Numbers::sEB(i+1) + " " + GN.str();
174  meShapeMapG06_[i] = dqmStore_->bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096., "s");
175  meShapeMapG06_[i]->setAxisTitle("channel", 1);
176  meShapeMapG06_[i]->setAxisTitle("sample", 2);
177  meShapeMapG06_[i]->setAxisTitle("amplitude", 3);
178  dqmStore_->tag(meShapeMapG06_[i], i+1);
179 
180  name = "EBTPT amplitude " + Numbers::sEB(i+1) + " " + GN.str(),
181  meAmplMapG06_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12., "s");
182  meAmplMapG06_[i]->setAxisTitle("ieta", 1);
183  meAmplMapG06_[i]->setAxisTitle("iphi", 2);
184  dqmStore_->tag(meAmplMapG06_[i], i+1);
185  }
186 
187  }
188 
189  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
190 
191  GainN.str("");
192  GainN << "Gain" << std::setw(2) << std::setfill('0') << 12;
193  GN.str("");
194  GN << "G" << std::setw(2) << std::setfill('0') << 12;
195 
196  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/" + GainN.str());
197  for (int i = 0; i < 36; i++) {
198  name = "EBTPT shape " + Numbers::sEB(i+1) + " " + GN.str();
199  meShapeMapG12_[i] = dqmStore_->bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096., "s");
200  meShapeMapG12_[i]->setAxisTitle("channel", 1);
201  meShapeMapG12_[i]->setAxisTitle("sample", 2);
202  meShapeMapG12_[i]->setAxisTitle("amplitude", 3);
203  dqmStore_->tag(meShapeMapG12_[i], i+1);
204 
205  name = "EBTPT amplitude " + Numbers::sEB(i+1) + " " + GN.str(),
206  meAmplMapG12_[i] = dqmStore_->bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12., "s");
207  meAmplMapG12_[i]->setAxisTitle("ieta", 1);
208  meAmplMapG12_[i]->setAxisTitle("iphi", 2);
209  dqmStore_->tag(meAmplMapG12_[i], i+1);
210  }
211 
212  }
213 
214  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN");
215 
216  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
217 
218  GainN.str("");
219  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
220  GN.str("");
221  GN << "G" << std::setw(2) << std::setfill('0') << 1;
222 
223  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/" + GainN.str());
224  for (int i = 0; i < 36; i++) {
225  name = "EBTPT PNs amplitude " + Numbers::sEB(i+1) + " " + GN.str();
226  mePnAmplMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
227  mePnAmplMapG01_[i]->setAxisTitle("channel", 1);
228  mePnAmplMapG01_[i]->setAxisTitle("amplitude", 2);
229  dqmStore_->tag(mePnAmplMapG01_[i], i+1);
230 
231  name = "EBTPT PNs pedestal " + Numbers::sEB(i+1) + " " + GN.str();
232  mePnPedMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
233  mePnPedMapG01_[i]->setAxisTitle("channel", 1);
234  mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
235  dqmStore_->tag(mePnPedMapG01_[i], i+1);
236  }
237 
238  }
239 
240  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
241 
242  GainN.str("");
243  GainN << "Gain" << std::setw(2) << std::setfill('0') << 16;
244  GN.str("");
245  GN << "G" << std::setw(2) << std::setfill('0') << 16;
246 
247  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/" + GainN.str());
248  for (int i = 0; i < 36; i++) {
249  name = "EBTPT PNs amplitude " + Numbers::sEB(i+1) + " " + GN.str();
250  mePnAmplMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
251  mePnAmplMapG16_[i]->setAxisTitle("channel", 1);
252  mePnAmplMapG16_[i]->setAxisTitle("amplitude", 2);
253  dqmStore_->tag(mePnAmplMapG16_[i], i+1);
254 
255  name = "EBTPT PNs pedestal " + Numbers::sEB(i+1) + " " + GN.str();
256  mePnPedMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
257  mePnPedMapG16_[i]->setAxisTitle("channel", 1);
258  mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
259  dqmStore_->tag(mePnPedMapG16_[i], i+1);
260  }
261 
262  }
263 
264  }
265 
266 }
MonitorElement * meAmplMapG06_[36]
int i
Definition: DBlmapReader.cc:9
DQMStore * dqmStore_
MonitorElement * meShapeMapG06_[36]
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * meShapeMapG12_[36]
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1354
MonitorElement * meShapeMapG01_[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 * meAmplMapG12_[36]
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
std::vector< int > MGPAGainsPN_
std::vector< int > MGPAGains_
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
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
std::string prefixME_

Member Data Documentation

float EBTestPulseTask::amplitudeThreshold_
private

Definition at line 92 of file EBTestPulseTask.h.

DQMStore* EBTestPulseTask::dqmStore_
private

Definition at line 61 of file EBTestPulseTask.h.

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

edm::InputTag EBTestPulseTask::EBDigiCollection_
private

Definition at line 70 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

edm::InputTag EBTestPulseTask::EcalPnDiodeDigiCollection_
private

Definition at line 71 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

edm::InputTag EBTestPulseTask::EcalRawDataCollection_
private

Definition at line 69 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

edm::InputTag EBTestPulseTask::EcalUncalibratedRecHitCollection_
private

Definition at line 72 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

bool EBTestPulseTask::enableCleanup_
private

Definition at line 65 of file EBTestPulseTask.h.

Referenced by EBTestPulseTask(), and endJob().

int EBTestPulseTask::ievt_
private

Definition at line 59 of file EBTestPulseTask.h.

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

bool EBTestPulseTask::init_
private

Definition at line 94 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG01_[36]
private

Definition at line 80 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG06_[36]
private

Definition at line 81 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG12_[36]
private

Definition at line 82 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnAmplMapG01_[36]
private

Definition at line 84 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnAmplMapG16_[36]
private

Definition at line 85 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnPedMapG01_[36]
private

Definition at line 87 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnPedMapG16_[36]
private

Definition at line 88 of file EBTestPulseTask.h.

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

bool EBTestPulseTask::mergeRuns_
private

Definition at line 67 of file EBTestPulseTask.h.

Referenced by beginRun(), and EBTestPulseTask().

MonitorElement* EBTestPulseTask::meShapeMapG01_[36]
private

Definition at line 76 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meShapeMapG06_[36]
private

Definition at line 77 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meShapeMapG12_[36]
private

Definition at line 78 of file EBTestPulseTask.h.

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

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

Definition at line 73 of file EBTestPulseTask.h.

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

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

Definition at line 74 of file EBTestPulseTask.h.

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

std::string EBTestPulseTask::prefixME_
private

Definition at line 63 of file EBTestPulseTask.h.

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