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 
10 
14 
16 public:
17  // Constructor and destructor
20  // For use with FWLite/Python
22  const std::string& mvaName,
23  int nCategories,
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
AnyMVAEstimatorRun2Base.h
mvaElectronID_Fall17_iso_V1_cff.mvaTag
mvaTag
Definition: mvaElectronID_Fall17_iso_V1_cff.py:16
mvaElectronID_Fall17_iso_V1_cff.variableDefinition
variableDefinition
Definition: mvaElectronID_Fall17_iso_V1_cff.py:90
AnyMVAEstimatorRun2Base
Definition: AnyMVAEstimatorRun2Base.h:11
GBRForestTools.h
ElectronMVAEstimatorRun2::nVariables_
std::vector< int > nVariables_
Definition: ElectronMVAEstimatorRun2.h:47
ElectronMVAEstimatorRun2::mvaValue
float mvaValue(const reco::Candidate *candidate, std::vector< float > const &auxVariables, int &iCategory) const override
Definition: ElectronMVAEstimatorRun2.cc:83
debug
#define debug
Definition: HDRShower.cc:19
MVAVariableManager.h
ElectronMVAEstimatorRun2::~ElectronMVAEstimatorRun2
~ElectronMVAEstimatorRun2() override
Definition: ElectronMVAEstimatorRun2.h:19
metsig::electron
Definition: SignAlgoResolutions.h:48
taus_updatedMVAIds_cff.mvaName
mvaName
Definition: taus_updatedMVAIds_cff.py:18
ElectronMVAEstimatorRun2::variables_
std::vector< std::vector< int > > variables_
Definition: ElectronMVAEstimatorRun2.h:54
reco::GsfElectron
Definition: GsfElectron.h:34
ElectronMVAEstimatorRun2::categoryFunctions_
std::vector< ThreadSafeFunctor< StringCutObjectSelector< reco::GsfElectron > > > categoryFunctions_
Definition: ElectronMVAEstimatorRun2.h:46
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
ElectronMVAEstimatorRun2::ElectronMVAEstimatorRun2
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
Definition: ElectronMVAEstimatorRun2.cc:5
edm::ParameterSet
Definition: ParameterSet.h:47
ElectronMVAEstimatorRun2::gbrForests_
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
Definition: ElectronMVAEstimatorRun2.h:50
ElectronMVAEstimatorRun2
Definition: ElectronMVAEstimatorRun2.h:15
ElectronMVAEstimatorRun2::findCategory
int findCategory(const reco::Candidate *candidate) const override
Definition: ElectronMVAEstimatorRun2.cc:122
ThreadSafeFunctor.h
ElectronMVAEstimatorRun2::init
void init(const std::vector< std::string > &weightFileNames)
Definition: ElectronMVAEstimatorRun2.cc:41
mvaElectronID_Fall17_iso_V1_cff.nCategories
nCategories
Definition: mvaElectronID_Fall17_iso_V1_cff.py:86
reco::Candidate
Definition: Candidate.h:27
ElectronMVAEstimatorRun2::mvaVarMngr_
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
Definition: ElectronMVAEstimatorRun2.h:56
ElectronMVAEstimatorRun2::mvaValue
float mvaValue(const reco::Candidate *candidate, float rho, int &iCategory) const
Definition: ElectronMVAEstimatorRun2.h:35
MVAVariableManager< reco::GsfElectron >
StringCutObjectSelector.h
mvaElectronID_Fall17_iso_V1_cff.weightFileNames
weightFileNames
Definition: mvaElectronID_Fall17_iso_V1_cff.py:89
Electron.h
ConversionTools.h
Conversion.h