22 float mvaValue(
const reco::Candidate* candPtr, std::vector<float>
const& auxVars,
int& iCategory)
const override;
58 if (
getTag() ==
"Run2Spring16NonTrigV1") {
66 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string>>(
"categoryCuts");
70 <<
"wrong number of category cuts in PhotonMVAEstimator" <<
getTag() << std::endl;
72 for (
auto const&
cut : categoryCutStrings)
78 <<
"wrong number of weightfiles in PhotonMVAEstimator" <<
getTag() << std::endl;
83 std::vector<int> variablesInCategory;
85 std::vector<std::string> variableNamesInCategory;
88 nVariables_.push_back(variableNamesInCategory.size());
96 <<
"Concerning PhotonMVAEstimator" <<
getTag() << std::endl
97 <<
"Variable " << variableNamesInCategory[
j] <<
" not found in variable definition file!" << std::endl;
105 std::vector<float>
const& auxVars,
106 int& iCategory)
const {
107 const reco::Photon* phoPtr = dynamic_cast<const reco::Photon*>(candPtr);
108 if (phoPtr ==
nullptr) {
110 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
111 <<
" but appears to be neither" << std::endl;
116 std::vector<float>
vars;
124 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
133 std::cout <<
" *** Inside PhotonMVAEstimator" <<
getTag() << std::endl;
134 std::cout <<
" category " << iCategory << std::endl;
140 const float response =
gbrForests_.at(iCategory)->GetResponse(
vars.data());
143 std::cout <<
" ### MVA " << response << std::endl << std::endl;
150 const reco::Photon* phoPtr = dynamic_cast<const reco::Photon*>(candPtr);
151 if (phoPtr ==
nullptr) {
153 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
154 <<
" but appears to be neither" << std::endl;
166 edm::LogWarning(
"MVA warning") <<
"category not defined for particle with pt " <<
photon.pt() <<
" GeV, eta "
167 <<
photon.superCluster()->eta() <<
" in PhotonMVAEstimator" <<
getTag();