CMS 3D CMS Logo

AnyMVAEstimatorRun2Base.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaTools_AnyMVAEstimatorRun2Base_H
2 #define RecoEgamma_EgammaTools_AnyMVAEstimatorRun2Base_H
3 
5 
8 
10 
12 
13  public:
14  // Constructor, destructor
17 
18  // Functions that must be provided in derived classes
19  // These function should work on electrons or photons
20  // of the reco or pat type
21 
22  virtual float mvaValue( const edm::Ptr<reco::Candidate>& particle, const edm::EventBase&) const = 0;
23 
24  // A specific implementation of MVA is expected to have one or more categories
25  // defined with respect to eta, pt, etc.
26  // This function determines the category for a given particle.
27  virtual int findCategory( const edm::Ptr<reco::Candidate>& particle) const = 0;
28  virtual int getNCategories() const = 0;
29  // The name is a unique name associated with a particular MVA implementation,
30  // it is found as a const data member in a derived class.
31  virtual const std::string& getName() const = 0;
32  // An extra variable string set during construction that can be used
33  // to distinguish different instances of the estimator configured with
34  // different weight files. The tag can be used to construct names of ValueMaps, etc.
35  virtual const std::string& getTag() const = 0;
36 
37  //
38  // Extra event content - if needed.
39  //
40  // Some MVA implementation may require direct access to event content.
41  // Implement these methods only if needed in the derived classes (use "override"
42  // for certainty).
43 
44  // This method needs to be used only once after this MVA estimator is constructed
45  virtual void setConsumes(edm::ConsumesCollector &&cc) const {};
46 
47  private:
48 
49  //
50  // Data members
51  //
52  // Configuration
54 
55 };
56 
57 // define the factory for this base class
61 
62 #endif
AnyMVAEstimatorRun2Base(const edm::ParameterSet &conf)
virtual int findCategory(const edm::Ptr< reco::Candidate > &particle) const =0
virtual void setConsumes(edm::ConsumesCollector &&cc) const
virtual float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::EventBase &) const =0
const edm::ParameterSet conf_
virtual const std::string & getTag() const =0
virtual const std::string & getName() const =0
virtual int getNCategories() const =0
edmplugin::PluginFactory< AnyMVAEstimatorRun2Base *(const edm::ParameterSet &) > AnyMVAEstimatorRun2Factory