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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 43 of file CosmicRejBDTVars.h.

Constructor & Destructor Documentation

ana::GetBDTCosRej_BPF_FHCPer2::GetBDTCosRej_BPF_FHCPer2 ( )
inline

Member Function Documentation

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

Definition at line 186 of file CosmicRejBDTVars.cxx.

References util::EnvExpansion(), and string.

187  {
188  if(!fReader_FHC_BPF_BDT_Per2) fReader_FHC_BPF_BDT_Per2 = new TMVA::Reader;
189 
190  std::string pidlib = util::EnvExpansion("$UCANA_LIB_PATH/")+"/TMVA_MProd5_BPF_FHC_Per2_BDT.weights.xml";
191 
192  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "min(CosFwdCell+CosBakCell,KalTrkFwdCell+KalTrkBakCell)", &FHC_BPF_BDT_Per2_Vars[0 ]);
193  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "BPFCosNumi" , &FHC_BPF_BDT_Per2_Vars[1 ]);
194  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "BPFLen" , &FHC_BPF_BDT_Per2_Vars[2 ]);
195  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "max(BPFStY,BPFEndY)" , &FHC_BPF_BDT_Per2_Vars[3 ]);
196  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "cos(BPFDirY)" , &FHC_BPF_BDT_Per2_Vars[4 ]);
197  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "BPFNHit/SliceNHit" , &FHC_BPF_BDT_Per2_Vars[5 ]);
198  fReader_FHC_BPF_BDT_Per2 -> AddVariable( "BPFPtOverP" , &FHC_BPF_BDT_Per2_Vars[6 ]);
199  // And my spectators
200  fReader_FHC_BPF_BDT_Per2 -> AddSpectator( "IsNu" , &FHC_BPF_BDT_Per2_Vars[7 ]);
201  fReader_FHC_BPF_BDT_Per2 -> AddSpectator( "IsNuMu" , &FHC_BPF_BDT_Per2_Vars[8 ]);
202  fReader_FHC_BPF_BDT_Per2 -> AddSpectator( "CVNMuon17" , &FHC_BPF_BDT_Per2_Vars[9 ]);
203  fReader_FHC_BPF_BDT_Per2 -> AddSpectator( "CVNMuon18" , &FHC_BPF_BDT_Per2_Vars[10]);
204  fReader_FHC_BPF_BDT_Per2 -> AddSpectator( "KalTrkRemID", &FHC_BPF_BDT_Per2_Vars[11]);
205  fReader_FHC_BPF_BDT_Per2 -> BookMVA("BDT", pidlib);
206  }
static TMVA::Reader * fReader_FHC_BPF_BDT_Per2
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
float FHC_BPF_BDT_Per2_Vars[12]
enum BeamMode string
float ana::GetBDTCosRej_BPF_FHCPer2::operator() ( const caf::SRProxy sr) const

Definition at line 162 of file CosmicRejBDTVars.cxx.

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

163  {
164  float score = -5.;
165 
173  // And my spectators
174  FHC_BPF_BDT_Per2_Vars[7 ] = kIsNuVar (sr);
175  FHC_BPF_BDT_Per2_Vars[8 ] = kIsCCVar (sr);
176  FHC_BPF_BDT_Per2_Vars[9 ] = kCVNm (sr);
177  FHC_BPF_BDT_Per2_Vars[10] = -5; // kCVNm2017(sr) doesn't exist anymore
178  FHC_BPF_BDT_Per2_Vars[11] = kRemID (sr);
179 
180  // Init TMVA
182  score = fReader_FHC_BPF_BDT_Per2->EvaluateMVA("BDT");
183  return score;
184  }
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;}})
static TMVA::Reader * fReader_FHC_BPF_BDT_Per2
float FHC_BPF_BDT_Per2_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
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: