CMS 3D CMS Logo

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

#include <LaserClient.h>

Inheritance diagram for ecaldqm::LaserClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

 LaserClient ()
 
void producePlots (ProcessType) override
 
 ~LaserClient () 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)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~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 &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
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
 
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)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

std::vector< float > expectedAmplitude_
 
std::vector< float > expectedPNAmplitude_
 
std::vector< float > expectedTiming_
 
float forwardFactor_
 
int minChannelEntries_
 
float toleranceAmplitudeFwdLo_
 
float toleranceAmplitudeHi_
 
float toleranceAmplitudeLo_
 
float toleranceAmpRMSRatio_
 
float tolerancePNAmp_
 
float tolerancePNRMSRatio_
 
float toleranceTiming_
 
float 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)
 
- 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::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 LaserClient.h.

Constructor & Destructor Documentation

◆ LaserClient()

ecaldqm::LaserClient::LaserClient ( )

Definition at line 15 of file LaserClient.cc.

16  : DQWorkerClient(),
17  wlToME_(),
24  expectedTiming_(0),
25  toleranceTiming_(0.),
26  toleranceTimRMS_(0.),
28  tolerancePNAmp_(0.),
30  forwardFactor_(0.) {}
std::map< int, unsigned > wlToME_
Definition: LaserClient.h:17
float toleranceAmplitudeFwdLo_
Definition: LaserClient.h:22
std::vector< float > expectedPNAmplitude_
Definition: LaserClient.h:28
std::vector< float > expectedAmplitude_
Definition: LaserClient.h:20
std::vector< float > expectedTiming_
Definition: LaserClient.h:25

◆ ~LaserClient()

ecaldqm::LaserClient::~LaserClient ( )
inlineoverride

Definition at line 10 of file LaserClient.h.

10 {}

Member Function Documentation

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 84 of file LaserClient.cc.

References funct::abs(), ecaldqm::MESetCollection::at(), ecaldqm::MESetMulti::beginChannel(), EcalBarrel, EcalEndcap, cms::soa::RestrictQualify::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(), l1ctLayer2EG_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::LASER_MEAN_ERROR, EcalDQMStatusHelper::LASER_RMS_ERROR, EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR, EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, ecaldqm::MESetMulti::maskMatches(), ecaldqm::memDCCIndex(), ecaldqm::DQWorker::MEs_, minChannelEntries_, ecaldqm::nDCC, ecaldqm::MESetMulti::setBinContent(), ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, toleranceAmplitudeFwdLo_, toleranceAmplitudeHi_, toleranceAmplitudeLo_, toleranceAmpRMSRatio_, tolerancePNRMSRatio_, toleranceTiming_, ecaldqm::MESet::iterator::toNextChannel(), ecaldqm::DQWorkerClient::towerAverage_(), funct::true, ecaldqm::MESetMulti::use(), LaserClient_cfi::wl, and wlToME_.

84  {
87 
88  MESetMulti& meQuality(static_cast<MESetMulti&>(MEs_.at("Quality")));
89  MESetMulti& meQualitySummary(static_cast<MESetMulti&>(MEs_.at("QualitySummary")));
90  MESetMulti& meAmplitudeMean(static_cast<MESetMulti&>(MEs_.at("AmplitudeMean")));
91  MESetMulti& meAmplitudeRMS(static_cast<MESetMulti&>(MEs_.at("AmplitudeRMS")));
92  MESetMulti& meTimingMean(static_cast<MESetMulti&>(MEs_.at("TimingMean")));
93  MESetMulti& meTimingRMSMap(static_cast<MESetMulti&>(MEs_.at("TimingRMSMap")));
94  MESetMulti& meTimingRMS(static_cast<MESetMulti&>(MEs_.at("TimingRMS")));
95  MESetMulti& mePNQualitySummary(static_cast<MESetMulti&>(MEs_.at("PNQualitySummary")));
96 
97  MESetMulti const& sAmplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
98  MESetMulti const& sTiming(static_cast<MESetMulti const&>(sources_.at("Timing")));
99  MESetMulti const& sPNAmplitude(static_cast<MESetMulti const&>(sources_.at("PNAmplitude")));
100  MESet const& sCalibStatus(static_cast<MESet const&>(sources_.at("CalibStatus")));
101 
102  for (std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) {
103  meQuality.use(wlItr->second);
104  meQualitySummary.use(wlItr->second);
105  meAmplitudeMean.use(wlItr->second);
106  meAmplitudeRMS.use(wlItr->second);
107  meTimingMean.use(wlItr->second);
108  meTimingRMSMap.use(wlItr->second);
109  meTimingRMS.use(wlItr->second);
110  mePNQualitySummary.use(wlItr->second);
111 
112  sAmplitude.use(wlItr->second);
113  sTiming.use(wlItr->second);
114  sPNAmplitude.use(wlItr->second);
115 
116  MESet::iterator qEnd(meQuality.end(GetElectronicsMap()));
117 
118  MESet::const_iterator tItr(GetElectronicsMap(), sTiming);
119  MESet::const_iterator aItr(GetElectronicsMap(), sAmplitude);
120 
121  int wl(wlItr->first - 1);
122  bool enabled(wl < 0 ? false : sCalibStatus.getBinContent(getEcalDQMSetupObjects(), wl) > 0 ? true : false);
123  for (MESet::iterator qItr(meQuality.beginChannel(GetElectronicsMap())); qItr != qEnd;
124  qItr.toNextChannel(GetElectronicsMap())) {
125  DetId id(qItr->getId());
126 
127  bool doMask(meQuality.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
128 
129  aItr = qItr;
130 
131  float aEntries(aItr->getBinEntries());
132 
133  if (aEntries < minChannelEntries_) {
134  qItr->setBinContent(enabled ? (doMask ? kMUnknown : kUnknown) : kMUnknown);
135  continue;
136  }
137 
138  float aMean(aItr->getBinContent());
139  float aRms(aItr->getBinError() * sqrt(aEntries));
140 
141  meAmplitudeMean.fill(getEcalDQMSetupObjects(), id, aMean);
142  meAmplitudeRMS.setBinContent(getEcalDQMSetupObjects(), id, aRms);
143 
144  tItr = qItr;
145 
146  float tEntries(tItr->getBinEntries());
147 
148  if (tEntries < minChannelEntries_)
149  continue;
150 
151  float tMean(tItr->getBinContent());
152  float tRms(tItr->getBinError() * sqrt(tEntries));
153  float threshAmplitudeLo_;
154 
155  meTimingMean.fill(getEcalDQMSetupObjects(), id, tMean);
156  meTimingRMS.fill(getEcalDQMSetupObjects(), id, tRms);
157  meTimingRMSMap.setBinContent(getEcalDQMSetupObjects(), id, tRms);
158 
159  float intensity(aMean / expectedAmplitude_[wlItr->second]);
160  if (isForward(id)) {
161  intensity /= forwardFactor_;
162  threshAmplitudeLo_ = toleranceAmplitudeFwdLo_;
163  } else
164  threshAmplitudeLo_ = toleranceAmplitudeLo_;
165 
166  if (intensity < threshAmplitudeLo_ || intensity > toleranceAmplitudeHi_ ||
167  aRms > aMean * toleranceAmpRMSRatio_ ||
168  std::abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ /*|| tRms > toleranceTimRMS_*/)
169  qItr->setBinContent(doMask ? kMBad : kBad);
170  else
171  qItr->setBinContent(doMask ? kMGood : kGood);
172  }
173 
174  towerAverage_(meQualitySummary, meQuality, 0.2);
175 
176  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
177  if (memDCCIndex(iDCC + 1) == unsigned(-1))
178  continue;
179  int subdet(0);
180  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
181  subdet = EcalBarrel;
182  else
183  subdet = EcalEndcap;
184 
185  for (unsigned iPN(0); iPN < 10; ++iPN) {
186  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
187 
188  bool doMask(mePNQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
189 
190  float pEntries(sPNAmplitude.getBinEntries(getEcalDQMSetupObjects(), id));
191 
192  if (pEntries < minChannelEntries_) {
193  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
194  continue;
195  }
196 
197  float pMean(sPNAmplitude.getBinContent(getEcalDQMSetupObjects(), id));
198  float pRms(sPNAmplitude.getBinError(getEcalDQMSetupObjects(), id) * sqrt(pEntries));
199  float intensity(pMean / expectedPNAmplitude_[wlItr->second]);
200 
201  if (intensity < tolerancePNAmp_ || pRms > pMean * tolerancePNRMSRatio_)
202  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
203  else
204  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
205  }
206  }
207  }
208  }
unsigned memDCCIndex(unsigned)
static const int LASER_MEAN_ERROR
void towerAverage_(MESet &, MESet const &, float)
MESet & at(const std::string &key)
Definition: MESet.h:399
static const int LASER_TIMING_RMS_ERROR
bool isForward(DetId const &)
std::map< int, unsigned > wlToME_
Definition: LaserClient.h:17
constexpr bool enabled
Definition: SoACommon.h:73
float toleranceAmplitudeFwdLo_
Definition: LaserClient.h:22
std::vector< float > expectedPNAmplitude_
Definition: LaserClient.h:28
T sqrt(T t)
Definition: SSEVec.h:19
StatusManager const * statusManager_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MESetCollection sources_
std::vector< float > expectedAmplitude_
Definition: LaserClient.h:20
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:131
static const int LASER_TIMING_MEAN_ERROR
std::vector< float > expectedTiming_
Definition: LaserClient.h:25
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155
static const int LASER_RMS_ERROR

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 32 of file LaserClient.cc.

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

32  {
33  minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
34  toleranceAmplitudeLo_ = _params.getUntrackedParameter<double>("toleranceAmplitudeLo");
35  toleranceAmplitudeFwdLo_ = _params.getUntrackedParameter<double>("toleranceAmplitudeFwdLo");
36  toleranceAmplitudeHi_ = _params.getUntrackedParameter<double>("toleranceAmplitudeHi");
37  toleranceAmpRMSRatio_ = _params.getUntrackedParameter<double>("toleranceAmpRMSRatio");
38  toleranceTiming_ = _params.getUntrackedParameter<double>("toleranceTiming");
39  toleranceTimRMS_ = _params.getUntrackedParameter<double>("toleranceTimRMS");
40  tolerancePNAmp_ = _params.getUntrackedParameter<double>("tolerancePNAmp");
41  tolerancePNRMSRatio_ = _params.getUntrackedParameter<double>("tolerancePNRMSRatio");
42  forwardFactor_ = _params.getUntrackedParameter<double>("forwardFactor");
43 
44  std::vector<int> laserWavelengths(_params.getUntrackedParameter<std::vector<int> >("laserWavelengths"));
45 
46  // wavelengths are not necessarily ordered
47  // create a map wl -> MESet index
48  // using Amplitude here but any multi-wavelength plot is fine
49 
51 
52  MESetMulti const& amplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
53  unsigned nWL(laserWavelengths.size());
54  for (unsigned iWL(0); iWL != nWL; ++iWL) {
55  int wl(laserWavelengths[iWL]);
56  if (wl <= 0 || wl >= 5)
57  throw cms::Exception("InvalidConfiguration") << "Laser Wavelength";
58  repl["wl"] = std::to_string(wl);
59  wlToME_[wl] = amplitude.getIndex(repl);
60  }
61 
62  expectedAmplitude_.resize(nWL);
63  expectedTiming_.resize(nWL);
64  expectedPNAmplitude_.resize(nWL);
65 
66  std::vector<double> inExpectedAmplitude(_params.getUntrackedParameter<std::vector<double> >("expectedAmplitude"));
67  std::vector<double> inExpectedTiming(_params.getUntrackedParameter<std::vector<double> >("expectedTiming"));
68  std::vector<double> inExpectedPNAmplitude(
69  _params.getUntrackedParameter<std::vector<double> >("expectedPNAmplitude"));
70 
71  for (std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr) {
72  unsigned iME(wlItr->second);
73  int iWL(wlItr->first - 1);
74  expectedAmplitude_[iME] = inExpectedAmplitude[iWL];
75  expectedTiming_[iME] = inExpectedTiming[iWL];
76  expectedPNAmplitude_[iME] = inExpectedPNAmplitude[iWL];
77  }
78 
79  qualitySummaries_.insert("Quality");
80  qualitySummaries_.insert("QualitySummary");
81  qualitySummaries_.insert("PNQualitySummary");
82  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::map< int, unsigned > wlToME_
Definition: LaserClient.h:17
static std::string to_string(const XMLCh *ch)
float toleranceAmplitudeFwdLo_
Definition: LaserClient.h:22
std::set< std::string > qualitySummaries_
std::vector< float > expectedPNAmplitude_
Definition: LaserClient.h:28
MESetCollection sources_
std::vector< float > expectedAmplitude_
Definition: LaserClient.h:20
std::vector< float > expectedTiming_
Definition: LaserClient.h:25
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:46

Member Data Documentation

◆ expectedAmplitude_

std::vector<float> ecaldqm::LaserClient::expectedAmplitude_
private

Definition at line 20 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ expectedPNAmplitude_

std::vector<float> ecaldqm::LaserClient::expectedPNAmplitude_
private

Definition at line 28 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ expectedTiming_

std::vector<float> ecaldqm::LaserClient::expectedTiming_
private

Definition at line 25 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ forwardFactor_

float ecaldqm::LaserClient::forwardFactor_
private

Definition at line 31 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ minChannelEntries_

int ecaldqm::LaserClient::minChannelEntries_
private

Definition at line 19 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceAmplitudeFwdLo_

float ecaldqm::LaserClient::toleranceAmplitudeFwdLo_
private

Definition at line 22 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceAmplitudeHi_

float ecaldqm::LaserClient::toleranceAmplitudeHi_
private

Definition at line 23 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceAmplitudeLo_

float ecaldqm::LaserClient::toleranceAmplitudeLo_
private

Definition at line 21 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceAmpRMSRatio_

float ecaldqm::LaserClient::toleranceAmpRMSRatio_
private

Definition at line 24 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ tolerancePNAmp_

float ecaldqm::LaserClient::tolerancePNAmp_
private

Definition at line 29 of file LaserClient.h.

Referenced by setParams().

◆ tolerancePNRMSRatio_

float ecaldqm::LaserClient::tolerancePNRMSRatio_
private

Definition at line 30 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceTiming_

float ecaldqm::LaserClient::toleranceTiming_
private

Definition at line 26 of file LaserClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceTimRMS_

float ecaldqm::LaserClient::toleranceTimRMS_
private

Definition at line 27 of file LaserClient.h.

Referenced by setParams().

◆ wlToME_

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

Definition at line 17 of file LaserClient.h.

Referenced by producePlots(), and setParams().