CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::LedClient Class Reference

#include <LedClient.h>

Inheritance diagram for ecaldqm::LedClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

 LedClient ()
 
void producePlots (ProcessType) override
 
 ~LedClient () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void releaseMEs () override
 
void releaseSource ()
 
virtual void resetMEs ()
 
void resetPerLumi ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
 ~DQWorkerClient () 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 &)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const EcalDQMSetupObjects getEcalDQMSetupObjects ()
 
const EcalElectronicsMappingGetElectronicsMap ()
 
const CaloGeometryGetGeometry ()
 
const std::string & getName () const
 
const CaloTopologyGetTopology ()
 
const EcalTrigTowerConstituentsMapGetTrigTowerMap ()
 
bool onlineMode () const
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

std::vector< double > expectedAmplitude_
 
std::vector< double > expectedPNAmplitude_
 
std::vector< double > expectedTiming_
 
float forwardFactor_
 
int minChannelEntries_
 
double toleranceAmplitude_
 
double toleranceAmpRMSRatio_
 
double tolerancePNAmp_
 
double tolerancePNRMSRatio_
 
double toleranceTiming_
 
double toleranceTimRMS_
 
std::map< int, unsigned > wlToME_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerClient
enum  ProcessType { kLumi, kJob, nProcessType }
 
enum  Quality {
  kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3,
  kMGood = 4, kMUnknown = 5
}
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerClient
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::DQWorkerClient
void setME (edm::ParameterSet const &_ps) final
 
void setSource (edm::ParameterSet const &) override
 
void towerAverage_ (MESet &, MESet const &, float)
 
bool using_ (std::string const &_name, ProcessType _type=kJob) const
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorkerClient
bool hasLumiPlots_
 
std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 7 of file LedClient.h.

Constructor & Destructor Documentation

◆ LedClient()

ecaldqm::LedClient::LedClient ( )

Definition at line 15 of file LedClient.cc.

◆ ~LedClient()

ecaldqm::LedClient::~LedClient ( )
inlineoverride

Definition at line 10 of file LedClient.h.

10 {}

Member Function Documentation

◆ producePlots()

void ecaldqm::LedClient::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 80 of file LedClient.cc.

80  {
83 
84  MESetMulti& meQuality(static_cast<MESetMulti&>(MEs_.at("Quality")));
85  MESetMulti& meQualitySummary(static_cast<MESetMulti&>(MEs_.at("QualitySummary")));
86  MESetMulti& meAmplitudeMean(static_cast<MESetMulti&>(MEs_.at("AmplitudeMean")));
87  MESetMulti& meAmplitudeRMS(static_cast<MESetMulti&>(MEs_.at("AmplitudeRMS")));
88  MESetMulti& meTimingMean(static_cast<MESetMulti&>(MEs_.at("TimingMean")));
89  MESetMulti& meTimingRMSMap(static_cast<MESetMulti&>(MEs_.at("TimingRMSMap")));
90  MESetMulti& mePNQualitySummary(static_cast<MESetMulti&>(MEs_.at("PNQualitySummary")));
91 
92  MESetMulti const& sAmplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
93  MESetMulti const& sTiming(static_cast<MESetMulti const&>(sources_.at("Timing")));
94  MESetMulti const& sPNAmplitude(static_cast<MESetMulti const&>(sources_.at("PNAmplitude")));
95  MESet const& sCalibStatus(static_cast<MESet const&>(sources_.at("CalibStatus")));
96 
97  for (std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) {
98  meQuality.use(wlItr->second);
99  meQualitySummary.use(wlItr->second);
100  meAmplitudeMean.use(wlItr->second);
101  meAmplitudeRMS.use(wlItr->second);
102  meTimingMean.use(wlItr->second);
103  meTimingRMSMap.use(wlItr->second);
104  mePNQualitySummary.use(wlItr->second);
105 
106  sAmplitude.use(wlItr->second);
107  sTiming.use(wlItr->second);
108  sPNAmplitude.use(wlItr->second);
109 
110  MESet::iterator qEnd(meQuality.end(GetElectronicsMap()));
111 
112  MESet::const_iterator tItr(GetElectronicsMap(), sTiming);
113  MESet::const_iterator aItr(GetElectronicsMap(), sAmplitude);
114 
115  int wl(wlItr->first + 3);
116  bool enabled(wl < 0 ? false : sCalibStatus.getBinContent(getEcalDQMSetupObjects(), wl) > 0 ? true : false);
117  for (MESet::iterator qItr(meQuality.beginChannel(GetElectronicsMap())); qItr != qEnd;
118  qItr.toNextChannel(GetElectronicsMap())) {
119  DetId id(qItr->getId());
120 
121  bool doMask(meQuality.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
122 
123  aItr = qItr;
124 
125  float aEntries(aItr->getBinEntries());
126 
127  if (aEntries < minChannelEntries_) {
128  qItr->setBinContent(enabled ? (doMask ? kMUnknown : kUnknown) : kMUnknown);
129  continue;
130  }
131 
132  float aMean(aItr->getBinContent());
133  float aRms(aItr->getBinError() * sqrt(aEntries));
134 
135  meAmplitudeMean.fill(getEcalDQMSetupObjects(), id, aMean);
136  meAmplitudeRMS.setBinContent(getEcalDQMSetupObjects(), id, aRms);
137 
138  tItr = qItr;
139 
140  float tEntries(tItr->getBinEntries());
141 
142  if (tEntries < minChannelEntries_)
143  continue;
144 
145  float tMean(tItr->getBinContent());
146  float tRms(tItr->getBinError() * sqrt(tEntries));
147 
148  meTimingMean.fill(getEcalDQMSetupObjects(), id, tMean);
149  meTimingRMSMap.setBinContent(getEcalDQMSetupObjects(), id, tRms);
150 
151  float intensity(aMean / expectedAmplitude_[wlItr->second]);
152  if (isForward(id))
153  intensity /= forwardFactor_;
154 
155  float aRmsThr(sqrt(pow(aMean * toleranceAmpRMSRatio_, 2) + pow(3., 2)));
156  if (intensity < toleranceAmplitude_ || aRms > aRmsThr ||
157  std::abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ || tRms > toleranceTimRMS_)
158  qItr->setBinContent(doMask ? kMBad : kBad);
159  else
160  qItr->setBinContent(doMask ? kMGood : kGood);
161  }
162 
163  towerAverage_(meQualitySummary, meQuality, 0.2);
164 
165  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
166  if (memDCCIndex(iDCC + 1) == unsigned(-1))
167  continue;
168  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
169  continue;
170 
171  for (unsigned iPN(0); iPN < 10; ++iPN) {
172  EcalPnDiodeDetId id(EcalEndcap, iDCC + 1, iPN + 1);
173 
174  bool doMask(mePNQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
175 
176  float pEntries(sPNAmplitude.getBinEntries(getEcalDQMSetupObjects(), id));
177 
178  if (pEntries < minChannelEntries_) {
179  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
180  continue;
181  }
182 
183  float pMean(sPNAmplitude.getBinContent(getEcalDQMSetupObjects(), id));
184  float pRms(sPNAmplitude.getBinError(getEcalDQMSetupObjects(), id) * sqrt(pEntries));
185  float intensity(pMean / expectedPNAmplitude_[wlItr->second]);
186 
187  if (intensity < tolerancePNAmp_ || pRms > pMean * tolerancePNRMSRatio_)
188  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
189  else
190  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
191  }
192  }
193  }
194  }

References funct::abs(), ecaldqm::MESetCollection::at(), ecaldqm::MESetMulti::beginChannel(), EcalEndcap, pixel_dqm_sourceclient-live_cfg::enabled, ecaldqm::MESetMulti::end(), expectedAmplitude_, expectedPNAmplitude_, expectedTiming_, ecaldqm::MESetMulti::fill(), forwardFactor_, ecaldqm::MESet::getBinContent(), ecaldqm::MESetMulti::getBinContent(), ecaldqm::MESetMulti::getBinEntries(), ecaldqm::MESetMulti::getBinError(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::GetTrigTowerMap(), triggerObjects_cff::id, ecaldqm::isForward(), ecaldqm::DQWorkerClient::kBad, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, ecaldqm::DQWorkerClient::kUnknown, EcalDQMStatusHelper::LED_MEAN_ERROR, EcalDQMStatusHelper::LED_RMS_ERROR, EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR, EcalDQMStatusHelper::LED_TIMING_RMS_ERROR, ecaldqm::MESetMulti::maskMatches(), ecaldqm::memDCCIndex(), ecaldqm::DQWorker::MEs_, minChannelEntries_, ecaldqm::nDCC, funct::pow(), ecaldqm::MESetMulti::setBinContent(), ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, toleranceAmpRMSRatio_, tolerancePNRMSRatio_, toleranceTiming_, toleranceTimRMS_, ecaldqm::MESet::iterator::toNextChannel(), ecaldqm::DQWorkerClient::towerAverage_(), funct::true, ecaldqm::MESetMulti::use(), LaserClient_cfi::wl, and wlToME_.

◆ setParams()

void ecaldqm::LedClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 30 of file LedClient.cc.

30  {
31  minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
32  toleranceAmplitude_ = _params.getUntrackedParameter<double>("toleranceAmplitude");
33  toleranceAmpRMSRatio_ = _params.getUntrackedParameter<double>("toleranceAmpRMSRatio");
34  toleranceTiming_ = _params.getUntrackedParameter<double>("toleranceTiming");
35  toleranceTimRMS_ = _params.getUntrackedParameter<double>("toleranceTimRMS");
36  tolerancePNAmp_ = _params.getUntrackedParameter<double>("tolerancePNAmp");
37  tolerancePNRMSRatio_ = _params.getUntrackedParameter<double>("tolerancePNRMSRatio");
38  forwardFactor_ = _params.getUntrackedParameter<double>("forwardFactor");
39 
40  std::vector<int> ledWavelengths(_params.getUntrackedParameter<std::vector<int> >("ledWavelengths"));
41 
42  // wavelengths are not necessarily ordered
43  // create a map wl -> MESet index
44  // using Amplitude here but any multi-wavelength plot is fine
45 
47 
48  MESetMulti const& amplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
49  unsigned nWL(ledWavelengths.size());
50  for (unsigned iWL(0); iWL != nWL; ++iWL) {
51  int wl(ledWavelengths[iWL]);
52  if (wl != 1 && wl != 2)
53  throw cms::Exception("InvalidConfiguration") << "Led Wavelength";
54  repl["wl"] = std::to_string(wl);
55  wlToME_[wl] = amplitude.getIndex(repl);
56  }
57 
58  expectedAmplitude_.resize(nWL);
59  expectedTiming_.resize(nWL);
60  expectedPNAmplitude_.resize(nWL);
61 
62  std::vector<double> inExpectedAmplitude(_params.getUntrackedParameter<std::vector<double> >("expectedAmplitude"));
63  std::vector<double> inExpectedTiming(_params.getUntrackedParameter<std::vector<double> >("expectedTiming"));
64  std::vector<double> inExpectedPNAmplitude(
65  _params.getUntrackedParameter<std::vector<double> >("expectedPNAmplitude"));
66 
67  for (std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) {
68  unsigned iME(wlItr->second);
69  int iWL(wlItr->first - 1);
70  expectedAmplitude_[iME] = inExpectedAmplitude[iWL];
71  expectedTiming_[iME] = inExpectedTiming[iWL];
72  expectedPNAmplitude_[iME] = inExpectedPNAmplitude[iWL];
73  }
74 
75  qualitySummaries_.insert("Quality");
76  qualitySummaries_.insert("QualitySummary");
77  qualitySummaries_.insert("PNQualitySummary");
78  }

References l1extraParticles_cfi::_params, CustomPhysics_cfi::amplitude, ecaldqm::MESetCollection::at(), Exception, expectedAmplitude_, expectedPNAmplitude_, expectedTiming_, forwardFactor_, CalibrationSummaryClient_cfi::ledWavelengths, minChannelEntries_, ecaldqm::DQWorkerClient::qualitySummaries_, ecaldqm::DQWorkerClient::sources_, toleranceAmplitude_, toleranceAmpRMSRatio_, tolerancePNAmp_, tolerancePNRMSRatio_, toleranceTiming_, toleranceTimRMS_, LaserClient_cfi::wl, and wlToME_.

Member Data Documentation

◆ expectedAmplitude_

std::vector<double> ecaldqm::LedClient::expectedAmplitude_
private

Definition at line 20 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ expectedPNAmplitude_

std::vector<double> ecaldqm::LedClient::expectedPNAmplitude_
private

Definition at line 26 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ expectedTiming_

std::vector<double> ecaldqm::LedClient::expectedTiming_
private

Definition at line 23 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ forwardFactor_

float ecaldqm::LedClient::forwardFactor_
private

Definition at line 29 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ minChannelEntries_

int ecaldqm::LedClient::minChannelEntries_
private

Definition at line 19 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceAmplitude_

double ecaldqm::LedClient::toleranceAmplitude_
private

Definition at line 21 of file LedClient.h.

Referenced by setParams().

◆ toleranceAmpRMSRatio_

double ecaldqm::LedClient::toleranceAmpRMSRatio_
private

Definition at line 22 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ tolerancePNAmp_

double ecaldqm::LedClient::tolerancePNAmp_
private

Definition at line 27 of file LedClient.h.

Referenced by setParams().

◆ tolerancePNRMSRatio_

double ecaldqm::LedClient::tolerancePNRMSRatio_
private

Definition at line 28 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceTiming_

double ecaldqm::LedClient::toleranceTiming_
private

Definition at line 24 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceTimRMS_

double ecaldqm::LedClient::toleranceTimRMS_
private

Definition at line 25 of file LedClient.h.

Referenced by producePlots(), and setParams().

◆ wlToME_

std::map<int, unsigned> ecaldqm::LedClient::wlToME_
private

Definition at line 17 of file LedClient.h.

Referenced by producePlots(), and setParams().

EcalDQMStatusHelper::LED_RMS_ERROR
static const int LED_RMS_ERROR
Definition: EcalDQMStatusHelper.h:40
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
EcalDQMStatusHelper::LED_MEAN_ERROR
static const int LED_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:39
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
ecaldqm::LedClient::wlToME_
std::map< int, unsigned > wlToME_
Definition: LedClient.h:17
ecaldqm::LedClient::expectedPNAmplitude_
std::vector< double > expectedPNAmplitude_
Definition: LedClient.h:26
ecaldqm::LedClient::expectedAmplitude_
std::vector< double > expectedAmplitude_
Definition: LedClient.h:20
ecaldqm::MESet::PathReplacements
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:46
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::memDCCIndex
unsigned memDCCIndex(unsigned)
Definition: EcalDQMCommonUtils.cc:46
ecaldqm::DQWorkerClient::statusManager_
StatusManager const * statusManager_
Definition: DQWorkerClient.h:60
EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR
static const int LED_TIMING_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:41
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
ecaldqm::isForward
bool isForward(DetId const &)
Definition: EcalDQMCommonUtils.cc:243
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
DetId
Definition: DetId.h:17
ecaldqm::DQWorkerClient::qualitySummaries_
std::set< std::string > qualitySummaries_
Definition: DQWorkerClient.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ecaldqm::kEBpHigh
Definition: EcalDQMCommonUtils.h:87
ecaldqm::LedClient::tolerancePNRMSRatio_
double tolerancePNRMSRatio_
Definition: LedClient.h:28
ecaldqm::DQWorker::GetTrigTowerMap
const EcalTrigTowerConstituentsMap * GetTrigTowerMap()
Definition: DQWorker.cc:110
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:104
ecaldqm::DQWorkerClient::kMBad
Definition: DQWorkerClient.h:37
EcalEndcap
Definition: EcalSubdetector.h:10
ecaldqm::DQWorkerClient::kUnknown
Definition: DQWorkerClient.h:37
ecaldqm::DQWorkerClient::kBad
Definition: DQWorkerClient.h:37
funct::true
true
Definition: Factorize.h:173
ecaldqm::DQWorkerClient::sources_
MESetCollection sources_
Definition: DQWorkerClient.h:55
ecaldqm::LedClient::forwardFactor_
float forwardFactor_
Definition: LedClient.h:29
ecaldqm::DQWorkerClient::kMGood
Definition: DQWorkerClient.h:37
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::DQWorkerClient::kMUnknown
Definition: DQWorkerClient.h:37
ecaldqm::LedClient::toleranceTiming_
double toleranceTiming_
Definition: LedClient.h:24
ecaldqm::kEBmLow
Definition: EcalDQMCommonUtils.h:84
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
EcalDQMStatusHelper::LED_TIMING_RMS_ERROR
static const int LED_TIMING_RMS_ERROR
Definition: EcalDQMStatusHelper.h:42
CalibrationSummaryClient_cfi.ledWavelengths
ledWavelengths
Definition: CalibrationSummaryClient_cfi.py:16
ecaldqm::LedClient::toleranceTimRMS_
double toleranceTimRMS_
Definition: LedClient.h:25
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
ecaldqm::LedClient::minChannelEntries_
int minChannelEntries_
Definition: LedClient.h:19
ecaldqm::LedClient::toleranceAmplitude_
double toleranceAmplitude_
Definition: LedClient.h:21
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ecaldqm::DQWorkerClient::towerAverage_
void towerAverage_(MESet &, MESet const &, float)
Definition: DQWorkerClient.cc:159
ecaldqm::DQWorkerClient::kGood
Definition: DQWorkerClient.h:37
Exception
Definition: hltDiff.cc:245
ecaldqm::LedClient::tolerancePNAmp_
double tolerancePNAmp_
Definition: LedClient.h:27
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ecaldqm::LedClient::expectedTiming_
std::vector< double > expectedTiming_
Definition: LedClient.h:23
pixel_dqm_sourceclient-live_cfg.enabled
enabled
Definition: pixel_dqm_sourceclient-live_cfg.py:136
ecaldqm::LedClient::toleranceAmpRMSRatio_
double toleranceAmpRMSRatio_
Definition: LedClient.h:22