7 , mvaVarMngr_ (conf.getParameter<
std::
string>(
"variableDefinition"))
13 if (
getTag() ==
"Run2Spring16NonTrigV1") {
20 const auto categoryCutStrings = conf.
getParameter<std::vector<std::string> >(
"categoryCuts");
24 <<
"wrong number of category cuts in PhotonMVAEstimator" <<
getTag() << std::endl;
31 <<
"wrong number of weightfiles in PhotonMVAEstimator" <<
getTag() << std::endl;
37 std::vector<int> variablesInCategory;
39 std::vector<std::string> variableNamesInCategory;
42 nVariables_.push_back(variableNamesInCategory.size());
50 <<
"Concerning PhotonMVAEstimator" <<
getTag() << std::endl
51 <<
"Variable " << variableNamesInCategory[j]
52 <<
" not found in variable definition file!" << std::endl;
64 if( phoPtr ==
nullptr) {
66 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
67 <<
" but appears to be neither" << std::endl;
72 std::vector<float>
vars;
79 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
89 std::cout <<
" category " << iCategory << std::endl;
90 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
95 const float response =
gbrForests_.at(iCategory)->GetResponse(vars.data());
98 std::cout <<
" ### MVA " << response << std::endl << std::endl;
107 if( phoPtr ==
nullptr ) {
109 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
110 <<
" but appears to be neither" << std::endl;
124 "category not defined for particle with pt " << photon.
pt() <<
" GeV, eta " <<
133 "PhotonMVAEstimator");
T getParameter(std::string const &) const
const std::string & getName(int index) const
float mvaValue(const reco::Candidate *candPtr, std::vector< float > const &auxVars, int &iCategory) const override
PhotonMVAEstimator(const edm::ParameterSet &conf)
MVAVariableManager< reco::Photon > mvaVarMngr_
double pt() const final
transverse momentum
float getValue(int index, const ParticleType &particle, const std::vector< float > &auxVariables) const
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
const std::string & getTag() const
Abs< T >::type abs(const T &t)
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
std::vector< int > nVariables_
std::vector< double > phoIsoPtScalingCoeff_
int getVarIndex(const std::string &name)
std::unique_ptr< EffectiveAreas > effectiveAreas_
int getNCategories() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::vector< int > > variables_
std::vector< ThreadSafeStringCut< StringCutObjectSelector< reco::Photon >, reco::Photon > > categoryFunctions_
int findCategory(const reco::Candidate *candPtr) const override