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

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

Public Member Functions

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

Protected Member Functions

void InitTMVA () const
 

Detailed Description

Definition at line 34 of file NusVarsTemp.h.

Constructor & Destructor Documentation

ana::GetNCCosRejG::GetNCCosRejG ( )
inline

Member Function Documentation

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

Definition at line 541 of file NusVarsTemp.cxx.

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

542  {
543  if(!fReaderGBDT) fReaderGBDT = new TMVA::Reader;
544 
545  const char* libpath = getenv("NCID_LIB_PATH");
546  assert(libpath);
547  std::string pidlib = std::string(libpath)+"/NCCosRejPID_BDTG_nus.weights.xml";
548 
549  fReaderGBDT->AddVariable("cosmicid", &TMVAGvars[0]); //cosmicid
550  fReaderGBDT->AddVariable("partptp", &TMVAGvars[1]); //partptp
551  fReaderGBDT->AddVariable("shwnhit", &TMVAGvars[2]); //shwnhit
552  fReaderGBDT->AddVariable("shwxminusy", &TMVAGvars[3]); //shwminusy
553  fReaderGBDT->AddVariable("shwxplusy", &TMVAGvars[4]); //shwxplusy
554  fReaderGBDT->AddVariable("shwxovery", &TMVAGvars[5]); //shwxpvery
555  fReaderGBDT->AddVariable("shwcalE", &TMVAGvars[6]); //shwcalE
556  fReaderGBDT->AddVariable("shwdirY", &TMVAGvars[7]); //shwdirY
557  fReaderGBDT->AddVariable("shwlen", &TMVAGvars[8]); //shwlen
558  fReaderGBDT->AddVariable("shwwwidth", &TMVAGvars[9]); //shwwwidth
559  fReaderGBDT->AddVariable("shwGap", &TMVAGvars[10]); //shwGap
560  fReaderGBDT->AddVariable("nshwlid", &TMVAGvars[11]); //nshwlid
561  fReaderGBDT->AddVariable("nmiphit", &TMVAGvars[12]); //nmiphit
562  fReaderGBDT->BookMVA("BDTG", pidlib);
563  }
static TMVA::Reader * fReaderGBDT
std::string getenv(std::string const &name)
assert(nhit_max >=nhit_nbins)
float TMVAGvars[13]
enum BeamMode string
float ana::GetNCCosRejG::operator() ( const caf::SRProxy sr) const

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

193  {
194  if(!fReaderGBDT) InitTMVA();
195 
196  float ncid;
197  if(!sr->vtx.elastic.IsValid) return -5.f;
198  if(sr->vtx.elastic.fuzzyk.npng == 0) return -5.f;
199  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return -5.f;
200  std::cout << "ERROR::GetNCCosRejG. Looking for cvn2017. Branch no longer exists." << std::endl;
201  abort();
202  //if(sr->sel.cvn2017.noutput == 0) return -5.f; // Karl::Deleted branch
203  if(std::isnan(1.*sr->sel.nuecosrej.partptp) ||
204  std::isinf(1.*sr->sel.nuecosrej.partptp)) return -5.f;
205  //cosmicid = sr->sel.cvn2017.output[14]; // Karl::Deleted branch
207  shwnhit = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhit;
208  shwnhitx = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx;
209  shwnhity = (float)sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;
213  shwcalE = sr->vtx.elastic.fuzzyk.png[0].shwlid.calE;
214  shwdirY = sr->vtx.elastic.fuzzyk.png[0].shwlid.dir.y;
215  shwlen = sr->vtx.elastic.fuzzyk.png[0].shwlid.len;
216  shwwidth = sr->vtx.elastic.fuzzyk.png[0].shwlid.width;
217  shwGap = sr->vtx.elastic.fuzzyk.png[0].shwlid.gap;
219  nmiphit = sr->slc.nmiphit;
220 
221  TMVAGvars[0] = cosmicid; // ncid
222  TMVAGvars[1] = partptp; // partptp
223  TMVAGvars[2] = shwnhit; // shwnhit;
224  TMVAGvars[3] = shwxminusy; // shwnhitx - shwnhity
225  TMVAGvars[4] = shwxplusy; // shnhitx + shwnhity
226  TMVAGvars[5] = shwxovery; // shwxminusy/shwxplusy
227  TMVAGvars[6] = shwcalE; // shwcalE
228  TMVAGvars[7] = shwdirY; // shwdirY
229  TMVAGvars[8] = shwlen; // shwlen
230  TMVAGvars[9] = shwwidth; // shwwidth
231  TMVAGvars[10] = shwGap; // shwgap
232  TMVAGvars[11] = nshwlid; // nshwlid
233  TMVAGvars[12] = nmiphit; // nmiphit;
234 
235  ncid = fReaderGBDT->EvaluateMVA("BDTG");
236 
237  return ncid;
238 
239  }
float nshwlid
caf::Proxy< size_t > npng
Definition: SRProxy.h:2038
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2040
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
static TMVA::Reader * fReaderGBDT
float shwwidth
float shwnhity
float shwGap
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
caf::Proxy< float > partptp
Definition: SRProxy.h:1057
void InitTMVA() const
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
float TMVAGvars[13]

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