5 mvaVarMngr_(conf.getParameter<
std::
string>(
"variableDefinition"))
9 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string> >(
"categoryCuts");
13 <<
"wrong number of category cuts in ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
27 const std::vector<std::string>& categoryCutStrings,
36 <<
"wrong number of category cuts in " <<
getName() <<
getTag() << std::endl;
39 init(weightFileNames);
45 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
51 <<
"wrong number of weightfiles in ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
57 std::vector<int> variablesInCategory;
62 std::vector<std::string> variableNamesInCategory;
65 nVariables_.push_back(variableNamesInCategory.size());
70 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
78 <<
"Concerning ElectronMVAEstimatorRun2" <<
getTag() << std::endl
79 <<
"Variable " << variableNamesInCategory[j]
80 <<
" not found in variable definition file!" << std::endl;
93 if( electron ==
nullptr ) {
95 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
96 <<
" but appears to be neither" << std::endl;
101 if (iCategory < 0)
return -999;
103 std::vector<float>
vars;
110 std::cout <<
" *** Inside ElectronMVAEstimatorRun2" <<
getTag() << std::endl;
111 std::cout <<
" category " << iCategory << std::endl;
112 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
116 const float response =
gbrForests_.at(iCategory)->GetResponse(vars.data());
119 std::cout <<
" ### MVA " << response << std::endl << std::endl;
129 if( electron ==
nullptr ) {
131 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
132 <<
" but appears to be neither" << std::endl;
146 "category not defined for particle with pt " << electron.
pt() <<
" GeV, eta " <<
T getParameter(std::string const &) const
const std::string & getName(int index) const
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
std::vector< int > nVariables_
double pt() const final
transverse momentum
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< ThreadSafeStringCut< StringCutObjectSelector< reco::GsfElectron >, reco::GsfElectron > > categoryFunctions_
float mvaValue(const reco::Candidate *candidate, std::vector< float > const &auxVariables, int &iCategory) const override
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
void init(const std::vector< std::string > &weightFileNames)
std::vector< std::vector< int > > variables_
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
int getVarIndex(const std::string &name)
int findCategory(const reco::Candidate *candidate) const override
SuperClusterRef superCluster() const override
reference to a SuperCluster
int getNCategories() const