CMS 3D CMS Logo

TowerStatusTask.cc
Go to the documentation of this file.
2 
7 
12 
13 namespace ecaldqm {
14 
15  TowerStatusTask::TowerStatusTask() : DQWorkerClient(), doDAQInfo_(false), doDCSInfo_(false) {
16  std::fill_n(daqStatus_, nDCC, 0.);
17  std::fill_n(dcsStatus_, nDCC, 0.);
18  }
19 
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  }
37 
41  }
42 
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  }
90 
92  if (doDAQInfo_)
94  if (doDCSInfo_)
96  }
97 
98  void TowerStatusTask::producePlotsTask_(float const* _status, std::string const& _type) {
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  }
120 
122 } // namespace ecaldqm
ecaldqm::TowerStatusTask
Definition: TowerStatusTask.h:14
TowerStatusTask.h
MessageLogger.h
ecaldqm::TowerStatusTask::doDCSInfo_
bool doDCSInfo_
Definition: TowerStatusTask.h:31
funct::false
false
Definition: Factorize.h:29
ecaldqm
Definition: DQWorker.h:37
ESHandle.h
EcalCondTowerObjectContainer::endcap
const Item & endcap(size_t hashedIndex) const
Definition: EcalCondTowerObjectContainer.h:36
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
ecaldqm::MESet::setBinContent
virtual void setBinContent(EcalDQMSetupObjects const, DetId const &, double)
Definition: MESet.h:79
ecaldqm::TowerStatusTask::producePlots
void producePlots(ProcessType) override
Definition: TowerStatusTask.cc:91
ecaldqm::MESet::fill
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
EBDetId.h
EEDetId.h
EcalScDetId::unhashIndex
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::TowerStatusTask::TowerStatusTask
TowerStatusTask()
Definition: TowerStatusTask.cc:15
ecaldqm::TowerStatusTask::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TowerStatusTask.cc:43
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::DQWorkerClient::ProcessType
ProcessType
Definition: DQWorkerClient.h:19
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
EcalTrigTowerDetId.h
ecaldqm::TowerStatusTask::setTokens
void setTokens(edm::ConsumesCollector &) override
Definition: TowerStatusTask.cc:38
edm::ParameterSet
Definition: ParameterSet.h:47
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
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
ecaldqm::TowerStatusTask::dcsStatus_
float dcsStatus_[nDCC]
Definition: TowerStatusTask.h:33
edm::EventSetup
Definition: EventSetup.h:58
ecaldqm::DQWorkerClient
Definition: DQWorkerClient.h:17
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
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
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
EcalScDetId.h
Exception
Definition: hltDiff.cc:245
EcalCondTowerObjectContainer::barrel
const Item & barrel(size_t hashedIndex) const
Definition: EcalCondTowerObjectContainer.h:34
EventSetup.h
EcalTrigTowerDetId::detIdFromDenseIndex
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
Definition: EcalTrigTowerDetId.cc:104
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
DEFINE_ECALDQM_WORKER
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:162
ParameterSet.h
ecaldqm::MESet::resetAll
virtual void resetAll(double=0., double=0., double=0.)
Definition: MESet.cc:108
ecaldqm::TowerStatusTask::setParams
void setParams(edm::ParameterSet const &) override
Definition: TowerStatusTask.cc:20
ecaldqm::TowerStatusTask::producePlotsTask_
void producePlotsTask_(float const *, std::string const &)
Definition: TowerStatusTask.cc:98
ecaldqm::TowerStatusTask::daqStatus_
float daqStatus_[nDCC]
Definition: TowerStatusTask.h:32
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
ecaldqm::MESet
Definition: MESet.h:42
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EcalScDetId::kSizeForDenseIndexing
Definition: EcalScDetId.h:188