21 #include<TLorentzVector.h>
25 #ifndef PACKAGE_SUTOOL_H_INCLUDED
26 #define PACKAGE_SUTOOL_H_INCLUDED
43 void nextline(std::ifstream& infile)
47 do { infile.get(s) ; }
while (s !=
'\n');
50 double p2bdy(
double,
double,
double,
int&);
51 int pdecy(
double,
double*,
const TVector3&, TLorentzVector*,
int);
52 void rotate(TLorentzVector&,
double,
double);
53 float interp(
float,
float,
float,
float,
float);
61 Interps(
double x1,
double x2,
int nd,
double* yd)
64 ndiv = nd; ydata = yd;
70 double get_val(
double x)
72 double rn = (x - xmin) / (xmax - xmin) * (double)ndiv;
74 if (irn <= 0) irn = 1;
75 else if (irn >= (ndiv - 1)) irn = ndiv - 2;
77 double x1 = interp(&ydata[irn - 1],
rn - (
double)irn);
81 void change(
double x1,
double x2,
int nd,
double* yd)
84 ndiv = nd; ydata = yd;
88 int check_xrange(
double x)
90 if (x < xmin)
return -1 ;
91 else if (x > xmax)
return 1;
97 double interp(
double* y,
double x)
100 double a = y[1] - y[0];
101 double b = y[2] - y[1];
102 double c = y[3] - y[2];
107 double b2 = 0.25 * x * (x - 1.);
108 double b3 = 2. / 3.*b2 * (x - 0.5);
110 return y[1] + x * b + b2 * (d + e) + b3 * f;
TString rn()
Get random string.
Abstract base class for different kinds of events.