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

◆ MVAType

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

◆ EGammaMvaEleEstimatorFWLite()

heppy::EGammaMvaEleEstimatorFWLite::EGammaMvaEleEstimatorFWLite ( )

Definition at line 9 of file EGammaMvaEleEstimatorFWLite.cc.

9 : estimator_(nullptr), estimatorCSA14_(nullptr) {}

◆ ~EGammaMvaEleEstimatorFWLite()

heppy::EGammaMvaEleEstimatorFWLite::~EGammaMvaEleEstimatorFWLite ( )

Definition at line 11 of file EGammaMvaEleEstimatorFWLite.cc.

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

References estimator_, and estimatorCSA14_.

Member Function Documentation

◆ initialize()

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

Definition at line 16 of file EGammaMvaEleEstimatorFWLite.cc.

19  {
20  delete estimator_;
21  estimator_ = nullptr;
22  delete estimatorCSA14_;
23  estimatorCSA14_ = nullptr;
24  std::vector<std::string> weightspaths;
25  weightspaths.reserve(weightsfiles.size());
26  for (const std::string& s : weightsfiles) {
27  weightspaths.push_back(edm::FileInPath(s).fullPath());
28  }
29  switch (type) {
32  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrig, useBinnedVersion, weightspaths);
33  break;
36  estimator_->initialize(methodName, EGammaMvaEleEstimator::kTrigNoIP, useBinnedVersion, weightspaths);
37  break;
40  estimator_->initialize(methodName, EGammaMvaEleEstimator::kNonTrig, useBinnedVersion, weightspaths);
41  break;
44  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kTrig, useBinnedVersion, weightspaths);
45  break;
48  estimatorCSA14_->initialize(methodName, EGammaMvaEleEstimatorCSA14::kNonTrig, useBinnedVersion, weightspaths);
49  break;
53  methodName, EGammaMvaEleEstimatorCSA14::kNonTrigPhys14, useBinnedVersion, weightspaths);
54  break;
55  default:
56  return;
57  }
58  }

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.

◆ mvaValue()

float heppy::EGammaMvaEleEstimatorFWLite::mvaValue ( const pat::Electron ele,
const reco::Vertex vertex,
double  rho,
bool  full5x5,
bool  printDebug = false 
)

Definition at line 60 of file EGammaMvaEleEstimatorFWLite.cc.

61  {
62  if (estimator_)
63  return estimator_->mvaValue(ele, vertex, rho, full5x5, printDebug);
64  else if (estimatorCSA14_)
65  return estimatorCSA14_->mvaValue(ele, printDebug);
66  else
67  throw cms::Exception("LogicError", "You must call unitialize before mvaValue\n");
68  }

References estimator_, estimatorCSA14_, Exception, EGammaMvaEleEstimatorCSA14::mvaValue(), EGammaMvaEleEstimator::mvaValue(), HLT_FULL_cff::printDebug, and bphysicsOniaDQM_cfi::vertex.

Member Data Documentation

◆ estimator_

EGammaMvaEleEstimator* heppy::EGammaMvaEleEstimatorFWLite::estimator_
private

◆ estimatorCSA14_

EGammaMvaEleEstimatorCSA14* heppy::EGammaMvaEleEstimatorFWLite::estimatorCSA14_
private
EGammaMvaEleEstimator
Definition: EGammaMvaEleEstimator.h:38
HLT_FULL_cff.printDebug
printDebug
Definition: HLT_FULL_cff.py:35519
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
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
edm::FileInPath
Definition: FileInPath.h:64
alignCSCRings.s
s
Definition: alignCSCRings.py:92
heppy::EGammaMvaEleEstimatorFWLite::kNonTrigPhys14
Definition: EGammaMvaEleEstimatorFWLite.h:28
heppy::EGammaMvaEleEstimatorFWLite::kNonTrigCSA14
Definition: EGammaMvaEleEstimatorFWLite.h:27
EGammaMvaEleEstimatorCSA14
Definition: EGammaMvaEleEstimatorCSA14.h:38
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
EGammaMvaEleEstimator::kNonTrig
Definition: EGammaMvaEleEstimator.h:46
EGammaMvaEleEstimator::mvaValue
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools const &myEcalCluster, bool printDebug=kFALSE)
Definition: EGammaMvaEleEstimator.cc:954
heppy::EGammaMvaEleEstimatorFWLite::kTrigCSA14
Definition: EGammaMvaEleEstimatorFWLite.h:26
EGammaMvaEleEstimatorCSA14::kNonTrig
Definition: EGammaMvaEleEstimatorCSA14.h:45
Exception
Definition: hltDiff.cc:245
heppy::EGammaMvaEleEstimatorFWLite::kTrigNoIP
Definition: EGammaMvaEleEstimatorFWLite.h:24
heppy::EGammaMvaEleEstimatorFWLite::estimatorCSA14_
EGammaMvaEleEstimatorCSA14 * estimatorCSA14_
Definition: EGammaMvaEleEstimatorFWLite.h:38
EGammaMvaEleEstimatorCSA14::kTrig
Definition: EGammaMvaEleEstimatorCSA14.h:44