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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/NuXAna/Vars/NusVarsTemp.h"

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 88 of file NusVarsTemp.h.

Constructor & Destructor Documentation

ana::GetNCCosRejp3_5::GetNCCosRejp3_5 ( )
inline

Member Function Documentation

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

Definition at line 641 of file NusVarsTemp.cxx.

References ana::assert(), cet::getenv(), and string.

642  {
643  if(!fReaderBDT3) fReaderBDT3 = new TMVA::Reader;
644  const char* libpath = getenv("NCID_LIB_PATH");
645  assert(libpath);
646  std::string pidlib = std::string(libpath)+"/TF_BDTA.weights.xml";
647  fReaderBDT3->AddVariable("cosmicid", &TMVAvars[0]); //cosmicid
648  fReaderBDT3->AddVariable("partptp", &TMVAvars[1]); //partptp
649  fReaderBDT3->AddVariable("shwnhit", &TMVAvars[2]); //shwnhit
650  fReaderBDT3->AddVariable("shwxminusy", &TMVAvars[3]); //shwminusy
651  fReaderBDT3->AddVariable("shwxplusy", &TMVAvars[4]); //shwxplusy
652  fReaderBDT3->AddVariable("shwxovery", &TMVAvars[5]); //shwxpvery
653  fReaderBDT3->AddVariable("shwcalE", &TMVAvars[6]); //shwcalE
654  fReaderBDT3->AddVariable("shwdirY", &TMVAvars[7]); //shwdirY
655  fReaderBDT3->AddVariable("shwlen", &TMVAvars[8]); //shwlen
656  fReaderBDT3->AddVariable("shwwwidth", &TMVAvars[9]); //shwwwidth
657  fReaderBDT3->AddVariable("shwGap", &TMVAvars[10]); //shwGap
658  fReaderBDT3->AddVariable("nshwlid", &TMVAvars[11]); //nshwlid
659  fReaderBDT3->AddVariable("nmiphit", &TMVAvars[12]); //nmiphit
660  fReaderBDT3->BookMVA("BDT", pidlib);
661  }
static TMVA::Reader * fReaderBDT3
std::string getenv(std::string const &name)
static float TMVAvars[4]
Definition: NDNCPi0Xsec.cxx:10
assert(nhit_max >=nhit_nbins)
enum BeamMode string
float ana::GetNCCosRejp3_5::operator() ( const caf::SRProxy sr) const

Definition at line 386 of file NusVarsTemp.cxx.

References om::cout, caf::Proxy< caf::SRVertexBranch >::elastic, allTimeWatchdog::endl, check_time_usage::float, caf::Proxy< caf::SRElastic >::fuzzyk, ana::GetNCCosRejBDTG2020::InitTMVA(), std::isinf(), std::isnan(), caf::Proxy< caf::SRElastic >::IsValid, ana::ncid, ana::nmiphit, caf::Proxy< caf::SRSlice >::nmiphit, caf::Proxy< caf::SRFuzzyK >::npng, ana::nshwlid, caf::Proxy< caf::SRFuzzyK >::nshwlid, caf::Proxy< caf::SRIDBranch >::nuecosrej, caf::Proxy< caf::SRNueCosRej >::partptp, caf::Proxy< caf::SRFuzzyK >::png, caf::Proxy< caf::StandardRecord >::sel, ana::shwcalE, ana::shwdirY, ana::shwGap, ana::shwlen, ana::shwnhit, ana::shwnhitx, ana::shwnhity, ana::shwwidth, ana::shwxminusy, ana::shwxovery, ana::shwxplusy, caf::Proxy< caf::StandardRecord >::slc, and caf::Proxy< caf::StandardRecord >::vtx.

387  {
388  if(!fReaderBDT3) InitTMVA();
389 
390  if(!sr->vtx.elastic.IsValid) return -5.f;
391  if(sr->vtx.elastic.fuzzyk.npng == 0) return -5.f;
392  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return -5.f;
393  std::cout << "ERROR::GetNCCosRejP3_5. Looking for cvn2017. Branch no longer exists." << std::endl;
394  abort();
395  //if(sr->sel.cvn2017.noutput == 0) return -5.f; // Karl::Deleted branch
396  if(std::isnan(1.*sr->sel.nuecosrej.partptp) ||
397  std::isinf(1.*sr->sel.nuecosrej.partptp)) return -5.f;
398  //cosmicid = sr->sel.cvn2017.output[14]; // Karl::Deleted branch
400  shwnhit = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhit;
401  shwnhitx = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx;
402  shwnhity = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;
406  shwcalE = sr->vtx.elastic.fuzzyk.png[0].shwlid.calE;
407  shwdirY = sr->vtx.elastic.fuzzyk.png[0].shwlid.dir.y;
408  shwlen = sr->vtx.elastic.fuzzyk.png[0].shwlid.len;
409  shwwidth = sr->vtx.elastic.fuzzyk.png[0].shwlid.width;
410  shwGap = sr->vtx.elastic.fuzzyk.png[0].shwlid.gap;
412  nmiphit = sr->slc.nmiphit;
413 
414  TMVAvars[0] = cosmicid; // ncid
415  TMVAvars[1] = partptp; // partptp
416  TMVAvars[2] = shwnhit; // shwnhit;
417  TMVAvars[3] = shwxminusy; // shwnhitx - shwnhity
418  TMVAvars[4] = shwxplusy; // shnhitx + shwnhity
419  TMVAvars[5] = shwxovery; // shwxminusy/shwxplusy
420  TMVAvars[6] = shwcalE; // shwcalE
421  TMVAvars[7] = shwdirY; // shwdirY
422  TMVAvars[8] = shwlen; // shwlen
423  TMVAvars[9] = shwwidth; // shwwidth
424  TMVAvars[10] = shwGap; // shwgap
425  TMVAvars[11] = nshwlid; // nshwlid
426  TMVAvars[12] = nmiphit; // nmiphit;
427 
428  ncid = fReaderBDT3->EvaluateMVA("BDT");
429  memset(TMVAvars, 0, sizeof(TMVAvars));
430  return ncid;
431 
432  }
float nshwlid
caf::Proxy< size_t > npng
Definition: SRProxy.h:2038
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2040
Definition: FillPIDs.h:18
int isinf(const stan::math::var &a)
Definition: std_isinf.hpp:16
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
float partptp
Definition: NusVarsTemp.cxx:50
float shwwidth
float shwnhity
float shwGap
static TMVA::Reader * fReaderBDT3
float shwxplusy
float shwnhitx
float shwcalE
int isnan(const stan::math::var &a)
Definition: std_isnan.hpp:18
float cosmicid
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
caf::Proxy< caf::SRNueCosRej > nuecosrej
Definition: SRProxy.h:1265
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
float shwlen
float nmiphit
caf::Proxy< unsigned int > nmiphit
Definition: SRProxy.h:1316
static float TMVAvars[4]
Definition: NDNCPi0Xsec.cxx:10
void InitTMVA() const
caf::Proxy< float > partptp
Definition: SRProxy.h:1057
float shwdirY
OStream cout
Definition: OStream.cxx:6
float ncid
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2058
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2142
float shwxovery
float shwxminusy
float shwnhit
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2141
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146

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