CMS 3D CMS Logo

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

#include <PresampleClient.h>

Inheritance diagram for ecaldqm::PresampleClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

 PresampleClient ()
 
void producePlots (ProcessType) override
 
 ~PresampleClient () 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)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~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 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
 

Private Attributes

float expectedMean_
 
int minChannelEntries_
 
float toleranceHigh_
 
float toleranceLow_
 
float toleranceRMS_
 
float toleranceRMSFwd_
 

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

Constructor & Destructor Documentation

◆ PresampleClient()

ecaldqm::PresampleClient::PresampleClient ( )

Definition at line 13 of file PresampleClient.cc.

14  : DQWorkerClient(),
16  expectedMean_(0.),
17  toleranceLow_(0.),
18  toleranceHigh_(0.),
19  toleranceRMS_(0.),
20  toleranceRMSFwd_(0.) {
21  qualitySummaries_.insert("Quality");
22  qualitySummaries_.insert("QualitySummary");
23  }

References ecaldqm::DQWorkerClient::qualitySummaries_.

◆ ~PresampleClient()

ecaldqm::PresampleClient::~PresampleClient ( )
inlineoverride

Definition at line 10 of file PresampleClient.h.

10 {}

Member Function Documentation

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 34 of file PresampleClient.cc.

34  {
35  MESet& meQualitySummary(MEs_.at("QualitySummary"));
36  MESet& meQuality(MEs_.at("Quality"));
37  MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
38  MESet& meMean(MEs_.at("Mean"));
39  MESet& meRMS(MEs_.at("RMS"));
40  MESet& meRMSMap(MEs_.at("RMSMap"));
41  MESet& meRMSMapAll(MEs_.at("RMSMapAll"));
42  MESet& meRMSMapAllByLumi(MEs_.at("RMSMapAllByLumi"));
43 
44  MESet const& sPedestal(sources_.at("Pedestal"));
45  MESet const& sPedestalByLS(sources_.at("PedestalByLS"));
46  MESet const& sChStatus(sources_.at("ChStatus"));
47 
50 
51  MESet::iterator qEnd(meQuality.end(GetElectronicsMap()));
52 
53  MESet::const_iterator pItr(GetElectronicsMap(), sPedestal);
54  MESet::const_iterator pLSItr(GetElectronicsMap(), sPedestalByLS);
55  double maxEB(0.), minEB(0.), maxEE(0.), minEE(0.);
56  double rmsMaxEB(0.), rmsMaxEE(0.);
57  for (MESet::iterator qItr(meQuality.beginChannel(GetElectronicsMap())); qItr != qEnd;
58  qItr.toNextChannel(GetElectronicsMap())) {
59  pItr = qItr;
60  pLSItr = qItr;
61 
62  DetId id(qItr->getId());
63 
64  bool doMask(meQuality.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
65 
66  double rmsThresh(toleranceRMS_);
67 
68  if (isForward(id))
69  rmsThresh = toleranceRMSFwd_;
70 
71  double entries(pItr->getBinEntries());
72  double entriesLS(pLSItr->getBinEntries());
73 
74  if (entries < minChannelEntries_) {
75  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
76  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
77  meRMSMap.setBinContent(getEcalDQMSetupObjects(), id, -1.);
78  continue;
79  }
80 
81  double mean(pItr->getBinContent());
82  double meanLS(pLSItr->getBinContent());
83  double rms(pItr->getBinError() * std::sqrt(entries));
84  double rmsLS(pLSItr->getBinError() * std::sqrt(entriesLS));
85 
86  int dccid(dccId(id, GetElectronicsMap()));
87 
88  meMean.fill(getEcalDQMSetupObjects(), dccid, mean);
89  meRMS.fill(getEcalDQMSetupObjects(), dccid, rms);
90  meRMSMap.setBinContent(getEcalDQMSetupObjects(), id, rms);
91  meRMSMapAllByLumi.setBinContent(getEcalDQMSetupObjects(), id, rmsLS);
92 
93  if (((mean > expectedMean_ + toleranceHigh_) || (mean < expectedMean_ - toleranceLow_)) || rms > rmsThresh) {
94  qItr->setBinContent(doMask ? kMBad : kBad);
95  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
96  if (!doMask)
97  meErrorsSummary.fill(getEcalDQMSetupObjects(), id);
98  } else {
99  qItr->setBinContent(doMask ? kMGood : kGood);
100  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
101  }
102 
103  // Fill Presample Trend plots:
104  // Use PedestalByLS which only contains digis from "current" LS
105  float chStatus(sChStatus.getBinContent(getEcalDQMSetupObjects(), id));
106  if (entriesLS < minChannelEntries_)
107  continue;
108  if (chStatus != EcalChannelStatusCode::kOk)
109  continue; // exclude problematic channels
110 
111  // Get max/min
112  // Min is effectively just 0
113  if (id.subdetId() == EcalBarrel) {
114  if (meanLS > maxEB)
115  maxEB = meanLS;
116  if (meanLS < minEB)
117  minEB = meanLS;
118  if (rmsLS > rmsMaxEB)
119  rmsMaxEB = rmsLS;
120  } else {
121  if (meanLS > maxEE)
122  maxEE = meanLS;
123  if (meanLS < minEE)
124  minEE = meanLS;
125  if (rmsLS > rmsMaxEE)
126  rmsMaxEE = rmsLS;
127  }
128 
129  } // qItr
130 
131  towerAverage_(meRMSMapAll, meRMSMap, -1.);
132 
133  MESet& meTrendMean(MEs_.at("TrendMean"));
134  MESet& meTrendRMS(MEs_.at("TrendRMS"));
135  meTrendMean.fill(getEcalDQMSetupObjects(), EcalBarrel, double(timestamp_.iLumi), maxEB - minEB);
136  meTrendMean.fill(getEcalDQMSetupObjects(), EcalEndcap, double(timestamp_.iLumi), maxEE - minEE);
137  meTrendRMS.fill(getEcalDQMSetupObjects(), EcalBarrel, double(timestamp_.iLumi), rmsMaxEB);
138  meTrendRMS.fill(getEcalDQMSetupObjects(), EcalEndcap, double(timestamp_.iLumi), rmsMaxEE);
139  }

References ecaldqm::MESetCollection::at(), ecaldqm::dccId(), EcalBarrel, EcalEndcap, expectedMean_, ecaldqm::MESet::fill(), ecaldqm::MESet::ConstBin::getBinContent(), ecaldqm::MESet::ConstBin::getBinEntries(), ecaldqm::MESet::ConstBin::getBinError(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::GetTrigTowerMap(), triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::isForward(), ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, EcalChannelStatusCode::kOk, ecaldqm::DQWorkerClient::kUnknown, SiStripPI::mean, ecaldqm::DQWorker::MEs_, minChannelEntries_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, SiStripPI::rms, ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, ecaldqm::DQWorker::timestamp_, toleranceHigh_, toleranceLow_, toleranceRMS_, toleranceRMSFwd_, ecaldqm::MESet::iterator::toNextChannel(), and ecaldqm::DQWorkerClient::towerAverage_().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 25 of file PresampleClient.cc.

25  {
26  minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
27  expectedMean_ = _params.getUntrackedParameter<double>("expectedMean");
28  toleranceLow_ = _params.getUntrackedParameter<double>("toleranceLow");
29  toleranceHigh_ = _params.getUntrackedParameter<double>("toleranceHigh");
30  toleranceRMS_ = _params.getUntrackedParameter<double>("toleranceRMS");
31  toleranceRMSFwd_ = _params.getUntrackedParameter<double>("toleranceRMSFwd");
32  }

References l1extraParticles_cfi::_params, expectedMean_, minChannelEntries_, toleranceHigh_, toleranceLow_, toleranceRMS_, and toleranceRMSFwd_.

Member Data Documentation

◆ expectedMean_

float ecaldqm::PresampleClient::expectedMean_
private

Definition at line 18 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

◆ minChannelEntries_

int ecaldqm::PresampleClient::minChannelEntries_
private

Definition at line 17 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceHigh_

float ecaldqm::PresampleClient::toleranceHigh_
private

Definition at line 20 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceLow_

float ecaldqm::PresampleClient::toleranceLow_
private

Definition at line 19 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceRMS_

float ecaldqm::PresampleClient::toleranceRMS_
private

Definition at line 21 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

◆ toleranceRMSFwd_

float ecaldqm::PresampleClient::toleranceRMSFwd_
private

Definition at line 22 of file PresampleClient.h.

Referenced by producePlots(), and setParams().

ecaldqm::PresampleClient::minChannelEntries_
int minChannelEntries_
Definition: PresampleClient.h:17
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::DQWorkerClient::statusManager_
StatusManager const * statusManager_
Definition: DQWorkerClient.h:67
ecaldqm::PresampleClient::toleranceHigh_
float toleranceHigh_
Definition: PresampleClient.h:20
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
ecaldqm::isForward
bool isForward(DetId const &)
Definition: EcalDQMCommonUtils.cc:243
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:118
EcalBarrel
Definition: EcalSubdetector.h:10
ecaldqm::PresampleClient::toleranceRMS_
float toleranceRMS_
Definition: PresampleClient.h:21
DetId
Definition: DetId.h:17
ecaldqm::DQWorkerClient::qualitySummaries_
std::set< std::string > qualitySummaries_
Definition: DQWorkerClient.h:63
ecaldqm::PresampleClient::expectedMean_
float expectedMean_
Definition: PresampleClient.h:18
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ecaldqm::DQWorker::GetTrigTowerMap
const EcalTrigTowerConstituentsMap * GetTrigTowerMap()
Definition: DQWorker.cc:124
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
ecaldqm::DQWorkerClient::kMBad
Definition: DQWorkerClient.h:44
EcalEndcap
Definition: EcalSubdetector.h:10
ecaldqm::DQWorkerClient::kUnknown
Definition: DQWorkerClient.h:44
ecaldqm::DQWorkerClient::kBad
Definition: DQWorkerClient.h:44
ecaldqm::DQWorkerClient::sources_
MESetCollection sources_
Definition: DQWorkerClient.h:62
ecaldqm::DQWorkerClient::kMGood
Definition: DQWorkerClient.h:44
EcalChannelStatusCode::kOk
Definition: EcalChannelStatusCode.h:21
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::DQWorkerClient::kMUnknown
Definition: DQWorkerClient.h:44
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
Definition: EcalDQMStatusHelper.h:24
ecaldqm::dccId
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:16
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
Definition: EcalDQMStatusHelper.h:25
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ecaldqm::DQWorkerClient::towerAverage_
void towerAverage_(MESet &, MESet const &, float)
Definition: DQWorkerClient.cc:159
ecaldqm::DQWorkerClient::kGood
Definition: DQWorkerClient.h:44
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:128
ecaldqm::PresampleClient::toleranceLow_
float toleranceLow_
Definition: PresampleClient.h:19
ecaldqm::PresampleClient::toleranceRMSFwd_
float toleranceRMSFwd_
Definition: PresampleClient.h:22