CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFEGammaHeavyObjectCache.cc
Go to the documentation of this file.
3 #include "TMVA/MethodBDT.h"
4 #include "TMVA/Reader.h"
5 
6 namespace pfEGHelpers {
8  {
9  const edm::FileInPath& wfile = conf.getParameter<edm::FileInPath>("pf_electronID_mvaWeightFile");
10  // Set the tmva reader for electrons
11  TMVA::Reader tmvaReaderEle_("!Color:Silent");
12  tmvaReaderEle_.AddVariable("lnPt_gsf",&lnPt_gsf);
13  tmvaReaderEle_.AddVariable("Eta_gsf",&Eta_gsf);
14  tmvaReaderEle_.AddVariable("dPtOverPt_gsf",&dPtOverPt_gsf);
15  tmvaReaderEle_.AddVariable("DPtOverPt_gsf",&DPtOverPt_gsf);
16  //tmvaReaderEle_.AddVariable("nhit_gsf",&nhit_gsf);
17  tmvaReaderEle_.AddVariable("chi2_gsf",&chi2_gsf);
18  //tmvaReaderEle_.AddVariable("DPtOverPt_kf",&DPtOverPt_kf);
19  tmvaReaderEle_.AddVariable("nhit_kf",&nhit_kf);
20  tmvaReaderEle_.AddVariable("chi2_kf",&chi2_kf);
21  tmvaReaderEle_.AddVariable("EtotPinMode",&EtotPinMode);
22  tmvaReaderEle_.AddVariable("EGsfPoutMode",&EGsfPoutMode);
23  tmvaReaderEle_.AddVariable("EtotBremPinPoutMode",&EtotBremPinPoutMode);
24  tmvaReaderEle_.AddVariable("DEtaGsfEcalClust",&DEtaGsfEcalClust);
25  tmvaReaderEle_.AddVariable("SigmaEtaEta",&SigmaEtaEta);
26  tmvaReaderEle_.AddVariable("HOverHE",&HOverHE);
27  // tmvaReaderEle_.AddVariable("HOverPin",&HOverPin);
28  tmvaReaderEle_.AddVariable("lateBrem",&lateBrem);
29  tmvaReaderEle_.AddVariable("firstBrem",&firstBrem);
30  std::unique_ptr<TMVA::IMethod> temp( tmvaReaderEle_.BookMVA("BDT", wfile.fullPath().c_str()) );
31  gbrEle_.reset( new GBRForest( dynamic_cast<TMVA::MethodBDT*>( tmvaReaderEle_.FindMVA("BDT") ) ) );
32  }
33  {
34  const edm::FileInPath& wfile = conf.getParameter<edm::FileInPath>("pf_convID_mvaWeightFile");
35  //Book MVA (single leg)
36  TMVA::Reader tmvaReader_("!Color:Silent");
37  tmvaReader_.AddVariable("del_phi",&del_phi);
38  tmvaReader_.AddVariable("nlayers", &nlayers);
39  tmvaReader_.AddVariable("chi2",&chi2);
40  tmvaReader_.AddVariable("EoverPt",&EoverPt);
41  tmvaReader_.AddVariable("HoverPt",&HoverPt);
42  tmvaReader_.AddVariable("track_pt", &track_pt);
43  tmvaReader_.AddVariable("STIP",&STIP);
44  tmvaReader_.AddVariable("nlost", &nlost);
45  std::unique_ptr<TMVA::IMethod> temp( tmvaReader_.BookMVA("BDT", wfile.fullPath().c_str()) );
46  gbrSingleLeg_.reset( new GBRForest( dynamic_cast<TMVA::MethodBDT*>( tmvaReader_.FindMVA("BDT") ) ) );
47  }
48  }
49 }
T getParameter(std::string const &) const
std::unique_ptr< const GBRForest > gbrEle_
std::unique_ptr< const GBRForest > gbrSingleLeg_
HeavyObjectCache(const edm::ParameterSet &)
std::string fullPath() const
Definition: FileInPath.cc:184