CMS 3D CMS Logo

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

#include <TowerStatusTask.h>

Inheritance diagram for ecaldqm::TowerStatusTask:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void producePlots (ProcessType) override
 
 TowerStatusTask ()
 
 ~TowerStatusTask () 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 setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void producePlotsTask_ (float const *, std::string const &)
 
void setParams (edm::ParameterSet const &) override
 
void setTokens (edm::ConsumesCollector &) override
 

Private Attributes

edm::ESGetToken< EcalDAQTowerStatus, EcalDAQTowerStatusRcddaqHndlToken
 
float daqStatus_ [nDCC]
 
edm::ESGetToken< EcalDCSTowerStatus, EcalDCSTowerStatusRcddcsHndlToken
 
float dcsStatus_ [nDCC]
 
bool doDAQInfo_
 
bool doDCSInfo_
 

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

Constructor & Destructor Documentation

◆ TowerStatusTask()

ecaldqm::TowerStatusTask::TowerStatusTask ( )

Definition at line 15 of file TowerStatusTask.cc.

15  : DQWorkerClient(), doDAQInfo_(false), doDCSInfo_(false) {
16  std::fill_n(daqStatus_, nDCC, 0.);
17  std::fill_n(dcsStatus_, nDCC, 0.);
18  }

References daqStatus_, dcsStatus_, and ecaldqm::nDCC.

◆ ~TowerStatusTask()

ecaldqm::TowerStatusTask::~TowerStatusTask ( )
inlineoverride

Definition at line 17 of file TowerStatusTask.h.

17 {}

Member Function Documentation

◆ endLuminosityBlock()

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

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 43 of file TowerStatusTask.cc.

43  {
44  if (doDAQInfo_) {
45  std::fill_n(daqStatus_, nDCC, 1.);
46 
47  const EcalDAQTowerStatus* daqHndl = &_es.getData(daqHndlToken);
48  auto daqhandle = _es.getHandle(daqHndlToken);
49  if (daqhandle.isValid()) {
50  for (unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++) {
51  if (daqHndl->barrel(id).getStatusCode() != 0) {
53  daqStatus_[dccId(ttid, GetElectronicsMap()) - 1] -= 25. / 1700.;
54  }
55  }
56  for (unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++) {
57  if (daqHndl->endcap(id).getStatusCode() != 0) {
59  unsigned dccid(dccId(scid, GetElectronicsMap()));
60  daqStatus_[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
61  }
62  }
63  } else
64  edm::LogWarning("EventSetup") << "EcalDAQTowerStatus record not valid";
65  }
66 
67  if (doDCSInfo_) {
68  std::fill_n(dcsStatus_, nDCC, 1.);
69 
70  const EcalDCSTowerStatus* dcsHndl = &_es.getData(dcsHndlToken);
71  auto dcshandle = _es.getHandle(dcsHndlToken);
72  if (dcshandle.isValid()) {
73  for (unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++) {
74  if (dcsHndl->barrel(id).getStatusCode() != 0) {
76  dcsStatus_[dccId(ttid, GetElectronicsMap()) - 1] -= 25. / 1700.;
77  }
78  }
79  for (unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++) {
80  if (dcsHndl->endcap(id).getStatusCode() != 0) {
82  unsigned dccid(dccId(scid, GetElectronicsMap()));
83  dcsStatus_[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
84  }
85  }
86  } else
87  edm::LogWarning("EventSetup") << "EcalDCSTowerStatus record not valid";
88  }
89  }

References EcalCondTowerObjectContainer< T >::barrel(), daqHndlToken, daqStatus_, ecaldqm::dccId(), dcsHndlToken, dcsStatus_, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, EcalCondTowerObjectContainer< T >::endcap(), edm::EventSetup::getData(), ecaldqm::DQWorker::GetElectronicsMap(), edm::EventSetup::getHandle(), EcalTrigTowerDetId::kEBTotalTowers, EcalScDetId::kSizeForDenseIndexing, ecaldqm::nCrystals(), ecaldqm::nDCC, ecaldqm::scConstituents(), findQualityFiles::size, and EcalScDetId::unhashIndex().

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 91 of file TowerStatusTask.cc.

91  {
92  if (doDAQInfo_)
94  if (doDCSInfo_)
96  }

References daqStatus_, dcsStatus_, doDAQInfo_, doDCSInfo_, and producePlotsTask_().

◆ producePlotsTask_()

void ecaldqm::TowerStatusTask::producePlotsTask_ ( float const *  _status,
std::string const &  _type 
)
private

Definition at line 98 of file TowerStatusTask.cc.

98  {
99  MESet* meSummary(nullptr);
100  MESet* meSummaryMap(nullptr);
101  MESet* meContents(nullptr);
102  meSummary = &MEs_.at(_type + "Summary");
103  meSummaryMap = &MEs_.at(_type + "SummaryMap");
104  meContents = &MEs_.at(_type + "Contents");
105 
106  meSummary->reset(GetElectronicsMap(), -1.);
107  meSummaryMap->resetAll(-1.);
108  meSummaryMap->reset(GetElectronicsMap());
109  meContents->reset(GetElectronicsMap(), -1.);
110 
111  float totalFraction(0.);
112  for (int iDCC(0); iDCC < nDCC; iDCC++) {
113  meSummaryMap->setBinContent(getEcalDQMSetupObjects(), iDCC + 1, _status[iDCC]);
114  meContents->fill(getEcalDQMSetupObjects(), iDCC + 1, _status[iDCC]);
115  totalFraction += _status[iDCC] / nCrystals(iDCC + 1);
116  }
117 
118  meSummary->fill(getEcalDQMSetupObjects(), totalFraction);
119  }

References ecaldqm::MESetCollection::at(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::MEs_, ecaldqm::nCrystals(), ecaldqm::nDCC, ecaldqm::MESet::reset(), ecaldqm::MESet::resetAll(), and ecaldqm::MESet::setBinContent().

Referenced by producePlots().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 20 of file TowerStatusTask.cc.

20  {
21  doDAQInfo_ = _params.getUntrackedParameter<bool>("doDAQInfo");
22  doDCSInfo_ = _params.getUntrackedParameter<bool>("doDCSInfo");
23 
24  if (doDAQInfo_ && doDCSInfo_)
25  return;
26  if (doDAQInfo_) {
27  MEs_.erase(std::string("DCSSummary"));
28  MEs_.erase(std::string("DCSSummaryMap"));
29  MEs_.erase(std::string("DCSContents"));
30  } else if (doDCSInfo_) {
31  MEs_.erase(std::string("DAQSummary"));
32  MEs_.erase(std::string("DAQSummaryMap"));
33  MEs_.erase(std::string("DAQContents"));
34  } else
35  throw cms::Exception("InvalidConfiguration") << "Nothing to do in TowerStatusTask";
36  }

References l1extraParticles_cfi::_params, doDAQInfo_, doDCSInfo_, ecaldqm::MESetCollection::erase(), Exception, ecaldqm::DQWorker::MEs_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ setTokens()

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

Member Data Documentation

◆ daqHndlToken

edm::ESGetToken<EcalDAQTowerStatus, EcalDAQTowerStatusRcd> ecaldqm::TowerStatusTask::daqHndlToken
private

Definition at line 26 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), and setTokens().

◆ daqStatus_

float ecaldqm::TowerStatusTask::daqStatus_[nDCC]
private

Definition at line 32 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), producePlots(), and TowerStatusTask().

◆ dcsHndlToken

edm::ESGetToken<EcalDCSTowerStatus, EcalDCSTowerStatusRcd> ecaldqm::TowerStatusTask::dcsHndlToken
private

Definition at line 27 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), and setTokens().

◆ dcsStatus_

float ecaldqm::TowerStatusTask::dcsStatus_[nDCC]
private

Definition at line 33 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), producePlots(), and TowerStatusTask().

◆ doDAQInfo_

bool ecaldqm::TowerStatusTask::doDAQInfo_
private

Definition at line 30 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), producePlots(), and setParams().

◆ doDCSInfo_

bool ecaldqm::TowerStatusTask::doDCSInfo_
private

Definition at line 31 of file TowerStatusTask.h.

Referenced by endLuminosityBlock(), producePlots(), and setParams().

ecaldqm::TowerStatusTask::doDCSInfo_
bool doDCSInfo_
Definition: TowerStatusTask.h:31
EcalCondTowerObjectContainer::endcap
const Item & endcap(size_t hashedIndex) const
Definition: EcalCondTowerObjectContainer.h:36
EcalScDetId::unhashIndex
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
EcalTrigTowerDetId::kEBTotalTowers
Definition: EcalTrigTowerDetId.h:116
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::TowerStatusTask::doDAQInfo_
bool doDAQInfo_
Definition: TowerStatusTask.h:30
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:118
EcalCondTowerObjectContainer
Definition: EcalCondTowerObjectContainer.h:13
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::TowerStatusTask::dcsHndlToken
edm::ESGetToken< EcalDCSTowerStatus, EcalDCSTowerStatusRcd > dcsHndlToken
Definition: TowerStatusTask.h:27
EcalScDetId
Definition: EcalScDetId.h:24
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:334
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::MESetCollection::erase
void erase(const std::string &key)
Definition: MESet.h:390
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
ecaldqm::TowerStatusTask::dcsStatus_
float dcsStatus_[nDCC]
Definition: TowerStatusTask.h:33
ecaldqm::TowerStatusTask::daqHndlToken
edm::ESGetToken< EcalDAQTowerStatus, EcalDAQTowerStatusRcd > daqHndlToken
Definition: TowerStatusTask.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ecaldqm::dccId
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:16
ecaldqm::scConstituents
std::vector< DetId > scConstituents(EcalScDetId const &)
Definition: EcalDQMCommonUtils.cc:173
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
edm::Transition::EndLuminosityBlock
Exception
Definition: hltDiff.cc:245
EcalCondTowerObjectContainer::barrel
const Item & barrel(size_t hashedIndex) const
Definition: EcalCondTowerObjectContainer.h:34
EcalTrigTowerDetId::detIdFromDenseIndex
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
Definition: EcalTrigTowerDetId.cc:104
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
ecaldqm::TowerStatusTask::producePlotsTask_
void producePlotsTask_(float const *, std::string const &)
Definition: TowerStatusTask.cc:98
ecaldqm::TowerStatusTask::daqStatus_
float daqStatus_[nDCC]
Definition: TowerStatusTask.h:32
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EcalScDetId::kSizeForDenseIndexing
Definition: EcalScDetId.h:188