CMS 3D CMS Logo

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

#include <TestPulseClient.h>

Inheritance diagram for ecaldqm::TestPulseClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

void producePlots (ProcessType) override
 
 TestPulseClient ()
 
 ~TestPulseClient () 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 std::string & 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 () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

std::vector< float > amplitudeThreshold_
 
std::map< int, unsigned > gainToME_
 
int minChannelEntries_
 
std::vector< float > PNAmplitudeThreshold_
 
std::map< int, unsigned > pnGainToME_
 
std::vector< float > tolerancePNRMS_
 
std::vector< float > toleranceRMS_
 

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 TestPulseClient.h.

Constructor & Destructor Documentation

◆ TestPulseClient()

ecaldqm::TestPulseClient::TestPulseClient ( )

Definition at line 15 of file TestPulseClient.cc.

16  : DQWorkerClient(),
17  gainToME_(),
18  pnGainToME_(),
21  toleranceRMS_(0),
23  tolerancePNRMS_(0) {}

◆ ~TestPulseClient()

ecaldqm::TestPulseClient::~TestPulseClient ( )
inlineoverride

Definition at line 10 of file TestPulseClient.h.

10 {}

Member Function Documentation

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 108 of file TestPulseClient.cc.

108  {
109  using namespace std;
110 
111  MESetMulti& meQuality(static_cast<MESetMulti&>(MEs_.at("Quality")));
112  MESetMulti& meAmplitudeRMS(static_cast<MESetMulti&>(MEs_.at("AmplitudeRMS")));
113  MESetMulti& meQualitySummary(static_cast<MESetMulti&>(MEs_.at("QualitySummary")));
114  MESetMulti& mePNQualitySummary(static_cast<MESetMulti&>(MEs_.at("PNQualitySummary")));
115 
116  MESetMulti const& sAmplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
117  MESetMulti const& sPNAmplitude(static_cast<MESetMulti const&>(sources_.at("PNAmplitude")));
118 
119  for (map<int, unsigned>::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr) {
120  meQuality.use(gainItr->second);
121  meQualitySummary.use(gainItr->second);
122  meAmplitudeRMS.use(gainItr->second);
123 
124  sAmplitude.use(gainItr->second);
125 
126  uint32_t mask(0);
127  switch (gainItr->first) {
128  case 1:
131  break;
132  case 6:
135  break;
136  case 12:
139  break;
140  default:
141  break;
142  }
143 
144  MESet::iterator qEnd(meQuality.end());
145  MESet::iterator rItr(meAmplitudeRMS);
146  MESet::const_iterator aItr(sAmplitude);
147  for (MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()) {
148  DetId id(qItr->getId());
149 
150  bool doMask(meQuality.maskMatches(id, mask, statusManager_));
151 
152  aItr = qItr;
153  rItr = qItr;
154 
155  float entries(aItr->getBinEntries());
156 
157  if (entries < minChannelEntries_) {
158  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
159  continue;
160  }
161 
162  float amp(aItr->getBinContent());
163  float rms(aItr->getBinError() * sqrt(entries));
164 
165  rItr->setBinContent(rms);
166 
167  if (amp < amplitudeThreshold_[gainItr->second] || rms > toleranceRMS_[gainItr->second])
168  qItr->setBinContent(doMask ? kMBad : kBad);
169  else
170  qItr->setBinContent(doMask ? kMGood : kGood);
171  }
172 
173  towerAverage_(meQualitySummary, meQuality, 0.2);
174  }
175 
176  for (map<int, unsigned>::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr) {
177  mePNQualitySummary.use(gainItr->second);
178 
179  sPNAmplitude.use(gainItr->second);
180 
181  uint32_t mask(0);
182  switch (gainItr->first) {
183  case 1:
186  break;
187  case 16:
190  break;
191  default:
192  break;
193  }
194 
195  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
196  if (memDCCIndex(iDCC + 1) == unsigned(-1))
197  continue;
198 
199  for (unsigned iPN(0); iPN < 10; ++iPN) {
200  int subdet(0);
201  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
202  subdet = EcalBarrel;
203  else
204  subdet = EcalEndcap;
205 
206  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
207 
208  bool doMask(mePNQualitySummary.maskMatches(id, mask, statusManager_));
209 
210  float amp(sPNAmplitude.getBinContent(id));
211  float entries(sPNAmplitude.getBinEntries(id));
212  float rms(sPNAmplitude.getBinError(id) * sqrt(entries));
213 
214  if (entries < minChannelEntries_) {
215  mePNQualitySummary.setBinContent(id, doMask ? kMUnknown : kUnknown);
216  continue;
217  }
218 
219  if (amp < PNAmplitudeThreshold_[gainItr->second] || rms > tolerancePNRMS_[gainItr->second])
220  mePNQualitySummary.setBinContent(id, doMask ? kMBad : kBad);
221  else
222  mePNQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
223  }
224  }
225  }
226  }

References amplitudeThreshold_, ecaldqm::MESetCollection::at(), ecaldqm::MESetMulti::beginChannel(), EcalBarrel, EcalEndcap, ecaldqm::MESetMulti::end(), gainToME_, ecaldqm::MESetMulti::getBinContent(), ecaldqm::MESetMulti::getBinEntries(), ecaldqm::MESetMulti::getBinError(), triggerObjects_cff::id, ecaldqm::DQWorkerClient::kBad, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, ecaldqm::DQWorkerClient::kUnknown, ecaldqm::MESetMulti::maskMatches(), ecaldqm::memDCCIndex(), ecaldqm::DQWorker::MEs_, minChannelEntries_, ecaldqm::nDCC, PNAmplitudeThreshold_, pnGainToME_, SiStripPI::rms, ecaldqm::MESetMulti::setBinContent(), ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR, tolerancePNRMS_, toleranceRMS_, ecaldqm::MESet::iterator::toNextChannel(), ecaldqm::DQWorkerClient::towerAverage_(), and ecaldqm::MESetMulti::use().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 25 of file TestPulseClient.cc.

25  {
26  minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
27 
28  std::vector<int> MGPAGains(_params.getUntrackedParameter<std::vector<int> >("MGPAGains"));
29  std::vector<int> MGPAGainsPN(_params.getUntrackedParameter<std::vector<int> >("MGPAGainsPN"));
30 
32 
33  MESetMulti const& amplitude(static_cast<MESetMulti const&>(sources_.at("Amplitude")));
34  unsigned nG(MGPAGains.size());
35  for (unsigned iG(0); iG != nG; ++iG) {
36  int gain(MGPAGains[iG]);
37  if (gain != 1 && gain != 6 && gain != 12)
38  throw cms::Exception("InvalidConfiguration") << "MGPA gain";
39  repl["gain"] = std::to_string(gain);
40  gainToME_[gain] = amplitude.getIndex(repl);
41  }
42 
43  repl.clear();
44 
45  MESetMulti const& pnAmplitude(static_cast<MESetMulti const&>(sources_.at("PNAmplitude")));
46  unsigned nGPN(MGPAGainsPN.size());
47  for (unsigned iG(0); iG != nGPN; ++iG) {
48  int gain(MGPAGainsPN[iG]);
49  if (gain != 1 && gain != 16)
50  throw cms::Exception("InvalidConfiguration") << "PN MGPA gain";
51  repl["pngain"] = std::to_string(gain);
52  pnGainToME_[gain] = pnAmplitude.getIndex(repl);
53  }
54 
55  amplitudeThreshold_.resize(nG);
56  toleranceRMS_.resize(nG);
57 
58  std::vector<double> inAmplitudeThreshold(_params.getUntrackedParameter<std::vector<double> >("amplitudeThreshold"));
59  std::vector<double> inToleranceRMS(_params.getUntrackedParameter<std::vector<double> >("toleranceRMS"));
60 
61  for (std::map<int, unsigned>::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr) {
62  unsigned iME(gainItr->second);
63  unsigned iGain(0);
64  switch (gainItr->first) {
65  case 1:
66  iGain = 0;
67  break;
68  case 6:
69  iGain = 1;
70  break;
71  case 12:
72  iGain = 2;
73  break;
74  }
75 
76  amplitudeThreshold_[iME] = inAmplitudeThreshold[iGain];
77  toleranceRMS_[iME] = inToleranceRMS[iGain];
78  }
79 
80  PNAmplitudeThreshold_.resize(nGPN);
81  tolerancePNRMS_.resize(nGPN);
82 
83  std::vector<double> inPNAmplitudeThreshold(
84  _params.getUntrackedParameter<std::vector<double> >("PNAmplitudeThreshold"));
85  std::vector<double> inTolerancePNRMS(_params.getUntrackedParameter<std::vector<double> >("tolerancePNRMS"));
86 
87  for (std::map<int, unsigned>::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr) {
88  unsigned iME(gainItr->second);
89  unsigned iGain(0);
90  switch (gainItr->first) {
91  case 1:
92  iGain = 0;
93  break;
94  case 16:
95  iGain = 1;
96  break;
97  }
98 
99  PNAmplitudeThreshold_[iME] = inPNAmplitudeThreshold[iGain];
100  tolerancePNRMS_[iME] = inTolerancePNRMS[iGain];
101  }
102 
103  qualitySummaries_.insert("Quality");
104  qualitySummaries_.insert("QualitySummary");
105  qualitySummaries_.insert("PNQualitySummary");
106  }

References l1extraParticles_cfi::_params, CustomPhysics_cfi::amplitude, amplitudeThreshold_, ecaldqm::MESetCollection::at(), Exception, PedestalClient_cfi::gain, gainToME_, ecaldqm::MESetMulti::getIndex(), PedestalClient_cfi::MGPAGains, PedestalClient_cfi::MGPAGainsPN, minChannelEntries_, PNAmplitudeThreshold_, pnGainToME_, ecaldqm::DQWorkerClient::qualitySummaries_, ecaldqm::DQWorkerClient::sources_, tolerancePNRMS_, and toleranceRMS_.

Member Data Documentation

◆ amplitudeThreshold_

std::vector<float> ecaldqm::TestPulseClient::amplitudeThreshold_
private

Definition at line 21 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ gainToME_

std::map<int, unsigned> ecaldqm::TestPulseClient::gainToME_
private

Definition at line 17 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ minChannelEntries_

int ecaldqm::TestPulseClient::minChannelEntries_
private

Definition at line 20 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ PNAmplitudeThreshold_

std::vector<float> ecaldqm::TestPulseClient::PNAmplitudeThreshold_
private

Definition at line 23 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ pnGainToME_

std::map<int, unsigned> ecaldqm::TestPulseClient::pnGainToME_
private

Definition at line 18 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ tolerancePNRMS_

std::vector<float> ecaldqm::TestPulseClient::tolerancePNRMS_
private

Definition at line 24 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceRMS_

std::vector<float> ecaldqm::TestPulseClient::toleranceRMS_
private

Definition at line 22 of file TestPulseClient.h.

Referenced by producePlots(), and setParams().

ecaldqm::TestPulseClient::minChannelEntries_
int minChannelEntries_
Definition: TestPulseClient.h:20
ecaldqm::TestPulseClient::tolerancePNRMS_
std::vector< float > tolerancePNRMS_
Definition: TestPulseClient.h:24
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
ecaldqm::TestPulseClient::toleranceRMS_
std::vector< float > toleranceRMS_
Definition: TestPulseClient.h:22
EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
Definition: EcalDQMStatusHelper.h:30
ecaldqm::MESet::PathReplacements
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::memDCCIndex
unsigned memDCCIndex(unsigned)
Definition: EcalDQMCommonUtils.cc:48
ecaldqm::DQWorkerClient::statusManager_
StatusManager const * statusManager_
Definition: DQWorkerClient.h:60
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
EcalBarrel
Definition: EcalSubdetector.h:10
EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:29
DetId
Definition: DetId.h:17
PedestalClient_cfi.MGPAGainsPN
MGPAGainsPN
Definition: PedestalClient_cfi.py:27
ecaldqm::DQWorkerClient::qualitySummaries_
std::set< std::string > qualitySummaries_
Definition: DQWorkerClient.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
Definition: EcalDQMStatusHelper.h:31
ecaldqm::TestPulseClient::amplitudeThreshold_
std::vector< float > amplitudeThreshold_
Definition: TestPulseClient.h:21
ecaldqm::kEBpHigh
Definition: EcalDQMCommonUtils.h:88
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
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
EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:28
ecaldqm::DQWorkerClient::sources_
MESetCollection sources_
Definition: DQWorkerClient.h:55
ecaldqm::DQWorkerClient::kMGood
Definition: DQWorkerClient.h:37
ecaldqm::TestPulseClient::gainToME_
std::map< int, unsigned > gainToME_
Definition: TestPulseClient.h:17
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:362
ecaldqm::DQWorkerClient::kMUnknown
Definition: DQWorkerClient.h:37
EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:27
ecaldqm::TestPulseClient::PNAmplitudeThreshold_
std::vector< float > PNAmplitudeThreshold_
Definition: TestPulseClient.h:23
ecaldqm::kEBmLow
Definition: EcalDQMCommonUtils.h:85
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
PedestalClient_cfi.MGPAGains
MGPAGains
Definition: PedestalClient_cfi.py:26
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
std
Definition: JetResolutionObject.h:76
ecaldqm::TestPulseClient::pnGainToME_
std::map< int, unsigned > pnGainToME_
Definition: TestPulseClient.h:18
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ecaldqm::DQWorkerClient::towerAverage_
void towerAverage_(MESet &, MESet const &, float)
Definition: DQWorkerClient.cc:159
ecaldqm::DQWorkerClient::kGood
Definition: DQWorkerClient.h:37
Exception
Definition: hltDiff.cc:246
EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
Definition: EcalDQMStatusHelper.h:32
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92