1 #ifndef __RecoEgamma_EgammaTools_MVAValueMapProducer_H__ 2 #define __RecoEgamma_EgammaTools_MVAValueMapProducer_H__ 20 template <
class ParticleType>
54 std::vector<std::unique_ptr<AnyMVAEstimatorRun2Base>> mvaEstimators;
58 for(
auto &imva : vConfig )
70 <<
" failed to find proper configuration for one of the MVAs in the main python script " << std::endl;
78 std::vector<std::string>
names;
79 for(
auto &imva : vConfig )
88 template <
class ParticleType>
91 ,
mvaEstimators_(getMVAEstimators(iConfig.getParameterSetVector(
"mvaConfigurations")))
92 ,
mvaValueMapNames_ (getValueMapNames(iConfig.getParameterSetVector(
"mvaConfigurations"),
"Values" ))
93 ,
mvaRawValueMapNames_ (getValueMapNames(iConfig.getParameterSetVector(
"mvaConfigurations"),
"RawValues" ))
94 ,
mvaCategoriesMapNames_(getValueMapNames(iConfig.getParameterSetVector(
"mvaConfigurations"),
"Categories"))
102 template <
class ParticleType>
109 for(
unsigned iEstimator = 0; iEstimator <
mvaEstimators_.size(); iEstimator++ ){
111 std::vector<float> mvaValues;
112 std::vector<float> mvaRawValues;
113 std::vector<int> mvaCategories;
116 for (
auto const&
cand : src->ptrs())
122 mvaRawValues.push_back( response );
123 mvaValues.push_back( 2.0/(1.0+
exp(-2.0*response))-1 );
124 mvaCategories.push_back( cat );
135 template <
class ParticleType>
const std::vector< std::string > mvaRawValueMapNames_
def create(alignables, pedeDump, additionalData, outputFile, config)
std::vector< ParameterSet > VParameterSet
const std::vector< std::unique_ptr< AnyMVAEstimatorRun2Base > > mvaEstimators_
const std::string names[nVars_]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addDefault(ParameterSetDescription const &psetDescription)
const MultiTokenT< edm::View< ParticleType > > src_
const std::vector< std::string > mvaCategoriesMapNames_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const std::vector< std::string > mvaValueMapNames_
edm::Handle< T > getValidHandle(const edm::Event &iEvent) const
~MVAValueMapProducer() override
MVAValueMapProducer(const edm::ParameterSet &)
const MVAVariableHelper< ParticleType > variableHelper_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
T get(const Candidate &c)