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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 45 of file WrongSignBDTVars.h.

Constructor & Destructor Documentation

ana::GetAntiNumuBDTCVN::GetAntiNumuBDTCVN ( )
inline

Definition at line 48 of file WrongSignBDTVars.h.

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

48 {}

Member Function Documentation

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

Definition at line 154 of file WrongSignBDTVars.cxx.

References std::acos(), caf::Proxy< caf::SRSlice >::boxmax, caf::Proxy< caf::SRSlice >::boxmin, caf::Proxy< caf::SRSlice >::calE, caf::Proxy< caf::SRVertexBranch >::elastic, caf::Proxy< caf::StandardRecord >::energy, ana::FindCAFAnaDir(), caf::Proxy< caf::SRElastic >::fuzzyk, caf::Proxy< caf::SRNumuEnergy >::hadcalE, caf::Proxy< caf::SRNumuEnergy >::hadtrkE, caf::Proxy< caf::SRElastic >::IsValid, ana::kEthetaSqr, ana::kInElasticity, ana::kLeptonAngle, ana::kNumuHadEFrac, ana::kNumuHadVisEFrac, ana::kStretch, M_PI, caf::Proxy< caf::SRSlice >::meanpos, caf::Proxy< caf::SRFuzzyK >::nshwlid, caf::Proxy< caf::SREnergyBranch >::numu, caf::Proxy< caf::SRFuzzyK >::png, cet::pow(), caf::Proxy< caf::StandardRecord >::slc, sr, string, caf::Proxy< caf::StandardRecord >::vtx, and caf::Proxy< caf::SRVector3D >::z.

155  {
156  if(!fReaderBDTCVNNumu_p1) fReaderBDTCVNNumu_p1 = new TMVA::Reader;
157  if(!fReaderBDTCVNNumu_p2) fReaderBDTCVNNumu_p2 = new TMVA::Reader;
158  std::string pidlib_p1 = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTGCVN2_p1.weights.xml";
159  std::string pidlib_p2 = FindCAFAnaDir()+"/data/wrong_sign/weights/TMVAClassification_BDTGCVN2_p2.weights.xml";
160  fReaderBDTCVNNumu_p1->AddVariable("stretch", &BDTCVNNumu_p1Vars[0]);
161  fReaderBDTCVNNumu_p1->AddVariable("inelasticity", &BDTCVNNumu_p1Vars[1]);
162  fReaderBDTCVNNumu_p1->AddVariable("prim_dedx0", &BDTCVNNumu_p1Vars[2]);
163  fReaderBDTCVNNumu_p1->AddVariable("cvnfsp", &BDTCVNNumu_p1Vars[3]);
164  fReaderBDTCVNNumu_p1->BookMVA("BDTG", pidlib_p1);
165 
166  fReaderBDTCVNNumu_p2->AddVariable("stretch", &BDTCVNNumu_p2Vars[0]);
167  fReaderBDTCVNNumu_p2->AddVariable("inelasticity", &BDTCVNNumu_p2Vars[1]);
168  fReaderBDTCVNNumu_p2->AddVariable("prim_dedx0", &BDTCVNNumu_p2Vars[2]);
169  fReaderBDTCVNNumu_p2->AddVariable("cvnfsp", &BDTCVNNumu_p2Vars[3]);
170  fReaderBDTCVNNumu_p2->AddVariable("maxprotondist", &BDTCVNNumu_p2Vars[4]);
171  fReaderBDTCVNNumu_p2->AddVariable("maxproton", &BDTCVNNumu_p2Vars[5]);
172  fReaderBDTCVNNumu_p2->BookMVA("BDTG", pidlib_p2);
173  }
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
static TMVA::Reader * fReaderBDTCVNNumu_p2
static TMVA::Reader * fReaderBDTCVNNumu_p1
float BDTCVNNumu_p1Vars[4]
float BDTCVNNumu_p2Vars[6]
enum BeamMode string
float ana::GetAntiNumuBDTCVN::operator() ( const caf::SRProxy sr) const

Definition at line 129 of file WrongSignBDTVars.cxx.

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

130  {
131  float antinumubdt = -5.;
132 
133  BDTCVNNumu_p1Vars[0] = kStretch(sr);
135  BDTCVNNumu_p1Vars[2] = kPrimDedx0(sr);
137 
138  BDTCVNNumu_p2Vars[0] = kStretch(sr);
140  BDTCVNNumu_p2Vars[2] = kPrimDedx0(sr);
144 
146  if(kNProng(sr) == 1)
147  antinumubdt = fReaderBDTCVNNumu_p1->EvaluateMVA("BDTG");
148  if(kNProng(sr) > 1)
149  antinumubdt = fReaderBDTCVNNumu_p2->EvaluateMVA("BDTG");
150 
151  return antinumubdt;
152  }
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 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
const Var kNProng
const Var kCVNFSProtonScore2018([](const caf::SRProxy *sr){return CVNFinalStateScore2018(sr, 2212);})
Proton score from CVN Final State labels, using Prod3Train CVN.
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
static TMVA::Reader * fReaderBDTCVNNumu_p2
static TMVA::Reader * fReaderBDTCVNNumu_p1
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));})
float BDTCVNNumu_p1Vars[4]
float BDTCVNNumu_p2Vars[6]

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