CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void releaseMEs () override
 
void releaseSource ()
 
void resetMEs ()
 
bool retrieveSource (DQMStore const &, ProcessType)
 
void setStatusManager (StatusManager const &_manager)
 
virtual ~DQWorkerClient ()
 
- 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 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 ()
 

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, kRun, 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 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=kRun) 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
std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- Protected Attributes inherited from ecaldqm::DQWorker
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 14 of file CalibrationSummaryClient.cc.

14  :
16  laserWlToME_(),
17  ledWlToME_(),
18  tpGainToME_(),
19  tpPNGainToME_(),
20  pedGainToME_(),
22  {
23  }
std::map< int, unsigned > pedPNGainToME_
ecaldqm::CalibrationSummaryClient::~CalibrationSummaryClient ( )
inline

Definition at line 11 of file CalibrationSummaryClient.h.

11 {}

Member Function Documentation

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

Implements ecaldqm::DQWorkerClient.

Definition at line 127 of file CalibrationSummaryClient.cc.

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

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 26 of file CalibrationSummaryClient.cc.

References edm::hlt::Exception, spr::find(), ecaldqm::MESetMulti::getIndex(), edm::ParameterSet::getUntrackedParameter(), EcalCondDBWriter_cfi::laser, laserWlToME_, EcalCondDBWriter_cfi::led, ledWlToME_, pedGainToME_, pedPNGainToME_, ecaldqm::DQWorkerClient::qualitySummaries_, ecaldqm::DQWorkerClient::sources_, AlCaHLTBitMon_QueryRunRegistry::string, cond::to_string(), tpGainToME_, tpPNGainToME_, and ecaldqm::DQWorkerClient::using_().

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