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

#include <OccupancyClient.h>

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

Public Member Functions

 OccupancyClient ()
 
void producePlots (ProcessType) override
 
 ~OccupancyClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void releaseMEs () override
 
void releaseSource ()
 
void resetMEs ()
 
bool retrieveSource (DQMStore const &, ProcessType)
 
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 &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 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 ()
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float deviationThreshold_
 
int minHits_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerClient
enum  ProcessType { kLumi, kRun, 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=kRun) 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
std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- 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 OccupancyClient.h.

Constructor & Destructor Documentation

ecaldqm::OccupancyClient::OccupancyClient ( )

Definition at line 13 of file OccupancyClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

13  :
15  minHits_(0),
17  {
18  qualitySummaries_.insert("QualitySummary");
19  }
std::set< std::string > qualitySummaries_
ecaldqm::OccupancyClient::~OccupancyClient ( )
inline

Definition at line 11 of file OccupancyClient.h.

11 {}

Member Function Documentation

void ecaldqm::OccupancyClient::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 29 of file OccupancyClient.cc.

References EcalTrigTowerDetId::detIdFromDenseIndex(), deviationThreshold_, EcalTriggerTower, python.tagInventory::entries, ecaldqm::getTrigTowerMap(), EcalTrigTowerDetId::ieta(), cmsHarvester::index, ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, EcalTrigTowerDetId::kSizeForDenseIndexing, ecaldqm::DQWorker::MEs_, minHits_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, ecaldqm::scConstituents(), ecaldqm::DQWorkerClient::sources_, ecaldqm::DQWorkerClient::statusManager_, ecaldqm::MESet::const_iterator::toNextChannel(), and EcalTrigTowerConstituentsMap::towerOf().

30  {
31  using namespace std;
32 
33  // number of allowed ieta indices
34  // EE-: -28 to -1 with -27, -25 empty
35  // EE+: 1 to 28 with 26, 28 empty
36  unsigned const nPhiRings(56);
37 
38  MESet& meQualitySummary(MEs_.at("QualitySummary"));
39 // MESet& meHotDigi(MEs_.at("HotDigi"));
40 // MESet& meHotRecHitThr(MEs_.at("HotRecHitThr"));
41 // MESet& meHotTPDigiThr(MEs_.at("HotTPDigiThr"));
42 
43  MESet const& sDigi(sources_.at("DigiAll"));
44  MESet const& sRecHitThr(sources_.at("RecHitThrAll"));
45  MESet const& sTPDigiThr(sources_.at("TPDigiThrAll"));
46 
50 
51  double digiPhiRingMean[nPhiRings];
52  std::fill_n(digiPhiRingMean, nPhiRings, 0.);
53  double rechitPhiRingMean[nPhiRings];
54  std::fill_n(rechitPhiRingMean, nPhiRings, 0.);
55  int numCrystals[nPhiRings]; // this is static, but is easier to count now
56  std::fill_n(numCrystals, nPhiRings, 0);
57 
58  MESet::const_iterator dEnd(sDigi.end());
59  MESet::const_iterator rItr(sRecHitThr);
60  for(MESet::const_iterator dItr(sDigi.beginChannel()); dItr != dEnd; dItr.toNextChannel()){
61  rItr = dItr;
62 
63  float entries(dItr->getBinContent());
64  float rhentries(rItr->getBinContent());
65 
66  DetId id(dItr->getId());
67  int ieta(0);
68  if(id.subdetId() == EcalTriggerTower) // barrel
69  ieta = EcalTrigTowerDetId(id).ieta();
70  else{
71  std::vector<DetId> ids(scConstituents(EcalScDetId(id)));
72  if(ids.size() == 0) continue;
73  ieta = getTrigTowerMap()->towerOf(ids[0]).ieta();
74  }
75 
76  unsigned index(ieta < 0 ? ieta + 28 : ieta + 27);
77 
78  digiPhiRingMean[index] += entries;
79  rechitPhiRingMean[index] += rhentries;
80  numCrystals[index] += 1;
81  }
82 
83  for(unsigned ie(0); ie < nPhiRings; ie++){
84  digiPhiRingMean[ie] /= numCrystals[ie];
85  rechitPhiRingMean[ie] /= numCrystals[ie];
86  }
87 
88  // second round to find hot towers
89  for(MESet::const_iterator dItr(sDigi.beginChannel()); dItr != dEnd; dItr.toNextChannel()){
90  DetId id(dItr->getId());
91 
92  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_));
93 
94  rItr = dItr;
95 
96  float entries(dItr->getBinContent());
97  float rhentries(rItr->getBinContent());
98 
99  int ieta(0);
100  if(id.subdetId() == EcalTriggerTower) // barrel
101  ieta = EcalTrigTowerDetId(id).ieta();
102  else{
103  std::vector<DetId> ids(scConstituents(EcalScDetId(id)));
104  if(ids.size() == 0) continue;
105  ieta = getTrigTowerMap()->towerOf(ids[0]).ieta();
106  }
107 
108  unsigned index(ieta < 0 ? ieta + 28 : ieta + 27);
109 
110  int quality(doMask ? kMGood : kGood);
111 
112  if(entries > minHits_ && entries > digiPhiRingMean[index] * deviationThreshold_){
113  // meHotDigi->fill(id);
114  quality = doMask ? kMBad : kBad;
115  }
116  if(rhentries > minHits_ && rhentries > rechitPhiRingMean[index] * deviationThreshold_){
117  // meHotRecHitThr->fill(id);
118  quality = doMask ? kMBad : kBad;
119  }
120 
121  meQualitySummary.setBinContent(id, double(quality));
122  }
123 
124  double tpdigiPhiRingMean[nPhiRings];
125  std::fill_n(tpdigiPhiRingMean, nPhiRings, 0.);
126 
127  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; ++iTT){
129  float entries(sTPDigiThr.getBinContent(ttid));
130 
131  unsigned index(ttid.ieta() < 0 ? ttid.ieta() + 28 : ttid.ieta() + 27);
132 
133  tpdigiPhiRingMean[index] += entries;
134  }
135 
136  for(int ie(0); ie < 28; ie++){
137  float denom(-1.);
138  if(ie < 27) denom = 72.;
139  else denom = 36.;
140  tpdigiPhiRingMean[ie] /= denom;
141  tpdigiPhiRingMean[55 - ie] /= denom;
142  }
143 
144  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; ++iTT){
146 
147  float entries(sTPDigiThr.getBinContent(ttid));
148 
149  unsigned index(ttid.ieta() < 0 ? ttid.ieta() + 28 : ttid.ieta() + 27);
150 
151  int quality(kGood);
152 
153  if(entries > minHits_ && entries > tpdigiPhiRingMean[index] * deviationThreshold_){
154  // meHotTPDigiThr.fill(ttid);
155  quality = kBad;
156  }
157 
158  if(quality != kBad) continue;
159 
160  std::vector<DetId> ids(getTrigTowerMap()->constituentsOf(ttid));
161  for(unsigned iD(0); iD < ids.size(); ++iD){
162  DetId& id(ids[iD]);
163 
164  int quality(meQualitySummary.getBinContent(id));
165  if(quality == kMBad || quality == kBad) continue;
166 
167  meQualitySummary.setBinContent(id, meQualitySummary.maskMatches(id, mask, statusManager_) ? kMBad : kBad);
168  }
169  }
170  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static const int PHYSICS_BAD_CHANNEL_WARNING
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_ERROR
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
int ieta() const
get the tower ieta
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
StatusManager const * statusManager_
MESetCollection sources_
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:76
std::vector< DetId > scConstituents(EcalScDetId const &)
void ecaldqm::OccupancyClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file OccupancyClient.cc.

References deviationThreshold_, edm::ParameterSet::getUntrackedParameter(), and minHits_.

23  {
24  minHits_ = _params.getUntrackedParameter<int>("minHits");
25  deviationThreshold_ = _params.getUntrackedParameter<double>("deviationThreshold");
26  }

Member Data Documentation

float ecaldqm::OccupancyClient::deviationThreshold_
private

Definition at line 19 of file OccupancyClient.h.

Referenced by producePlots(), and setParams().

int ecaldqm::OccupancyClient::minHits_
private

Definition at line 18 of file OccupancyClient.h.

Referenced by producePlots(), and setParams().