23 float mvaValue(
const reco::Candidate* candPtr, std::vector<float>
const& auxVars,
int& iCategory)
const override;
59 if (
getTag() ==
"Run2Spring16NonTrigV1") {
67 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string>>(
"categoryCuts");
71 <<
"wrong number of category cuts in PhotonMVAEstimator" <<
getTag() << std::endl;
73 for (
auto const&
cut : categoryCutStrings)
79 <<
"wrong number of weightfiles in PhotonMVAEstimator" <<
getTag() << std::endl;
84 std::vector<int> variablesInCategory;
86 std::vector<std::string> variableNamesInCategory;
89 nVariables_.push_back(variableNamesInCategory.size());
97 <<
"Concerning PhotonMVAEstimator" <<
getTag() << std::endl
98 <<
"Variable " << variableNamesInCategory[
j] <<
" not found in variable definition file!" << std::endl;
106 std::vector<float>
const& auxVars,
107 int& iCategory)
const {
109 if (phoPtr ==
nullptr) {
111 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
112 <<
" but appears to be neither" << std::endl;
117 std::vector<float>
vars;
125 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
134 std::cout <<
" *** Inside PhotonMVAEstimator" <<
getTag() << std::endl;
135 std::cout <<
" category " << iCategory << std::endl;
141 const float response =
gbrForests_.at(iCategory)->GetResponse(
vars.data());
144 std::cout <<
" ### MVA " << response << std::endl << std::endl;
152 if (phoPtr ==
nullptr) {
154 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
155 <<
" but appears to be neither" << std::endl;
167 edm::LogWarning(
"MVA warning") <<
"category not defined for particle with pt " <<
photon.pt() <<
" GeV, eta " 168 <<
photon.superCluster()->eta() <<
" in PhotonMVAEstimator" <<
getTag();
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
T getParameter(std::string const &) const
double pt() const final
transverse momentum
int findCategory(const reco::Candidate *candPtr) const override
PhotonMVAEstimator(const edm::ParameterSet &conf)
MVAVariableManager< reco::Photon > mvaVarMngr_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string & getName(int index) const
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::vector< ThreadSafeFunctor< StringCutObjectSelector< reco::Photon > > > categoryFunctions_
Abs< T >::type abs(const T &t)
const std::string & getTag() const
int getNCategories() const
float getValue(int index, const ParticleType &particle, const std::vector< float > &auxVariables) const
std::vector< int > nVariables_
std::vector< double > phoIsoPtScalingCoeff_
int getVarIndex(const std::string &name)
float mvaValue(const reco::Candidate *candPtr, std::vector< float > const &auxVars, int &iCategory) const override
std::unique_ptr< EffectiveAreas > effectiveAreas_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::vector< int > > variables_
~PhotonMVAEstimator() override
Log< level::Warning, false > LogWarning