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 &)
 
 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 &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const std::string & getName () const
 
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 setTime (time_t _t)
 
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)
 
- 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.

8 : DQWorkerTask() { std::fill_n(enable_, nDCC, false); }

References enable_, and ecaldqm::nDCC.

◆ ~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.

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  }

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

◆ filterRunType()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 10 of file PNDiodeTask.cc.

10  {
11  bool enable(false);
12 
13  for (int iDCC(0); iDCC < 54; iDCC++) {
14  if (_runType[iDCC] == EcalDCCHeaderBlock::LASER_STD || _runType[iDCC] == EcalDCCHeaderBlock::LASER_GAP ||
15  _runType[iDCC] == EcalDCCHeaderBlock::LED_STD || _runType[iDCC] == EcalDCCHeaderBlock::LED_GAP ||
16  _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_MGPA || _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_GAP ||
17  _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_STD || _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_GAP) {
18  enable = true;
19  enable_[iDCC] = true;
20  } else
21  enable_[iDCC] = false;
22  }
23 
24  return enable;
25  }

References particleFlowBadHcalPseudoCluster_cfi::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.

27  {
28  if (_ids.empty())
29  return;
30 
31  MESet* set(nullptr);
32 
33  switch (_collection) {
34  case kMEMTowerIdErrors:
35  set = &MEs_.at("MEMTowerId");
36  break;
38  set = &MEs_.at("MEMBlockSize");
39  break;
40  case kMEMChIdErrors:
41  set = &MEs_.at("MEMChId");
42  break;
43  case kMEMGainErrors:
44  set = &MEs_.at("MEMGain");
45  break;
46  default:
47  return;
48  }
49 
50  std::for_each(_ids.begin(), _ids.end(), [&](EcalElectronicsIdCollection::value_type const& id) {
51  if (id.towerId() == 69) {
52  edm::LogWarning("EcalDQM")
53  << "PNDiodeTask::runOnErrors : one of the ids in the electronics ID collection is unphysical in lumi "
54  "number "
55  << timestamp_.iLumi << ", event number "
56  << timestamp_
57  .iEvt; // Added March 2018 because some events have this unphysical tower ID and cause the ECAL calibration application to crash.
58  } else {
59  set->fill(EcalElectronicsId(id.dccId(), id.towerId(), 1, id.xtalId()));
60  }
61  });
62  }

References edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), ecaldqm::MESet::fill(), 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().

◆ runOnPnDigis()

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

Definition at line 64 of file PNDiodeTask.cc.

64  {
65  MESet& meOccupancy(MEs_.at("Occupancy"));
66  MESet& meOccupancySummary(MEs_.at("OccupancySummary"));
67  MESet& mePedestal(MEs_.at("Pedestal"));
68 
69  std::for_each(_digis.begin(), _digis.end(), [&](EcalPnDiodeDigiCollection::value_type const& digi) {
70  const EcalPnDiodeDetId& id(digi.id());
71 
72  if (!enable_[dccId(id) - 1])
73  return;
74 
75  meOccupancy.fill(id);
76  meOccupancySummary.fill(id);
77 
78  for (int iSample(0); iSample < 4; iSample++) {
79  if (digi.sample(iSample).gainId() != 1)
80  break;
81  mePedestal.fill(id, double(digi.sample(iSample).adc()));
82  }
83  });
84  }

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

Referenced by analyze().

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().

edm::EDCollection::value_type
T value_type
Definition: EDCollection.h:18
ecaldqm::PNDiodeTask::runOnPnDigis
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: PNDiodeTask.cc:64
ecaldqm::kMEMChIdErrors
Definition: Collections.h:21
ecaldqm::PNDiodeTask::enable_
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
EcalDCCHeaderBlock::LED_GAP
Definition: EcalDCCHeaderBlock.h:45
EcalDCCHeaderBlock::TESTPULSE_GAP
Definition: EcalDCCHeaderBlock.h:43
EcalDCCHeaderBlock::LASER_GAP
Definition: EcalDCCHeaderBlock.h:42
EcalDCCHeaderBlock::LASER_STD
Definition: EcalDCCHeaderBlock.h:26
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
EcalDCCHeaderBlock::PEDESTAL_GAP
Definition: EcalDCCHeaderBlock.h:44
ecaldqm::PNDiodeTask::runOnErrors
void runOnErrors(EcalElectronicsIdCollection const &, Collections)
Definition: PNDiodeTask.cc:27
EcalDCCHeaderBlock::TESTPULSE_MGPA
Definition: EcalDCCHeaderBlock.h:30
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
edm::LogWarning
Definition: MessageLogger.h:141
particleFlowBadHcalPseudoCluster_cfi.enable
enable
Definition: particleFlowBadHcalPseudoCluster_cfi.py:5
EcalDCCHeaderBlock::PEDESTAL_STD
Definition: EcalDCCHeaderBlock.h:31
ecaldqm::kPnDiodeDigi
Definition: Collections.h:27
ecaldqm::kMEMBlockSizeErrors
Definition: Collections.h:20
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
edm::SortedCollection::value_type
T value_type
Definition: SortedCollection.h:77
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ecaldqm::kMEMGainErrors
Definition: Collections.h:22
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:81
ecaldqm::kMEMTowerIdErrors
Definition: Collections.h:19
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92
ecaldqm::DQWorker::Timestamp::iEvt
edm::EventNumber_t iEvt
Definition: DQWorker.h:36
EcalDCCHeaderBlock::LED_STD
Definition: EcalDCCHeaderBlock.h:34
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:16