7 , mvaVarMngr_ (conf.getParameter<
std::
string>(
"variableDefinition"))
13 if (
getTag() ==
"Run2Spring16NonTrigV1") {
20 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
22 const std::vector <std::string> categoryCutStrings
23 = conf.
getParameter<std::vector<std::string> >(
"categoryCuts");
27 <<
"wrong number of category cuts in " <<
getName() <<
getTag() << std::endl;
37 <<
"wrong number of weightfiles in " <<
getName() <<
getTag() << std::endl;
43 std::vector<int> variablesInCategory;
45 std::vector<std::string> variableNamesInCategory;
48 nVariables_.push_back(variableNamesInCategory.size());
57 <<
"Variable " << variableNamesInCategory[j]
58 <<
" not found in variable definition file!" << std::endl;
70 if( phoPtr.get() ==
nullptr) {
72 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
73 <<
" but appears to be neither" << std::endl;
78 std::vector<float> vars;
85 if (
getTag() ==
"Run2Spring16NonTrigV1" and iCategory == 1) {
95 std::cout <<
" category " << iCategory << std::endl;
96 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
101 const float response =
gbrForests_.at(iCategory)->GetResponse(vars.data());
104 std::cout <<
" ### MVA " << response << std::endl << std::endl;
113 if( phoPtr.get() ==
nullptr ) {
115 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
116 <<
" but appears to be neither" << std::endl;
130 "category not defined for particle with pt " << phoPtr->
pt() <<
" GeV, eta " <<
145 "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_