13 const std::vector <std::string> weightFileNames
14 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
18 <<
"wrong number of weightfiles" << std::endl;
74 std::cout <<
" ### MVA " << result << std::endl;
87 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
88 <<
" but appears to be neither" << std::endl;
90 float pt = eleRecoPtr->pt();
91 float eta = eleRecoPtr->superCluster()->eta();
97 const float ptSplit = 10;
98 const float ebSplit = 0.800;
99 const float ebeeSplit = 1.479;
101 if (pt < ptSplit &&
std::abs(eta) < ebSplit)
107 if (pt < ptSplit &&
std::abs(eta) >= ebeeSplit)
110 if (pt >= ptSplit &&
std::abs(eta) < ebSplit)
116 if (pt >= ptSplit &&
std::abs(eta) >= ebeeSplit)
139 TMVA::Reader *tmpTMVAReader =
new TMVA::Reader(
"!Color:Silent:Error" );
149 tmpTMVAReader->AddVariable(
"ele_oldsigmaietaieta", &
_allMVAVars.
see);
150 tmpTMVAReader->AddVariable(
"ele_oldsigmaiphiiphi", &
_allMVAVars.
spp);
186 return tmpTMVAReader;
197 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
198 <<
" but appears to be neither" << std::endl;
202 auto superCluster = eleRecoPtr->superCluster();
213 myTrackRef = elePatPtr->closestCtfTrackRef();
216 _allMVAVars.
kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
241 float scEta = superCluster->eta();
T getParameter(std::string const &) const
std::vector< std::unique_ptr< TMVA::Reader > > _tmvaReaders
bool isNonnull() const
Checks for non-null.
T const * get() const
Returns C++ pointer to the item.
void constrainMVAVariables()
ElectronMVAEstimatorRun2Phys14NonTrig(const edm::ParameterSet &conf)
Abs< T >::type abs(const T &t)
bool isEndcapCategory(int category)
~ElectronMVAEstimatorRun2Phys14NonTrig()
bool isEndcap(GeomDetEnumerators::SubDetector m)
TMVA::Reader * createSingleReader(const int iCategory, const edm::FileInPath &weightFile)
int findCategory(const edm::Ptr< reco::Candidate > &particle)
float mvaValue(const edm::Ptr< reco::Candidate > &particle)
void fillMVAVariables(const edm::Ptr< reco::Candidate > &particle)
std::string fullPath() const