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 | Static Public Member Functions | Private Attributes
ecaldqm::TowerStatusTask Class Reference

#include <TowerStatusTask.h>

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

Public Types

enum  MESets {
  kDAQSummary, kDAQSummaryMap, kDAQContents, kDCSSummary,
  kDCSSummaryMap, kDCSContents, nMESets
}
 
- Public Types inherited from ecaldqm::DQWorker
enum  MESets { nMESets }
 

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void bookMEs () override
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
void runOnTowerStatus (const std::map< uint32_t, bool > &, int)
 
 TowerStatusTask (const edm::ParameterSet &, const edm::ParameterSet &)
 
 ~TowerStatusTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void analyze (const void *, Collections)
 
virtual void beginEvent (const edm::Event &, const edm::EventSetup &)
 
 DQWorkerTask (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
virtual void endEvent (const edm::Event &, const edm::EventSetup &)
 
virtual bool filterRunType (const std::vector< short > &)
 
virtual bool filterTrigger (const edm::TriggerResultsByName &)
 
virtual const std::vector
< std::pair< Collections,
Collections > > & 
getDependencies ()
 
virtual bool runsOn (unsigned)
 
virtual ~DQWorkerTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
 DQWorker (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
const std::vector< MESet * > & getMEs ()
 
virtual std::string const & getName ()
 
virtual bool isInitialized ()
 
virtual void reset ()
 
virtual void setInitialized (bool _init)
 
virtual void setVerbosity (int _verbosity)
 
virtual ~DQWorker ()
 

Static Public Member Functions

static void setMEData (std::vector< MEData > &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void setMEData (std::vector< MEData > &)
 

Private Attributes

std::map< uint32_t, bool > daqLumiStatus_
 
std::map< uint32_t, bool > daqRunStatus_
 
std::map< uint32_t, bool > dcsLumiStatus_
 
std::map< uint32_t, bool > dcsRunStatus_
 
bool doDAQInfo_
 
bool doDCSInfo_
 

Additional Inherited Members

- Static Public Attributes inherited from ecaldqm::DQWorker
static std::map< std::string,
std::vector< MEData > > 
meData
 
- Protected Member Functions inherited from ecaldqm::DQWorker
MESetcreateMESet_ (std::string const &, MEData const &, bool _readOnly=false) const
 
void meSet_ (unsigned, edm::ParameterSet const &)
 
- Protected Attributes inherited from ecaldqm::DQWorkerTask
uint32_t collectionMask_
 
std::vector< std::pair
< Collections, Collections > > 
dependencies_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool initialized_
 
std::vector< MESet * > MEs_
 
std::string name_
 
int verbosity_
 

Detailed Description

Definition at line 8 of file TowerStatusTask.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ecaldqm::TowerStatusTask::TowerStatusTask ( const edm::ParameterSet _params,
const edm::ParameterSet _paths 
)

Definition at line 21 of file TowerStatusTask.cc.

References ecaldqm::DQWorkerTask::collectionMask_, doDAQInfo_, doDCSInfo_, edm::hlt::Exception, edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::kLumiSection, ecaldqm::kRun, and ecaldqm::DQWorker::name_.

21  :
22  DQWorkerTask(_params, _paths, "TowerStatusTask"),
24  daqRunStatus_(),
26  dcsRunStatus_(),
27  doDAQInfo_(false),
28  doDCSInfo_(false)
29  {
31  (0x1 << kRun) |
32  (0x1 << kLumiSection);
33 
34  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
35 
36  doDAQInfo_ = taskParams.getUntrackedParameter<bool>("doDAQInfo");
37  doDCSInfo_ = taskParams.getUntrackedParameter<bool>("doDCSInfo");
38 
39  if(!doDAQInfo_ && !doDCSInfo_)
40  throw cms::Exception("InvalidConfiguration") << "Nonthing to do in TowerStatusTask";
41  }
DQWorkerTask(const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
Definition: DQWorkerTask.cc:5
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
std::map< uint32_t, bool > daqLumiStatus_
std::map< uint32_t, bool > dcsRunStatus_
std::map< uint32_t, bool > daqRunStatus_
std::map< uint32_t, bool > dcsLumiStatus_
std::string name_
Definition: DQWorker.h:55
ecaldqm::TowerStatusTask::~TowerStatusTask ( )

Definition at line 43 of file TowerStatusTask.cc.

44  {
45  }

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 108 of file TowerStatusTask.cc.

References daqLumiStatus_, daqRunStatus_, dcsLumiStatus_, dcsRunStatus_, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, edm::EventSetup::get(), edm::ESHandleBase::isValid(), EcalTrigTowerDetId::kEBTotalTowers, EcalScDetId::kSizeForDenseIndexing, DetId::rawId(), ntuplemaker::status, and EcalScDetId::unhashIndex().

109  {
111  if(doDAQInfo_){
112  _es.get<EcalDAQTowerStatusRcd>().get(daqHndl);
113  if (!daqHndl.isValid()){
114  edm::LogWarning("EventSetup") << "EcalDAQTowerStatus record not valid";
115  return;
116  }
117  }
118 
120  if(doDCSInfo_){
121  _es.get<EcalDCSTowerStatusRcd>().get(dcsHndl);
122  if (!dcsHndl.isValid()){
123  edm::LogWarning("EventSetup") << "EcalDCSTowerStatus record not valid";
124  return;
125  }
126  }
127 
128  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
130  if(doDAQInfo_){
131  uint16_t status(daqHndl->barrel(id).getStatusCode());
132  if(status != 0){
133  daqLumiStatus_[ttid.rawId()] = false;
134  daqRunStatus_[ttid.rawId()] = false;
135  }
136  }
137  if(doDCSInfo_){
138  uint16_t status(dcsHndl->barrel(id).getStatusCode());
139  if(status != 0){
140  dcsLumiStatus_[ttid.rawId()] = false;
141  dcsRunStatus_[ttid.rawId()] = false;
142  }
143  }
144  }
145 
146  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
148  if(doDAQInfo_){
149  uint16_t status(daqHndl->endcap(id).getStatusCode());
150  if(status != 0){
151  daqLumiStatus_[scid.rawId()] = false;
152  daqRunStatus_[scid.rawId()] = false;
153  }
154  }
155  if(doDCSInfo_){
156  uint16_t status(dcsHndl->endcap(id).getStatusCode());
157  if(status != 0){
158  dcsLumiStatus_[scid.rawId()] = false;
159  dcsRunStatus_[scid.rawId()] = false;
160  }
161  }
162  }
163  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
std::map< uint32_t, bool > daqLumiStatus_
std::map< uint32_t, bool > dcsRunStatus_
std::map< uint32_t, bool > daqRunStatus_
const T & get() const
Definition: EventSetup.h:55
std::map< uint32_t, bool > dcsLumiStatus_
tuple status
Definition: ntuplemaker.py:245
bool isValid() const
Definition: ESHandle.h:37
void ecaldqm::TowerStatusTask::beginRun ( const edm::Run ,
const edm::EventSetup  
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 53 of file TowerStatusTask.cc.

References daqLumiStatus_, daqRunStatus_, dcsLumiStatus_, dcsRunStatus_, EcalTrigTowerDetId::detIdFromDenseIndex(), doDAQInfo_, doDCSInfo_, kDAQContents, kDAQSummary, kDAQSummaryMap, kDCSContents, kDCSSummary, kDCSSummaryMap, EcalTrigTowerDetId::kEBTotalTowers, EcalScDetId::kSizeForDenseIndexing, ecaldqm::DQWorker::MEs_, DetId::rawId(), and EcalScDetId::unhashIndex().

54  {
55  if(doDAQInfo_){
56  MEs_[kDAQSummary]->book();
57  MEs_[kDAQSummaryMap]->book();
58  MEs_[kDAQContents]->book();
59 
60  MEs_[kDAQSummaryMap]->resetAll(-1.);
61  }
62  if(doDCSInfo_){
63  MEs_[kDCSSummary]->book();
64  MEs_[kDCSSummaryMap]->book();
65  MEs_[kDCSContents]->book();
66 
67  MEs_[kDCSSummaryMap]->resetAll(-1.);
68  }
69 
70  daqLumiStatus_.clear();
71  daqRunStatus_.clear();
72  dcsLumiStatus_.clear();
73  dcsRunStatus_.clear();
74 
75  for(unsigned id(0); id < EcalTrigTowerDetId::kEBTotalTowers; id++){
77  if(doDAQInfo_){
78  daqLumiStatus_[ttid.rawId()] = true;
79  daqRunStatus_[ttid.rawId()] = true;
80  }
81  if(doDCSInfo_){
82  dcsLumiStatus_[ttid.rawId()] = true;
83  dcsRunStatus_[ttid.rawId()] = true;
84  }
85  }
86 
87  for(unsigned id(0); id < EcalScDetId::kSizeForDenseIndexing; id++){
89  if(doDAQInfo_){
90  daqLumiStatus_[scid.rawId()] = true;
91  daqRunStatus_[scid.rawId()] = true;
92  }
93  if(doDCSInfo_){
94  dcsLumiStatus_[scid.rawId()] = true;
95  dcsRunStatus_[scid.rawId()] = true;
96  }
97  }
98  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
std::map< uint32_t, bool > daqLumiStatus_
std::map< uint32_t, bool > dcsRunStatus_
std::map< uint32_t, bool > daqRunStatus_
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
std::map< uint32_t, bool > dcsLumiStatus_
void ecaldqm::TowerStatusTask::bookMEs ( )
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 48 of file TowerStatusTask.cc.

49  {
50  }
void ecaldqm::TowerStatusTask::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 166 of file TowerStatusTask.cc.

References daqLumiStatus_, dcsLumiStatus_, doDAQInfo_, doDCSInfo_, and runOnTowerStatus().

167  {
170  }
std::map< uint32_t, bool > daqLumiStatus_
void runOnTowerStatus(const std::map< uint32_t, bool > &, int)
std::map< uint32_t, bool > dcsLumiStatus_
void ecaldqm::TowerStatusTask::endRun ( const edm::Run ,
const edm::EventSetup  
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 101 of file TowerStatusTask.cc.

References daqRunStatus_, dcsRunStatus_, doDAQInfo_, doDCSInfo_, and runOnTowerStatus().

102  {
105  }
std::map< uint32_t, bool > dcsRunStatus_
std::map< uint32_t, bool > daqRunStatus_
void runOnTowerStatus(const std::map< uint32_t, bool > &, int)
void ecaldqm::TowerStatusTask::runOnTowerStatus ( const std::map< uint32_t, bool > &  _status,
int  _type 
)

Definition at line 173 of file TowerStatusTask.cc.

References relmon_rootfiles_spy::contents, gather_cfg::cout, ecaldqm::dccId(), EcalElectronicsMapping::dccTowerConstituents(), EcalTriggerTower, ecaldqm::getElectronicsMap(), ecaldqm::DQWorker::initialized_, kDAQContents, kDAQSummary, kDAQSummaryMap, kDCSContents, kDCSSummary, kDCSSummaryMap, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, ecaldqm::DQWorker::MEs_, findQualityFiles::size, ntuplemaker::status, edmLumisInFiles::summary, and ecaldqm::towerId().

Referenced by endLuminosityBlock(), and endRun().

174  {
175  if(!initialized_) return;
176 
177  std::vector<int> activeChannels(54, 0);
178 
179  unsigned summary, summaryMap, contents;
180  if(_type == 0){
181  summary = kDAQSummary;
182  summaryMap = kDAQSummaryMap;
183  contents = kDAQContents;
184  }
185  else{
186  summary = kDCSSummary;
187  summaryMap = kDCSSummaryMap;
188  contents = kDCSContents;
189  }
190 
191  MEs_[summaryMap]->reset();
192 
193  for(std::map<uint32_t, bool>::const_iterator stItr(_status.begin()); stItr != _status.end(); ++stItr){
194  DetId id(stItr->first);
195  bool status(stItr->second);
196 
197  std::cout.flush();
198  MEs_[summaryMap]->setBinContent(id, status ? 1. : 0.);
199 
200  if(status){
201  if(id.subdetId() == EcalTriggerTower)
202  activeChannels[dccId(id) - 1] += 25;
203  else{
204  int dccid(dccId(id));
205  int towerid(towerId(id));
206  activeChannels[dccId(id) - 1] += getElectronicsMap()->dccTowerConstituents(dccid, towerid).size();
207  }
208  }
209  }
210 
211  int totalActive(0);
212  for(unsigned iDCC(0); iDCC < 54; iDCC++){
213  float fraction(float(activeChannels[iDCC]) / float(getElectronicsMap()->dccConstituents(iDCC + 1).size()));
214  MEs_[contents]->fill(iDCC + 1, fraction);
215  totalActive += activeChannels[iDCC];
216  }
217 
218  MEs_[summary]->fill(float(totalActive) / float(EBDetId::kSizeForDenseIndexing + EEDetId::kSizeForDenseIndexing));
219  }
const EcalElectronicsMapping * getElectronicsMap()
unsigned dccId(const DetId &)
unsigned towerId(const DetId &)
Definition: DetId.h:18
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
tuple size
Write out results.
std::vector< DetId > dccTowerConstituents(int dccId, int tower) const
Get the constituent detids for this dccId.
void ecaldqm::TowerStatusTask::setMEData ( std::vector< MEData > &  _data)
static

Definition at line 223 of file TowerStatusTask.cc.

References MonitorElement::DQM_KIND_REAL, MonitorElement::DQM_KIND_TH2F, kDAQContents, kDAQSummary, kDAQSummaryMap, kDCSContents, kDCSSummary, kDCSSummaryMap, EcalDQMBinningService::kEcal, EcalDQMBinningService::kReport, EcalDQMBinningService::kSM, and EcalDQMBinningService::kSuperCrystal.

224  {
231  }

Member Data Documentation

std::map<uint32_t, bool> ecaldqm::TowerStatusTask::daqLumiStatus_
private

Definition at line 35 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), beginRun(), and endLuminosityBlock().

std::map<uint32_t, bool> ecaldqm::TowerStatusTask::daqRunStatus_
private

Definition at line 35 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), beginRun(), and endRun().

std::map<uint32_t, bool> ecaldqm::TowerStatusTask::dcsLumiStatus_
private

Definition at line 36 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), beginRun(), and endLuminosityBlock().

std::map<uint32_t, bool> ecaldqm::TowerStatusTask::dcsRunStatus_
private

Definition at line 36 of file TowerStatusTask.h.

Referenced by beginLuminosityBlock(), beginRun(), and endRun().

bool ecaldqm::TowerStatusTask::doDAQInfo_
private
bool ecaldqm::TowerStatusTask::doDCSInfo_
private