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::OccupancyClient Class Reference

#include <OccupancyClient.h>

Inheritance diagram for ecaldqm::OccupancyClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Types

enum  MESets {
  kHotDigi, kHotRecHitThr, kHotTPDigiThr, kQualitySummary,
  nMESets
}
 
enum  Sources { sDigi, sRecHitThr, sTPDigiThr, nSources }
 
- Public Types inherited from ecaldqm::DQWorkerClient
enum  Sources { nSources }
 
- Public Types inherited from ecaldqm::DQWorker
enum  MESets { nMESets }
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void bookMEs () override
 
 OccupancyClient (const edm::ParameterSet &, const edm::ParameterSet &)
 
void producePlots () override
 
 ~OccupancyClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
 DQWorkerClient (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void initialize ()
 
void reset ()
 
virtual ~DQWorkerClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
 DQWorker (const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
const std::vector< MESet * > & getMEs ()
 
virtual std::string const & getName ()
 
virtual bool isInitialized ()
 
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

float deviationThreshold_
 
const CaloGeometrygeometry_
 
int minHits_
 

Additional Inherited Members

- Static Public Attributes inherited from ecaldqm::DQWorkerClient
static EcalDQMChannelStatus const * channelStatus
 
static EcalDQMTowerStatus const * towerStatus
 
- Static Public Attributes inherited from ecaldqm::DQWorker
static std::map< std::string,
std::vector< MEData > > 
meData
 
- Protected Member Functions inherited from ecaldqm::DQWorkerClient
void fillQuality_ (unsigned, DetId const &, uint32_t, float)
 
void source_ (unsigned, std::string const &, unsigned, edm::ParameterSet const &)
 
- 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::DQWorkerClient
std::vector< MESet const * > sources_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool initialized_
 
std::vector< MESet * > MEs_
 
std::string name_
 
int verbosity_
 

Detailed Description

Definition at line 10 of file OccupancyClient.h.

Member Enumeration Documentation

Enumerator
sDigi 
sRecHitThr 
sTPDigiThr 
nSources 

Definition at line 31 of file OccupancyClient.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file OccupancyClient.cc.

References deviationThreshold_, edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::OccupancyTask::kDigi, ecaldqm::OccupancyTask::kRecHitThr, ecaldqm::OccupancyTask::kTPDigiThr, minHits_, ecaldqm::DQWorker::name_, sDigi, ecaldqm::DQWorkerClient::source_(), sRecHitThr, and sTPDigiThr.

15  :
16  DQWorkerClient(_params, _paths, "OccupancyClient"),
17  geometry_(0),
18  minHits_(0),
20  {
21  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
22  minHits_ = taskParams.getUntrackedParameter<int>("minHits");
23  deviationThreshold_ = taskParams.getUntrackedParameter<double>("deviationThreshold");
24 
25  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
26  source_(sDigi, "OccupancyTask", OccupancyTask::kDigi, sources);
27  source_(sRecHitThr, "OccupancyTask", OccupancyTask::kRecHitThr, sources);
28  source_(sTPDigiThr, "OccupancyTask", OccupancyTask::kTPDigiThr, sources);
29  }
const CaloGeometry * geometry_
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void source_(unsigned, std::string const &, unsigned, edm::ParameterSet const &)
DQWorkerClient(const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
std::string name_
Definition: DQWorker.h:55
ecaldqm::OccupancyClient::~OccupancyClient ( )
inline

Definition at line 13 of file OccupancyClient.h.

13 {}

Member Function Documentation

void ecaldqm::OccupancyClient::beginRun ( const edm::Run ,
const edm::EventSetup _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 32 of file OccupancyClient.cc.

References edm::hlt::Exception, geometry_, edm::EventSetup::get(), and edm::ESHandle< class >::product().

33  {
35  _es.get<CaloGeometryRecord>().get(geomHndl);
36  geometry_ = geomHndl.product();
37  if(!geometry_)
38  throw cms::Exception("EventSetup") << "CaloGeometry invalid";
39  }
const CaloGeometry * geometry_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void ecaldqm::OccupancyClient::bookMEs ( )
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 42 of file OccupancyClient.cc.

References ecaldqm::DQWorker::bookMEs(), kQualitySummary, and ecaldqm::DQWorker::MEs_.

43  {
45 
46  MEs_[kQualitySummary]->resetAll(-1.);
47  }
virtual void bookMEs()
Definition: DQWorker.cc:48
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
void ecaldqm::OccupancyClient::producePlots ( )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 50 of file OccupancyClient.cc.

References EcalTrigTowerDetId::detIdFromDenseIndex(), deviationThreshold_, python.tagInventory::entries, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), ecaldqm::getTrigTowerMap(), EcalTrigTowerDetId::ietaAbs(), kHotDigi, kHotRecHitThr, kHotTPDigiThr, kQualitySummary, EcalTrigTowerDetId::kSizeForDenseIndexing, ecaldqm::DQWorker::MEs_, minHits_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, sDigi, ecaldqm::DQWorkerClient::sources_, sRecHitThr, and sTPDigiThr.

51  {
52  using namespace std;
53 
54  MEs_[kHotDigi]->reset();
55  MEs_[kHotRecHitThr]->reset();
56  MEs_[kHotTPDigiThr]->reset();
57 
59 
60  vector<double> digiPhiRingMean(28, 0.);
61  vector<double> rechitPhiRingMean(28, 0.);
62  vector<int> numCrystals(28, 0); // this is static, but is easier to count now
63 
64  for(unsigned dccid(1); dccid <= 54; dccid++){
65  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
66  vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
67 
68  if(ids.size() == 0) continue;
69 
70  for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
71  float entries(sources_[sDigi]->getBinContent(*idItr));
72  float rhentries(sources_[sRecHitThr]->getBinContent(*idItr));
73 
74  int ieta(getTrigTowerMap()->towerOf(*idItr).ietaAbs());
75  digiPhiRingMean.at(ieta - 1) += entries;
76  rechitPhiRingMean.at(ieta - 1) += rhentries;
77 
78  numCrystals.at(ieta - 1) += 1;
79  }
80  }
81  }
82 
83  for(int ie(0); ie < 28; ie++){
84  digiPhiRingMean[ie] /= numCrystals[ie];
85  rechitPhiRingMean[ie] /= numCrystals[ie];
86  }
87 
88  // second round to find hot towers
89  for(unsigned dccid(1); dccid <= 54; dccid++){
90  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
91  vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
92 
93  if(ids.size() == 0) continue;
94 
95  float quality(1.);
96  for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
97  float entries(sources_[sDigi]->getBinContent(*idItr));
98  float rhentries(sources_[sRecHitThr]->getBinContent(*idItr));
99 
100  int ieta(getTrigTowerMap()->towerOf(*idItr).ietaAbs());
101 
102  if(entries > minHits_ && entries > digiPhiRingMean.at(ieta - 1) * deviationThreshold_){
103  MEs_[kHotDigi]->fill(*idItr);
104  quality = 0.;
105  }
106  if(rhentries > minHits_ && rhentries > rechitPhiRingMean.at(ieta - 1) * deviationThreshold_){
107  MEs_[kHotRecHitThr]->fill(*idItr);
108  quality = 0.;
109  }
110  }
111  if(dccid <= 9 || dccid >= 46){
112  vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
113  for(vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
114  fillQuality_(kQualitySummary, *scItr, mask, quality);
115  }
116  else
117  fillQuality_(kQualitySummary, ids[0], mask, quality);
118  }
119  }
120 
121  vector<double> tpdigiPhiRingMean(28, 0.);
122 
123  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
125  float entries(sources_[sTPDigiThr]->getBinContent(ttid));
126 
127  tpdigiPhiRingMean.at(ttid.ietaAbs() - 1) += entries;
128  }
129 
130  for(int ie(0); ie < 28; ie++){
131  float denom(-1.);
132  if(ie < 27) denom = 72.;
133  else denom = 36.;
134  tpdigiPhiRingMean[ie] /= denom;
135  }
136 
137  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
139  float entries(sources_[sTPDigiThr]->getBinContent(ttid));
140 
141  if(entries > minHits_ && entries > tpdigiPhiRingMean.at(ttid.ietaAbs() - 1) * deviationThreshold_){
142  MEs_[kHotTPDigiThr]->fill(ttid);
143  vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
144  for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
145  if(MEs_[kQualitySummary]->getBinContent(*idItr) > 0.)
146  fillQuality_(kQualitySummary, *idItr, mask, 0.);
147  }
148  }
149  }
150 
151  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
const EcalElectronicsMapping * getElectronicsMap()
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
unsigned getNSuperCrystals(unsigned)
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
std::vector< MESet const * > sources_
void fillQuality_(unsigned, DetId const &, uint32_t, float)
void ecaldqm::OccupancyClient::setMEData ( std::vector< MEData > &  _data)
static

Definition at line 155 of file OccupancyClient.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, EcalDQMBinningService::kChannel, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kEcal2P, kHotDigi, kHotRecHitThr, kHotTPDigiThr, kQualitySummary, EcalDQMBinningService::kSuperCrystal, and EcalDQMBinningService::kTriggerTower.

Member Data Documentation

float ecaldqm::OccupancyClient::deviationThreshold_
private

Definition at line 42 of file OccupancyClient.h.

Referenced by OccupancyClient(), and producePlots().

const CaloGeometry* ecaldqm::OccupancyClient::geometry_
private

Definition at line 39 of file OccupancyClient.h.

Referenced by beginRun().

int ecaldqm::OccupancyClient::minHits_
private

Definition at line 41 of file OccupancyClient.h.

Referenced by OccupancyClient(), and producePlots().