CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
heppy::EGammaMvaEleEstimatorFWLite Class Reference

#include <EGammaMvaEleEstimatorFWLite.h>

Public Types

enum  MVAType {
  kTrig = 0, kTrigNoIP = 1, kNonTrig = 2, kTrigCSA14 = 3,
  kNonTrigCSA14 = 4, kNonTrigPhys14 = 5
}
 

Public Member Functions

 EGammaMvaEleEstimatorFWLite ()
 
void initialize (std::string methodName, MVAType type, bool useBinnedVersion, std::vector< std::string > weightsfiles)
 
float mvaValue (const pat::Electron &ele, const reco::Vertex &vertex, double rho, bool full5x5, bool printDebug=false)
 
 ~EGammaMvaEleEstimatorFWLite ()
 

Private Attributes

EGammaMvaEleEstimatorestimator_
 
EGammaMvaEleEstimatorCSA14estimatorCSA14_
 

Detailed Description

Definition at line 17 of file EGammaMvaEleEstimatorFWLite.h.

Member Enumeration Documentation

Enumerator
kTrig 
kTrigNoIP 
kNonTrig 
kTrigCSA14 
kNonTrigCSA14 
kNonTrigPhys14 

Definition at line 22 of file EGammaMvaEleEstimatorFWLite.h.

22  {
23  kTrig = 0, // MVA for triggering electrons
24  kTrigNoIP = 1, // MVA for triggering electrons without IP info
25  kNonTrig = 2, // MVA for non-triggering electrons
26  kTrigCSA14 = 3, // MVA for non-triggering electrons
27  kNonTrigCSA14 = 4, // MVA for non-triggering electrons
28  kNonTrigPhys14 = 5, // MVA for non-triggering electrons
29  };

Constructor & Destructor Documentation

heppy::EGammaMvaEleEstimatorFWLite::EGammaMvaEleEstimatorFWLite ( )

Definition at line 9 of file EGammaMvaEleEstimatorFWLite.cc.

9 : estimator_(nullptr), estimatorCSA14_(nullptr) {}
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
heppy::EGammaMvaEleEstimatorFWLite::~EGammaMvaEleEstimatorFWLite ( )

Definition at line 11 of file EGammaMvaEleEstimatorFWLite.cc.

References estimator_, and estimatorCSA14_.

11  {
12  delete estimator_;
13  delete estimatorCSA14_;
14  }
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_

Member Function Documentation

void heppy::EGammaMvaEleEstimatorFWLite::initialize ( std::string  methodName,
MVAType  type,
bool  useBinnedVersion,
std::vector< std::string >  weightsfiles 
)

Definition at line 16 of file EGammaMvaEleEstimatorFWLite.cc.

References estimator_, estimatorCSA14_, contentValuesFiles::fullPath, EGammaMvaEleEstimatorCSA14::initialize(), EGammaMvaEleEstimator::initialize(), kNonTrig, EGammaMvaEleEstimatorCSA14::kNonTrig, EGammaMvaEleEstimator::kNonTrig, kNonTrigCSA14, kNonTrigPhys14, EGammaMvaEleEstimatorCSA14::kNonTrigPhys14, kTrig, EGammaMvaEleEstimatorCSA14::kTrig, EGammaMvaEleEstimator::kTrig, kTrigCSA14, kTrigNoIP, EGammaMvaEleEstimator::kTrigNoIP, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
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  }
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
type
Definition: HCALResponse.h:21
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
float heppy::EGammaMvaEleEstimatorFWLite::mvaValue ( const pat::Electron ele,
const reco::Vertex vertex,
double  rho,
bool  full5x5,
bool  printDebug = false 
)

Definition at line 59 of file EGammaMvaEleEstimatorFWLite.cc.

References estimator_, estimatorCSA14_, Exception, EGammaMvaEleEstimatorCSA14::mvaValue(), and EGammaMvaEleEstimator::mvaValue().

60  {
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  }
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, noZS::EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)

Member Data Documentation

EGammaMvaEleEstimator* heppy::EGammaMvaEleEstimatorFWLite::estimator_
private
EGammaMvaEleEstimatorCSA14* heppy::EGammaMvaEleEstimatorFWLite::estimatorCSA14_
private