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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 30 of file CosmicRejBDTVars.h.

Constructor & Destructor Documentation

ana::GetBDTCosRej_BPF_FHCPer1::GetBDTCosRej_BPF_FHCPer1 ( )
inline

Definition at line 33 of file CosmicRejBDTVars.h.

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

33 {}

Member Function Documentation

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

Definition at line 136 of file CosmicRejBDTVars.cxx.

References util::EnvExpansion(), and string.

Referenced by ana::GetBDTCosRej_BPF_FHCHigh::GetBDTCosRej_BPF_FHCHigh(), GetBDTCosRej_BPF_FHCPer1(), ana::GetBDTCosRej_BPF_FHCPer2::GetBDTCosRej_BPF_FHCPer2(), ana::GetBDTCosRej_BPF_RHCHigh::GetBDTCosRej_BPF_RHCHigh(), ana::GetBDTCosRej_Kal_FHCHigh::GetBDTCosRej_Kal_FHCHigh(), ana::GetBDTCosRej_Kal_FHCPer1::GetBDTCosRej_Kal_FHCPer1(), ana::GetBDTCosRej_Kal_FHCPer2::GetBDTCosRej_Kal_FHCPer2(), ana::GetBDTCosRej_Kal_RHCHigh::GetBDTCosRej_Kal_RHCHigh(), operator()(), ana::GetBDTCosRej_BPF_FHCPer2::operator()(), ana::GetBDTCosRej_BPF_FHCHigh::operator()(), ana::GetBDTCosRej_BPF_RHCHigh::operator()(), ana::GetBDTCosRej_Kal_FHCPer1::operator()(), ana::GetBDTCosRej_Kal_FHCPer2::operator()(), ana::GetBDTCosRej_Kal_FHCHigh::operator()(), and ana::GetBDTCosRej_Kal_RHCHigh::operator()().

137  {
138  if(!fReader_FHC_BPF_BDT_Per1) fReader_FHC_BPF_BDT_Per1 = new TMVA::Reader;
139 
140  std::string pidlib = util::EnvExpansion("$UCANA_LIB_PATH/")+"/TMVA_MProd5_BPF_FHC_Per1_BDT.weights.xml";
141 
142  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "min(CosFwdCell+CosBakCell,KalTrkFwdCell+KalTrkBakCell)", &FHC_BPF_BDT_Per1_Vars[0 ]);
143  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "BPFCosNumi" , &FHC_BPF_BDT_Per1_Vars[1 ]);
144  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "BPFLen" , &FHC_BPF_BDT_Per1_Vars[2 ]);
145  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "max(BPFStY,BPFEndY)" , &FHC_BPF_BDT_Per1_Vars[3 ]);
146  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "cos(BPFDirY)" , &FHC_BPF_BDT_Per1_Vars[4 ]);
147  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "BPFNHit/SliceNHit" , &FHC_BPF_BDT_Per1_Vars[5 ]);
148  fReader_FHC_BPF_BDT_Per1 -> AddVariable( "BPFPtOverP" , &FHC_BPF_BDT_Per1_Vars[6 ]);
149  // And my spectators
150  fReader_FHC_BPF_BDT_Per1 -> AddSpectator( "IsNu" , &FHC_BPF_BDT_Per1_Vars[7 ]);
151  fReader_FHC_BPF_BDT_Per1 -> AddSpectator( "IsNuMu" , &FHC_BPF_BDT_Per1_Vars[8 ]);
152  fReader_FHC_BPF_BDT_Per1 -> AddSpectator( "CVNMuon17" , &FHC_BPF_BDT_Per1_Vars[9 ]);
153  fReader_FHC_BPF_BDT_Per1 -> AddSpectator( "CVNMuon18" , &FHC_BPF_BDT_Per1_Vars[10]);
154  fReader_FHC_BPF_BDT_Per1 -> AddSpectator( "KalTrkRemID", &FHC_BPF_BDT_Per1_Vars[11]);
155  fReader_FHC_BPF_BDT_Per1 -> BookMVA("BDT", pidlib);
156  }
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
float FHC_BPF_BDT_Per1_Vars[12]
static TMVA::Reader * fReader_FHC_BPF_BDT_Per1
enum BeamMode string
float ana::GetBDTCosRej_BPF_FHCPer1::operator() ( const caf::SRProxy sr) const

Definition at line 112 of file CosmicRejBDTVars.cxx.

References InitTMVA(), ana::kBPFBestMuonCosDirY, ana::kBPFBestMuonCosNumi, ana::kBPFBestMuonPtP, ana::kBPFBestMuonTrkLen, ana::kBPFHitRat, ana::kCVNm, ana::kIsCCVar, ana::kIsNuVar, ana::kMaxBPFStEnY, ana::kMinTrkCell, and ana::kRemID.

Referenced by ana::GetBDTCosRej_BPF_FHCHigh::GetBDTCosRej_BPF_FHCHigh(), GetBDTCosRej_BPF_FHCPer1(), ana::GetBDTCosRej_BPF_FHCPer2::GetBDTCosRej_BPF_FHCPer2(), ana::GetBDTCosRej_BPF_RHCHigh::GetBDTCosRej_BPF_RHCHigh(), ana::GetBDTCosRej_Kal_FHCHigh::GetBDTCosRej_Kal_FHCHigh(), ana::GetBDTCosRej_Kal_FHCPer1::GetBDTCosRej_Kal_FHCPer1(), ana::GetBDTCosRej_Kal_FHCPer2::GetBDTCosRej_Kal_FHCPer2(), and ana::GetBDTCosRej_Kal_RHCHigh::GetBDTCosRej_Kal_RHCHigh().

113  {
114  float score = -5.;
115 
123  // And my spectators
124  FHC_BPF_BDT_Per1_Vars[7 ] = kIsNuVar (sr);
125  FHC_BPF_BDT_Per1_Vars[8 ] = kIsCCVar (sr);
126  FHC_BPF_BDT_Per1_Vars[9 ] = kCVNm (sr);
127  FHC_BPF_BDT_Per1_Vars[10] = -5; // kCVNm2017(sr) doesn't exist anymore
128  FHC_BPF_BDT_Per1_Vars[11] = kRemID (sr);
129 
130  // Init TMVA
132  score = fReader_FHC_BPF_BDT_Per1->EvaluateMVA("BDT");
133  return score;
134  }
const Var kIsNuVar([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-1;if(sr->mc.nu[0].pdg > 0){return 1;}else{return 0;}})
float FHC_BPF_BDT_Per1_Vars[12]
const Var kMaxBPFStEnY([](const caf::SRProxy *sr){return std::max(kBPFBestMuonStarty(sr), kBPFBestMuonStopy(sr));})
const Var kIsCCVar([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-1;if(sr->mc.nu[0].iscc){return 1;}else{return 0;}})
const Var kBPFBestMuonCosNumi([](const caf::SRProxy *sr){float cosnumi=-5.0;if(kBPFValidMuon(sr)==false) return-5.f; unsigned int muIdx=(unsigned int) kCVNMuonIdx(sr);if(sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.IsValid){if(sr->hdr.det==caf::kNEARDET) cosnumi=sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.dir.Dot(beamDirND);if(sr->hdr.det==caf::kFARDET) cosnumi=sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.dir.Dot(beamDirFD);}return cosnumi;})
: Cos(NuMI beam dir) w.r.t. Best BPF Muon track
Definition: BPFVars.h:156
const Var kRemID
PID
Definition: Vars.cxx:81
const Var kBPFHitRat([](const caf::SRProxy *sr){float BPFHit=kBPFBestMuonNhits(sr);float SlcHit=kNHit(sr);if(BPFHit==-5) return BPFHit;else return BPFHit/SlcHit;})
const Var kBPFBestMuonCosDirY([](const caf::SRProxy *sr){float diry=kBPFBestMuonDiry(sr);if(diry==-5) return diry;else return(float) cos(diry);})
: Cosine of Reco Start Y-direction for the best muon track
Definition: BPFVars.h:93
static TMVA::Reader * fReader_FHC_BPF_BDT_Per1
const Var kCVNm
PID
Definition: Vars.cxx:39
const Var kBPFBestMuonPtP([](const caf::SRProxy *sr){float ptp=-5.0;if(kBPFValidMuon(sr)==false) return-5.f; unsigned int muIdx=(unsigned int) kCVNMuonIdx(sr);double Zbeam=-5.0;if(sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.IsValid){if(sr->hdr.det==caf::kNEARDET) Zbeam=sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.dir.Dot(beamDirND);if(sr->hdr.det==caf::kFARDET) Zbeam=sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.dir.Dot(beamDirFD);}if(Zbeam==-5.0) ptp=-5.0;else ptp=sqrt(1-Zbeam *Zbeam);return ptp;})
: Pt/P for Best Muon track
Definition: BPFVars.h:152
const Var kMinTrkCell([](const caf::SRProxy *sr){float CosCell=kCosmicForwardCell(sr)+kCosmicBackwardCell(sr);float KalCell=kKalmanForwardCell(sr)+kKalmanBackwardCell(sr);return std::min(CosCell, KalCell);})
const Var kBPFBestMuonTrkLen([](const caf::SRProxy *sr){float len=-1.0;if(kBPFValidMuon(sr)==false) return-5.f; unsigned int muIdx=(unsigned int) kCVNMuonIdx(sr);if(sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.IsValid) len=sr->vtx.elastic.fuzzyk.png[muIdx].bpf.muon.len/100.0;return len;})
: Reco length for the best muon track
Definition: BPFVars.h:135

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