8 #include "TMVA/Reader.h"
9 #include "TMVA/MethodBDT.h"
10 #include "TMVA/MethodCategory.h"
13 constexpr char ele_mva_name[] =
"BDTSimpleCat";
23 TMVA::Reader tmvaReader(
"!Color:Silent");
24 tmvaReader.AddVariable(
"fbrem",&fbrem);
25 tmvaReader.AddVariable(
"detain", &detain);
26 tmvaReader.AddVariable(
"dphiin", &dphiin);
27 tmvaReader.AddVariable(
"sieie", &sieie);
28 tmvaReader.AddVariable(
"hoe", &hoe);
29 tmvaReader.AddVariable(
"eop", &eop);
30 tmvaReader.AddVariable(
"e1x5e5x5", &e1x5e5x5);
31 tmvaReader.AddVariable(
"eleopout", &eleopout);
32 tmvaReader.AddVariable(
"detaeleout", &detaeleout);
33 tmvaReader.AddVariable(
"kfchi2", &kfchi2);
34 tmvaReader.AddVariable(
"kfhits", &mykfhits);
35 tmvaReader.AddVariable(
"mishits",&mymishits);
36 tmvaReader.AddVariable(
"dist", &absdist);
37 tmvaReader.AddVariable(
"dcot", &absdcot);
38 tmvaReader.AddVariable(
"nvtx", &myNvtx);
40 tmvaReader.AddSpectator(
"eta",&
eta);
41 tmvaReader.AddSpectator(
"pt",&
pt);
42 tmvaReader.AddSpectator(
"ecalseed",&ecalseed);
47 std::unique_ptr<TMVA::IMethod>
temp( tmvaReader.BookMVA(ele_mva_name,
fileName.c_str()) );
48 gbr.emplace_back(
new GBRForest( dynamic_cast<TMVA::MethodBDT*>( tmvaReader.FindMVA(ele_mva_name) ) ) );
52 std::vector<std::string> weightsfiles;
56 weightsfiles.push_back(path_mvaWeightFileEleID);
58 for(
const auto& wgtfile : weightsfiles ) {
59 TMVA::Reader tmvaReader(
"!Color:Silent");
60 tmvaReader.AddVariable(
"fbrem",&
fbrem);
61 tmvaReader.AddVariable(
"detain", &
detain);
62 tmvaReader.AddVariable(
"dphiin", &
dphiin);
63 tmvaReader.AddVariable(
"sieie", &
sieie);
64 tmvaReader.AddVariable(
"hoe", &
hoe);
65 tmvaReader.AddVariable(
"eop", &
eop);
66 tmvaReader.AddVariable(
"e1x5e5x5", &
e1x5e5x5);
67 tmvaReader.AddVariable(
"eleopout", &
eleopout);
68 tmvaReader.AddVariable(
"detaeleout", &
detaeleout);
69 tmvaReader.AddVariable(
"kfchi2", &
kfchi2);
70 tmvaReader.AddVariable(
"kfhits", &
mykfhits);
71 tmvaReader.AddVariable(
"mishits",&
mymishits);
72 tmvaReader.AddVariable(
"dist", &
absdist);
73 tmvaReader.AddVariable(
"dcot", &
absdcot);
74 tmvaReader.AddVariable(
"nvtx", &
myNvtx);
76 tmvaReader.AddSpectator(
"eta",&
eta);
77 tmvaReader.AddSpectator(
"pt",&
pt);
78 tmvaReader.AddSpectator(
"ecalseed",&
ecalseed);
83 std::unique_ptr<TMVA::IMethod>
temp( tmvaReader.BookMVA(ele_mva_name,wgtfile) );
84 gbr.emplace_back(
new GBRForest( dynamic_cast<TMVA::MethodBDT*>( tmvaReader.FindMVA(ele_mva_name) ) ) );
91 vars[0] = myElectron.
fbrem();
97 vars[6] = (myElectron.
e5x5()) !=0. ? 1.-(myElectron.
e1x5()/myElectron.
e5x5()) : -1. ;
107 vars[9] = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
108 vars[10] = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1.;
112 vars[14] = nvertices;
113 vars[15] = myElectron.
eta();
114 vars[16] = myElectron.
pt();
124 const unsigned index = (unsigned)(myElectron.
pt() >= 10) + 2*(
unsigned)(
std::abs(myElectron.
eta()) > 1.485);
double mva(const reco::GsfElectron &myElectron, int nvertices=0) const
bool isNonnull() const
Checks for non-null.
float eSuperClusterOverP() const
void bindVariables(float vars[18]) const
TrackRef closestCtfTrackRef() const
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
float deltaPhiSuperClusterTrackAtVtx() const
float hcalOverEcal() const
Abs< T >::type abs(const T &t)
float eEleClusterOverPout() const
float deltaEtaEleClusterTrackAtCalo() const
std::vector< std::string > vweightsfiles
virtual double eta() const final
momentum pseudorapidity
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
virtual double pt() const final
transverse momentum
bool ecalDrivenSeed() const
std::vector< std::unique_ptr< const GBRForest > > gbr