ATLAS Offline Software
Loading...
Searching...
No Matches
Efficiency1D.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef TIDA_EFFICIENCY1D_H
13#define TIDA_EFFICIENCY1D_H
14
15#include "T_Efficiency.h"
16#include "TH1F.h"
17
18
19class Efficiency1D : public T_Efficiency<TH1F> {
20
21public:
22
23 Efficiency1D(TH1F* h, const std::string& n="") :
24 T_Efficiency<TH1F>( h, n ) { }
25
26 Efficiency1D(TH1F* hnum, TH1F* hden, const std::string& n, double scale=100) :
27 T_Efficiency<TH1F>( hnum, hden, n, scale ) {
28 getibinvec(true);
29 finalise( scale );
30 }
31
33
34
35 // fill methods ..
36
37 virtual void Fill( double x, double w=1) {
38 m_hnumer->Fill(float(x),float(w));
39 m_hdenom->Fill(float(x),float(w));
40 }
41
42 virtual void FillDenom( double x, float w=1) {
43 m_hdenom->Fill(float(x),float(w));
44 m_hmissed->Fill(float(x),float(w));
45 }
46
48
49 TGraphAsymmErrors* Bayes(double scale=100) {
50 return BayesInternal( m_hnumer, m_hdenom, scale );
51 }
52
53protected:
54
55 virtual void getibinvec(bool force=false) {
56 if ( !force && !m_ibin.empty() ) return;
57 for ( int i=1 ; i<=m_hdenom->GetNbinsX() ; i++ ) {
58 m_ibin.push_back( i );
59 }
60 }
61
62};
63
64
65
66inline std::ostream& operator<<( std::ostream& s, const Efficiency1D& ) {
67 return s;
68}
69
70
71#endif // TIDA_EFFICIENCY1D_H
72
73
74
75
76
77
78
79
80
81
std::ostream & operator<<(std::ostream &s, const Efficiency1D &)
#define x
Header file for AthHistogramAlgorithm.
virtual void Fill(double x, double w=1)
virtual void FillDenom(double x, float w=1)
Efficiency1D(TH1F *h, const std::string &n="")
TGraphAsymmErrors * Bayes(double scale=100)
evaluate the uncertainties correctly ...
Efficiency1D(TH1F *hnum, TH1F *hden, const std::string &n, double scale=100)
virtual void getibinvec(bool force=false)
TGraphAsymmErrors * BayesInternal(TH1 *hn, TH1 *hd, double scale=100) const
std::vector< int > m_ibin
T_Efficiency(TH1F *h, const std::string &n)
void finalise(double scale=100)