CMS 3D CMS Logo

TowerStatusTask.cc
Go to the documentation of this file.
2 
7 
12 
17 
18 namespace ecaldqm {
19 
20  TowerStatusTask::TowerStatusTask() : DQWorkerClient(), doDAQInfo_(false), doDCSInfo_(false) {
21  std::fill_n(daqStatus_, nDCC, 0.);
22  std::fill_n(dcsStatus_, nDCC, 0.);
23  }
24 
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  }
42 
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, 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 
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, 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:10
TowerStatusTask.h
MessageLogger.h
ecaldqm::TowerStatusTask::doDCSInfo_
bool doDCSInfo_
Definition: TowerStatusTask.h:24
funct::false
false
Definition: Factorize.h:29
ecaldqm
Definition: DQWorker.h:29
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:20
EcalDCSTowerStatusRcd
Definition: EcalDCSTowerStatusRcd.h:5
ecaldqm::TowerStatusTask::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TowerStatusTask.cc:43
EcalDAQTowerStatusRcd.h
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::TowerStatusTask::doDAQInfo_
bool doDAQInfo_
Definition: TowerStatusTask.h:23
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
EcalScDetId
Definition: EcalScDetId.h:24
ecaldqm::DQWorkerClient::ProcessType
ProcessType
Definition: DQWorkerClient.h:15
edm::ESHandle
Definition: DTSurvey.h:22
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:104
EcalTrigTowerDetId.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
ecaldqm::TowerStatusTask::dcsStatus_
float dcsStatus_[nDCC]
Definition: TowerStatusTask.h:26
edm::EventSetup
Definition: EventSetup.h:58
ecaldqm::DQWorkerClient
Definition: DQWorkerClient.h:13
get
#define get
EcalDAQTowerStatus.h
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
ecaldqm::dccId
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:16
EcalTrigTowerDetId::kEBTotalTowers
Definition: EcalTrigTowerDetId.h:116
ecaldqm::scConstituents
std::vector< DetId > scConstituents(EcalScDetId const &)
Definition: EcalDQMCommonUtils.cc:173
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
EcalDCSTowerStatus.h
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:141
EcalScDetId::kSizeForDenseIndexing
Definition: EcalScDetId.h:188
ParameterSet.h
EcalDCSTowerStatusRcd.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:25
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
ecaldqm::MESet
Definition: MESet.h:42
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443