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

#include <TimingClient.h>

Inheritance diagram for ecaldqm::TimingClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Types

enum  MESets {
  kQuality, kMeanSM, kMeanAll, kFwdBkwdDiff,
  kFwdvBkwd, kRMS, kRMSAll, kProjEta,
  kProjPhi, kQualitySummary, nMESets
}
 
enum  Sources { sTimeAllMap, sTimeMap, nSources }
 
- Public Types inherited from ecaldqm::DQWorkerClient
enum  Sources { nSources }
 
- Public Types inherited from ecaldqm::DQWorker
enum  MESets { nMESets }
 

Public Member Functions

void bookMEs ()
 
void producePlots ()
 
 TimingClient (const edm::ParameterSet &, const edm::ParameterSet &)
 
 ~TimingClient ()
 
- 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 rmsThreshold_
 
float tailPopulThreshold_
 
- 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 TimingClient.h.

Member Enumeration Documentation

Enumerator
sTimeAllMap 
sTimeMap 
nSources 

Definition at line 33 of file TimingClient.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file TimingClient.cc.

References expectedMean_, edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::TimingTask::kTimeAllMap, ecaldqm::TimingTask::kTimeMap, meanThreshold_, minChannelEntries_, minTowerEntries_, ecaldqm::DQWorker::name_, rmsThreshold_, ecaldqm::DQWorkerClient::source_(), sTimeAllMap, sTimeMap, and tailPopulThreshold_.

11  :
12  DQWorkerClient(_params, _paths, "TimingClient"),
13  expectedMean_(0.),
14  meanThreshold_(0.),
15  rmsThreshold_(0.),
19  {
20  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
21  expectedMean_ = taskParams.getUntrackedParameter<double>("expectedMean");
22  meanThreshold_ = taskParams.getUntrackedParameter<double>("meanThreshold");
23  rmsThreshold_ = taskParams.getUntrackedParameter<double>("rmsThreshold");
24  minChannelEntries_ = taskParams.getUntrackedParameter<int>("minChannelEntries");
25  minTowerEntries_ = taskParams.getUntrackedParameter<int>("minTowerEntries");
26  tailPopulThreshold_ = taskParams.getUntrackedParameter<double>("tailPopulThreshold");
27 
28  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
29  source_(sTimeAllMap, "TimingTask", TimingTask::kTimeAllMap, sources);
30  source_(sTimeMap, "TimingTask", TimingTask::kTimeMap, sources);
31  }
void source_(unsigned, std::string const &, unsigned, edm::ParameterSet const &)
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
DQWorkerClient(const edm::ParameterSet &, const edm::ParameterSet &, std::string const &)
std::string name_
Definition: DQWorker.h:55
ecaldqm::TimingClient::~TimingClient ( )
inline

Definition at line 11 of file TimingClient.h.

11 {}

Member Function Documentation

void ecaldqm::TimingClient::bookMEs ( )
virtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 34 of file TimingClient.cc.

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

35  {
37 
38  MEs_[kQuality]->resetAll(-1.);
39  MEs_[kRMS]->resetAll(-1.);
40  MEs_[kQualitySummary]->resetAll(-1.);
41  }
virtual void bookMEs()
Definition: DQWorker.cc:48
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
void ecaldqm::TimingClient::producePlots ( )
virtual

Implements ecaldqm::DQWorkerClient.

Definition at line 44 of file TimingClient.cc.

References abs, EcalEndcap, python.tagInventory::entries, expectedMean_, ecaldqm::DQWorkerClient::fillQuality_(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), kFwdBkwdDiff, kFwdvBkwd, kMeanAll, kMeanSM, kProjEta, kProjPhi, kQuality, kQualitySummary, kRMS, kRMSAll, timingPdfMaker::mean, meanThreshold_, ecaldqm::DQWorker::MEs_, minChannelEntries_, minTowerEntries_, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, plotscripts::rms(), rmsThreshold_, ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), sTimeAllMap, sTimeMap, EBDetId::switchZSide(), EEDetId::switchZSide(), and tailPopulThreshold_.

45  {
46  using namespace std;
47 
48  MEs_[kMeanSM]->reset();
49  MEs_[kMeanAll]->reset();
50  MEs_[kRMS]->reset(-1.);
51  MEs_[kRMSAll]->reset();
52  MEs_[kProjEta]->reset();
53  MEs_[kProjPhi]->reset();
54  MEs_[kFwdBkwdDiff]->reset();
55  MEs_[kFwdvBkwd]->reset();
56 
58 
59  for(unsigned dccid(1); dccid <= 54; dccid++){
60 
61  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
62  vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
63 
64  if(ids.size() == 0) continue;
65 
66  // tower entries != sum(channel entries) because of the difference in timing cut at the source
67  float summaryEntries(0.);
68  if(dccid <= 9 || dccid >= 46){
69  vector<EcalScDetId> scids(getElectronicsMap()->getEcalScDetId(dccid, tower));
70  for(vector<EcalScDetId>::iterator scItr(scids.begin()); scItr != scids.end(); ++scItr)
71  summaryEntries += sources_[sTimeAllMap]->getBinEntries(*scItr);
72  }
73  else
74  summaryEntries = sources_[sTimeAllMap]->getBinEntries(ids[0]);
75 
76  float towerEntries(0.);
77  float towerMean(0.);
78  float towerMean2(0.);
79 
80  for(vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
81  float entries(sources_[sTimeMap]->getBinEntries(*idItr));
82  float mean(sources_[sTimeMap]->getBinContent(*idItr));
83  float rms(sources_[sTimeMap]->getBinError(*idItr) * sqrt(entries));
84 
85  towerEntries += entries;
86  towerMean += mean;
87  towerMean2 += mean * mean;
88 
90  fillQuality_(kQuality, *idItr, mask, 2.);
91  continue;
92  }
93 
94  MEs_[kMeanSM]->fill(*idItr, mean);
95  MEs_[kMeanAll]->fill(*idItr, mean);
96  MEs_[kProjEta]->fill(*idItr, mean);
97  MEs_[kProjPhi]->fill(*idItr, mean);
98  MEs_[kRMS]->fill(*idItr, rms);
99  MEs_[kRMSAll]->fill(*idItr, rms);
100 
101  if(dccid <= 27){
102  DetId posId(0);
103  if(idItr->subdetId() == EcalEndcap){
104  posId = EEDetId::switchZSide(*idItr);
105  }
106  else{
107  posId = EBDetId::switchZSide(*idItr);
108  }
109  float posTime(sources_[sTimeMap]->getBinContent(posId));
110  MEs_[kFwdBkwdDiff]->fill(*idItr, posTime - mean);
111  MEs_[kFwdvBkwd]->fill(*idItr, mean, posTime);
112  }
113 
114  float quality(abs(mean - expectedMean_) > meanThreshold_ || rms > rmsThreshold_ ? 0. : 1.);
115  fillQuality_(kQuality, *idItr, mask, quality);
116  }
117 
118  float quality(1.);
119  if(towerEntries > minTowerEntries_){
120  if(summaryEntries < towerEntries * (1. - tailPopulThreshold_)) // large timing deviation
121  quality = 0.;
122 
123  towerMean /= ids.size();
124  towerMean2 /= ids.size();
125 
126  float towerRMS(0.);
127  float variance(towerMean2 - towerMean * towerMean);
128  if(variance > 0.) towerRMS = sqrt(variance);
129 
130  if(abs(towerMean - expectedMean_) > meanThreshold_ || towerRMS > rmsThreshold_)
131  quality = 0.;
132  }
133  else
134  quality = 2.;
135 
136  if(dccid <= 9 || dccid >= 46){
137  vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
138  for(vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
139  fillQuality_(kQualitySummary, *scItr, mask, quality);
140  }
141  else
142  fillQuality_(kQualitySummary, ids[0], mask, quality);
143  }
144  }
145  }
const EcalElectronicsMapping * getElectronicsMap()
static const int PHYSICS_BAD_CHANNEL_WARNING
EBDetId switchZSide() const
Definition: EBDetId.cc:132
#define abs(x)
Definition: mlp_lapack.h:159
T sqrt(T t)
Definition: SSEVec.h:46
EEDetId switchZSide() const
Definition: EEDetId.cc:503
Definition: DetId.h:20
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
unsigned getNSuperCrystals(unsigned)
std::vector< MESet const * > sources_
void fillQuality_(unsigned, DetId const &, uint32_t, float)
void ecaldqm::TimingClient::setMEData ( std::vector< MEData > &  _data)
static

Definition at line 149 of file TimingClient.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, EcalDQMBinningService::AxisSpecs::high, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kEcal2P, EcalDQMBinningService::kEcal3P, kFwdBkwdDiff, kFwdvBkwd, kMeanAll, kMeanSM, kProjEta, EcalDQMBinningService::kProjEta, kProjPhi, EcalDQMBinningService::kProjPhi, kQuality, kQualitySummary, kRMS, kRMSAll, EcalDQMBinningService::kSM, EcalDQMBinningService::kSuperCrystal, EcalDQMBinningService::kUser, EcalDQMBinningService::AxisSpecs::low, and EcalDQMBinningService::AxisSpecs::nbins.

150  {
152 
154 
155  axis.nbins = 100;
156  axis.low = -25.;
157  axis.high = 25.;
158  _data[kMeanSM] = MEData("MeanSM", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
160 
161  axis.nbins = 50;
162  _data[kFwdvBkwd] = MEData("FwdvBkwd", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH2F, &axis, &axis);
163 
164  axis.low = -5.;
165  axis.high = 5.;
166  _data[kFwdBkwdDiff] = MEData("FwdBkwdDiff", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &axis);
167 
169 
170  axis.nbins = 100;
171  axis.low = 0.;
172  axis.high = 10.;
177  }

Member Data Documentation

float ecaldqm::TimingClient::expectedMean_
protected

Definition at line 40 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().

float ecaldqm::TimingClient::meanThreshold_
protected

Definition at line 41 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().

int ecaldqm::TimingClient::minChannelEntries_
protected

Definition at line 43 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().

int ecaldqm::TimingClient::minTowerEntries_
protected

Definition at line 44 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().

float ecaldqm::TimingClient::rmsThreshold_
protected

Definition at line 42 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().

float ecaldqm::TimingClient::tailPopulThreshold_
protected

Definition at line 45 of file TimingClient.h.

Referenced by producePlots(), and TimingClient().