ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/TauIsoMVA.h
Revision: 1.3
Committed: Thu Mar 28 13:44:17 2013 UTC (12 years, 1 month ago) by arapyan
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a, HEAD
Changes since 1.2: +2 -0 lines
Log Message:
proper gbrforest initialization

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id $
3 //
4 // Tau Iso MVA
5 //
6 // Authors: M. Chan (implemented by P. Harris)
7 //--------------------------------------------------------------------------------------------------
8
9 #ifndef MITPHYSICS_UTILS_TAUISOMVA_H
10 #define MITPHYSICS_UTILS_TAUISOMVA_H
11
12 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
13 #include <vector>
14 #include "MitAna/DataTree/interface/PFTau.h"
15 #include "CondFormats/EgammaObjects/interface/GBRForest.h"
16
17 class TRandom3;
18 class GBRForest;
19
20 namespace TMVA {
21 class Reader;
22 }
23
24 namespace mithep {
25 class TauIsoMVA {
26 public:
27 struct IsoRings
28 {
29 std::vector<int> niso;
30 std::vector<std::vector<float> > rings;
31 std::vector<std::vector<float> > shapes;
32
33 std::vector<float> getVector()
34 {
35 std::vector<float> all;
36 all.reserve(33);
37
38 for(uint i = 0; i < niso.size(); i++)
39 all.push_back(niso[i]);
40
41 for(uint i = 0; i < rings.size(); i++)
42 all.insert(all.end(), rings[i].begin(), rings[i].end());
43
44 for(uint i = 0; i < shapes.size(); i++)
45 all.insert(all.end(), shapes[i].begin(), shapes[i].end());
46
47 return all;
48 }
49 };
50 TauIsoMVA();
51 ~TauIsoMVA();
52 void Initialize (TString iWeightFile);
53 void InitializeGBR (TString iWeightFile);
54 double MVAValue (const PFTau *iTau,double iRho);
55 IsoRings computeIsoRings(const PFTau *iTau);
56
57 protected:
58 bool fGBR;
59 GBRForest *fGBRReader;
60 TMVA::Reader *fReader;
61 ClassDef(TauIsoMVA,1)
62 };
63 }
64 #endif