CMS 3D CMS Logo

PhotonMVAEstimator.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_PhotonIdentification_PhotonMVAEstimator_H
2 #define RecoEgamma_PhotonIdentification_PhotonMVAEstimator_H
3 
5 
7 
9 
11 
13 
16 
18 
19 #include <vector>
20 #include <string>
21 
23 
24  public:
25 
26  // Define here the number and the meaning of the categories
27  // for this specific MVA
28  const int nCategories_ = 2;
30  CAT_EB = 0,
31  CAT_EE = 1
32  };
33 
34  // Constructor and destructor
36  ~PhotonMVAEstimator() override;
37 
38  // Calculation of the MVA value
39  float mvaValue( const edm::Ptr<reco::Candidate>& candPtr, const edm::EventBase&) const override;
40 
41  // Utility functions
42  std::unique_ptr<const GBRForest> createSingleReader(const int iCategory, const edm::FileInPath &weightFile);
43 
44  int getNCategories() const override { return nCategories_; }
45  const std::string& getName() const final { return name_; }
46  const std::string& getTag() const final { return tag_; }
47 
48  int findCategory( const edm::Ptr<reco::Candidate>& candPtr ) const override;
49 
50  // Call this function once after the constructor to declare
51  // the needed event content pieces to the framework
52  void setConsumes(edm::ConsumesCollector&&) const override;
53 
54  private:
55 
56  // MVA name. This is a unique name for this MVA implementation.
57  // It will be used as part of ValueMap names.
58  // For simplicity, keep it set to the class name.
60 
61  // MVA tag. This is an additional string variable to distinguish
62  // instances of the estimator of this class configured with different
63  // weight files.
65 
66  std::vector<int> nVariables_;
67 
68  // Data members
69  std::vector< std::unique_ptr<const GBRForest> > gbrForests_;
70 
71  // All variables needed by this MVA
73 
74  // There might be different variables for each category, so the variables
75  // names vector is itself a vector of length nCategories
76  std::vector<std::vector<int>> variables_;
77 
78  // The variable manager which stores how to obtain the variables
80 
81  const double ebeeSplit_;
82 
83  const bool debug_;
84 
85  // Other objects needed by the MVA
86  std::unique_ptr<EffectiveAreas> effectiveAreas_;
87  std::vector<double> phoIsoPtScalingCoeff_;
88  double phoIsoCutoff_;
89 
90 };
91 
92 #endif
void setConsumes(edm::ConsumesCollector &&) const override
PhotonMVAEstimator(const edm::ParameterSet &conf)
const std::string methodName_
MVAVariableManager< reco::Photon > mvaVarMngr_
const std::string tag_
float mvaValue(const edm::Ptr< reco::Candidate > &candPtr, const edm::EventBase &) const override
int findCategory(const edm::Ptr< reco::Candidate > &candPtr) const override
const std::string & getName() const final
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
const std::string & getTag() const final
std::vector< int > nVariables_
std::vector< double > phoIsoPtScalingCoeff_
const std::string name_
int getNCategories() const override
std::unique_ptr< EffectiveAreas > effectiveAreas_
std::vector< std::vector< int > > variables_
~PhotonMVAEstimator() override
std::unique_ptr< const GBRForest > createSingleReader(const int iCategory, const edm::FileInPath &weightFile)