CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::TowerStatusTask Class Reference

#include <TowerStatusTask.h>

Inheritance diagram for ecaldqm::TowerStatusTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Types

enum  InfoType { DAQInfo, DCSInfo }
 
- Public Types inherited from ecaldqm::DQWorkerTask
typedef
EcalDCCHeaderBlock::EcalDCCEventSettings 
EventSettings
 

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void runOnTowerStatus (float const *, InfoType)
 
 TowerStatusTask ()
 
 ~TowerStatusTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual bool analyze (void const *, Collections)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterRunType (short const *)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
virtual ~DQWorkerTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & getName () const
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
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 ()
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

bool doDAQInfo_
 
bool doDCSInfo_
 

Additional Inherited Members

- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
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::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorkerTask
std::set< std::string > resettable_
 
- Protected Attributes inherited from ecaldqm::DQWorker
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 8 of file TowerStatusTask.h.

Member Enumeration Documentation

Enumerator
DAQInfo 
DCSInfo 

Definition at line 10 of file TowerStatusTask.h.

Constructor & Destructor Documentation

ecaldqm::TowerStatusTask::TowerStatusTask ( )

Definition at line 22 of file TowerStatusTask.cc.

22  :
23  DQWorkerTask(),
24  doDAQInfo_(false),
25  doDCSInfo_(false)
26  {
27  }
ecaldqm::TowerStatusTask::~TowerStatusTask ( )
inline

Definition at line 16 of file TowerStatusTask.h.

16 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 51 of file TowerStatusTask.cc.

References DAQInfo, ecaldqm::dccId(), DCSInfo, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, edm::EventSetup::get(), edm::ESHandleBase::isValid(), EcalTrigTowerDetId::kEBTotalTowers, EcalScDetId::kSizeForDenseIndexing, ecaldqm::nCrystals(), ecaldqm::nDCC, runOnTowerStatus(), ecaldqm::scConstituents(), findQualityFiles::size, ntuplemaker::status, and EcalScDetId::unhashIndex().

52  {
53  if(doDAQInfo_){
54  float status[nDCC];
55  std::fill_n(status, nDCC, 1.);
56 
58  _es.get<EcalDAQTowerStatusRcd>().get(daqHndl);
59  if(daqHndl.isValid()){
60  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
61  if(daqHndl->barrel(id).getStatusCode() != 0){
63  status[dccId(ttid) - 1] -= 25. / 1700.;
64  }
65  }
66  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
67  if(daqHndl->endcap(id).getStatusCode() != 0){
69  unsigned dccid(dccId(scid));
70  status[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
71  }
72  }
73 
74  runOnTowerStatus(status, DAQInfo);
75  }
76  else
77  edm::LogWarning("EventSetup") << "EcalDAQTowerStatus record not valid";
78  }
79 
80  if(doDCSInfo_){
81  float status[nDCC];
82  std::fill_n(status, nDCC, 1.);
83 
85  _es.get<EcalDCSTowerStatusRcd>().get(dcsHndl);
86  if(dcsHndl.isValid()){
87  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
88  if(dcsHndl->barrel(id).getStatusCode() != 0){
90  status[dccId(ttid) - 1] -= 25. / 1700.;
91  }
92  }
93  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
94  if(dcsHndl->endcap(id).getStatusCode() != 0){
96  unsigned dccid(dccId(scid));
97  status[dccid - 1] -= double(scConstituents(scid).size()) / nCrystals(dccid);
98  }
99  }
100 
101  runOnTowerStatus(status, DCSInfo);
102  }
103  else
104  edm::LogWarning("EventSetup") << "EcalDCSTowerStatus record not valid";
105  }
106  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
unsigned nCrystals(unsigned)
void runOnTowerStatus(float const *, InfoType)
std::vector< DetId > scConstituents(EcalScDetId const &)
tuple status
Definition: ntuplemaker.py:245
bool isValid() const
Definition: ESHandle.h:37
unsigned dccId(DetId const &)
tuple size
Write out results.
void ecaldqm::TowerStatusTask::runOnTowerStatus ( float const *  _status,
InfoType  _type 
)

Definition at line 109 of file TowerStatusTask.cc.

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

Referenced by beginLuminosityBlock().

110  {
111  MESet* meSummary(0);
112  MESet* meSummaryMap(0);
113  MESet* meContents(0);
114  if(_type == DAQInfo){
115  meSummary = &MEs_.at("DAQSummary");
116  meSummaryMap = &MEs_.at("DAQSummaryMap");
117  meContents = &MEs_.at("DAQContents");
118  }
119  else{
120  meSummary = &MEs_.at("DCSSummary");
121  meSummaryMap = &MEs_.at("DCSSummaryMap");
122  meContents = &MEs_.at("DCSContents");
123  }
124 
125  meSummary->reset(-1.);
126  meSummaryMap->resetAll(-1.);
127  meSummaryMap->reset();
128  meContents->reset(-1.);
129 
130  float totalFraction(0.);
131  for(int iDCC(0); iDCC < nDCC; iDCC++){
132  meSummaryMap->setBinContent(iDCC + 1, _status[iDCC]);
133  meContents->fill(iDCC + 1, _status[iDCC]);
134  totalFraction += _status[iDCC] / nCrystals(iDCC + 1);
135  }
136 
137  meSummary->fill(totalFraction);
138  }
unsigned nCrystals(unsigned)
MESetCollection MEs_
Definition: DQWorker.h:76
void ecaldqm::TowerStatusTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 30 of file TowerStatusTask.cc.

References doDAQInfo_, doDCSInfo_, edm::hlt::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:76

Member Data Documentation

bool ecaldqm::TowerStatusTask::doDAQInfo_
private

Definition at line 25 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), and setParams().

bool ecaldqm::TowerStatusTask::doDCSInfo_
private

Definition at line 26 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), and setParams().