BOSS 8.0.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
24#include "EvtVector4R.hh"
25#include <string>
26#include <vector>
27
28using std::string;
29using std::vector;
30
31class EvtComplex;
32
33// Helper class
35 double real;
36 double imag;
37 ControlPoint( double r = 0, double i = 0. ) {
38 real = r;
39 imag = i;
40 }
41};
42
43// class declaration
44
46public:
47 static int _nPoints;
48 static vector<double> _mHHLimits;
49 static vector<ControlPoint> _yvalues;
50 static vector<ControlPoint> _y2values;
51 static void setParams( const vector<double> x, const vector<double> ym,
52 const vector<double> yp );
53 static void setParams( const int n, const double* x, const double* ym, const double* yp );
54 // static void setParamsFromFile(const string swaveparfile, const double scale = 1.);
55
56 // operator
58
59 // constructor with all information about the resonance
61 const EvtVector4R& p4_d2 );
62
63 // destructor
64 virtual ~EvtCubicSpline();
65
66 // accessors
67 // return 4-momenta of the particles involved
68 inline const EvtVector4R& p4_p() { return _p4_p; }
69 inline const EvtVector4R& p4_d1() { return _p4_d1; }
70 inline const EvtVector4R& p4_d2() { return _p4_d2; }
71
72 // return amplitude
73 inline double amplitude() { return _ampl; }
74
75 // return theta
76 inline double theta() { return _theta; }
77
78 // functions
79
80 // calculate amplitude for this resonance
82
83 inline static void fprime( const vector<double>& x, const vector<ControlPoint>& y,
84 const int n, ControlPoint& yp2 ) {
85 double s1 = x[n - 1] - x[n - 2], s2 = x[n - 1] - x[n - 3], s3 = x[n - 1] - x[n - 4],
86 s12 = s1 - s2, s13 = s1 - s3, s23 = s2 - s3;
87 yp2.real = -( s1 * s2 / ( s13 * s23 * s3 ) ) * y[n - 4].real +
88 ( s1 * s3 / ( s12 * s2 * s23 ) ) * y[n - 3].real -
89 ( s2 * s3 / ( s1 * s12 * s13 ) ) * y[n - 2].real +
90 ( 1. / s1 + 1. / s2 + 1. / s3 ) * y[n - 1].real;
91 yp2.imag = -( s1 * s2 / ( s13 * s23 * s3 ) ) * y[n - 4].imag +
92 ( s1 * s3 / ( s12 * s2 * s23 ) ) * y[n - 3].imag -
93 ( s2 * s3 / ( s1 * s12 * s13 ) ) * y[n - 2].imag +
94 ( 1. / s1 + 1. / s2 + 1. / s3 ) * y[n - 1].imag;
95 }
96 inline static void fprime( const vector<double>& x, const vector<ControlPoint>& y,
97 ControlPoint& yp2 ) {
98 double s1 = x[0] - x[1], s2 = x[0] - x[2], s3 = x[0] - x[3], s12 = s1 - s2, s13 = s1 - s3,
99 s23 = s2 - s3;
100
101 yp2.real = -( s1 * s2 / ( s13 * s23 * s3 ) ) * y[3].real +
102 ( s1 * s3 / ( s12 * s2 * s23 ) ) * y[2].real -
103 ( s2 * s3 / ( s1 * s12 * s13 ) ) * y[1].real +
104 ( 1. / s1 + 1. / s2 + 1. / s3 ) * y[0].real;
105 yp2.imag = -( s1 * s2 / ( s13 * s23 * s3 ) ) * y[3].imag +
106 ( s1 * s3 / ( s12 * s2 * s23 ) ) * y[2].imag -
107 ( s2 * s3 / ( s1 * s12 * s13 ) ) * y[1].imag +
108 ( 1. / s1 + 1. / s2 + 1. / s3 ) * y[0].imag;
109 }
110 static int find_bin( double mass1, const vector<double>& x, const int n ) {
111 int mhi = 0;
112 for ( ; mhi < n; )
113 {
114 if ( mass1 < x[mhi] ) break;
115 mhi++;
116 }
117 return mhi == 0 ? 1 : ( mhi == n ? n - 1 : mhi );
118 }
119 static bool Complex_Derivative( const vector<double>& x, const vector<ControlPoint>& y,
120 const int n, vector<ControlPoint>& y2 );
121
122private:
123 EvtVector4R _p4_p, _p4_d1, _p4_d2;
124 double _ampl, _theta;
125
126 // double _m1a, _m1b, _g1;
127 // double _m2a, _m2b, _g2;
128};
129
130#endif
const Int_t n
double imag(const EvtComplex &c)
static vector< ControlPoint > _yvalues
static vector< double > _mHHLimits
static int find_bin(double mass1, const vector< double > &x, const int n)
EvtCubicSpline(const EvtVector4R &p4_p, const EvtVector4R &p4_d1, const EvtVector4R &p4_d2)
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)
ControlPoint(double r=0, double i=0.)