CMS 3D CMS Logo

EGammaMvaEleEstimatorFWLite.cc
Go to the documentation of this file.
1 
6 
7 namespace heppy {
8 
10 
12  delete estimator_;
13  delete estimatorCSA14_;
14  }
15 
17  MVAType type,
18  bool useBinnedVersion,
19  std::vector<std::string> weightsfiles) {
20  delete estimator_;
21  estimator_ = nullptr;
22  delete estimatorCSA14_;
23  estimatorCSA14_ = nullptr;
24  std::vector<std::string> weightspaths;
25  for (const std::string& s : weightsfiles) {
26  weightspaths.push_back(edm::FileInPath(s).fullPath());
27  }
28  switch (type) {
31  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrig, useBinnedVersion, weightspaths);
32  break;
35  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrigNoIP, useBinnedVersion, weightspaths);
36  break;
39  estimator_->initialize(methodName, EGammaMvaEleEstimator::kNonTrig, useBinnedVersion, weightspaths);
40  break;
43  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kTrig, useBinnedVersion, weightspaths);
44  break;
47  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kNonTrig, useBinnedVersion, weightspaths);
48  break;
52  methodName, EGammaMvaEleEstimatorCSA14::kNonTrigPhys14, useBinnedVersion, weightspaths);
53  break;
54  default:
55  return;
56  }
57  }
58 
60  const pat::Electron& ele, const reco::Vertex& vertex, double rho, bool full5x5, bool printDebug) {
61  if (estimator_)
62  return estimator_->mvaValue(ele, vertex, rho, full5x5, printDebug);
63  else if (estimatorCSA14_)
64  return estimatorCSA14_->mvaValue(ele, printDebug);
65  else
66  throw cms::Exception("LogicError", "You must call unitialize before mvaValue\n");
67  }
68 
69 } // namespace heppy
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
type
Definition: HCALResponse.h:21
#define nullptr
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)
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
Definition: AlphaT.h:16
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
Analysis-level electron class.
Definition: Electron.h:51