CMS 3D CMS Logo

ElectronMVAEstimatorRun2.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
2 #define RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
3 
8 
10 
11  public:
12 
13  // Constructor and destructor
16  // For use with FWLite/Python
18  const std::string &mvaName,
19  const bool debug = false);
20 
21  void init(const std::vector<std::string> &weightFileNames);
22 
23  // Calculation of the MVA value
24  float mvaValue( const edm::Ptr<reco::Candidate>& candPtr, const edm::EventBase& iEvent, int &iCategory) const override;
25 
26  // Call this function once after the constructor to declare
27  // the needed event content pieces to the framework
28  void setConsumes(edm::ConsumesCollector&&) final;
29 
30  int findCategory( const edm::Ptr<reco::Candidate>& candPtr) const override;
31 
32  private:
33 
34  int findCategory( const edm::Ptr<reco::GsfElectron>& gsfPtr) const;
35 
36  std::vector<StringCutObjectSelector<reco::GsfElectron>> categoryFunctions_;
37  std::vector<int> nVariables_;
38 
39  // Data members
40  std::vector< std::unique_ptr<const GBRForest> > gbrForests_;
41 
42 
43  // There might be different variables for each category, so the variables
44  // names vector is itself a vector of length nCategories
45  std::vector<std::vector<int>> variables_;
46 
48 
49 };
50 
51 #endif
int findCategory(const edm::Ptr< reco::Candidate > &candPtr) const override
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
int iEvent
Definition: GenABIO.cc:230
float mvaValue(const edm::Ptr< reco::Candidate > &candPtr, const edm::EventBase &iEvent, int &iCategory) const override
std::vector< StringCutObjectSelector< reco::GsfElectron > > categoryFunctions_
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
void setConsumes(edm::ConsumesCollector &&) final
void init(const std::vector< std::string > &weightFileNames)
std::vector< std::vector< int > > variables_
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
#define debug
Definition: HDRShower.cc:19