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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 33 of file WrongSignBDTVars.h.

Constructor & Destructor Documentation

ana::GetAntiNueBDTCVN::GetAntiNueBDTCVN ( )
inline

Definition at line 36 of file WrongSignBDTVars.h.

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

36 {}

Member Function Documentation

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

Definition at line 108 of file WrongSignBDTVars.cxx.

References ana::FindCAFAnaDir(), and string.

109  {
110  if(!fReaderBDTCVNNue_p1) fReaderBDTCVNNue_p1 = new TMVA::Reader;
111  if(!fReaderBDTCVNNue_p2) fReaderBDTCVNNue_p2 = new TMVA::Reader;
112  std::string pidlib_p1 = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTGCVN2_p1.weights.xml";
113  std::string pidlib_p2 = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTGCVN2_p2.weights.xml";
114  fReaderBDTCVNNue_p1->AddVariable("stretch", &BDTCVNNue_p1Vars[0]);
115  fReaderBDTCVNNue_p1->AddVariable("inelasticity", &BDTCVNNue_p1Vars[1]);
116  fReaderBDTCVNNue_p1->AddVariable("prim_dedx0", &BDTCVNNue_p1Vars[2]);
117  fReaderBDTCVNNue_p1->AddVariable("cvnfsp", &BDTCVNNue_p1Vars[3]);
118  fReaderBDTCVNNue_p1->BookMVA("BDTG", pidlib_p1);
119 
120  fReaderBDTCVNNue_p2->AddVariable("stretch", &BDTCVNNue_p2Vars[0]);
121  fReaderBDTCVNNue_p2->AddVariable("inelasticity", &BDTCVNNue_p2Vars[1]);
122  fReaderBDTCVNNue_p2->AddVariable("prim_dedx0", &BDTCVNNue_p2Vars[2]);
123  fReaderBDTCVNNue_p2->AddVariable("cvnfsp", &BDTCVNNue_p2Vars[3]);
124  fReaderBDTCVNNue_p2->AddVariable("maxprotondist", &BDTCVNNue_p2Vars[4]);
125  fReaderBDTCVNNue_p2->AddVariable("maxproton", &BDTCVNNue_p2Vars[5]);
126  fReaderBDTCVNNue_p2->BookMVA("BDTG", pidlib_p2);
127  }
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
float BDTCVNNue_p1Vars[4]
static TMVA::Reader * fReaderBDTCVNNue_p1
static TMVA::Reader * fReaderBDTCVNNue_p2
float BDTCVNNue_p2Vars[6]
enum BeamMode string
float ana::GetAntiNueBDTCVN::operator() ( const caf::SRProxy sr) const

Definition at line 83 of file WrongSignBDTVars.cxx.

References ana::GetAntiNueBDT::InitTMVA(), ana::kCVNFSProtonScore2018, ana::kInElasticity, ana::kNProng, ana::kPrimDedx0, ana::kProngCVNMaxProton, ana::kProngCVNMaxProtonDist, and ana::kStretch.

84  {
85  float antinuebdt = -5.;
86 
87  BDTCVNNue_p1Vars[0] = kStretch(sr);
91 
92  BDTCVNNue_p2Vars[0] = kStretch(sr);
98 
100  if(kNProng(sr) == 1)
101  antinuebdt = fReaderBDTCVNNue_p1->EvaluateMVA("BDTG");
102  if(kNProng(sr) > 1)
103  antinuebdt = fReaderBDTCVNNue_p2->EvaluateMVA("BDTG");
104 
105  return antinuebdt;
106  }
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 kProngCVNMaxProtonDist([](const caf::SRProxy *sr){double score=-5;double dist=-5;const caf::SRVector3DProxy &vtx=sr->vtx.elastic.vtx;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;++i){if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid > score){score=sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid;const caf::SRVector3DProxy &st=sr->vtx.elastic.fuzzyk.png[i].start;dist=util::pythag(vtx.X()-st.X(), vtx.Y()-st.Y(), vtx.Z()-st.Z());}}return dist;})
return distance from vertex for most proton-like prong
Definition: NueVarsExtra.h:137
const Var kPrimDedx0
float BDTCVNNue_p1Vars[4]
static TMVA::Reader * fReaderBDTCVNNue_p1
const Var kNProng
const Var kCVNFSProtonScore2018([](const caf::SRProxy *sr){return CVNFinalStateScore2018(sr, 2212);})
Proton score from CVN Final State labels, using Prod3Train CVN.
static TMVA::Reader * fReaderBDTCVNNue_p2
const Var kProngCVNMaxProton([](const caf::SRProxy *sr){double score=-5;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;++i){if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid > score) score=sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid;}return score;})
return CVN proton score for most proton-like prong
Definition: NueVarsExtra.h:134
float BDTCVNNue_p2Vars[6]
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));})

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