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 | Protected Attributes
ecaldqm::IntegrityClient Class Reference

#include <IntegrityClient.h>

Inheritance diagram for ecaldqm::IntegrityClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Types

enum  MESets { kQuality, kQualitySummary, nMESets }
 
enum  Sources {
  sOccupancy, sGain, sChId, sGainSwitch,
  sTowerId, sBlockSize, nSources
}
 
- Public Types inherited from ecaldqm::DQWorkerClient
enum  Sources { nSources }
 
- Public Types inherited from ecaldqm::DQWorker
enum  MESets { nMESets }
 

Public Member Functions

void bookMEs () override
 
 IntegrityClient (const edm::ParameterSet &, const edm::ParameterSet &)
 
void producePlots () override
 
 ~IntegrityClient ()
 
- 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 &)
 
virtual void beginRun (const edm::Run &, 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 > &)
 

Protected Attributes

float errFractionThreshold_
 
- 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_
 

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 &)
 

Detailed Description

Definition at line 8 of file IntegrityClient.h.

Member Enumeration Documentation

Enumerator
kQuality 
kQualitySummary 
nMESets 

Definition at line 17 of file IntegrityClient.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file IntegrityClient.cc.

References errFractionThreshold_, edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::IntegrityTask::kBlockSize, ecaldqm::IntegrityTask::kChId, ecaldqm::OccupancyTask::kDigi, ecaldqm::IntegrityTask::kGain, ecaldqm::IntegrityTask::kGainSwitch, ecaldqm::IntegrityTask::kTowerId, ecaldqm::DQWorker::name_, sBlockSize, sChId, sGain, sGainSwitch, sOccupancy, ecaldqm::DQWorkerClient::source_(), and sTowerId.

10  :
11  DQWorkerClient(_params, _paths, "IntegrityClient"),
13  {
14  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
15  errFractionThreshold_ = taskParams.getUntrackedParameter<double>("errFractionThreshold");
16 
17  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
18  source_(sOccupancy, "OccupancyTask", OccupancyTask::kDigi, sources);
19  source_(sGain, "IntegrityTask", IntegrityTask::kGain, sources);
20  source_(sChId, "IntegrityTask", IntegrityTask::kChId, sources);
21  source_(sGainSwitch, "IntegrityTask", IntegrityTask::kGainSwitch, sources);
22  source_(sTowerId, "IntegrityTask", IntegrityTask::kTowerId, sources);
23  source_(sBlockSize, "IntegrityTask", IntegrityTask::kBlockSize, sources);
24  }
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::IntegrityClient::~IntegrityClient ( )
inline

Definition at line 11 of file IntegrityClient.h.

11 {}

Member Function Documentation

void ecaldqm::IntegrityClient::bookMEs ( )
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 27 of file IntegrityClient.cc.

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

28  {
30 
31  MEs_[kQuality]->resetAll(-1.);
32  MEs_[kQualitySummary]->resetAll(-1.);
33  }
virtual void bookMEs()
Definition: DQWorker.cc:48
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
void ecaldqm::IntegrityClient::producePlots ( )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 36 of file IntegrityClient.cc.

References EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, python.tagInventory::entries, errFractionThreshold_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), kQuality, kQualitySummary, sBlockSize, sChId, sGain, sGainSwitch, sOccupancy, ecaldqm::DQWorkerClient::sources_, sTowerId, EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

37  {
38  uint32_t mask(1 << EcalDQMStatusHelper::CH_ID_ERROR |
43 
44  for(unsigned dccid(1); dccid <= 54; dccid++){
45  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
46  std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
47 
48  if(ids.size() == 0) continue;
49 
50  float towerEntries(0.);
51  bool towerGood(true);
52 
53  for(std::vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
54  float entries(sources_[sOccupancy]->getBinContent(*idItr));
55  towerEntries += entries;
56 
57  float gain(sources_[sGain]->getBinContent(*idItr));
58  float chid(sources_[sChId]->getBinContent(*idItr));
59  float gainswitch(sources_[sGainSwitch]->getBinContent(*idItr));
60 
61  if(entries + gain + chid + gainswitch < 1.){
62  fillQuality_(kQuality, *idItr, mask, 2.);
63  continue;
64  }
65 
66  float chErr((gain + chid + gainswitch) / (entries + gain + chid + gainswitch));
67 
68  if(chErr > errFractionThreshold_){
69  fillQuality_(kQuality, *idItr, mask, 0.);
70  towerGood = false;
71  }
72  else
73  fillQuality_(kQuality, *idItr, mask, 1.);
74  }
75 
76  float towerid(sources_[sTowerId]->getBinContent(ids[0]));
77  float blocksize(sources_[sBlockSize]->getBinContent(ids[0]));
78 
79  float quality(-1.);
80 
81  if(towerEntries + towerid + blocksize > 1.){
82  float towerErr((towerid + blocksize) / (towerEntries + towerid + blocksize));
83  if(towerErr > errFractionThreshold_) towerGood = false;
84 
85  quality = towerGood ? 1. : 0.;
86  }
87  else{
88  quality = 2.;
89  }
90 
91  if(dccid <= 9 || dccid >= 46){
92  std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
93  for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
94  fillQuality_(kQualitySummary, *scItr, mask, quality);
95  }
96  else
97  fillQuality_(kQualitySummary, ids[0], mask, quality);
98  }
99  }
100  }
const EcalElectronicsMapping * getElectronicsMap()
static const int TT_SIZE_ERROR
static const int CH_GAIN_SWITCH_ERROR
unsigned getNSuperCrystals(unsigned)
static const int CH_GAIN_ZERO_ERROR
std::vector< MESet const * > sources_
static const int TT_ID_ERROR
void fillQuality_(unsigned, DetId const &, uint32_t, float)
static const int CH_ID_ERROR
void ecaldqm::IntegrityClient::setMEData ( std::vector< MEData > &  _data)
static

Member Data Documentation

float ecaldqm::IntegrityClient::errFractionThreshold_
protected

Definition at line 36 of file IntegrityClient.h.

Referenced by IntegrityClient(), and producePlots().