CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
ecaldqm::PNDiodeTask Class Reference

#include <PNDiodeTask.h>

Inheritance diagram for ecaldqm::PNDiodeTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
bool filterRunType (short const *) override
 
 PNDiodeTask ()
 
void runOnErrors (EcalElectronicsIdCollection const &, Collections)
 
void runOnPnDigis (EcalPnDiodeDigiCollection const &)
 
 ~PNDiodeTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Protected Attributes

bool enable_ [ecaldqm::nDCC]
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setParams (edm::ParameterSet const &)
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 

Detailed Description

Definition at line 13 of file PNDiodeTask.h.

Constructor & Destructor Documentation

◆ PNDiodeTask()

ecaldqm::PNDiodeTask::PNDiodeTask ( )

Definition at line 8 of file PNDiodeTask.cc.

References enable_, and ecaldqm::nDCC.

8 : DQWorkerTask() { std::fill_n(enable_, nDCC, false); }
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26

◆ ~PNDiodeTask()

ecaldqm::PNDiodeTask::~PNDiodeTask ( )
inlineoverride

Definition at line 16 of file PNDiodeTask.h.

16 {}

Member Function Documentation

◆ analyze()

bool ecaldqm::PNDiodeTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 29 of file PNDiodeTask.h.

References ecaldqm::kMEMBlockSizeErrors, ecaldqm::kMEMChIdErrors, ecaldqm::kMEMGainErrors, ecaldqm::kMEMTowerIdErrors, ecaldqm::kPnDiodeDigi, runOnErrors(), and runOnPnDigis().

29  {
30  switch (_collection) {
31  case kMEMTowerIdErrors:
33  case kMEMChIdErrors:
34  case kMEMGainErrors:
35  if (_p)
36  runOnErrors(*static_cast<EcalElectronicsIdCollection const*>(_p), _collection);
37  return true;
38  break;
39  case kPnDiodeDigi:
40  if (_p)
41  runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
42  return true;
43  break;
44  default:
45  break;
46  }
47 
48  return false;
49  }
void runOnErrors(EcalElectronicsIdCollection const &, Collections)
Definition: PNDiodeTask.cc:27
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: PNDiodeTask.cc:77

◆ filterRunType()

bool ecaldqm::PNDiodeTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 10 of file PNDiodeTask.cc.

References remoteMonitoring_LED_IterMethod_cfg::enable, enable_, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDCCHeaderBlock::TESTPULSE_GAP, and EcalDCCHeaderBlock::TESTPULSE_MGPA.

◆ runOnErrors()

void ecaldqm::PNDiodeTask::runOnErrors ( EcalElectronicsIdCollection const &  _ids,
Collections  _collection 
)

Definition at line 27 of file PNDiodeTask.cc.

References ecaldqm::MESetCollection::at(), edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iEvt, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kMEMBlockSizeErrors, ecaldqm::kMEMChIdErrors, ecaldqm::kMEMGainErrors, ecaldqm::kMEMTowerIdErrors, ecaldqm::DQWorker::MEs_, ecaldqm::DQWorker::timestamp_, and ecaldqm::towerId().

Referenced by analyze().

27  {
28  if (_ids.empty())
29  return;
30 
31  MESet* meMEMErrors = &MEs_.at("MEMErrors");
32 
33  // MEM Box Integrity Errors (TowerIds 69 and 70)
34  // errorType matches to the following labels in DQM plot
35  // 0 = TOWERID
36  // 1 = BLOCKSIZE
37  // 2 = CHID
38  // 3 = GAIN
39  int errorType(-1);
40  switch (_collection) {
41  case kMEMTowerIdErrors:
42  errorType = 0;
43  break;
45  errorType = 1;
46  break;
47  case kMEMChIdErrors:
48  errorType = 2;
49  break;
50  case kMEMGainErrors:
51  errorType = 3;
52  break;
53  default:
54  return;
55  }
56 
57  // Integrity errors for MEM boxes (towerIds 69/70)
58  // Plot contains two bins per dccId. Integer number
59  // bins correspond to towerId 69 and half integer
60  // number bins correspond to towerId 70.
61  std::for_each(_ids.begin(),
62  _ids.end(),
64  if (id.towerId() == 69)
65  meMEMErrors->fill(getEcalDQMSetupObjects(), id.dccId() + 0.0, errorType);
66  else if (id.towerId() == 70)
67  meMEMErrors->fill(getEcalDQMSetupObjects(), id.dccId() + 0.5, errorType);
68  else {
69  edm::LogWarning("EcalDQM")
70  << "PNDiodeTask::runOnErrors : one of the ids in the electronics ID collection does not "
71  << "correspond to one of the MEM box towerIds (69/70) in lumi number " << timestamp_.iLumi
72  << ", event number " << timestamp_.iEvt;
73  }
74  });
75  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Timestamp timestamp_
Definition: DQWorker.h:134
edm::EventNumber_t iEvt
Definition: DQWorker.h:49
MESetCollection MEs_
Definition: DQWorker.h:131
Log< level::Warning, false > LogWarning

◆ runOnPnDigis()

void ecaldqm::PNDiodeTask::runOnPnDigis ( EcalPnDiodeDigiCollection const &  _digis)

Definition at line 77 of file PNDiodeTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ecaldqm::dccId(), enable_, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), triggerObjects_cff::id, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

77  {
78  MESet& meOccupancy(MEs_.at("Occupancy"));
79  MESet& meOccupancySummary(MEs_.at("OccupancySummary"));
80  MESet& mePedestal(MEs_.at("Pedestal"));
81 
82  std::for_each(_digis.begin(), _digis.end(), [&](EcalPnDiodeDigiCollection::value_type const& digi) {
83  const EcalPnDiodeDetId& id(digi.id());
84 
85  if (!enable_[dccId(id, GetElectronicsMap()) - 1])
86  return;
87 
88  meOccupancy.fill(getEcalDQMSetupObjects(), id);
89  meOccupancySummary.fill(getEcalDQMSetupObjects(), id);
90 
91  for (int iSample(0); iSample < 4; iSample++) {
92  if (digi.sample(iSample).gainId() != 1)
93  break;
94  mePedestal.fill(getEcalDQMSetupObjects(), id, double(digi.sample(iSample).adc()));
95  }
96  });
97  }
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131

Member Data Documentation

◆ enable_

bool ecaldqm::PNDiodeTask::enable_[ecaldqm::nDCC]
protected

Definition at line 26 of file PNDiodeTask.h.

Referenced by filterRunType(), PNDiodeTask(), and runOnPnDigis().