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 
8 
9 #include <cmath>
10 
11 namespace ecaldqm
12 {
15  minEntries_(0),
16  errorFractionThreshold_(0.)
17  {
18  qualitySummaries_.insert("EmulQualitySummary");
19  }
20 
21  void
23  {
24  minEntries_ = _params.getUntrackedParameter<int>("minEntries");
25  errorFractionThreshold_ = _params.getUntrackedParameter<double>("errorFractionThreshold");
26  }
27 
28  void
30  {
31  MESet& meTimingSummary(MEs_.at("TimingSummary"));
32  MESet& meNonSingleSummary(MEs_.at("NonSingleSummary"));
33  MESet& meEmulQualitySummary(MEs_.at("EmulQualitySummary"));
34 
35  MESet const& sEtEmulError(sources_.at("EtEmulError"));
36  MESet const& sMatchedIndex(sources_.at("MatchedIndex"));
37 
39 
40  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
42 
43  bool doMask(meEmulQualitySummary.maskMatches(ttid, mask, statusManager_));
44 
45  float towerEntries(0.);
46  float tMax(0.5);
47  float nMax(0.);
48  for(int iBin(0); iBin < 6; iBin++){
49  float entries(sMatchedIndex.getBinContent(ttid, iBin + 1));
50  towerEntries += entries;
51 
52  if(entries > nMax){
53  nMax = entries;
54  tMax = iBin == 0 ? -0.5 : iBin + 0.5; // historical reasons.. much clearer to say "no entry = -0.5"
55  }
56  }
57 
58  meTimingSummary.setBinContent(ttid, tMax);
59 
60  if(towerEntries < minEntries_){
61  meEmulQualitySummary.setBinContent(ttid, doMask ? kMUnknown : kUnknown);
62  continue;
63  }
64 
65  float nonsingleFraction(1. - nMax / towerEntries);
66 
67  if(nonsingleFraction > 0.)
68  meNonSingleSummary.setBinContent(ttid, nonsingleFraction);
69 
70  if(sEtEmulError.getBinContent(ttid) / towerEntries > errorFractionThreshold_)
71  meEmulQualitySummary.setBinContent(ttid, doMask ? kMBad : kBad);
72  else
73  meEmulQualitySummary.setBinContent(ttid, doMask ? kMGood : kGood);
74  }
75  }
76 
78 }
T getUntrackedParameter(std::string const &, T const &) const
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static const int PHYSICS_BAD_CHANNEL_WARNING
void producePlots(ProcessType) override
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
void setParams(edm::ParameterSet const &) override
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
MESetCollection MEs_
Definition: DQWorker.h:75