8 const auto weightFileNames = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
9 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string> >(
"categoryCuts");
13 <<
"wrong number of category cuts in ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
20 init(weightFileNames);
27 const std::vector<std::string>& categoryCutStrings,
28 const std::vector<std::string>& weightFileNames,
34 <<
"wrong number of category cuts in " <<
getName() <<
getTag() << std::endl;
36 for (
auto const&
cut : categoryCutStrings)
38 init(weightFileNames);
43 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
49 <<
"wrong number of weightfiles in ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
54 std::vector<int> variablesInCategory;
59 std::vector<std::string> variableNamesInCategory;
62 nVariables_.push_back(variableNamesInCategory.size());
67 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
75 <<
"Concerning ElectronMVAEstimatorRun2" <<
getTag() << std::endl
76 <<
"Variable " << variableNamesInCategory[
j] <<
" not found in variable definition file!" << std::endl;
84 const std::vector<float>& auxVariables,
85 int& iCategory)
const {
88 if (electron ==
nullptr) {
90 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
91 <<
" but appears to be neither" << std::endl;
99 std::vector<float>
vars;
107 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
108 std::cout <<
" category " << iCategory << std::endl;
109 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
116 std::cout <<
" ### MVA " << response << std::endl << std::endl;
125 if (electron ==
nullptr) {
127 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
128 <<
" but appears to be neither" << std::endl;
140 edm::LogWarning(
"MVA warning") <<
"category not defined for particle with pt " << electron.
pt() <<
" GeV, eta "
const std::string & getName(int index) const
double pt() const final
transverse momentum
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
std::vector< int > nVariables_
float getValue(int index, const ParticleType &particle, const std::vector< float > &auxVariables) const
const std::string & getName() const
const std::string & getTag() const
std::vector< ThreadSafeFunctor< StringCutObjectSelector< reco::GsfElectron > > > categoryFunctions_
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
void init(const std::vector< std::string > &weightFileNames)
std::vector< std::vector< int > > variables_
int getVarIndex(const std::string &name)
T getParameter(std::string const &) const
float mvaValue(const reco::Candidate *candidate, std::vector< float > const &auxVariables, int &iCategory) const override
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
int getNCategories() const
int findCategory(const reco::Candidate *candidate) const override
Log< level::Warning, false > LogWarning
SuperClusterRef superCluster() const override
reference to a SuperCluster