CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ElectronMVAEstimatorRun2.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
2 #define RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
3 
10 
14 
16 public:
17  // Constructor and destructor
20  // For use with FWLite/Python
22  const std::string& mvaName,
23  int nCategories,
24  const std::string& variableDefinition,
25  const std::vector<std::string>& categoryCutStrings,
26  const std::vector<std::string>& weightFileNames,
27  bool debug = false);
28 
29  // Calculation of the MVA value
30  float mvaValue(const reco::Candidate* candidate,
31  std::vector<float> const& auxVariables,
32  int& iCategory) const override;
33 
34  // for FWLite just passing rho
35  float mvaValue(const reco::Candidate* candidate, float rho, int& iCategory) const {
36  return mvaValue(candidate, std::vector<float>{rho}, iCategory);
37  }
38 
39  int findCategory(const reco::Candidate* candidate) const override;
40 
41 private:
42  void init(const std::vector<std::string>& weightFileNames);
43 
44  int findCategory(reco::GsfElectron const& electron) const;
45 
46  std::vector<ThreadSafeFunctor<StringCutObjectSelector<reco::GsfElectron>>> categoryFunctions_;
47  std::vector<int> nVariables_;
48 
49  // Data members
50  std::vector<std::unique_ptr<const GBRForest>> gbrForests_;
51 
52  // There might be different variables for each category, so the variables
53  // names vector is itself a vector of length nCategories
54  std::vector<std::vector<int>> variables_;
55 
57 };
58 
59 #endif
float mvaValue(const reco::Candidate *candidate, float rho, int &iCategory) const
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
std::vector< ThreadSafeFunctor< StringCutObjectSelector< reco::GsfElectron > > > categoryFunctions_
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
void init(const std::vector< std::string > &weightFileNames)
std::vector< std::vector< int > > variables_
#define debug
Definition: HDRShower.cc:19
float mvaValue(const reco::Candidate *candidate, std::vector< float > const &auxVariables, int &iCategory) const override
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
int findCategory(const reco::Candidate *candidate) const override