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

#include <PresampleClient.h>

Inheritance diagram for ecaldqm::PresampleClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Types

enum  MESets {
  kQuality, kMean, kMeanDCC, kRMS,
  kRMSMap, kRMSMapSummary, kQualitySummary, nMESets
}
 
enum  Sources { sPedestal, 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
 
 PresampleClient (const edm::ParameterSet &, const edm::ParameterSet &)
 
void producePlots () override
 
 ~PresampleClient ()
 
- 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 expectedMean_
 
float meanThreshold_
 
int minChannelEntries_
 
int minTowerEntries_
 
float noisyFracThreshold_
 
float rmsThreshold_
 
float rmsThresholdHighEta_
 
- 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 PresampleClient.h.

Member Enumeration Documentation

Enumerator
sPedestal 
nSources 

Definition at line 30 of file PresampleClient.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file PresampleClient.cc.

References expectedMean_, edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::PresampleTask::kPedestal, meanThreshold_, minChannelEntries_, minTowerEntries_, ecaldqm::DQWorker::name_, noisyFracThreshold_, rmsThreshold_, rmsThresholdHighEta_, ecaldqm::DQWorkerClient::source_(), and sPedestal.

11  :
12  DQWorkerClient(_params, _paths, "PresampleClient"),
15  expectedMean_(0.),
16  meanThreshold_(0.),
17  rmsThreshold_(0.),
20  {
21  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
22  minChannelEntries_ = taskParams.getUntrackedParameter<int>("minChannelEntries");
23  minTowerEntries_ = taskParams.getUntrackedParameter<int>("minTowerEntries");
24  expectedMean_ = taskParams.getUntrackedParameter<double>("expectedMean");
25  meanThreshold_ = taskParams.getUntrackedParameter<double>("meanThreshold");
26  rmsThreshold_ = taskParams.getUntrackedParameter<double>("rmsThreshold");
27  rmsThresholdHighEta_ = taskParams.getUntrackedParameter<double>("rmsThresholdHighEta");
28  noisyFracThreshold_ = taskParams.getUntrackedParameter<double>("noisyFracThreshold");
29 
30  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
31  source_(sPedestal, "PresampleTask", PresampleTask::kPedestal, sources);
32  }
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::PresampleClient::~PresampleClient ( )
inline

Definition at line 11 of file PresampleClient.h.

11 {}

Member Function Documentation

void ecaldqm::PresampleClient::bookMEs ( )
overridevirtual
void ecaldqm::PresampleClient::producePlots ( )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 46 of file PresampleClient.cc.

References funct::abs(), python.tagInventory::entries, expectedMean_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), ecaldqm::kEEpLow, kMean, kMeanDCC, kQuality, kQualitySummary, kRMS, kRMSMap, kRMSMapSummary, timingPdfMaker::mean, meanThreshold_, ecaldqm::DQWorker::MEs_, minChannelEntries_, minTowerEntries_, noisyFracThreshold_, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, plotscripts::rms(), rmsThreshold_, rmsThresholdHighEta_, ecaldqm::DQWorkerClient::sources_, sPedestal, and mathSSE::sqrt().

47  {
48  MEs_[kMean]->reset();
49  MEs_[kMeanDCC]->reset();
50  MEs_[kRMS]->reset();
51  MEs_[kRMSMap]->reset(-1.);
52  MEs_[kRMSMapSummary]->reset(-1.);
53 
56 
57  for(unsigned dccid(1); dccid <= 54; dccid++){
58 
59  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
60  std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
61 
62  if(ids.size() == 0) continue;
63 
64  unsigned iSM(dccid - 1);
65  float rmsThresh(rmsThreshold_);
66  if(iSM <= kEEmHigh || iSM >= kEEpLow || tower > 48) rmsThresh = rmsThresholdHighEta_;
67 
68  float nNoisy(0.);
69  float towerEntries(0.);
70  float towerMean(0.);
71  float towerRMS(0.);
72 
73  for(std::vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
74  float entries(sources_[sPedestal]->getBinEntries(*idItr));
75  float mean(sources_[sPedestal]->getBinContent(*idItr));
76  float rms(sources_[sPedestal]->getBinError(*idItr) * std::sqrt(entries));
77  towerEntries += entries;
78  towerMean += mean * entries;
79  towerRMS += (rms * rms + mean * mean) * entries;
80 
81  if(entries < minChannelEntries_){
82  fillQuality_(kQuality, *idItr, mask, 2.);
83  continue;
84  }
85 
86  MEs_[kMean]->fill(*idItr, mean);
87  MEs_[kMeanDCC]->fill(*idItr, mean);
88  MEs_[kRMS]->fill(*idItr, rms);
89  MEs_[kRMSMap]->fill(*idItr, rms);
90 
91  if(std::abs(mean - expectedMean_) > meanThreshold_ || rms > rmsThresh){
92  fillQuality_(kQuality, *idItr, mask, 0.);
93  nNoisy += 1.;
94  }
95  else
96  fillQuality_(kQuality, *idItr, mask, 1.);
97  }
98 
99  towerMean /= towerEntries;
100  towerRMS = std::sqrt(towerRMS / towerEntries - towerMean * towerMean);
101 
102  float quality(-1.);
103 
104  if(towerEntries > minTowerEntries_)
105  quality = nNoisy / ids.size() > noisyFracThreshold_ ? 0. : 1.;
106  else
107  quality = 2.;
108 
109  if(dccid <= 9 || dccid >= 46){
110  std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
111  for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr){
112  fillQuality_(kQualitySummary, *scItr, mask, quality);
113  MEs_[kRMSMapSummary]->setBinContent(*scItr, towerRMS);
114  }
115  }
116  else{
117  fillQuality_(kQualitySummary, ids[0], mask, quality);
118  MEs_[kRMSMapSummary]->setBinContent(ids[0], towerRMS);
119  }
120  }
121  }
122  }
const EcalElectronicsMapping * getElectronicsMap()
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
unsigned getNSuperCrystals(unsigned)
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
std::vector< MESet const * > sources_
void fillQuality_(unsigned, DetId const &, uint32_t, float)
void ecaldqm::PresampleClient::setMEData ( std::vector< MEData > &  _data)
static

Definition at line 126 of file PresampleClient.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, EcalDQMBinningService::AxisSpecs::high, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kDCC, EcalDQMBinningService::kEcal2P, kMean, kMeanDCC, kQuality, kQualitySummary, kRMS, kRMSMap, kRMSMapSummary, EcalDQMBinningService::kSM, EcalDQMBinningService::kSuperCrystal, EcalDQMBinningService::kUser, EcalDQMBinningService::AxisSpecs::low, and EcalDQMBinningService::AxisSpecs::nbins.

127  {
129 
131 
132  axis.nbins = 120;
133  axis.low = 170.;
134  axis.high = 230.;
135  _data[kMean] = MEData("Mean", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
136  _data[kMeanDCC] = MEData("MeanDCC", BinService::kEcal2P, BinService::kDCC, MonitorElement::DQM_KIND_TPROFILE, 0, &axis);
137 
138  axis.nbins = 100;
139  axis.low = 0.;
140  axis.high = 10.;
141  _data[kRMS] = MEData("RMS", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
142  _data[kRMSMap] = MEData("RMSMap", BinService::kSM, BinService::kCrystal, MonitorElement::DQM_KIND_TH2F, 0, 0, &axis);
144 
146  }

Member Data Documentation

float ecaldqm::PresampleClient::expectedMean_
protected

Definition at line 38 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

float ecaldqm::PresampleClient::meanThreshold_
protected

Definition at line 39 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

int ecaldqm::PresampleClient::minChannelEntries_
protected

Definition at line 36 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

int ecaldqm::PresampleClient::minTowerEntries_
protected

Definition at line 37 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

float ecaldqm::PresampleClient::noisyFracThreshold_
protected

Definition at line 42 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

float ecaldqm::PresampleClient::rmsThreshold_
protected

Definition at line 40 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().

float ecaldqm::PresampleClient::rmsThresholdHighEta_
protected

Definition at line 41 of file PresampleClient.h.

Referenced by PresampleClient(), and producePlots().