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

#include <EETestPulseTask.h>

Inheritance diagram for EETestPulseTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EETestPulseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EETestPulseTask ()
 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
< EcalPnDiodeDigiCollection
EcalPnDiodeDigiCollection_
 
edm::EDGetTokenT
< EcalRawDataCollection
EcalRawDataCollection_
 
edm::EDGetTokenT
< EcalUncalibratedRecHitCollection
EcalUncalibratedRecHitCollection_
 
edm::EDGetTokenT
< EEDigiCollection
EEDigiCollection_
 
bool enableCleanup_
 
int ievt_
 
bool init_
 
MonitorElementmeAmplMapG01_ [18]
 
MonitorElementmeAmplMapG06_ [18]
 
MonitorElementmeAmplMapG12_ [18]
 
MonitorElementmePnAmplMapG01_ [18]
 
MonitorElementmePnAmplMapG16_ [18]
 
MonitorElementmePnPedMapG01_ [18]
 
MonitorElementmePnPedMapG16_ [18]
 
bool mergeRuns_
 
MonitorElementmeShapeMapG01_ [18]
 
MonitorElementmeShapeMapG06_ [18]
 
MonitorElementmeShapeMapG12_ [18]
 
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 22 of file EETestPulseTask.h.

Constructor & Destructor Documentation

EETestPulseTask::EETestPulseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file EETestPulseTask.cc.

References dqmStore_, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EcalUncalibratedRecHitCollection_, EEDigiCollection_, 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.

28  {
29 
30  init_ = false;
31 
33 
34  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
35 
36  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
37 
38  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
39 
40  EcalRawDataCollection_ = consumes<EcalRawDataCollection>(ps.getParameter<edm::InputTag>("EcalRawDataCollection"));
41  EEDigiCollection_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEDigiCollection"));
42  EcalPnDiodeDigiCollection_ = consumes<EcalPnDiodeDigiCollection>(ps.getParameter<edm::InputTag>("EcalPnDiodeDigiCollection"));
43  EcalUncalibratedRecHitCollection_ = consumes<EcalUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EcalUncalibratedRecHitCollection"));
44 
45  MGPAGains_.reserve(3);
46  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
47  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
48 
49  MGPAGainsPN_.reserve(2);
50  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
51  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
52 
53  for (int i = 0; i < 18; i++) {
54  meShapeMapG01_[i] = 0;
55  meAmplMapG01_[i] = 0;
56  meShapeMapG06_[i] = 0;
57  meAmplMapG06_[i] = 0;
58  meShapeMapG12_[i] = 0;
59  meAmplMapG12_[i] = 0;
60  mePnAmplMapG01_[i] = 0;
61  mePnPedMapG01_[i] = 0;
62  mePnAmplMapG16_[i] = 0;
63  mePnPedMapG16_[i] = 0;
64  }
65 
66 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
std::vector< int > MGPAGains_
MonitorElement * meShapeMapG06_[18]
MonitorElement * mePnAmplMapG01_[18]
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * meAmplMapG01_[18]
MonitorElement * mePnAmplMapG16_[18]
std::string prefixME_
DQMStore * dqmStore_
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
MonitorElement * meAmplMapG12_[18]
MonitorElement * meShapeMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
MonitorElement * meAmplMapG06_[18]
MonitorElement * meShapeMapG01_[18]
MonitorElement * mePnPedMapG16_[18]
std::vector< int > MGPAGainsPN_
EETestPulseTask::~EETestPulseTask ( )
virtual

Destructor.

Definition at line 68 of file EETestPulseTask.cc.

68  {
69 
70 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 345 of file EETestPulseTask.cc.

References ecalMGPA::adc(), EcalMGPASample::adc(), EcalEndcap, EcalPnDiodeDigiCollection_, EcalRawDataCollection_, EcalUncalibratedRecHitCollection_, EEDigiCollection_, MonitorElement::Fill(), edm::Event::getByToken(), i, Numbers::icEE(), ievt_, init_, ecalpyutils::ism(), Numbers::iSM(), EEDetId::ix(), 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.

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file EETestPulseTask.cc.

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

72  {
73 
74  ievt_ = 0;
75 
76  if ( dqmStore_ ) {
77  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask");
78  dqmStore_->rmdir(prefixME_ + "/EETestPulseTask");
79  }
80 
81 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
std::string prefixME_
DQMStore * dqmStore_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EETestPulseTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file EETestPulseTask.cc.

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

83  {
84 
85  Numbers::initGeometry(c, false);
86 
87  if ( ! mergeRuns_ ) this->reset();
88 
89 }
void reset(void)
Reset.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
void EETestPulseTask::cleanup ( void  )
protected

Cleanup.

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

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

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 337 of file EETestPulseTask.cc.

References cleanup(), enableCleanup_, and ievt_.

337  {
338 
339  edm::LogInfo("EETestPulseTask") << "analyzed " << ievt_ << " events";
340 
341  if ( enableCleanup_ ) this->cleanup();
342 
343 }
void cleanup(void)
Cleanup.
void EETestPulseTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file EETestPulseTask.cc.

91  {
92 
93 }
void EETestPulseTask::reset ( void  )
protected

Reset.

Definition at line 95 of file EETestPulseTask.cc.

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

Referenced by beginRun().

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

Setup.

Definition at line 122 of file EETestPulseTask.cc.

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

Referenced by analyze().

122  {
123 
124  init_ = true;
125 
127  std::stringstream GainN, GN;
128 
129  if ( dqmStore_ ) {
130  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask");
131 
132  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
133 
134  GainN.str("");
135  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
136  GN.str("");
137  GN << "G" << std::setw(2) << std::setfill('0') << 1;
138 
139  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/" + GainN.str());
140  for (int i = 0; i < 18; i++) {
141  name = "EETPT shape " + Numbers::sEE(i+1) + " " + GN.str();
142  meShapeMapG01_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
143  meShapeMapG01_[i]->setAxisTitle("channel", 1);
144  meShapeMapG01_[i]->setAxisTitle("sample", 2);
145  meShapeMapG01_[i]->setAxisTitle("amplitude", 3);
146  dqmStore_->tag(meShapeMapG01_[i], i+1);
147 
148  name = "EETPT amplitude " + Numbers::sEE(i+1) + " " + GN.str();
149  meAmplMapG01_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12., "s");
150  meAmplMapG01_[i]->setAxisTitle("ix", 1);
151  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapG01_[i]->setAxisTitle("101-ix", 1);
152  meAmplMapG01_[i]->setAxisTitle("iy", 2);
153  dqmStore_->tag(meAmplMapG01_[i], i+1);
154  }
155 
156  }
157 
158  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
159 
160  GainN.str("");
161  GainN << "Gain" << std::setw(2) << std::setfill('0') << 6;
162  GN.str("");
163  GN << "G" << std::setw(2) << std::setfill('0') << 6;
164 
165  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/" + GainN.str());
166  for (int i = 0; i < 18; i++) {
167  name = "EETPT shape " + Numbers::sEE(i+1) + " " + GN.str();
168  meShapeMapG06_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
169  meShapeMapG06_[i]->setAxisTitle("channel", 1);
170  meShapeMapG06_[i]->setAxisTitle("sample", 2);
171  meShapeMapG06_[i]->setAxisTitle("amplitude", 3);
172  dqmStore_->tag(meShapeMapG06_[i], i+1);
173 
174  name = "EETPT amplitude " + Numbers::sEE(i+1) + " " + GN.str();
175  meAmplMapG06_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12., "s");
176  meAmplMapG06_[i]->setAxisTitle("ix", 1);
177  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapG06_[i]->setAxisTitle("101-ix", 1);
178  meAmplMapG06_[i]->setAxisTitle("iy", 2);
179  dqmStore_->tag(meAmplMapG06_[i], i+1);
180  }
181 
182  }
183 
184  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
185 
186  GainN.str("");
187  GainN << "Gain" << std::setw(2) << std::setfill('0') << 12;
188  GN.str("");
189  GN << "G" << std::setw(2) << std::setfill('0') << 12;
190 
191  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/" + GainN.str());
192  for (int i = 0; i < 18; i++) {
193  name = "EETPT shape " + Numbers::sEE(i+1) + " " + GN.str();
194  meShapeMapG12_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
195  meShapeMapG12_[i]->setAxisTitle("channel", 1);
196  meShapeMapG12_[i]->setAxisTitle("sample", 2);
197  meShapeMapG12_[i]->setAxisTitle("amplitude", 3);
198  dqmStore_->tag(meShapeMapG12_[i], i+1);
199 
200  name = "EETPT amplitude " + Numbers::sEE(i+1) + " " + GN.str();
201  meAmplMapG12_[i] = dqmStore_->bookProfile2D(name, name, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12., "s");
202  meAmplMapG12_[i]->setAxisTitle("ix", 1);
203  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapG12_[i]->setAxisTitle("101-ix", 1);
204  meAmplMapG12_[i]->setAxisTitle("iy", 2);
205  dqmStore_->tag(meAmplMapG12_[i], i+1);
206  }
207 
208  }
209 
210  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/PN");
211 
212  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
213 
214  GainN.str("");
215  GainN << "Gain" << std::setw(2) << std::setfill('0') << 1;
216  GN.str("");
217  GN << "G" << std::setw(2) << std::setfill('0') << 1;
218 
219  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/PN/" + GainN.str());
220  for (int i = 0; i < 18; i++) {
221  name = "EETPT PNs amplitude " + Numbers::sEE(i+1) + " " + GN.str();
222  mePnAmplMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
223  mePnAmplMapG01_[i]->setAxisTitle("channel", 1);
224  mePnAmplMapG01_[i]->setAxisTitle("amplitude", 2);
225  dqmStore_->tag(mePnAmplMapG01_[i], i+1);
226  name = "EETPT PNs pedestal " + Numbers::sEE(i+1) + " " + GN.str();
227  mePnPedMapG01_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
228  mePnPedMapG01_[i]->setAxisTitle("channel", 1);
229  mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
230  dqmStore_->tag(mePnPedMapG01_[i], i+1);
231  }
232 
233  }
234 
235  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
236 
237  GainN.str("");
238  GainN << "Gain" << std::setw(2) << std::setfill('0') << 16;
239  GN.str("");
240  GN << "G" << std::setw(2) << std::setfill('0') << 16;
241 
242  dqmStore_->setCurrentFolder(prefixME_ + "/EETestPulseTask/PN/" + GainN.str());
243  for (int i = 0; i < 18; i++) {
244  name = "EETPT PNs amplitude " + Numbers::sEE(i+1) + " " + GN.str();
245  mePnAmplMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
246  mePnAmplMapG16_[i]->setAxisTitle("channel", 1);
247  mePnAmplMapG16_[i]->setAxisTitle("amplitude", 2);
248  dqmStore_->tag(mePnAmplMapG16_[i], i+1);
249  name = "EETPT PNs pedestal " + Numbers::sEE(i+1) + " " + GN.str();
250  mePnPedMapG16_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
251  mePnPedMapG16_[i]->setAxisTitle("channel", 1);
252  mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
253  dqmStore_->tag(mePnPedMapG16_[i], i+1);
254  }
255 
256  }
257 
258  }
259 
260 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
std::vector< int > MGPAGains_
MonitorElement * meShapeMapG06_[18]
MonitorElement * mePnAmplMapG01_[18]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
MonitorElement * meAmplMapG01_[18]
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
MonitorElement * mePnAmplMapG16_[18]
std::string prefixME_
DQMStore * dqmStore_
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_[18]
MonitorElement * meShapeMapG12_[18]
MonitorElement * mePnPedMapG01_[18]
MonitorElement * meAmplMapG06_[18]
MonitorElement * meShapeMapG01_[18]
MonitorElement * mePnPedMapG16_[18]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
std::vector< int > MGPAGainsPN_
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1330

Member Data Documentation

float EETestPulseTask::amplitudeThreshold_
private

Definition at line 93 of file EETestPulseTask.h.

DQMStore* EETestPulseTask::dqmStore_
private

Definition at line 62 of file EETestPulseTask.h.

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

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

Definition at line 72 of file EETestPulseTask.h.

Referenced by analyze(), and EETestPulseTask().

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

Definition at line 70 of file EETestPulseTask.h.

Referenced by analyze(), and EETestPulseTask().

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

Definition at line 73 of file EETestPulseTask.h.

Referenced by analyze(), and EETestPulseTask().

edm::EDGetTokenT<EEDigiCollection> EETestPulseTask::EEDigiCollection_
private

Definition at line 71 of file EETestPulseTask.h.

Referenced by analyze(), and EETestPulseTask().

bool EETestPulseTask::enableCleanup_
private

Definition at line 66 of file EETestPulseTask.h.

Referenced by EETestPulseTask(), and endJob().

int EETestPulseTask::ievt_
private

Definition at line 60 of file EETestPulseTask.h.

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

bool EETestPulseTask::init_
private

Definition at line 95 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::meAmplMapG01_[18]
private

Definition at line 81 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::meAmplMapG06_[18]
private

Definition at line 82 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::meAmplMapG12_[18]
private

Definition at line 83 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::mePnAmplMapG01_[18]
private

Definition at line 85 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::mePnAmplMapG16_[18]
private

Definition at line 86 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::mePnPedMapG01_[18]
private

Definition at line 88 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::mePnPedMapG16_[18]
private

Definition at line 89 of file EETestPulseTask.h.

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

bool EETestPulseTask::mergeRuns_
private

Definition at line 68 of file EETestPulseTask.h.

Referenced by beginRun(), and EETestPulseTask().

MonitorElement* EETestPulseTask::meShapeMapG01_[18]
private

Definition at line 77 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::meShapeMapG06_[18]
private

Definition at line 78 of file EETestPulseTask.h.

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

MonitorElement* EETestPulseTask::meShapeMapG12_[18]
private

Definition at line 79 of file EETestPulseTask.h.

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

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

Definition at line 74 of file EETestPulseTask.h.

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

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

Definition at line 75 of file EETestPulseTask.h.

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

std::string EETestPulseTask::prefixME_
private

Definition at line 64 of file EETestPulseTask.h.

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