CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
void releaseMEs () override
 
void releaseSource ()
 
virtual void resetMEs ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
virtual ~DQWorkerClient ()
 
- 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 &)
 
std::string const & 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 ()(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 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

ecaldqm::TowerStatusTask::TowerStatusTask ( )

Definition at line 20 of file TowerStatusTask.cc.

References daqStatus_, dcsStatus_, and ecaldqm::nDCC.

20  :
22  doDAQInfo_(false),
23  doDCSInfo_(false)
24  {
25  std::fill_n(daqStatus_, nDCC, 0.);
26  std::fill_n(dcsStatus_, nDCC, 0.);
27  }
ecaldqm::TowerStatusTask::~TowerStatusTask ( )
inline

Definition at line 13 of file TowerStatusTask.h.

13 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 51 of file TowerStatusTask.cc.

References daqStatus_, ecaldqm::dccId(), dcsStatus_, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, edm::EventSetup::get(), edm::ESHandleBase::isValid(), EcalTrigTowerDetId::kEBTotalTowers, EcalScDetId::kSizeForDenseIndexing, ecaldqm::nCrystals(), ecaldqm::nDCC, ecaldqm::scConstituents(), findQualityFiles::size, and EcalScDetId::unhashIndex().

52  {
53  if(doDAQInfo_){
54  std::fill_n(daqStatus_, nDCC, 1.);
55 
57  _es.get<EcalDAQTowerStatusRcd>().get(daqHndl);
58  if(daqHndl.isValid()){
59  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
60  if(daqHndl->barrel(id).getStatusCode() != 0){
62  daqStatus_[dccId(ttid) - 1] -= 25. / 1700.;
63  }
64  }
65  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
66  if(daqHndl->endcap(id).getStatusCode() != 0){
68  unsigned dccid(dccId(scid));
69  daqStatus_[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
70  }
71  }
72  }
73  else
74  edm::LogWarning("EventSetup") << "EcalDAQTowerStatus record not valid";
75  }
76 
77  if(doDCSInfo_){
78  std::fill_n(dcsStatus_, nDCC, 1.);
79 
81  _es.get<EcalDCSTowerStatusRcd>().get(dcsHndl);
82  if(dcsHndl.isValid()){
83  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
84  if(dcsHndl->barrel(id).getStatusCode() != 0){
86  dcsStatus_[dccId(ttid) - 1] -= 25. / 1700.;
87  }
88  }
89  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
90  if(dcsHndl->endcap(id).getStatusCode() != 0){
92  unsigned dccid(dccId(scid));
93  dcsStatus_[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
94  }
95  }
96  }
97  else
98  edm::LogWarning("EventSetup") << "EcalDCSTowerStatus record not valid";
99  }
100  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
unsigned nCrystals(unsigned)
std::vector< DetId > scConstituents(EcalScDetId const &)
bool isValid() const
Definition: ESHandle.h:47
unsigned dccId(DetId const &)
tuple size
Write out results.
void ecaldqm::TowerStatusTask::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 103 of file TowerStatusTask.cc.

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

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

Definition at line 110 of file TowerStatusTask.cc.

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

Referenced by producePlots().

111  {
112  MESet* meSummary(0);
113  MESet* meSummaryMap(0);
114  MESet* meContents(0);
115  meSummary = &MEs_.at(_type + "Summary");
116  meSummaryMap = &MEs_.at(_type + "SummaryMap");
117  meContents = &MEs_.at(_type + "Contents");
118 
119  meSummary->reset(-1.);
120  meSummaryMap->resetAll(-1.);
121  meSummaryMap->reset();
122  meContents->reset(-1.);
123 
124  float totalFraction(0.);
125  for(int iDCC(0); iDCC < nDCC; iDCC++){
126  meSummaryMap->setBinContent(iDCC + 1, _status[iDCC]);
127  meContents->fill(iDCC + 1, _status[iDCC]);
128  totalFraction += _status[iDCC] / nCrystals(iDCC + 1);
129  }
130 
131  meSummary->fill(totalFraction);
132  }
unsigned nCrystals(unsigned)
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::TowerStatusTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 30 of file TowerStatusTask.cc.

References doDAQInfo_, doDCSInfo_, Exception, edm::ParameterSet::getUntrackedParameter(), ecaldqm::DQWorker::MEs_, and AlCaHLTBitMon_QueryRunRegistry::string.

31  {
32  doDAQInfo_ = _params.getUntrackedParameter<bool>("doDAQInfo");
33  doDCSInfo_ = _params.getUntrackedParameter<bool>("doDCSInfo");
34 
35  if(doDAQInfo_ && doDCSInfo_) return;
36  if(doDAQInfo_){
37  MEs_.erase(std::string("DCSSummary"));
38  MEs_.erase(std::string("DCSSummaryMap"));
39  MEs_.erase(std::string("DCSContents"));
40  }
41  else if(doDCSInfo_){
42  MEs_.erase(std::string("DAQSummary"));
43  MEs_.erase(std::string("DAQSummaryMap"));
44  MEs_.erase(std::string("DAQContents"));
45  }
46  else
47  throw cms::Exception("InvalidConfiguration") << "Nothing to do in TowerStatusTask";
48  }
MESetCollection MEs_
Definition: DQWorker.h:75

Member Data Documentation

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

Definition at line 25 of file TowerStatusTask.h.

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

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

Definition at line 26 of file TowerStatusTask.h.

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

bool ecaldqm::TowerStatusTask::doDAQInfo_
private

Definition at line 23 of file TowerStatusTask.h.

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

bool ecaldqm::TowerStatusTask::doDCSInfo_
private

Definition at line 24 of file TowerStatusTask.h.

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