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
MvaSoftMuonEstimator Class Reference

#include <MvaSoftMuonEstimator.h>

Public Member Functions

 MvaSoftMuonEstimator (std::string)
 
float mvaValue (float, float, float, float, float)
 
 ~MvaSoftMuonEstimator ()
 

Private Attributes

float mva_deltaR
 
float mva_ptRel
 
float mva_ratio
 
float mva_sip2d
 
float mva_sip3d
 
TMVA::Reader * TMVAReader
 
std::string weightFile
 

Detailed Description

Definition at line 16 of file MvaSoftMuonEstimator.h.

Constructor & Destructor Documentation

MvaSoftMuonEstimator::MvaSoftMuonEstimator ( std::string  weightFile)

Definition at line 12 of file MvaSoftMuonEstimator.cc.

References reco::details::loadTMVAWeights(), mva_deltaR, mva_ptRel, mva_ratio, mva_sip2d, mva_sip3d, and TMVAReader.

12  {
13  TMVAReader = new TMVA::Reader("Color:Silent:Error");
14  TMVAReader->SetVerbose(false);
15  TMVAReader->AddVariable("TagInfo1.sip3d", &mva_sip3d);
16  TMVAReader->AddVariable("TagInfo1.sip2d", &mva_sip2d);
17  TMVAReader->AddVariable("TagInfo1.ptRel", &mva_ptRel);
18  TMVAReader->AddVariable("TagInfo1.deltaR", &mva_deltaR);
19  TMVAReader->AddVariable("TagInfo1.ratio", &mva_ratio);
21 }
void loadTMVAWeights(TMVA::Reader *reader, const std::string &method, const std::string &weightFile, bool verbose=false)
MvaSoftMuonEstimator::~MvaSoftMuonEstimator ( )

Definition at line 23 of file MvaSoftMuonEstimator.cc.

References TMVAReader.

23  {
24  delete TMVAReader;
25 }

Member Function Documentation

float MvaSoftMuonEstimator::mvaValue ( float  sip3d,
float  sip2d,
float  ptRel,
float  deltaR,
float  ratio 
)

Definition at line 29 of file MvaSoftMuonEstimator.cc.

References deltaR(), mva_deltaR, mva_ptRel, mva_ratio, mva_sip2d, mva_sip3d, GlobalPosition_Frontier_DevDB_cff::tag, and TMVAReader.

29  {
30  mva_sip3d = sip3d;
31  mva_sip2d = sip2d;
32  mva_ptRel = ptRel;
34  mva_ratio = ratio;
35  // Evaluate tagger
36  float tag = TMVAReader->EvaluateMVA("BDT");
37  // Transform output between approximately 0 and 1
38  tag = (tag+1.)/2.;
39 
40  return tag;
41 }
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17

Member Data Documentation

float MvaSoftMuonEstimator::mva_deltaR
private

Definition at line 30 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), and mvaValue().

float MvaSoftMuonEstimator::mva_ptRel
private

Definition at line 30 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), and mvaValue().

float MvaSoftMuonEstimator::mva_ratio
private

Definition at line 30 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), and mvaValue().

float MvaSoftMuonEstimator::mva_sip2d
private

Definition at line 30 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), and mvaValue().

float MvaSoftMuonEstimator::mva_sip3d
private

Definition at line 30 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), and mvaValue().

TMVA::Reader* MvaSoftMuonEstimator::TMVAReader
private

Definition at line 27 of file MvaSoftMuonEstimator.h.

Referenced by MvaSoftMuonEstimator(), mvaValue(), and ~MvaSoftMuonEstimator().

std::string MvaSoftMuonEstimator::weightFile
private

Definition at line 29 of file MvaSoftMuonEstimator.h.