CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MvaSoftEleEstimator Class Reference

#include <MvaSoftElectronEstimator.h>

Public Member Functions

 MvaSoftEleEstimator (std::string)
 
Double_t mvaValue (Float_t, Float_t, Float_t, Float_t, Float_t, Float_t)
 
 ~MvaSoftEleEstimator ()
 

Private Attributes

float mva_deltaR
 
float mva_e_pi
 
float mva_ptRel
 
float mva_ratio
 
float mva_sip2d
 
float mva_sip3d
 
TMVA::Reader * TMVAReader
 

Detailed Description

–> NOTE if you want to use this class as standalone without the CMSSW part you need to uncomment the below line and compile normally with scramv1 b Then you need just to load it in your root macro the lib with the correct path, eg: gSystem->Load("/data/benedet/CMSSW_5_2_2/lib/slc5_amd64_gcc462/pluginEGammaEGammaAnalysisTools.so");

Definition at line 36 of file MvaSoftElectronEstimator.h.

Constructor & Destructor Documentation

MvaSoftEleEstimator::MvaSoftEleEstimator ( std::string  weightFile)

Definition at line 26 of file MvaSoftElectronEstimator.cc.

References reco::details::loadTMVAWeights().

27 {
28  TMVAReader = new TMVA::Reader("Color:Silent:Error");
29  TMVAReader->SetVerbose(false);
30  TMVAReader->AddVariable("sip3d", &mva_sip3d);
31  TMVAReader->AddVariable("sip2d", &mva_sip2d);
32  TMVAReader->AddVariable("ptRel", &mva_ptRel);
33  TMVAReader->AddVariable("deltaR", &mva_deltaR);
34  TMVAReader->AddVariable("ratio", &mva_ratio);
35  TMVAReader->AddVariable("mva_e_pi", &mva_e_pi);
36  reco::details::loadTMVAWeights(TMVAReader, "BDT", weightFile.c_str());
37 
38 }
void loadTMVAWeights(TMVA::Reader *reader, const std::string &method, const std::string &weightFile, bool verbose=false)
MvaSoftEleEstimator::~MvaSoftEleEstimator ( )

Definition at line 40 of file MvaSoftElectronEstimator.cc.

41 {
42  delete TMVAReader;
43 }

Member Function Documentation

Double_t MvaSoftEleEstimator::mvaValue ( Float_t  ,
Float_t  ,
Float_t  ,
Float_t  ,
Float_t  ,
Float_t   
)

Definition at line 47 of file MvaSoftElectronEstimator.cc.

References deltaR(), and GlobalPosition_Frontier_DevDB_cff::tag.

47  {
48 
49  mva_sip3d = sip3d;
50  mva_sip2d = sip2d;
51  mva_ptRel = ptRel;
53  mva_ratio = ratio;
55 
56  float tag = TMVAReader->EvaluateMVA("BDT");
57  // Transform output between 0 and 1
58  tag = (tag+1.0)/2.0;
59 
60  return tag;
61 }
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17

Member Data Documentation

float MvaSoftEleEstimator::mva_deltaR
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

float MvaSoftEleEstimator::mva_e_pi
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

float MvaSoftEleEstimator::mva_ptRel
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

float MvaSoftEleEstimator::mva_ratio
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

float MvaSoftEleEstimator::mva_sip2d
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

float MvaSoftEleEstimator::mva_sip3d
private

Definition at line 45 of file MvaSoftElectronEstimator.h.

TMVA::Reader* MvaSoftEleEstimator::TMVAReader
private

Definition at line 44 of file MvaSoftElectronEstimator.h.