ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/FakeMods/interface/FakeRate.h
Revision: 1.5
Committed: Tue Aug 11 09:15:59 2009 UTC (15 years, 8 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a, Mit_028a, Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, HEAD
Changes since 1.4: +21 -20 lines
Log Message:
Further cleanup

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: FakeRate.h,v 1.4 2009/08/10 16:07:26 phedex Exp $
3 //
4 // FakeRate
5 //
6 // Class for storing the fake rates.
7 //
8 // Authors: S.Xie
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITPHYSICS_FAKEMODS_FAKERATE_H
12 #define MITPHYSICS_FAKEMODS_FAKERATE_H
13
14 #include "MitAna/DataTree/interface/DataObject.h"
15 #include "MitCommon/DataFormats/interface/TH2DAsymErr.h"
16
17 class TH1F;
18 class TH2F;
19 class TF1;
20 class TF2;
21
22 namespace mithep
23 {
24 class FakeRate : public DataObject
25 {
26 public:
27 FakeRate() {}
28 FakeRate(TString eleFRFile, TString muonFRFile, TString eleFRFunctionName,
29 TString muonFRFunctionName, TString eleFRHistName, TString muonFRHistName,
30 Bool_t use2DFakeRate,
31 Bool_t useFitFunction) : fElectronFRFilename(eleFRFile),
32 fMuonFRFilename(muonFRFile),
33 fElectronFRFunctionName(eleFRFunctionName),
34 fMuonFRFunctionName(muonFRFunctionName),
35 fElectronFRHistName(eleFRHistName),
36 fMuonFRHistName(muonFRHistName),
37 fUse2DFakeRate (use2DFakeRate),
38 fUseFitFunction(useFitFunction) {
39 fIsInit = Init();
40 }
41
42 Bool_t Init();
43 Double_t ElectronFakeRate(Double_t et, Double_t eta, Double_t phi);
44 Double_t ElectronFakeRateError(Double_t pt, Double_t eta, Double_t phi,
45 mithep::TH2DAsymErr::EErrType errorType);
46 Double_t ElectronFakeRateStatErrorLow(Double_t pt, Double_t eta, Double_t phi);
47 Double_t ElectronFakeRateStatErrorHigh(Double_t pt, Double_t eta, Double_t phi);
48 Double_t ElectronFakeRateSysErrorLow(Double_t pt, Double_t eta, Double_t phi);
49 Double_t ElectronFakeRateSysErrorHigh(Double_t pt, Double_t eta, Double_t phi);
50 Double_t ElectronFakeRateErrorLow(Double_t pt, Double_t eta, Double_t phi);
51 Double_t ElectronFakeRateErrorHigh(Double_t pt, Double_t eta, Double_t phi);
52 Double_t MuonFakeRate(Double_t pt, Double_t eta, Double_t phi);
53 Double_t MuonFakeRateError(Double_t pt, Double_t eta, Double_t phi,
54 mithep::TH2DAsymErr::EErrType errorType);
55 Double_t MuonFakeRateStatErrorLow(Double_t pt, Double_t eta, Double_t phi);
56 Double_t MuonFakeRateStatErrorHigh(Double_t pt, Double_t eta, Double_t phi);
57 Double_t MuonFakeRateSysErrorLow(Double_t pt, Double_t eta, Double_t phi);
58 Double_t MuonFakeRateSysErrorHigh(Double_t pt, Double_t eta, Double_t phi);
59 Double_t MuonFakeRateErrorLow(Double_t pt, Double_t eta, Double_t phi);
60 Double_t MuonFakeRateErrorHigh(Double_t pt, Double_t eta, Double_t phi);
61
62 const char *GetElectronFRFilename() { return fElectronFRFilename; }
63 const char *GetMuonFRFilename() { return fMuonFRFilename; }
64 const char *GetElectronFRFunctionName() { return fElectronFRFunctionName; }
65 const char *GetMuonFRFunctionName() { return fMuonFRFunctionName; }
66 const char *GetElectronFRHistName() { return fElectronFRHistName; }
67 const char *GetMuonFRHistName() { return fMuonFRHistName; }
68 Bool_t GetUse2DFakeRate() { return fUse2DFakeRate; }
69 Bool_t GetUseFitFunction() { return fUseFitFunction; }
70 TH2DAsymErr *GetMuonFakeRate() { return fMuonFakeRateHist_PtEta; }
71 TH2DAsymErr *GetElectronFakeRate() { return fElectronFakeRateHist_PtEta; }
72
73 void SetElectronFRFilename(const char *name) { fElectronFRFilename = name; }
74 void SetMuonFRFilename(const char *name) { fMuonFRFilename = name; }
75 void SetElectronFRFunctionName(const char *name) { fElectronFRFunctionName = name; }
76 void SetMuonFRFunctionName(const char *name) { fMuonFRFunctionName = name; }
77 void SetElectronFRHistName(const char *name) { fElectronFRHistName = name; }
78 void SetMuonFRHistName(const char *name) { fMuonFRHistName = name; }
79 void SetUse2DFakeRate(Bool_t b) { fUse2DFakeRate = b; }
80 void SetUseFitFunction(Bool_t b) { fUseFitFunction = b; }
81
82 protected:
83 void DeleteHistos();
84
85 TString fElectronFRFilename; //filename of file containing electron fake rate
86 TString fMuonFRFilename; //filename of file containing muon fake rate
87 TString fElectronFRFunctionName; //name of electron fake rate function
88 TString fMuonFRFunctionName; //name of muon fake rate function
89 TString fElectronFRHistName; //name of histogram containing electron fake rate
90 TString fMuonFRHistName; //name of histogram containing muon fake rate
91 Bool_t fUse2DFakeRate; //whether to use 2D pt-eta fake rate
92 Bool_t fUseFitFunction; //whether to use fit function or not
93
94 private:
95 Bool_t fIsInit; //=true if histograms are loaded
96 TH2DAsymErr *fElectronFakeRateHist_PtEta; //2D Fake Rate for electrons
97 TH2DAsymErr *fMuonFakeRateHist_PtEta; //2D Fake Rate for muons
98 TH1F *fElectronFakeRateHist_Pt; //1D Fake Rate for electrons
99 TH1F *fMuonFakeRateHist_Pt; //1D Fake Rate for electrons
100 TF2 *fElectronFakeRateFit_PtEta; //2D Fake Rate Fit for electrons
101 TF2 *fMuonFakeRateFit_PtEta; //2D Fake Rate Fit for muons
102 TF1 *fElectronFakeRateFit_Pt; //1D Fake Rate Fit for electrons
103 TF1 *fMuonFakeRateFit_Pt; //1D Fake Rate Fit for electrons
104
105 ClassDef(FakeRate, 1) // Fake rate class
106 };
107 }
108 #endif