20 float mvaValue(
const reco::Candidate* candPtr, std::vector<float>
const& auxVars,
int& iCategory)
const override;
55 if (
getTag() ==
"Run2Spring16NonTrigV1") {
63 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string>>(
"categoryCuts");
67 <<
"wrong number of category cuts in PhotonMVAEstimator" <<
getTag() << std::endl;
69 for (
auto const&
cut : categoryCutStrings)
75 <<
"wrong number of weightfiles in PhotonMVAEstimator" <<
getTag() << std::endl;
80 std::vector<int> variablesInCategory;
82 std::vector<std::string> variableNamesInCategory;
85 nVariables_.push_back(variableNamesInCategory.size());
93 <<
"Concerning PhotonMVAEstimator" <<
getTag() << std::endl
94 <<
"Variable " << variableNamesInCategory[
j] <<
" not found in variable definition file!" << std::endl;
102 std::vector<float>
const& auxVars,
103 int& iCategory)
const {
104 const reco::Photon* phoPtr = dynamic_cast<const reco::Photon*>(candPtr);
105 if (phoPtr ==
nullptr) {
107 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
108 <<
" but appears to be neither" << std::endl;
113 std::vector<float>
vars;
120 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
129 std::cout <<
" *** Inside PhotonMVAEstimator" <<
getTag() << std::endl;
130 std::cout <<
" category " << iCategory << std::endl;
136 const float response =
gbrForests_.at(iCategory)->GetResponse(
vars.data());
139 std::cout <<
" ### MVA " << response << std::endl << std::endl;
146 const reco::Photon* phoPtr = dynamic_cast<const reco::Photon*>(candPtr);
147 if (phoPtr ==
nullptr) {
149 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
150 <<
" but appears to be neither" << std::endl;
162 edm::LogWarning(
"MVA warning") <<
"category not defined for particle with pt " <<
photon.pt() <<
" GeV, eta "
163 <<
photon.superCluster()->eta() <<
" in PhotonMVAEstimator" <<
getTag();