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 &)
 
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
 
void setTokens (edm::ConsumesCollector &) override
 

Private Attributes

const EcalChannelStatuschStatus
 
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcdchStatusToken
 
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)
 
- 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 11 of file IntegrityClient.h.

Constructor & Destructor Documentation

◆ IntegrityClient()

ecaldqm::IntegrityClient::IntegrityClient ( )

Definition at line 13 of file IntegrityClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

14  qualitySummaries_.insert("Quality");
15  qualitySummaries_.insert("QualitySummary");
16  }
std::set< std::string > 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 28 of file IntegrityClient.cc.

References chStatus, chStatusToken, and edm::EventSetup::getData().

28  {
29  chStatus = &_es.getData(chStatusToken);
30  }
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > chStatusToken
const EcalChannelStatus * chStatus

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 32 of file IntegrityClient.cc.

References ecaldqm::MESetCollection::at(), EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, chStatus, ecaldqm::dccId(), EcalBarrel, EcalCondObjectContainer< T >::end(), errFractionThreshold_, EcalCondObjectContainer< T >::find(), 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.

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

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 18 of file IntegrityClient.cc.

References l1extraParticles_cfi::_params, and errFractionThreshold_.

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

◆ setTokens()

void ecaldqm::IntegrityClient::setTokens ( edm::ConsumesCollector _collector)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 22 of file IntegrityClient.cc.

References chStatusToken, edm::EndLuminosityBlock, and edm::ConsumesCollector::esConsumes().

22  {
24  }
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > chStatusToken

Member Data Documentation

◆ chStatus

const EcalChannelStatus* ecaldqm::IntegrityClient::chStatus
private

Definition at line 22 of file IntegrityClient.h.

Referenced by endLuminosityBlock(), and producePlots().

◆ chStatusToken

edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> ecaldqm::IntegrityClient::chStatusToken
private

Definition at line 21 of file IntegrityClient.h.

Referenced by endLuminosityBlock(), and setTokens().

◆ errFractionThreshold_

float ecaldqm::IntegrityClient::errFractionThreshold_
private

Definition at line 25 of file IntegrityClient.h.

Referenced by producePlots(), and setParams().