CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EGammaMvaEleEstimatorFWLite.cc
Go to the documentation of this file.
1 
6 
7 namespace heppy {
8 
10  estimator_(0),
11  estimatorCSA14_(0)
12 {
13 }
14 
16 {
17  delete estimator_;
18  delete estimatorCSA14_;
19 }
20 
22  MVAType type,
23  bool useBinnedVersion,
24  std::vector<std::string> weightsfiles )
25 {
26  delete estimator_; estimator_ = 0;
27  delete estimatorCSA14_; estimatorCSA14_ = 0;
28  std::vector<std::string> weightspaths;
29  for (const std::string &s : weightsfiles) {
30  weightspaths.push_back( edm::FileInPath(s).fullPath() );
31  }
32  switch(type) {
35  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrig, useBinnedVersion, weightspaths);
36  break;
39  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrigNoIP, useBinnedVersion, weightspaths);
40  break;
43  estimator_->initialize(methodName, EGammaMvaEleEstimator::kNonTrig, useBinnedVersion, weightspaths);
44  break;
47  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kTrig, useBinnedVersion, weightspaths);
48  break;
51  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kNonTrig, useBinnedVersion, weightspaths);
52  break;
55  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kNonTrigPhys14, useBinnedVersion, weightspaths);
56  break;
57  default:
58  return;
59  }
60 }
61 
63  const reco::Vertex& vertex,
64  double rho,
65  bool full5x5,
66  bool printDebug)
67 {
68  if (estimator_) return estimator_->mvaValue(ele,vertex,rho,full5x5,printDebug);
69  else if (estimatorCSA14_) return estimatorCSA14_->mvaValue(ele,printDebug);
70  else throw cms::Exception("LogicError", "You must call unitialize before mvaValue\n");
71 }
72 
73 }
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
type
Definition: HCALResponse.h:21
Double_t mvaValue(Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t d0, Double_t ip3d, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
Definition: DDAxes.h:10
float mvaValue(const pat::Electron &ele, const reco::Vertex &vertex, double rho, bool full5x5, bool printDebug=false)
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, noZS::EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
void initialize(std::string methodName, MVAType type, bool useBinnedVersion, std::vector< std::string > weightsfiles)
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
Analysis-level electron class.
Definition: Electron.h:52