5 name_(conf.getParameter<
std::
string>(
"mvaName")),
6 tag_(conf.getParameter<
std::
string>(
"mvaTag")),
7 methodName_(
"BDTG method"),
8 mvaVarMngr_(conf.getParameter<
std::
string>(
"variableDefinition")),
9 ebeeSplit_ (conf.getParameter<double> (
"ebeeSplit")),
10 debug_(conf.getUntrackedParameter<
bool>(
"debug",
false))
15 if (
tag_ ==
"Run2Spring16NonTrigV1") {
22 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
27 <<
"wrong number of weightfiles in " <<
name_ <<
tag_ << std::endl;
33 std::vector<std::string> variableNamesInCategory;
34 std::vector<int> variablesInCategory;
41 nVariables_.push_back(variableNamesInCategory.size());
49 <<
"Concerning " <<
name_ <<
tag_ << std::endl
50 <<
"Variable " << variableNamesInCategory[j]
51 <<
" 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;
75 std::vector<float>
vars;
82 if (
tag_ ==
"Run2Spring16NonTrigV1" and iCategory ==
CAT_EE) {
92 std::cout <<
" category " << iCategory << std::endl;
93 for (
int i = 0;
i < nVariables_[iCategory]; ++
i) {
98 const float response =
gbrForests_.at(iCategory)->GetResponse(vars.data());
101 std::cout <<
" ### MVA " << response << std::endl << std::endl;
113 if( pho ==
nullptr) {
115 <<
" given particle is expected to be reco::Photon or pat::Photon," << std::endl
116 <<
" but appears to be neither" << std::endl;
119 float eta = pho->superCluster()->eta();
137 cc.consumes<
double>(
tag);
143 "PhotonMVAEstimator");
const std::string getName(int index) const
T getParameter(std::string const &) const
void setConsumes(edm::ConsumesCollector &&) const override
T const * get() const
Returns C++ pointer to the item.
PhotonMVAEstimator(const edm::ParameterSet &conf)
MVAVariableManager< reco::Photon > mvaVarMngr_
std::vector< edm::InputTag > getHelperInputTags() const
float mvaValue(const edm::Ptr< reco::Candidate > &candPtr, const edm::EventBase &) const override
int findCategory(const edm::Ptr< reco::Candidate > &candPtr) const override
Abs< T >::type abs(const T &t)
int getVarIndex(std::string &name)
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
std::vector< int > nVariables_
std::vector< double > phoIsoPtScalingCoeff_
float getValue(int index, const edm::Ptr< ParticleType > &ptclPtr, const edm::EventBase &iEvent) const
std::unique_ptr< EffectiveAreas > effectiveAreas_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::vector< int > > variables_
~PhotonMVAEstimator() override
std::vector< edm::InputTag > getGlobalInputTags() const