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 &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 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_
 
int processedEvents
 

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 14 of file IntegrityClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

15  qualitySummaries_.insert("Quality");
16  qualitySummaries_.insert("QualitySummary");
17  }
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 29 of file IntegrityClient.cc.

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

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

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 33 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(), l1ctLayer2EG_cff::id, ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, ecaldqm::DQWorkerClient::kUnknown, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, processedEvents, ecaldqm::DQWorkerClient::sources_, ecaldqm::DQWorkerClient::statusManager_, ecaldqm::MESet::iterator::toNextChannel(), EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

33  {
37 
38  MESet& meQuality(MEs_.at("Quality"));
39  MESet& meQualitySummary(MEs_.at("QualitySummary"));
40  MESet& meChStatus(MEs_.at("ChStatus"));
41 
42  MESet const& sOccupancy(sources_.at("Occupancy"));
43  MESet const& sGain(sources_.at("Gain"));
44  MESet const& sChId(sources_.at("ChId"));
45  MESet const& sGainSwitch(sources_.at("GainSwitch"));
46  MESet const& sTowerId(sources_.at("TowerId"));
47  MESet const& sBlockSize(sources_.at("BlockSize"));
48  MESetNonObject const& sNumEvents(static_cast<MESetNonObject&>(sources_.at("NumEvents")));
49 
50  //Get the no.of events per LS calculated in OccupancyTask
51  int nEv = sNumEvents.getFloatValue();
52  processedEvents += nEv; //Sum it up to get the total processed events for the whole run.
53 
54  //TTID errors nomalized by total no.of events in a run.
55  MESet& meTTIDNorm(MEs_.at("TowerIdNormalized"));
56  MESet::iterator tEnd(meTTIDNorm.end(GetElectronicsMap()));
57  for (MESet::iterator tItr(meTTIDNorm.beginChannel(GetElectronicsMap())); tItr != tEnd;
58  tItr.toNextChannel(GetElectronicsMap())) {
59  DetId id(tItr->getId());
60  float towerid(sTowerId.getBinContent(getEcalDQMSetupObjects(), id));
61  tItr->setBinContent(towerid / processedEvents);
62  }
63  // Fill Channel Status Map MEs
64  // Record is checked for updates at every endLumi and filled here
65  MESet::iterator chSEnd(meChStatus.end(GetElectronicsMap()));
66  for (MESet::iterator chSItr(meChStatus.beginChannel(GetElectronicsMap())); chSItr != chSEnd;
67  chSItr.toNextChannel(GetElectronicsMap())) {
68  DetId id(chSItr->getId());
69 
71 
72  // Set appropriate channel map (EB or EE)
73  if (id.subdetId() == EcalBarrel) {
74  EBDetId ebid(id);
75  chIt = chStatus->find(ebid);
76  } else {
77  EEDetId eeid(id);
78  chIt = chStatus->find(eeid);
79  }
80 
81  // Get status code and fill ME
82  if (chIt != chStatus->end()) {
83  uint16_t code(chIt->getEncodedStatusCode());
84  chSItr->setBinContent(code);
85  }
86 
87  } // Channel Status Map
88 
89  MESet::iterator qEnd(meQuality.end(GetElectronicsMap()));
90  MESet::const_iterator occItr(GetElectronicsMap(), sOccupancy);
91  for (MESet::iterator qItr(meQuality.beginChannel(GetElectronicsMap())); qItr != qEnd;
92  qItr.toNextChannel(GetElectronicsMap())) {
93  occItr = qItr;
94 
95  DetId id(qItr->getId());
96 
97  bool doMask(meQuality.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
98 
99  float entries(occItr->getBinContent());
100 
101  float gain(sGain.getBinContent(getEcalDQMSetupObjects(), id));
102  float chid(sChId.getBinContent(getEcalDQMSetupObjects(), id));
103  float gainswitch(sGainSwitch.getBinContent(getEcalDQMSetupObjects(), id));
104 
105  float towerid(sTowerId.getBinContent(getEcalDQMSetupObjects(), id));
106  float blocksize(sBlockSize.getBinContent(getEcalDQMSetupObjects(), id));
107 
108  if (entries + gain + chid + gainswitch + towerid + blocksize < 1.) {
109  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
110  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
111  continue;
112  }
113 
114  float chErr((gain + chid + gainswitch + towerid + blocksize) /
115  (entries + gain + chid + gainswitch + towerid + blocksize));
116 
117  if (chErr > errFractionThreshold_) {
118  qItr->setBinContent(doMask ? kMBad : kBad);
119  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
120  } else {
121  qItr->setBinContent(doMask ? kMGood : kGood);
122  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
123  }
124  }
125 
126  // Quality check: set an entire FED to BAD if "any" DCC-SRP or DCC-TCC mismatch errors are detected
127  // Fill mismatch statistics
128  MESet const& sBXSRP(sources_.at("BXSRP"));
129  MESet const& sBXTCC(sources_.at("BXTCC"));
130  std::vector<bool> hasMismatchDCC(nDCC, false);
131  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
132  if (sBXSRP.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) > 50. ||
133  sBXTCC.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) > 50.) // "any" => 50
134  hasMismatchDCC[iDCC] = true;
135  }
136  // Analyze mismatch statistics
137  for (MESet::iterator qsItr(meQualitySummary.beginChannel(GetElectronicsMap()));
138  qsItr != meQualitySummary.end(GetElectronicsMap());
139  qsItr.toNextChannel(GetElectronicsMap())) {
140  DetId id(qsItr->getId());
141  unsigned iDCC(dccId(id, GetElectronicsMap()) - 1);
142  if (hasMismatchDCC[iDCC])
143  meQualitySummary.setBinContent(
145  id,
146  meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()) ? kMBad : kBad);
147  }
148 
149  } // 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:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
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:131
static const int TT_ID_ERROR
const_iterator end() const
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155
static const int CH_ID_ERROR

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 19 of file IntegrityClient.cc.

References l1extraParticles_cfi::_params, and errFractionThreshold_.

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

◆ setTokens()

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

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 23 of file IntegrityClient.cc.

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

23  {
25  }
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().

◆ processedEvents

int ecaldqm::IntegrityClient::processedEvents
private

Definition at line 26 of file IntegrityClient.h.

Referenced by producePlots().