Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VtxRegressor.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file VtxRegressor.C
1 #include "VtxRegressor.h"
3 using namespace TMVA;
4 
6  reader = new Reader();
7  reader->AddVariable("track1_pt",&pt1);
8  reader->AddVariable("track2_pt",&pt2);
9  reader->AddVariable("track1_phi",&phi);
10  reader->AddVariable("track1_phi-track2_phi",&dphi);
11  reader->AddVariable("track1_eta",&eta);
12  reader->AddVariable("track1_eta-track2_eta",&deta);
13  reader->AddVariable("vtx_radius",&rin);
14  reader->BookMVA(methodname.c_str(),pathname.c_str());
15  _method=methodname;
16 }
17 
19  if (reader) delete reader;
20  reader=NULL;
21 }
23  pt1=reco1->get_pt();
24  pt2=reco2->get_pt();
25  phi=reco1->get_phi();
26  dphi=reco1->get_phi()-reco2->get_phi();
27  eta=reco1->get_eta();
28  deta=reco1->get_eta()-reco2->get_eta();
29  rin=recoVertex->getPos().Perp();
30  return reader->EvaluateRegression(_method.c_str())[0];
31 }