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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/3FlavorAna/Vars/WrongSignBDTVars.h"

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 8 of file WrongSignBDTVars.h.

Constructor & Destructor Documentation

ana::GetAntiNueBDT::GetAntiNueBDT ( )
inline

Definition at line 11 of file WrongSignBDTVars.h.

References InitTMVA(), operator()(), and sr.

11 {}

Member Function Documentation

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

Definition at line 43 of file WrongSignBDTVars.cxx.

References ana::FindCAFAnaDir(), and string.

Referenced by GetAntiNueBDT(), ana::GetAntiNueBDTCVN::GetAntiNueBDTCVN(), ana::GetAntiNumuBDT::GetAntiNumuBDT(), ana::GetAntiNumuBDTCVN::GetAntiNumuBDTCVN(), operator()(), ana::GetAntiNumuBDT::operator()(), ana::GetAntiNueBDTCVN::operator()(), and ana::GetAntiNumuBDTCVN::operator()().

44  {
45  if(!fReaderBDTNue) fReaderBDTNue = new TMVA::Reader;
46  std::string pidlib = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTG2.weights.xml";
47  fReaderBDTNue->AddVariable("stretch", &BDTNueVars[0]);
48  fReaderBDTNue->AddVariable("inelasticity", &BDTNueVars[1]);
49  fReaderBDTNue->AddVariable("prim_dedx0", &BDTNueVars[2]);
50  fReaderBDTNue->AddVariable("sec_shw_gap", &BDTNueVars[3]);
51  fReaderBDTNue->AddVariable("sec_avg_dedx", &BDTNueVars[4]);
52  fReaderBDTNue->BookMVA("BDTG", pidlib);
53  }
float BDTNueVars[5]
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
static TMVA::Reader * fReaderBDTNue
enum BeamMode string
float ana::GetAntiNueBDT::operator() ( const caf::SRProxy sr) const

Definition at line 28 of file WrongSignBDTVars.cxx.

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

Referenced by GetAntiNueBDT(), ana::GetAntiNueBDTCVN::GetAntiNueBDTCVN(), ana::GetAntiNumuBDT::GetAntiNumuBDT(), and ana::GetAntiNumuBDTCVN::GetAntiNumuBDTCVN().

29  {
30  float antinuebdt = -5.;
31 
32  BDTNueVars[0] = kStretch(sr);
33  BDTNueVars[1] = kInElasticity(sr);
34  BDTNueVars[2] = kPrimDedx0(sr);
35  BDTNueVars[3] = kSecShwGap(sr);
36  BDTNueVars[4] = kSecAvgDedx(sr);
37 
38  if(!fReaderBDTNue) InitTMVA();
39  antinuebdt = fReaderBDTNue->EvaluateMVA("BDTG");
40  return antinuebdt;
41  }
float BDTNueVars[5]
const Var kInElasticity([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 1.f;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return 1.f;return((sr->slc.calE- sr->vtx.elastic.fuzzyk.png[0].shwlid.calE)/(sr->slc.calE));})
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);})
void InitTMVA() const
const Var kPrimDedx0
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);})
static TMVA::Reader * fReaderBDTNue

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