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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 121 of file CosmicRejBDTVars.h.

Constructor & Destructor Documentation

ana::GetBDTCosRej_Kal_RHCHigh::GetBDTCosRej_Kal_RHCHigh ( )
inline

Member Function Documentation

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

Definition at line 496 of file CosmicRejBDTVars.cxx.

References util::EnvExpansion(), and string.

497  {
498  if(!fReader_RHC_Kal_BDT_High) fReader_RHC_Kal_BDT_High = new TMVA::Reader;
499 
500  std::string pidlib = util::EnvExpansion("$UCANA_LIB_PATH/")+"/TMVA_MProd5_Kal_RHC_High_BDT.weights.xml";
501 
502  fReader_RHC_Kal_BDT_High -> AddVariable( "min(CosFwdCell+CosBakCell,KalTrkFwdCell+KalTrkBakCell)", &RHC_Kal_BDT_High_Vars[0 ]);
503  fReader_RHC_Kal_BDT_High -> AddVariable( "KalTrkCosNumi" , &RHC_Kal_BDT_High_Vars[1 ]);
504  fReader_RHC_Kal_BDT_High -> AddVariable( "KalTrkLen" , &RHC_Kal_BDT_High_Vars[2 ]);
505  fReader_RHC_Kal_BDT_High -> AddVariable( "max(KalTrkStY,KalTrkEndY)" , &RHC_Kal_BDT_High_Vars[3 ]);
506  fReader_RHC_Kal_BDT_High -> AddVariable( "cos(KalTrkDirY)" , &RHC_Kal_BDT_High_Vars[4 ]);
507  fReader_RHC_Kal_BDT_High -> AddVariable( "KalTrkNHit/SliceNHit" , &RHC_Kal_BDT_High_Vars[5 ]);
508  fReader_RHC_Kal_BDT_High -> AddVariable( "KalTrkPtOverP" , &RHC_Kal_BDT_High_Vars[6 ]);
509  // And my spectators
510  fReader_RHC_Kal_BDT_High -> AddSpectator( "IsNu" , &RHC_Kal_BDT_High_Vars[7 ]);
511  fReader_RHC_Kal_BDT_High -> AddSpectator( "IsNuMu" , &RHC_Kal_BDT_High_Vars[8 ]);
512  fReader_RHC_Kal_BDT_High -> AddSpectator( "CVNMuon17" , &RHC_Kal_BDT_High_Vars[9 ]);
513  fReader_RHC_Kal_BDT_High -> AddSpectator( "CVNMuon18" , &RHC_Kal_BDT_High_Vars[10]);
514  fReader_RHC_Kal_BDT_High -> AddSpectator( "KalTrkRemID", &RHC_Kal_BDT_High_Vars[11]);
515  fReader_RHC_Kal_BDT_High -> BookMVA("BDT", pidlib);
516  }
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
static TMVA::Reader * fReader_RHC_Kal_BDT_High
float RHC_Kal_BDT_High_Vars[12]
enum BeamMode string
float ana::GetBDTCosRej_Kal_RHCHigh::operator() ( const caf::SRProxy sr) const

Definition at line 471 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.

472  {
473  float score = -5.;
474 
476  RHC_Kal_BDT_High_Vars[1 ] = kCosNumi (sr);
479  RHC_Kal_BDT_High_Vars[4 ] = kcosDirY (sr);
482  // And my spectators
483  RHC_Kal_BDT_High_Vars[7 ] = kIsNuVar (sr);
484  RHC_Kal_BDT_High_Vars[8 ] = kIsCCVar (sr);
485  RHC_Kal_BDT_High_Vars[9 ] = kCVNm (sr);
486  RHC_Kal_BDT_High_Vars[10] = -5; // kCVNm2017(sr) doesn't exist anymore
487  RHC_Kal_BDT_High_Vars[11] = kRemID (sr);
488 
489  // Init TMVA
491  score = fReader_RHC_Kal_BDT_High->EvaluateMVA("BDT");
492 
493  return score;
494  }
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_RHC_Kal_BDT_High
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 RHC_Kal_BDT_High_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: