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
15  ~ElectronMVAEstimatorRun2() override;
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) const override;
25 
26  // Utility functions
27  int getNCategories() const override { return nCategories_; }
28  const std::string& getName() const final { return name_; }
29  const std::string& getTag() const final { return tag_; }
30 
31  int findCategory( const edm::Ptr<reco::Candidate>& candPtr) const override;
32 
33  // Call this function once after the constructor to declare
34  // the needed event content pieces to the framework
35  void setConsumes(edm::ConsumesCollector&&) const final;
36 
37  private:
38 
39  // MVA name. This is a unique name for this MVA implementation.
40  // It will be used as part of ValueMap names.
41  // For simplicity, keep it set to the class name.
43 
44  // MVA tag. This is an additional string variable to distinguish
45  // instances of the estimator of this class configured with different
46  // weight files.
48 
49  // The number of categories and number of variables per category
51  std::vector<StringCutObjectSelector<reco::GsfElectron>> categoryFunctions_;
52  std::vector<int> nVariables_;
53 
54  // Data members
55  std::vector< std::unique_ptr<const GBRForest> > gbrForests_;
56 
58 
59 
60  // There might be different variables for each category, so the variables
61  // names vector is itself a vector of length nCategories
62  std::vector<std::vector<int>> variables_;
63 
65 
66  bool debug_;
67 
68 };
69 
70 #endif
int findCategory(const edm::Ptr< reco::Candidate > &candPtr) const override
const std::string & getTag() const final
int getNCategories() const override
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
void setConsumes(edm::ConsumesCollector &&) const final
int iEvent
Definition: GenABIO.cc:230
std::vector< StringCutObjectSelector< reco::GsfElectron > > categoryFunctions_
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
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
const std::string & getName() const final
float mvaValue(const edm::Ptr< reco::Candidate > &candPtr, const edm::EventBase &iEvent) const override