LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
mvapid::MVAAlg::SumDistance2 Struct Reference

#include "MVAAlg.h"

Public Member Functions

 SumDistance2 (TGraph2D *g)
 
double operator() (const double *p)
 

Public Attributes

TGraph2D * fGraph
 

Detailed Description

Definition at line 52 of file MVAAlg.h.

Constructor & Destructor Documentation

mvapid::MVAAlg::SumDistance2::SumDistance2 ( TGraph2D *  g)
inline

Definition at line 56 of file MVAAlg.h.

56 : fGraph(g) {}

Member Function Documentation

double mvapid::MVAAlg::SumDistance2::operator() ( const double *  p)
inline

Definition at line 59 of file MVAAlg.h.

References util::end(), tca::evt, hits(), sum, track, lar::dump::vector(), x, y, and z.

60  {
61 
62  ROOT::Math::XYZVector x0(p[0], p[2], p[4]);
63  ROOT::Math::XYZVector u(p[1], p[3], p[5]);
64 
65  u = u.Unit();
66  double* x = fGraph->GetX();
67  double* y = fGraph->GetY();
68  double* z = fGraph->GetZ();
69  int npoints = fGraph->GetN();
70  double sum = 0;
71  for (int i = 0; i < npoints; ++i) {
72  ROOT::Math::XYZVector xp(x[i], y[i], z[i]);
73  sum += ((xp - x0).Cross(u)).Mag2();
74  }
75  return sum;
76  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Double_t sum
Definition: plot.C:31

Member Data Documentation

TGraph2D* mvapid::MVAAlg::SumDistance2::fGraph

Definition at line 54 of file MVAAlg.h.


The documentation for this struct was generated from the following file: