9 #include "TMVA/Tools.h"
10 #include "TMVA/Reader.h"
12 using namespace HWWFunctions;
16 fMethodname(
"BDTG method"),
17 fIsInitialized(kFALSE)
20 for(UInt_t
i=0;
i<6; ++
i) {
29 for(UInt_t
i=0;
i<6; ++
i) {
36 TString Subdet0Pt10To14p5Weights ,
37 TString Subdet1Pt10To14p5Weights ,
38 TString Subdet0Pt14p5To20Weights,
39 TString Subdet1Pt14p5To20Weights,
40 TString Subdet0Pt20ToInfWeights,
41 TString Subdet1Pt20ToInfWeights) {
44 edm::LogError(
"InvalidInput") <<
"[MuonIDMVA::Initialize] Version must be 1. Aborting.";
51 for(UInt_t
i=0;
i<6; ++
i) {
54 fTMVAReader[
i] =
new TMVA::Reader(
"!Color:!Silent:Error" );
96 Double_t MuGlobalNchi2,
97 Double_t MuNValidHits,
98 Double_t MuNTrackerHits,
99 Double_t MuNPixelHits,
105 Double_t MuSegmentCompatibility,
106 Double_t MuCaloCompatibility,
107 Double_t MuHadEnergyOverPt,
108 Double_t MuHoEnergyOverPt,
109 Double_t MuEmEnergyOverPt,
110 Double_t MuHadS9EnergyOverPt,
111 Double_t MuHoS9EnergyOverPt,
112 Double_t MuEmS9EnergyOverPt,
113 Double_t MuTrkIso03OverPt,
114 Double_t MuEMIso03OverPt,
115 Double_t MuHadIso03OverPt,
116 Double_t MuTrkIso05OverPt,
117 Double_t MuEMIso05OverPt,
118 Double_t MuHadIso05OverPt,
123 edm::LogError(
"NotInitialized") <<
"Error: MuonIDMVA not properly initialized.";
128 if (fabs(MuEta) < 1.479) subdet = 0;
131 if (MuPt > 14.5) ptBin = 1;
132 if (MuPt > 20.0) ptBin = 2;
161 Double_t mva = -9999;
165 if (subdet == 0 && ptBin == 0) MVABin = 0;
166 if (subdet == 1 && ptBin == 0) MVABin = 1;
167 if (subdet == 0 && ptBin == 1) MVABin = 2;
168 if (subdet == 1 && ptBin == 1) MVABin = 3;
169 if (subdet == 0 && ptBin == 2) MVABin = 4;
170 if (subdet == 1 && ptBin == 2) MVABin = 5;
171 assert(MVABin >= 0 && MVABin <= 5);
177 LogDebug(
"MuonIDMVA") <<
"Debug Muon MVA: "
178 << MuPt <<
" " << MuEta <<
" --> MVABin " << MVABin <<
" : "
214 edm::LogError(
"NotInialized") <<
"Error: MuonIDMVA not properly initialized.";
219 Double_t MuEta = hww.
mus_trk_p4().at(mu).eta();
223 if (fabs(MuEta) < 1.479) subdet = 0;
226 if (MuPt > 14.5) ptBin = 1;
227 if (MuPt > 20.0) ptBin = 2;
258 Double_t mva = -9999;
262 if (subdet == 0 && ptBin == 0) MVABin = 0;
263 if (subdet == 1 && ptBin == 0) MVABin = 1;
264 if (subdet == 0 && ptBin == 1) MVABin = 2;
265 if (subdet == 1 && ptBin == 1) MVABin = 3;
266 if (subdet == 0 && ptBin == 2) MVABin = 4;
267 if (subdet == 1 && ptBin == 2) MVABin = 5;
268 assert(MVABin >= 0 && MVABin <= 5);
274 LogDebug(
"MuonIDMVA") <<
"Debug Muon MVA: "
276 << hww.
mus_p4().at(mu).pt() <<
" " << hww.
mus_p4().at(mu).eta() <<
" " << hww.
mus_p4().at(mu).phi() <<
" : "
277 << MuPt <<
" " << MuEta <<
" --> MVABin " << MVABin <<
" : "
Float_t fMVAVar_MuEMIso05OverPt
Float_t fMVAVar_MuIP3dSig
Float_t fMVAVar_MuGlobalNchi2
Float_t fMVAVar_MuEMIso03OverPt
double mud0PV_smurfV3(HWW &, unsigned int index)
std::vector< int > & trks_valid_pixelhits()
std::vector< float > & mus_iso05_hadEt()
void Initialize(TString methodName, unsigned int version, TString Subdet0Pt10To14p5Weights, TString Subdet1Pt10To14p5Weights, TString Subdet0Pt14p5To20Weights, TString Subdet1Pt14p5To20Weights, TString Subdet0Pt20ToInfWeights, TString Subdet1Pt20ToInfWeights)
Float_t fMVAVar_MuHoEnergyOverPt
std::vector< float > & mus_gfit_chi2()
Float_t fMVAVar_MuCaloCompatibility
Float_t fMVAVar_MuHadEnergyOverPt
std::vector< int > & mus_trkidx()
Float_t fMVAVar_MuTrkIso03OverPt
std::vector< LorentzVector > & mus_p4()
std::vector< float > & mus_iso03_hadEt()
unsigned int & evt_lumiBlock()
std::vector< float > & mus_e_hoS9()
std::vector< int > & mus_nmatches()
std::vector< float > & mus_iso03_sumPt()
Float_t fMVAVar_MuNPixelHits
std::vector< int > & mus_gfit_validSTAHits()
std::vector< float > & mus_ndof()
std::vector< float > & mus_ip3derr()
Float_t fMVAVar_MuNMatches
std::vector< float > & mus_ip3d()
std::vector< float > & mus_e_emS9()
Float_t fMVAVar_MuEmS9EnergyOverPt
Float_t fMVAVar_MuHadIso05OverPt
std::pair< double, double > trks_d0_pv(HWW &, int itrk, int ipv)
std::vector< LorentzVector > & mus_trk_p4()
std::vector< int > & mus_validHits()
Float_t fMVAVar_MuTrkKink
Float_t fMVAVar_MuTrkIso05OverPt
Float_t fMVAVar_MuHadIso03OverPt
std::vector< float > & mus_gfit_ndof()
static const Double_t MuonEffectiveArea(EMuonEffectiveAreaType type, Double_t Eta)
Float_t fMVAVar_MuSegmentCompatibility
std::vector< float > & mus_e_hadS9()
std::vector< float > & mus_e_had()
std::vector< float > & mus_trkKink()
Float_t fMVAVar_MuEmEnergyOverPt
Float_t fMVAVar_MuHadS9EnergyOverPt
std::vector< float > & mus_segmCompatibility()
TMVA::Reader * fTMVAReader[6]
std::vector< float > & mus_e_em()
std::vector< float > & mus_iso05_sumPt()
Float_t fMVAVar_MuNTrackerHits
std::vector< float > & mus_caloCompatibility()
unsigned int & evt_event()
std::vector< float > & mus_e_ho()
Float_t fMVAVar_MuHoS9EnergyOverPt
Float_t fMVAVar_MuNValidHits
std::vector< float > & mus_iso05_emEt()
Double_t MVAValue(HWW &, const unsigned int mu, const unsigned int vertex)
std::vector< float > & mus_chi2()
Float_t fMVAVar_MuTkNchi2
std::vector< float > & mus_iso03_emEt()