CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTTauDQMSummaryPlotter Class Reference

#include <HLTTauDQMSummaryPlotter.h>

Inheritance diagram for HLTTauDQMSummaryPlotter:
HLTTauDQMPlotter

Public Member Functions

void bookPlots ()
 
 HLTTauDQMSummaryPlotter (const edm::ParameterSet &ps, const std::string &dqmBaseFolder)
 
void plot ()
 
 ~HLTTauDQMSummaryPlotter ()
 

Private Member Functions

void bookEfficiencyHisto (const std::string &folder, const std::string &name, const std::string &hist1, bool copyLabels=false)
 
void bookFractionHisto (const std::string &folder, const std::string &name)
 
void bookTriggerBitEfficiencyHistos (std::string folder, std::string histo)
 
void plotEfficiencyHisto (std::string folder, std::string name, std::string hist1, std::string hist2)
 
void plotFractionHisto (const std::string &folder, const std::string &name)
 
void plotIntegratedEffHisto (std::string folder, std::string name, std::string refHisto, std::string evCount, int bin)
 
void plotTriggerBitEfficiencyHistos (std::string folder, std::string histo)
 
- Private Member Functions inherited from HLTTauDQMPlotter
 HLTTauDQMPlotter (const edm::ParameterSet &pset, const std::string &dqmBaseFolder)
 
bool isValid () const
 
 ~HLTTauDQMPlotter ()
 
std::pair< bool, LVmatch (const LV &, const LVColl &, double)
 
const std::string & triggerTag () const
 

Private Attributes

DQMStorestore_
 
std::string type_
 
- Private Attributes inherited from HLTTauDQMPlotter
bool configValid_
 
std::string dqmFolder_
 
std::string dqmFullFolder_
 
bool runValid_
 

Detailed Description

Definition at line 7 of file HLTTauDQMSummaryPlotter.h.

Constructor & Destructor Documentation

HLTTauDQMSummaryPlotter::HLTTauDQMSummaryPlotter ( const edm::ParameterSet ps,
const std::string &  dqmBaseFolder 
)

Definition at line 23 of file HLTTauDQMSummaryPlotter.cc.

References HLTTauDQMPlotter::configValid_, alignCSCRings::e, edm::ParameterSet::getUntrackedParameter(), HLTTauDQMPlotter::runValid_, AlCaHLTBitMon_QueryRunRegistry::string, type_, and cms::Exception::what().

23  :
24  HLTTauDQMPlotter(ps, dqmBaseFolder),
25  store_(nullptr)
26 {
27  if(!configValid_)
28  return;
29 
30  // no run concept in summary plotter
31  runValid_ = true;
32 
33  //Process PSet
34  try {
35  type_ = ps.getUntrackedParameter<std::string>("ConfigType");
36  } catch ( cms::Exception &e ) {
37  edm::LogWarning("HLTTauDQMOfflineSource") << "HLTTauDQMSummaryPlotter::HLTTauDQMSummaryPlotter(): " << e.what();
38  configValid_ = false;
39  return;
40  }
41  configValid_ = true;
42 }
virtual char const * what() const
Definition: Exception.cc:141
T getUntrackedParameter(std::string const &, T const &) const
HLTTauDQMPlotter(const edm::ParameterSet &pset, const std::string &dqmBaseFolder)
HLTTauDQMSummaryPlotter::~HLTTauDQMSummaryPlotter ( )

Definition at line 44 of file HLTTauDQMSummaryPlotter.cc.

44 {}

Member Function Documentation

void HLTTauDQMSummaryPlotter::bookEfficiencyHisto ( const std::string &  folder,
const std::string &  name,
const std::string &  hist1,
bool  copyLabels = false 
)
private

Definition at line 135 of file HLTTauDQMSummaryPlotter.cc.

References newFWLiteAna::bin, DQMStore::bookProfile(), DQMStore::dirExists(), DQMStore::get(), MonitorElement::getAxisTitle(), MonitorElement::getNbinsX(), MonitorElement::getTH1F(), MonitorElement::getTitle(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), MonitorElement::setTitle(), store_, and tmp.

Referenced by bookPlots().

135  {
136  if ( store_->dirExists(folder) ) {
137  store_->setCurrentFolder(folder);
138 
139  MonitorElement * effnum = store_->get(folder+"/"+hist1);
140 
141  if ( effnum ) {
142  MonitorElement *tmp = store_->bookProfile(name,name,effnum->getTH1F()->GetNbinsX(),effnum->getTH1F()->GetXaxis()->GetXmin(),effnum->getTH1F()->GetXaxis()->GetXmax(),105,0,1.05);
143 
144  tmp->setTitle(effnum->getTitle());
145  tmp->setAxisTitle(effnum->getAxisTitle(), 1); // X
146  tmp->setAxisTitle("Efficiency", 2);
147  if(copyLabels) {
148  const TAxis *xaxis = effnum->getTH1F()->GetXaxis();
149  for(int bin=1; bin <= effnum->getNbinsX(); ++bin) {
150  tmp->setBinLabel(bin, xaxis->GetBinLabel(bin));
151  }
152  }
153  }
154  }
155 }
std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::string getTitle(void) const
get MonitorElement title
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1187
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
void setTitle(const std::string &title)
set (ie. change) histogram/profile title
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
TH1F * getTH1F(void) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int getNbinsX(void) const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void HLTTauDQMSummaryPlotter::bookFractionHisto ( const std::string &  folder,
const std::string &  name 
)
private
void HLTTauDQMSummaryPlotter::bookPlots ( )

Definition at line 46 of file HLTTauDQMSummaryPlotter.cc.

References bookEfficiencyHisto(), bookTriggerBitEfficiencyHistos(), HLTTauDQMPlotter::configValid_, edm::Service< T >::isAvailable(), store_, HLTTauDQMPlotter::triggerTag(), and type_.

46  {
47  if(!configValid_)
48  return;
49 
51  if(store.isAvailable()) {
52  store_ = store.operator->();
53  //Path Summary
54  if ( type_ == "Path" ) {
55  bookTriggerBitEfficiencyHistos(triggerTag(), "EventsPerFilter");
56 
57  bookEfficiencyHisto(triggerTag(), "L2TrigTauEtEff", "helpers/L2TrigTauEtEffNum");
58  bookEfficiencyHisto(triggerTag(), "L2TrigTauHighEtEff", "helpers/L2TrigTauHighEtEffNum");
59  bookEfficiencyHisto(triggerTag(), "L2TrigTauEtaEff", "helpers/L2TrigTauEtaEffNum");
60  bookEfficiencyHisto(triggerTag(), "L2TrigTauPhiEff", "helpers/L2TrigTauPhiEffNum");
61 
62  bookEfficiencyHisto(triggerTag(), "L3TrigTauEtEff", "helpers/L3TrigTauEtEffNum");
63  bookEfficiencyHisto(triggerTag(), "L3TrigTauHighEtEff", "helpers/L3TrigTauHighEtEffNum");
64  bookEfficiencyHisto(triggerTag(), "L3TrigTauEtaEff", "helpers/L3TrigTauEtaEffNum");
65  bookEfficiencyHisto(triggerTag(), "L3TrigTauPhiEff", "helpers/L3TrigTauPhiEffNum");
66  }
67 
68  //L1 Summary
69  else if ( type_ == "L1" ) {
70  bookEfficiencyHisto(triggerTag(),"L1TauEtEff","EfficiencyHelpers/L1TauEtEffNum");
71  bookEfficiencyHisto(triggerTag(),"L1TauHighEtEff","EfficiencyHelpers/L1TauHighEtEffNum");
72  bookEfficiencyHisto(triggerTag(),"L1TauEtaEff","EfficiencyHelpers/L1TauEtaEffNum");
73  bookEfficiencyHisto(triggerTag(),"L1TauPhiEff","EfficiencyHelpers/L1TauPhiEffNum");
74 
75  bookEfficiencyHisto(triggerTag(),"L1JetEtEff","EfficiencyHelpers/L1JetEtEffNum");
76  bookEfficiencyHisto(triggerTag(),"L1JetHighEtEff","EfficiencyHelpers/L1JetHighEtEffNum");
77  bookEfficiencyHisto(triggerTag(),"L1JetEtaEff","EfficiencyHelpers/L1JetEtaEffNum");
78  bookEfficiencyHisto(triggerTag(),"L1JetPhiEff","EfficiencyHelpers/L1JetPhiEffNum");
79  }
80 
81  else if(type_ == "PathSummary") {
82  bookEfficiencyHisto(triggerTag(), "PathEfficiency", "helpers/PathTriggerBits", true);
83  }
84  }
85  store_ = nullptr;
86 }
const std::string & triggerTag() const
void bookTriggerBitEfficiencyHistos(std::string folder, std::string histo)
bool isAvailable() const
Definition: Service.h:46
void bookEfficiencyHisto(const std::string &folder, const std::string &name, const std::string &hist1, bool copyLabels=false)
void HLTTauDQMSummaryPlotter::bookTriggerBitEfficiencyHistos ( std::string  folder,
std::string  histo 
)
private

Definition at line 219 of file HLTTauDQMSummaryPlotter.cc.

References newFWLiteAna::bin, DQMStore::bookProfile(), DQMStore::dirExists(), DQMStore::get(), MonitorElement::getNbinsX(), MonitorElement::getTH1F(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and store_.

Referenced by bookPlots().

219  {
220  if ( store_->dirExists(folder) ) {
221  store_->setCurrentFolder(folder);
222 
223  MonitorElement * eff = store_->get(folder+"/"+histo);
224 
225  if ( eff ) {
226  //store_->bookProfile("EfficiencyRefInput","Efficiency with Matching",eff->getNbinsX()-1,0,eff->getNbinsX()-1,100,0,1);
227  //store_->bookProfile("EfficiencyRefL1","Efficiency with Matching Ref to L1",eff->getNbinsX()-2,0,eff->getNbinsX()-2,100,0,1);
228  MonitorElement *me_prev = store_->bookProfile("EfficiencyRefPrevious","Efficiency to Previous",eff->getNbinsX()-1,0,eff->getNbinsX()-1,100,0,1);
229  me_prev->setAxisTitle("Efficiency", 2);
230  const TAxis *xaxis = eff->getTH1F()->GetXaxis();
231  for(int bin=1; bin < eff->getNbinsX(); ++bin) {
232  me_prev->setBinLabel(bin, xaxis->GetBinLabel(bin));
233  }
234  }
235  }
236 }
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1187
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
TH1F * getTH1F(void) const
int getNbinsX(void) const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void HLTTauDQMSummaryPlotter::plot ( )

Definition at line 88 of file HLTTauDQMSummaryPlotter.cc.

References edm::Service< T >::isAvailable(), plotEfficiencyHisto(), plotTriggerBitEfficiencyHistos(), store_, HLTTauDQMPlotter::triggerTag(), and type_.

Referenced by cuy.FindIssue::__init__().

88  {
90  if(store.isAvailable()) {
91  store_ = store.operator->();
92  //Path Summary
93  if ( type_ == "Path" ) {
94  plotTriggerBitEfficiencyHistos(triggerTag(), "EventsPerFilter");
95 
96  plotEfficiencyHisto(triggerTag(), "L2TrigTauEtEff", "helpers/L2TrigTauEtEffNum", "helpers/L2TrigTauEtEffDenom");
97  plotEfficiencyHisto(triggerTag(), "L2TrigTauHighEtEff", "helpers/L2TrigTauHighEtEffNum", "helpers/L2TrigTauHighEtEffDenom");
98  plotEfficiencyHisto(triggerTag(), "L2TrigTauEtaEff", "helpers/L2TrigTauEtaEffNum", "helpers/L2TrigTauEtaEffDenom");
99  plotEfficiencyHisto(triggerTag(), "L2TrigTauPhiEff", "helpers/L2TrigTauPhiEffNum", "helpers/L2TrigTauPhiEffDenom");
100 
101  plotEfficiencyHisto(triggerTag(), "L3TrigTauEtEff", "helpers/L3TrigTauEtEffNum", "helpers/L3TrigTauEtEffDenom");
102  plotEfficiencyHisto(triggerTag(), "L3TrigTauHighEtEff", "helpers/L3TrigTauHighEtEffNum", "helpers/L3TrigTauHighEtEffDenom");
103  plotEfficiencyHisto(triggerTag(), "L3TrigTauEtaEff", "helpers/L3TrigTauEtaEffNum", "helpers/L3TrigTauEtaEffDenom");
104  plotEfficiencyHisto(triggerTag(), "L3TrigTauPhiEff", "helpers/L3TrigTauPhiEffNum", "helpers/L3TrigTauPhiEffDenom");
105  }
106 
107  //L1 Summary
108  else if ( type_ == "L1" ) {
109  plotEfficiencyHisto(triggerTag(),"L1TauEtEff","EfficiencyHelpers/L1TauEtEffNum","EfficiencyHelpers/L1TauEtEffDenom");
110  plotEfficiencyHisto(triggerTag(),"L1TauHighEtEff","EfficiencyHelpers/L1TauHighEtEffNum","EfficiencyHelpers/L1TauHighEtEffDenom");
111  plotEfficiencyHisto(triggerTag(),"L1TauEtaEff","EfficiencyHelpers/L1TauEtaEffNum","EfficiencyHelpers/L1TauEtaEffDenom");
112  plotEfficiencyHisto(triggerTag(),"L1TauPhiEff","EfficiencyHelpers/L1TauPhiEffNum","EfficiencyHelpers/L1TauPhiEffDenom");
113 
114  plotEfficiencyHisto(triggerTag(),"L1JetEtEff","EfficiencyHelpers/L1JetEtEffNum","EfficiencyHelpers/L1JetEtEffDenom");
115  plotEfficiencyHisto(triggerTag(),"L1JetHighEtEff","EfficiencyHelpers/L1JetHighEtEffNum","EfficiencyHelpers/L1JetHighEtEffDenom");
116  plotEfficiencyHisto(triggerTag(),"L1JetEtaEff","EfficiencyHelpers/L1JetEtaEffNum","EfficiencyHelpers/L1JetEtaEffDenom");
117  plotEfficiencyHisto(triggerTag(),"L1JetPhiEff","EfficiencyHelpers/L1JetPhiEffNum","EfficiencyHelpers/L1JetPhiEffDenom");
118 
119  plotEfficiencyHisto(triggerTag(),"L1ElectronEtEff","EfficiencyHelpers/L1ElectronEtEffNum","EfficiencyHelpers/L1ElectronEtEffDenom");
120  plotEfficiencyHisto(triggerTag(),"L1ElectronEtaEff","EfficiencyHelpers/L1ElectronEtaEffNum","EfficiencyHelpers/L1ElectronEtaEffDenom");
121  plotEfficiencyHisto(triggerTag(),"L1ElectronPhiEff","EfficiencyHelpers/L1ElectronPhiEffNum","EfficiencyHelpers/L1ElectronPhiEffDenom");
122 
123  plotEfficiencyHisto(triggerTag(),"L1MuonEtEff","EfficiencyHelpers/L1MuonEtEffNum","EfficiencyHelpers/L1MuonEtEffDenom");
124  plotEfficiencyHisto(triggerTag(),"L1MuonEtaEff","EfficiencyHelpers/L1MuonEtaEffNum","EfficiencyHelpers/L1MuonEtaEffDenom");
125  plotEfficiencyHisto(triggerTag(),"L1MuonPhiEff","EfficiencyHelpers/L1MuonPhiEffNum","EfficiencyHelpers/L1MuonPhiEffDenom");
126  }
127 
128  else if(type_ == "PathSummary") {
129  plotEfficiencyHisto(triggerTag(), "PathEfficiency", "helpers/PathTriggerBits", "helpers/RefEvents");
130  }
131  }
132  store_ = nullptr;
133 }
void plotTriggerBitEfficiencyHistos(std::string folder, std::string histo)
const std::string & triggerTag() const
bool isAvailable() const
Definition: Service.h:46
void plotEfficiencyHisto(std::string folder, std::string name, std::string hist1, std::string hist2)
void HLTTauDQMSummaryPlotter::plotEfficiencyHisto ( std::string  folder,
std::string  name,
std::string  hist1,
std::string  hist2 
)
private

Definition at line 157 of file HLTTauDQMSummaryPlotter.cc.

References DQMStore::dirExists(), postValidation_cfi::efficiency, DQMStore::get(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), i, DQMStore::setCurrentFolder(), mathSSE::sqrt(), and store_.

Referenced by plot().

157  {
158  if ( store_->dirExists(folder) ) {
159  store_->setCurrentFolder(folder);
160 
161  MonitorElement * effnum = store_->get(folder+"/"+hist1);
162  MonitorElement * effdenom = store_->get(folder+"/"+hist2);
163  MonitorElement * eff = store_->get(folder+"/"+name);
164 
165  if(effnum && effdenom && eff) {
166  const TH1F *num = effnum->getTH1F();
167  const TH1F *denom = effdenom->getTH1F();
168  TProfile *prof = eff->getTProfile();
169  for (int i = 1; i <= num->GetNbinsX(); ++i) {
170  if(denom->GetBinContent(i) < num->GetBinContent(i)) {
171  edm::LogError("HLTTauDQMOffline") << "Encountered denominator < numerator with efficiency plot " << name << " in folder " << folder << ", bin " << i << " numerator " << num->GetBinContent(i) << " denominator " << denom->GetBinContent(i);
172  continue;
173  }
174  std::tuple<float, float> effErr = calcEfficiency(num->GetBinContent(i), denom->GetBinContent(i));
175  const float efficiency = std::get<0>(effErr);
176  const float err = std::get<1>(effErr);
177  prof->SetBinContent(i, efficiency);
178  prof->SetBinEntries(i, 1);
179  prof->SetBinError(i, std::sqrt(efficiency*efficiency + err*err)); // why simple SetBinError(err) does not work?
180  }
181  }
182  }
183 }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
TH1F * getTH1F(void) const
TProfile * getTProfile(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void HLTTauDQMSummaryPlotter::plotFractionHisto ( const std::string &  folder,
const std::string &  name 
)
private
void HLTTauDQMSummaryPlotter::plotIntegratedEffHisto ( std::string  folder,
std::string  name,
std::string  refHisto,
std::string  evCount,
int  bin 
)
private

Definition at line 185 of file HLTTauDQMSummaryPlotter.cc.

References DQMStore::dirExists(), DQMStore::get(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), timingPdfMaker::histo, i, funct::integral(), pileupCalc::nbins, DQMStore::setCurrentFolder(), mathSSE::sqrt(), and store_.

185  {
186  if ( store_->dirExists(folder) ) {
187  store_->setCurrentFolder(folder);
188 
189  MonitorElement * refH = store_->get(folder+"/"+refHisto);
190  MonitorElement * evC = store_->get(folder+"/"+evCount);
191  MonitorElement * eff = store_->get(folder+"/"+name);
192 
193  if ( refH && evC && eff ) {
194  TH1F *histo = refH->getTH1F();
195  float nGenerated = evC->getTH1F()->GetBinContent(bin);
196  // Assuming that the histogram is incremented with weight=1 for each event
197  // this function integrates the histogram contents above every bin and stores it
198  // in that bin. The result is plot of integral rate versus threshold plot.
199  int nbins = histo->GetNbinsX();
200  double integral = histo->GetBinContent(nbins+1); // Initialize to overflow
201  if (nGenerated<=0.0) nGenerated=1.0;
202  for ( int i = nbins; i >= 1; i-- ) {
203  double thisBin = histo->GetBinContent(i);
204  integral += thisBin;
205  double integralEff;
206  double integralError;
207  integralEff = (integral / nGenerated);
208  eff->getTProfile()->SetBinContent(i, integralEff);
209  eff->getTProfile()->SetBinEntries(i, 1);
210  // error
211  integralError = (sqrt(integral) / nGenerated);
212 
213  eff->getTProfile()->SetBinError(i, sqrt(integralEff*integralEff+integralError*integralError));
214  }
215  }
216  }
217 }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
TH1F * getTH1F(void) const
TProfile * getTProfile(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void HLTTauDQMSummaryPlotter::plotTriggerBitEfficiencyHistos ( std::string  folder,
std::string  histo 
)
private

Definition at line 238 of file HLTTauDQMSummaryPlotter.cc.

References DQMStore::dirExists(), postValidation_cfi::efficiency, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), i, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), mathSSE::sqrt(), and store_.

Referenced by plot().

238  {
239  if ( store_->dirExists(folder) ) {
240  store_->setCurrentFolder(folder);
241  MonitorElement * eff = store_->get(folder+"/"+histo);
242  //MonitorElement * effRefTruth = store_->get(folder+"/EfficiencyRefInput");
243  //MonitorElement * effRefL1 = store_->get(folder+"/EfficiencyRefL1");
244  MonitorElement * effRefPrevious = store_->get(folder+"/EfficiencyRefPrevious");
245 
246  //if ( eff && effRefTruth && effRefL1 && effRefPrevious ) {
247  if (eff && effRefPrevious) {
248  TProfile *previous = effRefPrevious->getTProfile();
249 
250  //Calculate efficiencies with ref to matched objects
251  /*
252  for ( int i = 2; i <= eff->getNbinsX(); ++i ) {
253  double efficiency = calcEfficiency(eff->getBinContent(i),eff->getBinContent(1)).first;
254  double err = calcEfficiency(eff->getBinContent(i),eff->getBinContent(1)).second;
255 
256  effRefTruth->getTProfile()->SetBinContent(i-1,efficiency);
257  effRefTruth->getTProfile()->SetBinEntries(i-1,1);
258  effRefTruth->getTProfile()->SetBinError(i-1,sqrt(efficiency*efficiency+err*err));
259  effRefTruth->setBinLabel(i-1,eff->getTH1F()->GetXaxis()->GetBinLabel(i));
260 
261  }
262  //Calculate efficiencies with ref to L1
263  for ( int i = 3; i <= eff->getNbinsX(); ++i ) {
264  double efficiency = calcEfficiency(eff->getBinContent(i),eff->getBinContent(2)).first;
265  double err = calcEfficiency(eff->getBinContent(i),eff->getBinContent(2)).second;
266 
267  effRefL1->getTProfile()->SetBinContent(i-2,efficiency);
268  effRefL1->getTProfile()->SetBinEntries(i-2,1);
269  effRefL1->getTProfile()->SetBinError(i-2,sqrt(efficiency*efficiency+err*err));
270  effRefL1->setBinLabel(i-2,eff->getTH1F()->GetXaxis()->GetBinLabel(i));
271  }
272  */
273  //Calculate efficiencies with ref to previous
274  for ( int i = 2; i <= eff->getNbinsX(); ++i ) {
275  if(eff->getBinContent(i-1) < eff->getBinContent(i)) {
276  edm::LogError("HLTTauDQMOffline") << "Encountered denominator < numerator with efficiency plot EfficiencyRefPrevious in folder " << folder << ", bin " << i << " numerator " << eff->getBinContent(i) << " denominator " << eff->getBinContent(i-1);
277  continue;
278  }
279  const std::tuple<float, float> effErr = calcEfficiency(eff->getBinContent(i), eff->getBinContent(i-1));
280  const float efficiency = std::get<0>(effErr);
281  const float err = std::get<1>(effErr);
282 
283  previous->SetBinContent(i-1, efficiency);
284  previous->SetBinEntries(i-1, 1);
285  previous->SetBinError(i-1, std::sqrt(efficiency*efficiency + err*err)); // why simple SetBinError(err) does not work?
286  effRefPrevious->setBinLabel(i-1,eff->getTH1F()->GetXaxis()->GetBinLabel(i));
287  }
288  }
289  }
290 }
int i
Definition: DBlmapReader.cc:9
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:649
TH1F * getTH1F(void) const
double getBinContent(int binx) const
get content of bin (1-D)
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585

Member Data Documentation

DQMStore* HLTTauDQMSummaryPlotter::store_
private
std::string HLTTauDQMSummaryPlotter::type_
private