CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 &)
 
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 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.

References daqStatus_, dcsStatus_, and ecaldqm::nDCC.

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

◆ ~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.

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().

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  }
size
Write out results.
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
edm::ESGetToken< EcalDAQTowerStatus, EcalDAQTowerStatusRcd > daqHndlToken
edm::ESGetToken< EcalDCSTowerStatus, EcalDCSTowerStatusRcd > dcsHndlToken
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
const Item & barrel(size_t hashedIndex) const
unsigned nCrystals(unsigned)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
const Item & endcap(size_t hashedIndex) const
std::vector< DetId > scConstituents(EcalScDetId const &)
Log< level::Warning, false > LogWarning

◆ producePlots()

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

Implements ecaldqm::DQWorkerClient.

Definition at line 91 of file TowerStatusTask.cc.

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

91  {
92  if (doDAQInfo_)
94  if (doDCSInfo_)
96  }
void producePlotsTask_(float const *, std::string const &)

◆ producePlotsTask_()

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

Definition at line 98 of file TowerStatusTask.cc.

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().

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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned nCrystals(unsigned)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 20 of file TowerStatusTask.cc.

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

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  }
MESetCollection MEs_
Definition: DQWorker.h:131
void erase(const std::string &key)
Definition: MESet.h:390

◆ setTokens()

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

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 38 of file TowerStatusTask.cc.

References daqHndlToken, dcsHndlToken, edm::EndLuminosityBlock, and edm::ConsumesCollector::esConsumes().

38  {
41  }
edm::ESGetToken< EcalDAQTowerStatus, EcalDAQTowerStatusRcd > daqHndlToken
edm::ESGetToken< EcalDCSTowerStatus, EcalDCSTowerStatusRcd > dcsHndlToken

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().