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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 82 of file CosmicRejBDTVars.h.

Constructor & Destructor Documentation

ana::GetBDTCosRej_Kal_FHCPer1::GetBDTCosRej_Kal_FHCPer1 ( )
inline

Member Function Documentation

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

Definition at line 343 of file CosmicRejBDTVars.cxx.

References util::EnvExpansion(), and string.

344  {
345  if(!fReader_FHC_Kal_BDT_Per1) fReader_FHC_Kal_BDT_Per1 = new TMVA::Reader;
346 
347  std::string pidlib = util::EnvExpansion("$UCANA_LIB_PATH/")+"/TMVA_MProd5_Kal_FHC_Per1_BDT.weights.xml";
348 
349  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "min(CosFwdCell+CosBakCell,KalTrkFwdCell+KalTrkBakCell)", &FHC_Kal_BDT_Per1_Vars[0 ]);
350  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "KalTrkCosNumi" , &FHC_Kal_BDT_Per1_Vars[1 ]);
351  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "KalTrkLen" , &FHC_Kal_BDT_Per1_Vars[2 ]);
352  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "max(KalTrkStY,KalTrkEndY)" , &FHC_Kal_BDT_Per1_Vars[3 ]);
353  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "cos(KalTrkDirY)" , &FHC_Kal_BDT_Per1_Vars[4 ]);
354  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "KalTrkNHit/SliceNHit" , &FHC_Kal_BDT_Per1_Vars[5 ]);
355  fReader_FHC_Kal_BDT_Per1 -> AddVariable( "KalTrkPtOverP" , &FHC_Kal_BDT_Per1_Vars[6 ]);
356  // And my spectators
357  fReader_FHC_Kal_BDT_Per1 -> AddSpectator( "IsNu" , &FHC_Kal_BDT_Per1_Vars[7 ]);
358  fReader_FHC_Kal_BDT_Per1 -> AddSpectator( "IsNuMu" , &FHC_Kal_BDT_Per1_Vars[8 ]);
359  fReader_FHC_Kal_BDT_Per1 -> AddSpectator( "CVNMuon17" , &FHC_Kal_BDT_Per1_Vars[9 ]);
360  fReader_FHC_Kal_BDT_Per1 -> AddSpectator( "CVNMuon18" , &FHC_Kal_BDT_Per1_Vars[10]);
361  fReader_FHC_Kal_BDT_Per1 -> AddSpectator( "KalTrkRemID", &FHC_Kal_BDT_Per1_Vars[11]);
362  fReader_FHC_Kal_BDT_Per1 -> BookMVA("BDT", pidlib);
363  }
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
static TMVA::Reader * fReader_FHC_Kal_BDT_Per1
float FHC_Kal_BDT_Per1_Vars[12]
enum BeamMode string
float ana::GetBDTCosRej_Kal_FHCPer1::operator() ( const caf::SRProxy sr) const

Definition at line 318 of file CosmicRejBDTVars.cxx.

References ana::GetBDTCosRej_BPF_FHCPer1::InitTMVA(), ana::kcosDirY, ana::kCosNumi, ana::kCVNm, ana::kIsCCVar, ana::kIsNuVar, ana::kKalHitRat, ana::kMaxKalTrStEnY, ana::kMinTrkCell, ana::kNumuMuonPtP, ana::kRemID, and ana::kTrkLength.

319  {
320  float score = -5.;
321 
323  FHC_Kal_BDT_Per1_Vars[1 ] = kCosNumi (sr);
326  FHC_Kal_BDT_Per1_Vars[4 ] = kcosDirY (sr);
329  // And my spectators
330  FHC_Kal_BDT_Per1_Vars[7 ] = kIsNuVar (sr);
331  FHC_Kal_BDT_Per1_Vars[8 ] = kIsCCVar (sr);
332  FHC_Kal_BDT_Per1_Vars[9 ] = kCVNm (sr);
333  FHC_Kal_BDT_Per1_Vars[10] = -5; // kCVNm2017(sr) doesn't exist anymore
334  FHC_Kal_BDT_Per1_Vars[11] = kRemID (sr);
335 
336  // Init TMVA
338  score = fReader_FHC_Kal_BDT_Per1->EvaluateMVA("BDT");
339 
340  return score;
341  }
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;}})
const Var kKalHitRat([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;float TrkHit=kTrkNhits(sr);float SlcHit=kNHit(sr);return TrkHit/SlcHit;})
const Var kTrkLength([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].len/100;})
Definition: NumuVars.h:65
static TMVA::Reader * fReader_FHC_Kal_BDT_Per1
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 kMaxKalTrStEnY([](const caf::SRProxy *sr){return std::max(kTrkStartY(sr), kTrkEndY(sr));})
const Var kRemID
PID
Definition: Vars.cxx:81
const Var kNumuMuonPtP([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks > 0 &&sr->trk.kalman.idxremid!=999){if(sr->hdr.det==1){double Zbeam=sr->trk.kalman.tracks[0].dir.Dot(beamDirND);double ptp=sqrt(1-Zbeam *Zbeam);return(float) ptp;}if(sr->hdr.det==2){double Zbeam=sr->trk.kalman.tracks[0].dir.Dot(beamDirFD);double ptp=sqrt(1-Zbeam *Zbeam);return(float) ptp;}}return-5.f;})
Definition: NumuVars.h:49
float FHC_Kal_BDT_Per1_Vars[12]
const Var kcosDirY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return(float) cos(kDirY(sr));})
Definition: NumuVars.h:41
const Var kCVNm
PID
Definition: Vars.cxx:39
const Var kCosNumi([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks > 0 &&sr->trk.kalman.idxremid!=999){if(sr->hdr.det==1){return sr->trk.kalman.tracks[0].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman.tracks[0].dir.Dot(beamDirFD);}}return-5.f;})
Definition: NumuVars.h:43
const Var kMinTrkCell([](const caf::SRProxy *sr){float CosCell=kCosmicForwardCell(sr)+kCosmicBackwardCell(sr);float KalCell=kKalmanForwardCell(sr)+kKalmanBackwardCell(sr);return std::min(CosCell, KalCell);})

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