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)
 
 ~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 &)
 
std::string const & getName () const
 
bool onlineMode () const
 
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)
 

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

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_
ecaldqm::CalibrationSummaryClient::~CalibrationSummaryClient ( )
inlineoverride

Definition at line 11 of file CalibrationSummaryClient.h.

References producePlots(), and setParams().

11 {}

Member Function Documentation

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

Implements ecaldqm::DQWorkerClient.

Definition at line 127 of file CalibrationSummaryClient.cc.

References DEFINE_ECALDQM_WORKER, EcalBarrel, EcalEndcap, ecaldqm::MESetMulti::getBinContent(), triggerObjects_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_().

Referenced by ~CalibrationSummaryClient().

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());
148  for (MESet::iterator qItr(meQualitySummary.beginChannel()); qItr != qEnd; qItr.toNextChannel()) {
149  DetId id(qItr->getId());
150 
151  int status(kGood);
152 
153  if (status == kGood && sLaser) {
154  for (map<int, unsigned>::iterator wlItr(laserWlToME_.begin()); wlItr != laserWlToME_.end(); ++wlItr) {
155  sLaser->use(wlItr->second);
156  if (sLaser->getBinContent(id) == kBad) {
157  status = kBad;
158  break;
159  }
160  }
161  }
162 
163  if (status == kGood && sLed) {
164  DetId id(qItr->getId());
165  if (id.subdetId() == EcalEndcap) {
166  for (map<int, unsigned>::iterator wlItr(ledWlToME_.begin()); wlItr != ledWlToME_.end(); ++wlItr) {
167  sLed->use(wlItr->second);
168  if (sLed->getBinContent(id) == kBad) {
169  status = kBad;
170  break;
171  }
172  }
173  }
174  }
175 
176  if (status == kGood && sTestPulse) {
177  for (map<int, unsigned>::iterator gainItr(tpGainToME_.begin()); gainItr != tpGainToME_.end(); ++gainItr) {
178  sTestPulse->use(gainItr->second);
179  if (sTestPulse->getBinContent(id) == kBad) {
180  status = kBad;
181  break;
182  }
183  }
184  }
185 
186  if (status == kGood && sPedestal) {
187  for (map<int, unsigned>::iterator gainItr(pedGainToME_.begin()); gainItr != pedGainToME_.end(); ++gainItr) {
188  sPedestal->use(gainItr->second);
189  if (sPedestal->getBinContent(id) == kBad) {
190  status = kBad;
191  break;
192  }
193  }
194  }
195 
196  qItr->setBinContent(status);
197  }
198 
199  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
200  if (memDCCIndex(iDCC + 1) == unsigned(-1))
201  continue;
202  for (unsigned iPN(0); iPN < 10; ++iPN) {
203  int subdet(0);
204  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
205  subdet = EcalBarrel;
206  else
207  subdet = EcalEndcap;
208 
209  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
210 
211  int status(kGood);
212 
213  if (sPNIntegrity.getBinContent(id) == kBad)
214  status = kBad;
215 
216  if (status == kGood && sLaserPN) {
217  for (map<int, unsigned>::iterator wlItr(laserWlToME_.begin()); wlItr != laserWlToME_.end(); ++wlItr) {
218  sLaserPN->use(wlItr->second);
219  if (sLaserPN->getBinContent(id) == kBad) {
220  status = kBad;
221  break;
222  }
223  }
224  }
225 
226  if (status == kGood && sLedPN) {
227  for (map<int, unsigned>::iterator wlItr(ledWlToME_.begin()); wlItr != ledWlToME_.end(); ++wlItr) {
228  sLedPN->use(wlItr->second);
229  if (sLedPN->getBinContent(id) == kBad) {
230  status = kBad;
231  break;
232  }
233  }
234  }
235 
236  if (status == kGood && sTestPulsePN) {
237  for (map<int, unsigned>::iterator gainItr(tpPNGainToME_.begin()); gainItr != tpPNGainToME_.end(); ++gainItr) {
238  sTestPulsePN->use(gainItr->second);
239  if (sTestPulsePN->getBinContent(id) == kBad) {
240  status = kBad;
241  break;
242  }
243  }
244  }
245 
246  if (status == kGood && sPedestalPN) {
247  for (map<int, unsigned>::iterator gainItr(pedPNGainToME_.begin()); gainItr != pedPNGainToME_.end();
248  ++gainItr) {
249  sPedestalPN->use(gainItr->second);
250  if (sPedestalPN->getBinContent(id) == kBad) {
251  status = kBad;
252  break;
253  }
254  }
255  }
256 
257  mePNQualitySummary.setBinContent(id, status);
258  }
259  }
260  }
unsigned memDCCIndex(unsigned)
std::map< int, unsigned > pedPNGainToME_
bool using_(std::string const &_name, ProcessType _type=kJob) const
MESetCollection sources_
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:78
void ecaldqm::CalibrationSummaryClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file CalibrationSummaryClient.cc.

References Exception, spr::find(), PedestalClient_cfi::gain, ecaldqm::MESetMulti::getIndex(), edm::ParameterSet::getUntrackedParameter(), 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, tpGainToME_, tpPNGainToME_, ecaldqm::DQWorkerClient::using_(), and LaserClient_cfi::wl.

Referenced by ~CalibrationSummaryClient().

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  }
std::map< int, unsigned > pedPNGainToME_
bool using_(std::string const &_name, ProcessType _type=kJob) const
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_
MESetCollection sources_
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31

Member Data Documentation

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

Definition at line 18 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

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

Definition at line 19 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

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

Definition at line 22 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

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

Definition at line 23 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

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

Definition at line 20 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().

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

Definition at line 21 of file CalibrationSummaryClient.h.

Referenced by producePlots(), and setParams().