CMS 3D CMS Logo

EGammaMvaEleEstimatorFWLite.cc
Go to the documentation of this file.
1 
6 
7 namespace heppy {
8 
9  EGammaMvaEleEstimatorFWLite::EGammaMvaEleEstimatorFWLite() : estimator_(nullptr), estimatorCSA14_(nullptr) {}
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
EGammaMvaEleEstimator
Definition: EGammaMvaEleEstimator.h:38
EGammaMvaEleEstimatorCSA14::mvaValue
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, noZS::EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
Definition: EGammaMvaEleEstimatorCSA14.cc:251
heppy::EGammaMvaEleEstimatorFWLite::estimator_
EGammaMvaEleEstimator * estimator_
Definition: EGammaMvaEleEstimatorFWLite.h:37
EGammaMvaEleEstimator::mvaValue
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
Definition: EGammaMvaEleEstimator.cc:954
heppy::EGammaMvaEleEstimatorFWLite::kTrig
Definition: EGammaMvaEleEstimatorFWLite.h:23
heppy::EGammaMvaEleEstimatorFWLite::kNonTrig
Definition: EGammaMvaEleEstimatorFWLite.h:25
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
EGammaMvaEleEstimatorCSA14::kNonTrigPhys14
Definition: EGammaMvaEleEstimatorCSA14.h:46
EGammaMvaEleEstimator::kTrig
Definition: EGammaMvaEleEstimator.h:44
EGammaMvaEleEstimator::kTrigNoIP
Definition: EGammaMvaEleEstimator.h:45
EGammaMvaEleEstimatorCSA14::initialize
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
Definition: EGammaMvaEleEstimatorCSA14.cc:25
EGammaMvaEleEstimator::initialize
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
Definition: EGammaMvaEleEstimator.cc:42
heppy::EGammaMvaEleEstimatorFWLite::mvaValue
float mvaValue(const pat::Electron &ele, const reco::Vertex &vertex, double rho, bool full5x5, bool printDebug=false)
Definition: EGammaMvaEleEstimatorFWLite.cc:59
heppy::EGammaMvaEleEstimatorFWLite::EGammaMvaEleEstimatorFWLite
EGammaMvaEleEstimatorFWLite()
Definition: EGammaMvaEleEstimatorFWLite.cc:9
FileInPath.h
edm::FileInPath
Definition: FileInPath.h:64
alignCSCRings.s
s
Definition: alignCSCRings.py:92
heppy::EGammaMvaEleEstimatorFWLite::MVAType
MVAType
Definition: EGammaMvaEleEstimatorFWLite.h:22
heppy::EGammaMvaEleEstimatorFWLite::kNonTrigPhys14
Definition: EGammaMvaEleEstimatorFWLite.h:28
EGammaMvaEleEstimator.h
heppy::EGammaMvaEleEstimatorFWLite::kNonTrigCSA14
Definition: EGammaMvaEleEstimatorFWLite.h:27
EGammaMvaEleEstimatorCSA14
Definition: EGammaMvaEleEstimatorCSA14.h:38
heppy
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
Definition: AlphaT.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
heppy::EGammaMvaEleEstimatorFWLite::initialize
void initialize(std::string methodName, MVAType type, bool useBinnedVersion, std::vector< std::string > weightsfiles)
Definition: EGammaMvaEleEstimatorFWLite.cc:16
EGammaMvaEleEstimatorFWLite.h
EGammaMvaEleEstimator::kNonTrig
Definition: EGammaMvaEleEstimator.h:46
heppy::EGammaMvaEleEstimatorFWLite::kTrigCSA14
Definition: EGammaMvaEleEstimatorFWLite.h:26
EGammaMvaEleEstimatorCSA14::kNonTrig
Definition: EGammaMvaEleEstimatorCSA14.h:45
type
type
Definition: HCALResponse.h:21
Exception
Definition: hltDiff.cc:246
heppy::EGammaMvaEleEstimatorFWLite::kTrigNoIP
Definition: EGammaMvaEleEstimatorFWLite.h:24
EGammaMvaEleEstimatorCSA14.h
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
HLT_2018_cff.printDebug
printDebug
Definition: HLT_2018_cff.py:34187
heppy::EGammaMvaEleEstimatorFWLite::~EGammaMvaEleEstimatorFWLite
~EGammaMvaEleEstimatorFWLite()
Definition: EGammaMvaEleEstimatorFWLite.cc:11
heppy::EGammaMvaEleEstimatorFWLite::estimatorCSA14_
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
Definition: EGammaMvaEleEstimatorFWLite.h:38
EGammaMvaEleEstimatorCSA14::kTrig
Definition: EGammaMvaEleEstimatorCSA14.h:44
reco::Vertex
Definition: Vertex.h:35