CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrigPrimClient.cc
Go to the documentation of this file.
1 #include "../interface/TrigPrimClient.h"
2 
4 
6 
7 #include <cmath>
8 
9 namespace ecaldqm {
10 
12  DQWorkerClient(_params, _paths, "TrigPrimClient")
13  {
14  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
15  source_(sEtRealMap, "TrigPrimTask", TrigPrimTask::kEtRealMap, sources);
16  source_(sEtEmulError, "TrigPrimTask", TrigPrimTask::kEtEmulError, sources);
17  source_(sTimingError, "TrigPrimTask", TrigPrimTask::kTimingError, sources);
18  source_(sMatchedIndex, "TrigPrimTask", TrigPrimTask::kMatchedIndex, sources);
19  }
20 
21  void
23  {
25 
26  MEs_[kEmulQualitySummary]->resetAll(-1.);
27  }
28 
29  void
31  {
32  // MEs_[kTiming]->reset();
33  MEs_[kTimingSummary]->reset();
34  MEs_[kNonSingleSummary]->reset();
35 
37 
38  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
40 
41  float towerEntries(0.);
42  float tMax(0.5);
43  float nMax(0.);
44  for(int iBin(0); iBin < 6; iBin++){
45  float entries(sources_[sMatchedIndex]->getBinEntries(ttid, iBin + 1));
46  towerEntries += entries;
47 
48  if(entries > nMax){
49  nMax = entries;
50  tMax = iBin == 0 ? -0.5 : iBin + 0.5; // historical reasons.. much clearer to say "no entry = -0.5"
51  }
52  }
53 
54  // MEs_[kTiming]->setBinContent(ttid, tMax);
55  MEs_[kTimingSummary]->setBinContent(ttid, tMax);
56 
57  if(towerEntries < 1.){
58  fillQuality_(kEmulQualitySummary, ttid, mask, 2.);
59  continue;
60  }
61 
62  float nonsingleFraction(1. - nMax / towerEntries);
63 
64  if(nonsingleFraction > 0.)
65  MEs_[kNonSingleSummary]->setBinContent(ttid, nonsingleFraction);
66 
67  float quality(sources_[sEtEmulError]->getBinContent(ttid) > 0. || sources_[sTimingError]->getBinContent(ttid) > 0. ? 0. : 1.);
68  fillQuality_(kEmulQualitySummary, ttid, mask, quality);
69  }
70  }
71 
72  /*static*/
73  void
74  TrigPrimClient::setMEData(std::vector<MEData>& _data)
75  {
79  }
80 
82 }
83 
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static const int PHYSICS_BAD_CHANNEL_WARNING
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void source_(unsigned, std::string const &, unsigned, edm::ParameterSet const &)
void bookMEs() override
static void setMEData(std::vector< MEData > &)
void producePlots() override
TrigPrimClient(const edm::ParameterSet &, const edm::ParameterSet &)
virtual void bookMEs()
Definition: DQWorker.cc:48
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
std::vector< MESet const * > sources_
DEFINE_ECALDQM_WORKER(CertificationClient)
void fillQuality_(unsigned, DetId const &, uint32_t, float)