CMS 3D CMS Logo

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

#include <IntegrityClient.h>

Inheritance diagram for ecaldqm::IntegrityClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 IntegrityClient ()
 
void producePlots (ProcessType) override
 
 ~IntegrityClient () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
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 EcalDQMSetupObjects getEcalDQMSetupObjects ()
 
const EcalElectronicsMappingGetElectronicsMap ()
 
const CaloGeometryGetGeometry ()
 
const std::string & getName () const
 
const CaloTopologyGetTopology ()
 
const EcalTrigTowerConstituentsMapGetTrigTowerMap ()
 
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 setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

edm::ESHandle< EcalChannelStatuschStatus
 
float errFractionThreshold_
 

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 11 of file IntegrityClient.h.

Constructor & Destructor Documentation

◆ IntegrityClient()

ecaldqm::IntegrityClient::IntegrityClient ( )

Definition at line 14 of file IntegrityClient.cc.

15  qualitySummaries_.insert("Quality");
16  qualitySummaries_.insert("QualitySummary");
17  }

References ecaldqm::DQWorkerClient::qualitySummaries_.

◆ ~IntegrityClient()

ecaldqm::IntegrityClient::~IntegrityClient ( )
inlineoverride

Definition at line 14 of file IntegrityClient.h.

14 {}

Member Function Documentation

◆ endLuminosityBlock()

void ecaldqm::IntegrityClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 25 of file IntegrityClient.cc.

25  {
26  _es.get<EcalChannelStatusRcd>().get(chStatus);
27  }

References chStatus, edm::EventSetup::get(), and get.

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 29 of file IntegrityClient.cc.

29  {
33 
34  MESet& meQuality(MEs_.at("Quality"));
35  MESet& meQualitySummary(MEs_.at("QualitySummary"));
36  MESet& meChStatus(MEs_.at("ChStatus"));
37 
38  MESet const& sOccupancy(sources_.at("Occupancy"));
39  MESet const& sGain(sources_.at("Gain"));
40  MESet const& sChId(sources_.at("ChId"));
41  MESet const& sGainSwitch(sources_.at("GainSwitch"));
42  MESet const& sTowerId(sources_.at("TowerId"));
43  MESet const& sBlockSize(sources_.at("BlockSize"));
44 
45  // Fill Channel Status Map MEs
46  // Record is checked for updates at every endLumi and filled here
47  MESet::iterator chSEnd(meChStatus.end(GetElectronicsMap()));
48  for (MESet::iterator chSItr(meChStatus.beginChannel(GetElectronicsMap())); chSItr != chSEnd;
49  chSItr.toNextChannel(GetElectronicsMap())) {
50  DetId id(chSItr->getId());
51 
53 
54  // Set appropriate channel map (EB or EE)
55  if (id.subdetId() == EcalBarrel) {
56  EBDetId ebid(id);
57  chIt = chStatus->find(ebid);
58  } else {
59  EEDetId eeid(id);
60  chIt = chStatus->find(eeid);
61  }
62 
63  // Get status code and fill ME
64  if (chIt != chStatus->end()) {
65  uint16_t code(chIt->getEncodedStatusCode());
66  chSItr->setBinContent(code);
67  }
68 
69  } // Channel Status Map
70 
71  MESet::iterator qEnd(meQuality.end(GetElectronicsMap()));
72  MESet::const_iterator occItr(GetElectronicsMap(), sOccupancy);
73  for (MESet::iterator qItr(meQuality.beginChannel(GetElectronicsMap())); qItr != qEnd;
74  qItr.toNextChannel(GetElectronicsMap())) {
75  occItr = qItr;
76 
77  DetId id(qItr->getId());
78 
79  bool doMask(meQuality.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
80 
81  float entries(occItr->getBinContent());
82 
83  float gain(sGain.getBinContent(getEcalDQMSetupObjects(), id));
84  float chid(sChId.getBinContent(getEcalDQMSetupObjects(), id));
85  float gainswitch(sGainSwitch.getBinContent(getEcalDQMSetupObjects(), id));
86 
87  float towerid(sTowerId.getBinContent(getEcalDQMSetupObjects(), id));
88  float blocksize(sBlockSize.getBinContent(getEcalDQMSetupObjects(), id));
89 
90  if (entries + gain + chid + gainswitch + towerid + blocksize < 1.) {
91  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
92  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
93  continue;
94  }
95 
96  float chErr((gain + chid + gainswitch + towerid + blocksize) /
97  (entries + gain + chid + gainswitch + towerid + blocksize));
98 
99  if (chErr > errFractionThreshold_) {
100  qItr->setBinContent(doMask ? kMBad : kBad);
101  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
102  } else {
103  qItr->setBinContent(doMask ? kMGood : kGood);
104  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
105  }
106  }
107 
108  // Quality check: set an entire FED to BAD if "any" DCC-SRP or DCC-TCC mismatch errors are detected
109  // Fill mismatch statistics
110  MESet const& sBXSRP(sources_.at("BXSRP"));
111  MESet const& sBXTCC(sources_.at("BXTCC"));
112  std::vector<bool> hasMismatchDCC(nDCC, false);
113  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
114  if (sBXSRP.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) > 50. ||
115  sBXTCC.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) > 50.) // "any" => 50
116  hasMismatchDCC[iDCC] = true;
117  }
118  // Analyze mismatch statistics
119  for (MESet::iterator qsItr(meQualitySummary.beginChannel(GetElectronicsMap()));
120  qsItr != meQualitySummary.end(GetElectronicsMap());
121  qsItr.toNextChannel(GetElectronicsMap())) {
122  DetId id(qsItr->getId());
123  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
124  if (hasMismatchDCC[iDCC])
125  meQualitySummary.setBinContent(
127  id,
128  meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()) ? kMBad : kBad);
129  }
130 
131  } // producePlots()

References ecaldqm::MESetCollection::at(), EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, chStatus, ecaldqm::dccId(), EcalBarrel, errFractionThreshold_, PedestalClient_cfi::gain, ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::GetTrigTowerMap(), triggerObjects_cff::id, ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, ecaldqm::DQWorkerClient::kUnknown, ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, ecaldqm::DQWorkerClient::sources_, ecaldqm::DQWorkerClient::statusManager_, ecaldqm::MESet::iterator::toNextChannel(), EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 19 of file IntegrityClient.cc.

19  {
20  errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
21  }

References l1extraParticles_cfi::_params, and errFractionThreshold_.

Member Data Documentation

◆ chStatus

edm::ESHandle<EcalChannelStatus> ecaldqm::IntegrityClient::chStatus
private

Definition at line 21 of file IntegrityClient.h.

Referenced by endLuminosityBlock(), and producePlots().

◆ errFractionThreshold_

float ecaldqm::IntegrityClient::errFractionThreshold_
private

Definition at line 23 of file IntegrityClient.h.

Referenced by producePlots(), and setParams().

EBDetId
Definition: EBDetId.h:17
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::DQWorkerClient::statusManager_
StatusManager const * statusManager_
Definition: DQWorkerClient.h:60
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
EcalBarrel
Definition: EcalSubdetector.h:10
DetId
Definition: DetId.h:17
ecaldqm::DQWorkerClient::qualitySummaries_
std::set< std::string > qualitySummaries_
Definition: DQWorkerClient.h:56
ecaldqm::IntegrityClient::chStatus
edm::ESHandle< EcalChannelStatus > chStatus
Definition: IntegrityClient.h:21
ecaldqm::DQWorker::GetTrigTowerMap
const EcalTrigTowerConstituentsMap * GetTrigTowerMap()
Definition: DQWorker.cc:110
EcalDQMStatusHelper::TT_SIZE_ERROR
static const int TT_SIZE_ERROR
Definition: EcalDQMStatusHelper.h:15
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:104
EEDetId
Definition: EEDetId.h:14
ecaldqm::DQWorkerClient::kMBad
Definition: DQWorkerClient.h:37
EcalDQMStatusHelper::CH_ID_ERROR
static const int CH_ID_ERROR
Definition: EcalDQMStatusHelper.h:11
EcalDQMStatusHelper::TT_ID_ERROR
static const int TT_ID_ERROR
Definition: EcalDQMStatusHelper.h:14
ecaldqm::DQWorkerClient::kUnknown
Definition: DQWorkerClient.h:37
ecaldqm::DQWorkerClient::kBad
Definition: DQWorkerClient.h:37
ecaldqm::DQWorkerClient::sources_
MESetCollection sources_
Definition: DQWorkerClient.h:55
ecaldqm::IntegrityClient::errFractionThreshold_
float errFractionThreshold_
Definition: IntegrityClient.h:23
ecaldqm::DQWorkerClient::kMGood
Definition: DQWorkerClient.h:37
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR
static const int CH_GAIN_ZERO_ERROR
Definition: EcalDQMStatusHelper.h:12
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::DQWorkerClient::kMUnknown
Definition: DQWorkerClient.h:37
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
get
#define get
ecaldqm::dccId
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:16
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR
static const int CH_GAIN_SWITCH_ERROR
Definition: EcalDQMStatusHelper.h:13
ecaldqm::DQWorkerClient::kGood
Definition: DQWorkerClient.h:37
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19