CMS 3D CMS Logo

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

#include <CalibrationSummaryClient.h>

Inheritance diagram for ecaldqm::CalibrationSummaryClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

 CalibrationSummaryClient ()
 
void producePlots (ProcessType) override
 
 ~CalibrationSummaryClient () 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::map< int, unsigned > laserWlToME_
 
std::map< int, unsigned > ledWlToME_
 
std::map< int, unsigned > pedGainToME_
 
std::map< int, unsigned > pedPNGainToME_
 
std::map< int, unsigned > tpGainToME_
 
std::map< int, unsigned > tpPNGainToME_
 

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 8 of file CalibrationSummaryClient.h.

Constructor & Destructor Documentation

◆ CalibrationSummaryClient()

ecaldqm::CalibrationSummaryClient::CalibrationSummaryClient ( )

Definition at line 13 of file CalibrationSummaryClient.cc.

14  : DQWorkerClient(),
15  laserWlToME_(),
16  ledWlToME_(),
17  tpGainToME_(),
18  tpPNGainToME_(),
19  pedGainToME_(),
20  pedPNGainToME_() {}
std::map< int, unsigned > pedPNGainToME_

◆ ~CalibrationSummaryClient()

ecaldqm::CalibrationSummaryClient::~CalibrationSummaryClient ( )
inlineoverride

Definition at line 11 of file CalibrationSummaryClient.h.

11 {}

Member Function Documentation

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 127 of file CalibrationSummaryClient.cc.

References ecaldqm::MESetCollection::at(), EcalBarrel, EcalEndcap, ecaldqm::MESetMulti::getBinContent(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), l1ctLayer2EG_cff::id, ecaldqm::DQWorkerClient::kBad, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::DQWorkerClient::kGood, laserWlToME_, ledWlToME_, ecaldqm::memDCCIndex(), ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, pedGainToME_, pedPNGainToME_, ecaldqm::DQWorkerClient::sources_, mps_update::status, ecaldqm::MESet::iterator::toNextChannel(), tpGainToME_, tpPNGainToME_, ecaldqm::MESetMulti::use(), and ecaldqm::DQWorkerClient::using_().

127  {
128  using namespace std;
129 
130  MESet& meQualitySummary(MEs_.at("QualitySummary"));
131  MESet& mePNQualitySummary(MEs_.at("PNQualitySummary"));
132 
133  MESetMulti const* sLaser(using_("Laser") ? static_cast<MESetMulti const*>(&sources_.at("Laser")) : nullptr);
134  MESetMulti const* sLaserPN(using_("LaserPN") ? static_cast<MESetMulti const*>(&sources_.at("LaserPN")) : nullptr);
135  MESetMulti const* sLed(using_("Led") ? static_cast<MESetMulti const*>(&sources_.at("Led")) : nullptr);
136  MESetMulti const* sLedPN(using_("LedPN") ? static_cast<MESetMulti const*>(&sources_.at("LedPN")) : nullptr);
137  MESetMulti const* sTestPulse(using_("TestPulse") ? static_cast<MESetMulti const*>(&sources_.at("TestPulse"))
138  : nullptr);
139  MESetMulti const* sTestPulsePN(using_("TestPulsePN") ? static_cast<MESetMulti const*>(&sources_.at("TestPulsePN"))
140  : nullptr);
141  MESetMulti const* sPedestal(using_("Pedestal") ? static_cast<MESetMulti const*>(&sources_.at("Pedestal"))
142  : nullptr);
143  MESetMulti const* sPedestalPN(using_("PedestalPN") ? static_cast<MESetMulti const*>(&sources_.at("PedestalPN"))
144  : nullptr);
145  MESet const& sPNIntegrity(sources_.at("PNIntegrity"));
146 
147  MESet::iterator qEnd(meQualitySummary.end(GetElectronicsMap()));
148  for (MESet::iterator qItr(meQualitySummary.beginChannel(GetElectronicsMap())); qItr != qEnd;
149  qItr.toNextChannel(GetElectronicsMap())) {
150  DetId id(qItr->getId());
151 
152  int status(kGood);
153 
154  if (status == kGood && sLaser) {
155  for (map<int, unsigned>::iterator wlItr(laserWlToME_.begin()); wlItr != laserWlToME_.end(); ++wlItr) {
156  sLaser->use(wlItr->second);
157  if (sLaser->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
158  status = kBad;
159  break;
160  }
161  }
162  }
163 
164  if (status == kGood && sLed) {
165  DetId id(qItr->getId());
166  if (id.subdetId() == EcalEndcap) {
167  for (map<int, unsigned>::iterator wlItr(ledWlToME_.begin()); wlItr != ledWlToME_.end(); ++wlItr) {
168  sLed->use(wlItr->second);
169  if (sLed->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
170  status = kBad;
171  break;
172  }
173  }
174  }
175  }
176 
177  if (status == kGood && sTestPulse) {
178  for (map<int, unsigned>::iterator gainItr(tpGainToME_.begin()); gainItr != tpGainToME_.end(); ++gainItr) {
179  sTestPulse->use(gainItr->second);
180  if (sTestPulse->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
181  status = kBad;
182  break;
183  }
184  }
185  }
186 
187  if (status == kGood && sPedestal) {
188  for (map<int, unsigned>::iterator gainItr(pedGainToME_.begin()); gainItr != pedGainToME_.end(); ++gainItr) {
189  sPedestal->use(gainItr->second);
190  if (sPedestal->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
191  status = kBad;
192  break;
193  }
194  }
195  }
196 
197  qItr->setBinContent(status);
198  }
199 
200  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
201  if (memDCCIndex(iDCC + 1) == unsigned(-1))
202  continue;
203  for (unsigned iPN(0); iPN < 10; ++iPN) {
204  int subdet(0);
205  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
206  subdet = EcalBarrel;
207  else
208  subdet = EcalEndcap;
209 
210  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
211 
212  int status(kGood);
213 
214  if (sPNIntegrity.getBinContent(getEcalDQMSetupObjects(), id) == kBad)
215  status = kBad;
216 
217  if (status == kGood && sLaserPN) {
218  for (map<int, unsigned>::iterator wlItr(laserWlToME_.begin()); wlItr != laserWlToME_.end(); ++wlItr) {
219  sLaserPN->use(wlItr->second);
220  if (sLaserPN->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
221  status = kBad;
222  break;
223  }
224  }
225  }
226 
227  if (status == kGood && sLedPN) {
228  for (map<int, unsigned>::iterator wlItr(ledWlToME_.begin()); wlItr != ledWlToME_.end(); ++wlItr) {
229  sLedPN->use(wlItr->second);
230  if (sLedPN->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
231  status = kBad;
232  break;
233  }
234  }
235  }
236 
237  if (status == kGood && sTestPulsePN) {
238  for (map<int, unsigned>::iterator gainItr(tpPNGainToME_.begin()); gainItr != tpPNGainToME_.end(); ++gainItr) {
239  sTestPulsePN->use(gainItr->second);
240  if (sTestPulsePN->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
241  status = kBad;
242  break;
243  }
244  }
245  }
246 
247  if (status == kGood && sPedestalPN) {
248  for (map<int, unsigned>::iterator gainItr(pedPNGainToME_.begin()); gainItr != pedPNGainToME_.end();
249  ++gainItr) {
250  sPedestalPN->use(gainItr->second);
251  if (sPedestalPN->getBinContent(getEcalDQMSetupObjects(), id) == kBad) {
252  status = kBad;
253  break;
254  }
255  }
256  }
257 
258  mePNQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, status);
259  }
260  }
261  }
unsigned memDCCIndex(unsigned)
MESet & at(const std::string &key)
Definition: MESet.h:399
std::map< int, unsigned > pedPNGainToME_
bool using_(std::string const &_name, ProcessType _type=kJob) const
MESetCollection sources_
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:131

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file CalibrationSummaryClient.cc.

References l1extraParticles_cfi::_params, ecaldqm::MESetCollection::at(), ecaldqm::MESetCollection::erase(), Exception, spr::find(), PedestalClient_cfi::gain, ecaldqm::MESetMulti::getIndex(), EcalCondDBWriter_cfi::laser, CalibrationSummaryClient_cfi::laserWavelengths, laserWlToME_, EcalCondDBWriter_cfi::led, CalibrationSummaryClient_cfi::ledWavelengths, ledWlToME_, pedGainToME_, pedPNGainToME_, ecaldqm::DQWorkerClient::qualitySummaries_, ecaldqm::DQWorkerClient::sources_, AlCaHLTBitMon_QueryRunRegistry::string, cond::impl::to_string(), cmsswSequenceInfo::tp, tpGainToME_, tpPNGainToME_, ecaldqm::DQWorkerClient::using_(), and LaserClient_cfi::wl.

22  {
23  std::vector<std::string> sourceList(_params.getUntrackedParameter<std::vector<std::string> >("activeSources"));
24  if (std::find(sourceList.begin(), sourceList.end(), "Laser") == sourceList.end()) {
25  sources_.erase(std::string("Laser"));
26  sources_.erase(std::string("LaserPN"));
27  }
28  if (std::find(sourceList.begin(), sourceList.end(), "Led") == sourceList.end()) {
29  sources_.erase(std::string("Led"));
30  sources_.erase(std::string("LedPN"));
31  }
32  if (std::find(sourceList.begin(), sourceList.end(), "TestPulse") == sourceList.end()) {
33  sources_.erase(std::string("TestPulse"));
34  sources_.erase(std::string("TestPulsePN"));
35  }
36  if (std::find(sourceList.begin(), sourceList.end(), "Pedestal") == sourceList.end()) {
37  sources_.erase(std::string("Pedestal"));
38  sources_.erase(std::string("PedestalPN"));
39  }
40 
42 
43  if (using_("Laser")) {
44  repl.clear();
45  std::vector<int> laserWavelengths(_params.getUntrackedParameter<std::vector<int> >("laserWavelengths"));
46  MESetMulti const& laser(static_cast<MESetMulti const&>(sources_.at("Laser")));
47  unsigned nWL(laserWavelengths.size());
48  for (unsigned iWL(0); iWL != nWL; ++iWL) {
49  int wl(laserWavelengths[iWL]);
50  if (wl <= 0 || wl >= 5)
51  throw cms::Exception("InvalidConfiguration") << "Laser Wavelength";
52  repl["wl"] = std::to_string(wl);
53  laserWlToME_[wl] = laser.getIndex(repl);
54  }
55  }
56 
57  if (using_("Led")) {
58  repl.clear();
59  std::vector<int> ledWavelengths(_params.getUntrackedParameter<std::vector<int> >("ledWavelengths"));
60  MESetMulti const& led(static_cast<MESetMulti const&>(sources_.at("Led")));
61  unsigned nWL(ledWavelengths.size());
62  for (unsigned iWL(0); iWL != nWL; ++iWL) {
63  int wl(ledWavelengths[iWL]);
64  if (wl <= 0 || wl >= 5)
65  throw cms::Exception("InvalidConfiguration") << "Led Wavelength";
66  repl["wl"] = std::to_string(wl);
67  ledWlToME_[wl] = led.getIndex(repl);
68  }
69  }
70 
71  if (using_("TestPulse")) {
72  repl.clear();
73  std::vector<int> tpMGPAGains(_params.getUntrackedParameter<std::vector<int> >("testPulseMGPAGains"));
74  MESetMulti const& tp(static_cast<MESetMulti const&>(sources_.at("TestPulse")));
75  unsigned nG(tpMGPAGains.size());
76  for (unsigned iG(0); iG != nG; ++iG) {
77  int gain(tpMGPAGains[iG]);
78  if (gain != 1 && gain != 6 && gain != 12)
79  throw cms::Exception("InvalidConfiguration") << "MGPA gain";
80  repl["gain"] = std::to_string(gain);
81  tpGainToME_[gain] = tp.getIndex(repl);
82  }
83 
84  repl.clear();
85  std::vector<int> tpMGPAGainsPN(_params.getUntrackedParameter<std::vector<int> >("testPulseMGPAGainsPN"));
86  MESetMulti const& tppn(static_cast<MESetMulti const&>(sources_.at("TestPulsePN")));
87  unsigned nGPN(tpMGPAGainsPN.size());
88  for (unsigned iG(0); iG != nGPN; ++iG) {
89  int gain(tpMGPAGainsPN[iG]);
90  if (gain != 1 && gain != 16)
91  throw cms::Exception("InvalidConfiguration") << "PN MGPA gain";
92  repl["pngain"] = std::to_string(gain);
93  tpPNGainToME_[gain] = tppn.getIndex(repl);
94  }
95  }
96 
97  if (using_("Pedestal")) {
98  repl.clear();
99  std::vector<int> pedMGPAGains(_params.getUntrackedParameter<std::vector<int> >("pedestalMGPAGains"));
100  MESetMulti const& ped(static_cast<MESetMulti const&>(sources_.at("Pedestal")));
101  unsigned nG(pedMGPAGains.size());
102  for (unsigned iG(0); iG != nG; ++iG) {
103  int gain(pedMGPAGains[iG]);
104  if (gain != 1 && gain != 6 && gain != 12)
105  throw cms::Exception("InvalidConfiguration") << "MGPA gain";
106  repl["gain"] = std::to_string(gain);
107  pedGainToME_[gain] = ped.getIndex(repl);
108  }
109 
110  repl.clear();
111  std::vector<int> pedMGPAGainsPN(_params.getUntrackedParameter<std::vector<int> >("pedestalMGPAGainsPN"));
112  MESetMulti const& pedpn(static_cast<MESetMulti const&>(sources_.at("PedestalPN")));
113  unsigned nGPN(pedMGPAGainsPN.size());
114  for (unsigned iG(0); iG != nGPN; ++iG) {
115  int gain(pedMGPAGainsPN[iG]);
116  if (gain != 1 && gain != 16)
117  throw cms::Exception("InvalidConfiguration") << "PN MGPA gain";
118  repl["pngain"] = std::to_string(gain);
119  pedPNGainToME_[gain] = pedpn.getIndex(repl);
120  }
121  }
122 
123  qualitySummaries_.insert("QualitySummary");
124  qualitySummaries_.insert("PNQualitySummary");
125  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::map< int, unsigned > pedPNGainToME_
std::string to_string(const V &value)
Definition: OMSAccess.h:77
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::set< std::string > qualitySummaries_
bool using_(std::string const &_name, ProcessType _type=kJob) const
MESetCollection sources_
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:46
void erase(const std::string &key)
Definition: MESet.h:390

Member Data Documentation

◆ laserWlToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::laserWlToME_
private

Definition at line 18 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

◆ ledWlToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::ledWlToME_
private

Definition at line 19 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

◆ pedGainToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::pedGainToME_
private

Definition at line 22 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

◆ pedPNGainToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::pedPNGainToME_
private

Definition at line 23 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

◆ tpGainToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::tpGainToME_
private

Definition at line 20 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

◆ tpPNGainToME_

std::map<int, unsigned> ecaldqm::CalibrationSummaryClient::tpPNGainToME_
private

Definition at line 21 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().