1 |
pharris |
1.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 |
pharris |
1.2 |
#include "CondFormats/EgammaObjects/interface/GBRForest.h"
|
16 |
pharris |
1.1 |
|
17 |
|
|
class TRandom3;
|
18 |
|
|
namespace TMVA {
|
19 |
|
|
class Reader;
|
20 |
|
|
}
|
21 |
|
|
|
22 |
|
|
namespace mithep {
|
23 |
|
|
class TauIsoMVA {
|
24 |
|
|
public:
|
25 |
|
|
struct IsoRings
|
26 |
|
|
{
|
27 |
|
|
std::vector<int> niso;
|
28 |
|
|
std::vector<std::vector<float> > rings;
|
29 |
|
|
std::vector<std::vector<float> > shapes;
|
30 |
|
|
|
31 |
|
|
std::vector<float> getVector()
|
32 |
|
|
{
|
33 |
|
|
std::vector<float> all;
|
34 |
|
|
all.reserve(33);
|
35 |
|
|
|
36 |
|
|
for(uint i = 0; i < niso.size(); i++)
|
37 |
|
|
all.push_back(niso[i]);
|
38 |
|
|
|
39 |
|
|
for(uint i = 0; i < rings.size(); i++)
|
40 |
|
|
all.insert(all.end(), rings[i].begin(), rings[i].end());
|
41 |
|
|
|
42 |
|
|
for(uint i = 0; i < shapes.size(); i++)
|
43 |
|
|
all.insert(all.end(), shapes[i].begin(), shapes[i].end());
|
44 |
|
|
|
45 |
|
|
return all;
|
46 |
|
|
}
|
47 |
|
|
};
|
48 |
|
|
TauIsoMVA();
|
49 |
|
|
~TauIsoMVA();
|
50 |
|
|
void Initialize (TString iWeightFile);
|
51 |
pharris |
1.2 |
void InitializeGBR (TString iWeightFile);
|
52 |
pharris |
1.1 |
double MVAValue (const PFTau *iTau,double iRho);
|
53 |
|
|
IsoRings computeIsoRings(const PFTau *iTau);
|
54 |
|
|
|
55 |
|
|
protected:
|
56 |
pharris |
1.2 |
bool fGBR;
|
57 |
|
|
GBRForest *fGBRReader;
|
58 |
pharris |
1.1 |
TMVA::Reader *fReader;
|
59 |
pharris |
1.2 |
ClassDef(TauIsoMVA,1)
|
60 |
pharris |
1.1 |
};
|
61 |
|
|
}
|
62 |
|
|
#endif
|