6 , mvaVarMngr_ (conf.getParameter<
std::
string>(
"variableDefinition"))
12 if (
getTag() ==
"Run2Spring16NonTrigV1") {
19 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
21 const std::vector <std::string> categoryCutStrings
22 = conf.
getParameter<std::vector<std::string> >(
"categoryCuts");
26 <<
"wrong number of category cuts in " <<
getName() <<
getTag() << std::endl;
36 <<
"wrong number of weightfiles in " <<
getName() <<
getTag() << std::endl;
42 std::vector<std::string> variableNamesInCategory;
43 std::vector<int> variablesInCategory;
47 nVariables_.push_back(variableNamesInCategory.size());
56 <<
"Variable " << variableNamesInCategory[j]
57 <<
" not found in variable definition file!" << std::endl;
69 if( phoPtr.get() ==
nullptr) {
71 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
72 <<
" but appears to be neither" << std::endl;
77 std::vector<float> vars;
84 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
94 std::cout <<
" category " << iCategory << std::endl;
95 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
100 const float response =
gbrForests_.at(iCategory)->GetResponse(vars.data());
103 std::cout <<
" ### MVA " << response << std::endl << std::endl;
112 if( phoPtr.get() ==
nullptr ) {
114 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
115 <<
" but appears to be neither" << std::endl;
129 "category not defined for particle with pt " << phoPtr->
pt() <<
" GeV, eta " <<
144 "PhotonMVAEstimator");
void setConsumes(edm::ConsumesCollector &&cc)
T getParameter(std::string const &) const
const std::string & getName(int index) const
PhotonMVAEstimator(const edm::ParameterSet &conf)
MVAVariableManager< reco::Photon > mvaVarMngr_
double pt() const final
transverse momentum
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
const std::string & getName() const
const std::string & getTag() const
int findCategory(const edm::Ptr< reco::Candidate > &candPtr) const override
Abs< T >::type abs(const T &t)
void setConsumes(edm::ConsumesCollector &&) override
std::vector< StringCutObjectSelector< reco::Photon > > categoryFunctions_
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
float mvaValue(const edm::Ptr< reco::Candidate > &candPtr, const edm::EventBase &iEvent, int &iCategory) const override
std::vector< int > nVariables_
std::vector< double > phoIsoPtScalingCoeff_
int getVarIndex(const std::string &name)
float getValue(int index, const edm::Ptr< ParticleType > &ptclPtr, const edm::EventBase &iEvent) const
std::unique_ptr< EffectiveAreas > effectiveAreas_
int getNCategories() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::vector< int > > variables_