BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtCubicSpline.hh
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtGen/EvtCubicSpline.hh
12//
13// Description:resonance-defining class
14//
15// Modification history:
16//
17// ponyisi 18 Feb 2008 created
18//
19//------------------------------------------------------------------------
20
21#ifndef EVTCUBICSPLINE_HH
22#define EVTCUBICSPLINE_HH
23
25#include <vector>
26#include <string>
27
28using std::vector;
29using std::string;
30
31class EvtComplex;
32
33// Helper class
35 double real;
36 double imag;
37 ControlPoint(double r=0, double i=0.) { real = r; imag = i; }
38};
39
40//class declaration
41
43public:
44
45 static int _nPoints;
46 static vector<double> _mHHLimits;
47 static vector<ControlPoint> _yvalues;
48 static vector<ControlPoint> _y2values;
49 static void setParams(const vector<double> x, const vector<double> ym, const vector<double> yp);
50 static void setParams(const int n, const double* x, const double* ym, const double* yp);
51// static void setParamsFromFile(const string swaveparfile, const double scale = 1.);
52
53 //operator
55
56 //constructor with all information about the resonance
58 const EvtVector4R& p4_d2);
59
60 //destructor
61 virtual ~EvtCubicSpline();
62
63 //accessors
64 //return 4-momenta of the particles involved
65 inline const EvtVector4R& p4_p() { return _p4_p; }
66 inline const EvtVector4R& p4_d1() { return _p4_d1; }
67 inline const EvtVector4R& p4_d2() { return _p4_d2; }
68
69
70 //return amplitude
71 inline double amplitude() { return _ampl; }
72
73 //return theta
74 inline double theta() { return _theta; }
75
76 //functions
77
78 //calculate amplitude for this resonance
80
81 inline static void fprime(const vector<double>& x, const vector<ControlPoint>& y, const int n, ControlPoint &yp2){
82 double s1 = x[n-1] - x[n-2],
83 s2 = x[n-1] - x[n-3],
84 s3 = x[n-1] - x[n-4],
85 s12 = s1-s2,
86 s13 = s1-s3,
87 s23 = s2-s3;
88 yp2.real = -( s1*s2/( s13*s23*s3 ) )*y[n-4].real+( s1*s3/( s12*s2*s23 ) )*y[n-3].real
89 -( s2*s3/( s1*s12*s13 ) )*y[n-2].real+( 1./s1+1./s2+1./s3 )*y[n-1].real;
90 yp2.imag = -( s1*s2/( s13*s23*s3 ) )*y[n-4].imag+( s1*s3/( s12*s2*s23 ) )*y[n-3].imag
91 -( s2*s3/( s1*s12*s13 ) )*y[n-2].imag+( 1./s1+1./s2+1./s3 )*y[n-1].imag;
92 }
93 inline static void fprime(const vector<double>& x, const vector<ControlPoint>& y, ControlPoint &yp2){
94 double s1 = x[0]-x[1],
95 s2 = x[0]-x[2],
96 s3 = x[0]-x[3],
97 s12 = s1-s2,
98 s13 = s1-s3,
99 s23 = s2-s3;
100
101 yp2.real = -( s1*s2/( s13*s23*s3 ) )*y[3].real+( s1*s3/( s12*s2*s23 ) )*y[2].real
102 -( s2*s3/( s1*s12*s13 ) )*y[1].real+( 1./s1+1./s2+1./s3 )*y[0].real;
103 yp2.imag = -( s1*s2/( s13*s23*s3 ) )*y[3].imag+( s1*s3/( s12*s2*s23 ) )*y[2].imag
104 -( s2*s3/( s1*s12*s13 ) )*y[1].imag+( 1./s1+1./s2+1./s3 )*y[0].imag;
105 }
106 static int find_bin(double mass1, const vector<double>& x, const int n){
107 int mhi = 0;
108 for (;mhi<n;){
109 if (mass1<x[mhi]) break;
110 mhi++;
111 }
112 return mhi==0?1:(mhi==n?n-1:mhi);
113 }
114 static bool Complex_Derivative(const vector<double>& x, const vector<ControlPoint>& y, const int n, vector<ControlPoint> &y2);
115
116private:
117
118 EvtVector4R _p4_p, _p4_d1, _p4_d2;
119 double _ampl, _theta;
120
121 // double _m1a, _m1b, _g1;
122 // double _m2a, _m2b, _g2;
123};
124
125#endif
126
const Int_t n
Double_t x[10]
double imag(const EvtComplex &c)
Definition: EvtComplex.hh:246
static vector< ControlPoint > _yvalues
double amplitude()
static vector< double > _mHHLimits
static int find_bin(double mass1, const vector< double > &x, const int n)
virtual ~EvtCubicSpline()
EvtCubicSpline & operator=(const EvtCubicSpline &)
EvtComplex resAmpl()
const EvtVector4R & p4_p()
static vector< ControlPoint > _y2values
static void setParams(const vector< double > x, const vector< double > ym, const vector< double > yp)
static int _nPoints
const EvtVector4R & p4_d2()
static bool Complex_Derivative(const vector< double > &x, const vector< ControlPoint > &y, const int n, vector< ControlPoint > &y2)
static void fprime(const vector< double > &x, const vector< ControlPoint > &y, const int n, ControlPoint &yp2)
const EvtVector4R & p4_d1()
static void fprime(const vector< double > &x, const vector< ControlPoint > &y, ControlPoint &yp2)
double y[1000]
double double double double * s12
Definition: qcdloop1.h:77
double double double double double * s23
Definition: qcdloop1.h:77
ControlPoint(double r=0, double i=0.)