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 ()
 
- 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 &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
 ~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 &)
 
std::string const & 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 ()(false)
 

Protected Attributes

bool enable_ [ecaldqm::nDCC]
 
- Protected Attributes inherited from ecaldqm::DQWorkerTask
std::set< std::string > resettable_
 
- 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 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

ecaldqm::PNDiodeTask::PNDiodeTask ( )

Definition at line 8 of file PNDiodeTask.cc.

References enable_, and ecaldqm::nDCC.

8  :
10  {
11  std::fill_n(enable_, nDCC, false);
12  }
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26
ecaldqm::PNDiodeTask::~PNDiodeTask ( )
inline

Definition at line 16 of file PNDiodeTask.h.

References analyze(), filterRunType(), runOnErrors(), and runOnPnDigis().

16 {}

Member Function Documentation

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

Referenced by ~PNDiodeTask().

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 15 of file PNDiodeTask.cc.

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

Referenced by ~PNDiodeTask().

16  {
17  bool enable(false);
18 
19  for(int iDCC(0); iDCC < 54; iDCC++){
20  if(_runType[iDCC] == EcalDCCHeaderBlock::LASER_STD ||
21  _runType[iDCC] == EcalDCCHeaderBlock::LASER_GAP ||
22  _runType[iDCC] == EcalDCCHeaderBlock::LED_STD ||
23  _runType[iDCC] == EcalDCCHeaderBlock::LED_GAP ||
24  _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
25  _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_GAP ||
26  _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_STD ||
27  _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_GAP){
28  enable = true;
29  enable_[iDCC] = true;
30  }
31  else
32  enable_[iDCC] = false;
33  }
34 
35  return enable;
36  }
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26
void ecaldqm::PNDiodeTask::runOnErrors ( EcalElectronicsIdCollection const &  _ids,
Collections  _collection 
)

Definition at line 39 of file PNDiodeTask.cc.

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

40  {
41  if(_ids.empty()) return;
42 
43  MESet* set(nullptr);
44 
45  switch(_collection){
46  case kMEMTowerIdErrors:
47  set = &MEs_.at("MEMTowerId");
48  break;
50  set = &MEs_.at("MEMBlockSize");
51  break;
52  case kMEMChIdErrors:
53  set = &MEs_.at("MEMChId");
54  break;
55  case kMEMGainErrors:
56  set = &MEs_.at("MEMGain");
57  break;
58  default:
59  return;
60  }
61 
62  std::for_each(_ids.begin(), _ids.end(), [&](EcalElectronicsIdCollection::value_type const& id){
63  if (id.towerId() == 69) {
64  edm::LogWarning("EcalDQM") << "PNDiodeTask::runOnErrors : one of the ids in the electronics ID collection is unphysical in lumi number " << timestamp_.iLumi << ", event number " << timestamp_.iEvt; // Added March 2018 because some events have this unphysical tower ID and cause the ECAL calibration application to crash.
65  }
66  else {
67  set->fill(EcalElectronicsId(id.dccId(), id.towerId(), 1, id.xtalId()));
68  }
69  });
70  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
unsigned towerId(DetId const &)
Timestamp timestamp_
Definition: DQWorker.h:78
edm::EventNumber_t iEvt
Definition: DQWorker.h:36
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
void ecaldqm::PNDiodeTask::runOnPnDigis ( EcalPnDiodeDigiCollection const &  _digis)

Definition at line 73 of file PNDiodeTask.cc.

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

Referenced by analyze(), and ~PNDiodeTask().

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

Member Data Documentation

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

Definition at line 26 of file PNDiodeTask.h.

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