Public Member Functions | Protected Member Functions | List of all members
ana::GetAntiNumuBDT Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-23/3FlavorAna/Vars/WrongSignBDTVars.h"

Public Member Functions

 GetAntiNumuBDT ()
 
float operator() (const caf::SRProxy *sr) const
 

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 21 of file WrongSignBDTVars.h.

Constructor & Destructor Documentation

ana::GetAntiNumuBDT::GetAntiNumuBDT ( )
inline

Definition at line 24 of file WrongSignBDTVars.h.

References ana::GetAntiNueBDT::InitTMVA(), ana::GetAntiNueBDT::operator()(), and sr.

24 {}

Member Function Documentation

void ana::GetAntiNumuBDT::InitTMVA ( ) const
protected

Definition at line 70 of file WrongSignBDTVars.cxx.

References ana::FindCAFAnaDir(), and string.

71  {
72  if(!fReaderBDTNumu) fReaderBDTNumu = new TMVA::Reader;
73  std::string pidlib = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTG2.weights.xml";
74  fReaderBDTNumu->AddVariable("stretch", &BDTNumuVars[0]);
75  fReaderBDTNumu->AddVariable("inelasticity", &BDTNumuVars[1]);
76  fReaderBDTNumu->AddVariable("prim_dedx0", &BDTNumuVars[2]);
77  fReaderBDTNumu->AddVariable("sec_shw_gap", &BDTNumuVars[3]);
78  fReaderBDTNumu->AddVariable("sec_avg_dedx", &BDTNumuVars[4]);
79  fReaderBDTNumu->BookMVA("BDTG", pidlib);
80  }
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
static TMVA::Reader * fReaderBDTNumu
float BDTNumuVars[5]
enum BeamMode string
float ana::GetAntiNumuBDT::operator() ( const caf::SRProxy sr) const

Definition at line 55 of file WrongSignBDTVars.cxx.

References ana::GetAntiNueBDT::InitTMVA(), ana::kNumuHadVisEFrac, ana::kPrimDedx0, ana::kSecAvgDedx, ana::kSecShwGap, and ana::kStretch.

56  {
57  float antinumubdt = -5.;
58 
59  BDTNumuVars[0] = kStretch(sr);
61  BDTNumuVars[2] = kPrimDedx0(sr);
62  BDTNumuVars[3] = kSecShwGap(sr);
63  BDTNumuVars[4] = kSecAvgDedx(sr);
64 
65  if(!fReaderBDTNumu) InitTMVA();
66  antinumubdt = fReaderBDTNumu->EvaluateMVA("BDTG");
67  return antinumubdt;
68  }
const Var kSecAvgDedx([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-5.;if(sr->vtx.elastic.fuzzyk.nshwlid< 2) return 0.;if(sr->vtx.elastic.fuzzyk.npng< 2) return 0.;if(sr->vtx.elastic.fuzzyk.png[1].len< 1e-10) return-5.;return(double)(sr->vtx.elastic.fuzzyk.png[1].calE/sr->vtx.elastic.fuzzyk.png[1].len);})
const Var kNumuHadVisEFrac([](const caf::SRProxy *sr){if(sr->slc.calE==0) return-5.;return(double)(sr->energy.numu.hadcalE+sr->energy.numu.hadtrkE)/(sr->slc.calE);})
const Var kPrimDedx0
static TMVA::Reader * fReaderBDTNumu
float BDTNumuVars[5]
const Var kStretch([](const caf::SRProxy *sr){if(sr->slc.meanpos.z==sr->slc.boxmin.z) return-5.;return(double)((sr->slc.boxmax.z-sr->slc.meanpos.z)/(sr->slc.meanpos.z-sr->slc.boxmin.z));})
const Var kSecShwGap([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-5.;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return-5.;if(sr->vtx.elastic.fuzzyk.nshwlid< 2) return(double) sr->vtx.elastic.fuzzyk.png[0].shwlid.gap;return double(sr->vtx.elastic.fuzzyk.png[1].shwlid.gap);})

The documentation for this class was generated from the following files: