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 edm::EDConsumerBase

Public Member Functions

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

float amplitudeThreshold_
 
DQMStoredqmStore_
 
edm::EDGetTokenT
< EBDigiCollection
EBDigiCollection_
 
edm::EDGetTokenT
< EcalPnDiodeDigiCollection
EcalPnDiodeDigiCollection_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
edm::EDGetTokenT
< EcalUncalibratedRecHitCollection
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
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 23 of file EBTestPulseTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 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, 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  EcalUncalibratedRecHitCollection_ = consumes<EcalUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EcalUncalibratedRecHitCollection"));
48 
49  MGPAGains_.reserve(3);
50  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
51  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
52 
53  MGPAGainsPN_.reserve(2);
54  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
55  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
56 
57  for (int i = 0; i < 36; i++) {
58  meShapeMapG01_[i] = 0;
59  meAmplMapG01_[i] = 0;
60  meShapeMapG06_[i] = 0;
61  meAmplMapG06_[i] = 0;
62  meShapeMapG12_[i] = 0;
63  meAmplMapG12_[i] = 0;
64  mePnAmplMapG01_[i] = 0;
65  mePnPedMapG01_[i] = 0;
66  mePnAmplMapG16_[i] = 0;
67  mePnPedMapG16_[i] = 0;
68  }
69 
70 
71 }
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_
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
MonitorElement * meShapeMapG06_[36]
MonitorElement * mePnAmplMapG01_[36]
MonitorElement * meAmplMapG01_[36]
MonitorElement * mePnAmplMapG16_[36]
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * meShapeMapG12_[36]
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
MonitorElement * meShapeMapG01_[36]
MonitorElement * meAmplMapG12_[36]
MonitorElement * mePnPedMapG01_[36]
MonitorElement * mePnPedMapG16_[36]
std::vector< int > MGPAGainsPN_
std::vector< int > MGPAGains_
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
std::string prefixME_
EBTestPulseTask::~EBTestPulseTask ( )
virtual

Destructor.

Definition at line 73 of file EBTestPulseTask.cc.

73  {
74 
75 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 350 of file EBTestPulseTask.cc.

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

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file EBTestPulseTask.cc.

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

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

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 88 of file EBTestPulseTask.cc.

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

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

Cleanup.

Definition at line 266 of file EBTestPulseTask.cc.

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

Referenced by endJob().

266  {
267 
268  if ( ! init_ ) return;
269 
270  if ( dqmStore_ ) {
271  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask");
272 
273  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
274 
275  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain01");
276  for (int i = 0; i < 36; i++) {
277  if ( meShapeMapG01_[i] ) dqmStore_->removeElement( meShapeMapG01_[i]->getName() );
278  meShapeMapG01_[i] = 0;
279  if ( meAmplMapG01_[i] ) dqmStore_->removeElement( meAmplMapG01_[i]->getName() );
280  meAmplMapG01_[i] = 0;
281  }
282 
283  }
284 
285  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
286 
287  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain06");
288  for (int i = 0; i < 36; i++) {
289  if ( meShapeMapG06_[i] ) dqmStore_->removeElement( meShapeMapG06_[i]->getName() );
290  meShapeMapG06_[i] = 0;
291  if ( meAmplMapG06_[i] ) dqmStore_->removeElement( meAmplMapG06_[i]->getName() );
292  meAmplMapG06_[i] = 0;
293  }
294 
295  }
296 
297  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
298 
299  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/Gain12");
300  for (int i = 0; i < 36; i++) {
301  if ( meShapeMapG12_[i] ) dqmStore_->removeElement( meShapeMapG12_[i]->getName() );
302  meShapeMapG12_[i] = 0;
303  if ( meAmplMapG12_[i] ) dqmStore_->removeElement( meAmplMapG12_[i]->getName() );
304  meAmplMapG12_[i] = 0;
305  }
306 
307  }
308 
309  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN");
310 
311  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
312 
313  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/Gain01");
314  for (int i = 0; i < 36; i++) {
315  if ( mePnAmplMapG01_[i] ) dqmStore_->removeElement( mePnAmplMapG01_[i]->getName() );
316  mePnAmplMapG01_[i] = 0;
317  if ( mePnPedMapG01_[i] ) dqmStore_->removeElement( mePnPedMapG01_[i]->getName() );
318  mePnPedMapG01_[i] = 0;
319  }
320 
321  }
322 
323 
324  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
325 
326  dqmStore_->setCurrentFolder(prefixME_ + "/EBTestPulseTask/PN/Gain16");
327  for (int i = 0; i < 36; i++) {
328  if ( mePnAmplMapG16_[i] ) dqmStore_->removeElement( mePnAmplMapG16_[i]->getName() );
329  mePnAmplMapG16_[i] = 0;
330  if ( mePnPedMapG16_[i] ) dqmStore_->removeElement( mePnPedMapG16_[i]->getName() );
331  mePnPedMapG16_[i] = 0;
332  }
333 
334  }
335 
336  }
337 
338  init_ = false;
339 
340 }
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:2772
MonitorElement * meShapeMapG01_[36]
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:584
std::string prefixME_
void EBTestPulseTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 342 of file EBTestPulseTask.cc.

References cleanup(), enableCleanup_, and ievt_.

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

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file EBTestPulseTask.cc.

96  {
97 
98 }
void EBTestPulseTask::reset ( void  )
protected

Reset.

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

100  {
101 
102  for (int i = 0; i < 36; i++) {
103  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
104  if ( meShapeMapG01_[i] ) meShapeMapG01_[i]->Reset();
105  if ( meAmplMapG01_[i] ) meAmplMapG01_[i]->Reset();
106  }
107  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
108  if ( meShapeMapG06_[i] ) meShapeMapG06_[i]->Reset();
109  if ( meAmplMapG06_[i] ) meAmplMapG06_[i]->Reset();
110  }
111  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
112  if ( meShapeMapG12_[i] ) meShapeMapG12_[i]->Reset();
113  if ( meAmplMapG12_[i] ) meAmplMapG12_[i]->Reset();
114  }
115  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
116  if ( mePnAmplMapG01_[i] ) mePnAmplMapG01_[i]->Reset();
117  if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
118  }
119  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
120  if ( mePnAmplMapG16_[i] ) mePnAmplMapG16_[i]->Reset();
121  if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
122  }
123  }
124 
125 }
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 127 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(), AlCaHLTBitMon_QueryRunRegistry::string, and DQMStore::tag().

Referenced by analyze().

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

Member Data Documentation

float EBTestPulseTask::amplitudeThreshold_
private

Definition at line 94 of file EBTestPulseTask.h.

DQMStore* EBTestPulseTask::dqmStore_
private

Definition at line 63 of file EBTestPulseTask.h.

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

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

Definition at line 72 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

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

Definition at line 73 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

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

Definition at line 71 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

edm::EDGetTokenT<EcalUncalibratedRecHitCollection> EBTestPulseTask::EcalUncalibratedRecHitCollection_
private

Definition at line 74 of file EBTestPulseTask.h.

Referenced by analyze(), and EBTestPulseTask().

bool EBTestPulseTask::enableCleanup_
private

Definition at line 67 of file EBTestPulseTask.h.

Referenced by EBTestPulseTask(), and endJob().

int EBTestPulseTask::ievt_
private

Definition at line 61 of file EBTestPulseTask.h.

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

bool EBTestPulseTask::init_
private

Definition at line 96 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG01_[36]
private

Definition at line 82 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG06_[36]
private

Definition at line 83 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meAmplMapG12_[36]
private

Definition at line 84 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnAmplMapG01_[36]
private

Definition at line 86 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnAmplMapG16_[36]
private

Definition at line 87 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnPedMapG01_[36]
private

Definition at line 89 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::mePnPedMapG16_[36]
private

Definition at line 90 of file EBTestPulseTask.h.

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

bool EBTestPulseTask::mergeRuns_
private

Definition at line 69 of file EBTestPulseTask.h.

Referenced by beginRun(), and EBTestPulseTask().

MonitorElement* EBTestPulseTask::meShapeMapG01_[36]
private

Definition at line 78 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meShapeMapG06_[36]
private

Definition at line 79 of file EBTestPulseTask.h.

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

MonitorElement* EBTestPulseTask::meShapeMapG12_[36]
private

Definition at line 80 of file EBTestPulseTask.h.

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

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

Definition at line 75 of file EBTestPulseTask.h.

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

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

Definition at line 76 of file EBTestPulseTask.h.

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

std::string EBTestPulseTask::prefixME_
private

Definition at line 65 of file EBTestPulseTask.h.

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