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 std::string & getName () const
 
bool onlineMode () const
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

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

Private Attributes

float daqStatus_ [nDCC]
 
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)
 
- 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 10 of file TowerStatusTask.h.

Constructor & Destructor Documentation

◆ TowerStatusTask()

ecaldqm::TowerStatusTask::TowerStatusTask ( )

Definition at line 20 of file TowerStatusTask.cc.

20  : DQWorkerClient(), doDAQInfo_(false), doDCSInfo_(false) {
21  std::fill_n(daqStatus_, nDCC, 0.);
22  std::fill_n(dcsStatus_, nDCC, 0.);
23  }

References daqStatus_, dcsStatus_, and ecaldqm::nDCC.

◆ ~TowerStatusTask()

ecaldqm::TowerStatusTask::~TowerStatusTask ( )
inlineoverride

Definition at line 13 of file TowerStatusTask.h.

13 {}

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 
48  _es.get<EcalDAQTowerStatusRcd>().get(daqHndl);
49  if (daqHndl.isValid()) {
50  for (unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++) {
51  if (daqHndl->barrel(id).getStatusCode() != 0) {
53  daqStatus_[dccId(ttid) - 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));
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 
71  _es.get<EcalDCSTowerStatusRcd>().get(dcsHndl);
72  if (dcsHndl.isValid()) {
73  for (unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++) {
74  if (dcsHndl->barrel(id).getStatusCode() != 0) {
76  dcsStatus_[dccId(ttid) - 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));
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(), daqStatus_, ecaldqm::dccId(), dcsStatus_, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, EcalCondTowerObjectContainer< T >::endcap(), edm::EventSetup::get(), get, EcalDAQStatusCode::getStatusCode(), EcalChannelStatusCode::getStatusCode(), edm::ESHandleBase::isValid(), 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(-1.);
107  meSummaryMap->resetAll(-1.);
108  meSummaryMap->reset();
109  meContents->reset(-1.);
110 
111  float totalFraction(0.);
112  for (int iDCC(0); iDCC < nDCC; iDCC++) {
113  meSummaryMap->setBinContent(iDCC + 1, _status[iDCC]);
114  meContents->fill(iDCC + 1, _status[iDCC]);
115  totalFraction += _status[iDCC] / nCrystals(iDCC + 1);
116  }
117 
118  meSummary->fill(totalFraction);
119  }

References ecaldqm::MESet::fill(), 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 25 of file TowerStatusTask.cc.

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

References l1extraParticles_cfi::_params, doDAQInfo_, doDCSInfo_, Exception, ecaldqm::DQWorker::MEs_, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ daqStatus_

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

Definition at line 25 of file TowerStatusTask.h.

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

◆ dcsStatus_

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

Definition at line 26 of file TowerStatusTask.h.

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

◆ doDAQInfo_

bool ecaldqm::TowerStatusTask::doDAQInfo_
private

Definition at line 23 of file TowerStatusTask.h.

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

◆ doDCSInfo_

bool ecaldqm::TowerStatusTask::doDCSInfo_
private

Definition at line 24 of file TowerStatusTask.h.

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

ecaldqm::TowerStatusTask::doDCSInfo_
bool doDCSInfo_
Definition: TowerStatusTask.h:24
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
EcalDCSTowerStatusRcd
Definition: EcalDCSTowerStatusRcd.h:5
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::TowerStatusTask::doDAQInfo_
bool doDAQInfo_
Definition: TowerStatusTask.h:23
EcalScDetId
Definition: EcalScDetId.h:24
edm::ESHandle
Definition: DTSurvey.h:22
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:334
EcalChannelStatusCode::getStatusCode
Code getStatusCode() const
return decoded status
Definition: EcalChannelStatusCode.h:47
EcalDAQStatusCode::getStatusCode
uint16_t getStatusCode() const
Definition: EcalDAQStatusCode.h:26
ecaldqm::DQWorkerClient::DQWorkerClient
DQWorkerClient()
Definition: DQWorkerClient.cc:17
ecaldqm::TowerStatusTask::dcsStatus_
float dcsStatus_[nDCC]
Definition: TowerStatusTask.h:26
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
EcalTrigTowerDetId::kEBTotalTowers
Definition: EcalTrigTowerDetId.h:116
ecaldqm::scConstituents
std::vector< DetId > scConstituents(EcalScDetId const &)
Definition: EcalDQMCommonUtils.cc:173
Exception
Definition: hltDiff.cc:246
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:92
EcalScDetId::kSizeForDenseIndexing
Definition: EcalScDetId.h:188
ecaldqm::TowerStatusTask::producePlotsTask_
void producePlotsTask_(float const *, std::string const &)
Definition: TowerStatusTask.cc:98
ecaldqm::TowerStatusTask::daqStatus_
float daqStatus_[nDCC]
Definition: TowerStatusTask.h:25
EcalDAQTowerStatusRcd
Definition: EcalDAQTowerStatusRcd.h:5
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:16