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 7 of file PNDiodeTask.cc.

References enable_, and ecaldqm::nDCC.

7  :
9  {
10  std::fill_n(enable_, nDCC, false);
11  }
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:38
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: PNDiodeTask.cc:67
bool ecaldqm::PNDiodeTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

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

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

Definition at line 38 of file PNDiodeTask.cc.

References edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), triggerObjects_cff::id, ecaldqm::kMEMBlockSizeErrors, ecaldqm::kMEMChIdErrors, ecaldqm::kMEMGainErrors, ecaldqm::kMEMTowerIdErrors, ecaldqm::DQWorker::MEs_, and ecaldqm::towerId().

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

39  {
40  if(_ids.empty()) return;
41 
42  MESet* set(nullptr);
43 
44  switch(_collection){
45  case kMEMTowerIdErrors:
46  set = &MEs_.at("MEMTowerId");
47  break;
49  set = &MEs_.at("MEMBlockSize");
50  break;
51  case kMEMChIdErrors:
52  set = &MEs_.at("MEMChId");
53  break;
54  case kMEMGainErrors:
55  set = &MEs_.at("MEMGain");
56  break;
57  default:
58  return;
59  }
60 
61  std::for_each(_ids.begin(), _ids.end(), [&](EcalElectronicsIdCollection::value_type const& id){
62  set->fill(EcalElectronicsId(id.dccId(), id.towerId(), 1, id.xtalId()));
63  });
64  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
unsigned towerId(DetId const &)
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
void ecaldqm::PNDiodeTask::runOnPnDigis ( EcalPnDiodeDigiCollection const &  _digis)

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

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