CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 13 of file EGammaMvaEleEstimatorFWLite.h.

Member Enumeration Documentation

Enumerator
kTrig 
kTrigNoIP 
kNonTrig 
kTrigCSA14 
kNonTrigCSA14 
kNonTrigPhys14 

Definition at line 18 of file EGammaMvaEleEstimatorFWLite.h.

18  {
19  kTrig = 0, // MVA for triggering electrons
20  kTrigNoIP = 1, // MVA for triggering electrons without IP info
21  kNonTrig = 2, // MVA for non-triggering electrons
22  kTrigCSA14 = 3, // MVA for non-triggering electrons
23  kNonTrigCSA14 = 4, // MVA for non-triggering electrons
24  kNonTrigPhys14 = 5, // MVA for non-triggering electrons
25  };

Constructor & Destructor Documentation

heppy::EGammaMvaEleEstimatorFWLite::EGammaMvaEleEstimatorFWLite ( )

Definition at line 9 of file EGammaMvaEleEstimatorFWLite.cc.

9  :
10  estimator_(0),
12 {
13 }
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
heppy::EGammaMvaEleEstimatorFWLite::~EGammaMvaEleEstimatorFWLite ( )

Definition at line 15 of file EGammaMvaEleEstimatorFWLite.cc.

References estimator_, and estimatorCSA14_.

16 {
17  delete estimator_;
18  delete estimatorCSA14_;
19 }
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_

Member Function Documentation

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

Definition at line 21 of file EGammaMvaEleEstimatorFWLite.cc.

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

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 }
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 62 of file EGammaMvaEleEstimatorFWLite.cc.

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

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 }
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