CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtMHelAmp.cc
Go to the documentation of this file.
4#include <cstdlib>
5
6using std::endl;
7
8EvtMHelAmp::EvtMHelAmp( const EvtId& id, EvtMLineShape * lineshape,
9 const vector<EvtMNode* >& children, const vector<EvtComplex>& elem )
10{
11 _id = id;
13 _parent = NULL;
14 _lineshape = lineshape;
15
16 _elem = elem;
17
18 vector<EvtSpinType::spintype> type;
19 for( int i=0; i<children.size(); ++i ) {
20 _children.push_back( children[i] );
21 type.push_back( children[i]->getspintype() );
22 const vector<int> &res = children[i]->getresonance();
23 for( int j=0; j<res.size(); ++j )
24 _resonance.push_back( res[j] );
25 children[i]->setparent( this );
26 }
27
28 // XXX New code - bugs could appear here XXX
29 _amp = EvtSpinAmp( type );
30 vector<int> index = _amp.iterinit();
31 int i = 0;
32 do {
33 if( !_amp.allowed(index) )
34 _amp( index ) = 0.0;
35 else if( abs(index[0] - index[1]) > _twospin )
36 _amp( index ) = 0.0;
37 else {
38 _amp( index ) = elem[i];
39 ++i;
40 }
41 } while( _amp.iterate( index ) );
42 if(elem.size() != i) {
43 report(ERROR,"EvtGen")
44 <<"Wrong number of elements input in helicity amplitude."<<endl;
45 ::abort();
46 }
47
48 if( children.size() > 2 ) {
49 report(ERROR,"EvtGen")
50 <<"Helicity amplitude formalism can only handle two body resonances"
51 <<endl;
52 ::abort();
53 }
54}
55
56EvtSpinAmp EvtMHelAmp::amplitude( const vector<EvtVector4R> &
57 product ) const
58{
59 EvtVector4R d = _children[0]->get4vector(product);
60 double phi, theta;
61
62 if( _parent == NULL ) {
63
64 // This means that we're calculating the first level and we need to just
65 // calculate the polar and azymuthal angles daughters in rest frame of
66 // this (root) particle (this is automatic).
67 phi = atan2( d.get(1), d.get(2) );
68 theta = acos( d.get(3)/d.d3mag() );
69
70 } else {
71
72 // We have parents therefore calculate things in correct coordinate
73 // system
74 EvtVector4R p = _parent->get4vector(product);
75 EvtVector4R q = get4vector(product);
76
77 // See if we have a grandparent - if no then the z-axis is defined by
78 // the z-axis of the root particle
79 EvtVector4R g = _parent->getparent()==NULL ?
80 EvtVector4R(0.0, 0.0, 0.0, 1.0) :
81 _parent->getparent()->get4vector(product);
82
83 theta = acos(EvtDecayAngle(p, q, d));
84 phi = EvtDecayAnglePhi( g, p, q, d );
85
86 }
87
88 vector<EvtSpinType::spintype> types( 3 );
89 types[0] = getspintype();
90 types[1] = _children[0]->getspintype();
91 types[2] = _children[1]->getspintype();
92 EvtSpinAmp amp( types, EvtComplex(0.0, 0.0) );
93 vector<int> index = amp.iterallowedinit();
94
95 do {
96 if( abs(index[1]-index[2]) > _twospin ) continue;
97 amp(index) +=
98 conj(wignerD(_twospin,index[0],index[1]-index[2],phi,theta,0.0)) *
99 _amp(index[1],index[2]);
100 } while(amp.iterateallowed(index));
101
102 EvtSpinAmp amp0 = _children[0]->amplitude(product);
103 EvtSpinAmp amp1 = _children[1]->amplitude(product);
104
105 amp.extcont( amp0, 1, 0 );
106 amp.extcont( amp1, 1, 0 );
107
108 amp *= sqrt( ( _twospin + 1 ) / ( 2 * EvtConst::twoPi ) ) *
109 _children[0]->line(product) * _children[1]->line(product);
110
111 return amp;
112}
113
115{
116 vector<EvtMNode *> children;
117
118 for( int i=0; i<_children.size(); ++i ) {
119 children.push_back( _children[i]->duplicate() );
120 }
121
122 EvtMLineShape * lineshape = _lineshape->duplicate();
123 EvtMHelAmp * ret = new EvtMHelAmp( _id, lineshape, children, _elem );
124 lineshape->setres( ret );
125
126 return ret;
127}
Evt3Rank3C conj(const Evt3Rank3C &t2)
double abs(const EvtComplex &c)
double EvtDecayAnglePhi(const EvtVector4R &z, const EvtVector4R &p, const EvtVector4R &q, const EvtVector4R &d)
Definition EvtKine.cc:111
double EvtDecayAngle(const EvtVector4R &p, const EvtVector4R &q, const EvtVector4R &d)
Definition EvtKine.cc:33
EvtComplex wignerD(int j, int m1, int m2, double phi, double theta, double gamma)
Definition EvtKine.cc:132
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:36
@ ERROR
Definition EvtReport.hh:49
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition KKsem.h:33
static const double twoPi
Definition EvtConst.hh:29
Definition EvtId.hh:27
EvtSpinAmp amplitude(const vector< EvtVector4R > &product) const
Definition EvtMHelAmp.cc:56
EvtMNode * duplicate() const
EvtMHelAmp(const EvtId &id, EvtMLineShape *, const vector< EvtMNode * > &, const vector< EvtComplex > &)
Definition EvtMHelAmp.cc:8
void setres(EvtMRes *n)
Definition EvtMRes.hh:14
virtual EvtMLineShape * duplicate() const =0
int _twospin
Definition EvtMNode.hh:61
EvtVector4R get4vector(const vector< EvtVector4R > &product) const
Definition EvtMNode.cc:4
EvtId _id
Definition EvtMNode.hh:58
EvtMNode * getparent() const
Definition EvtMNode.hh:44
vector< int > _resonance
Definition EvtMNode.hh:65
EvtMNode * _parent
Definition EvtMNode.hh:68
EvtSpinType::spintype getspintype() const
Definition EvtMNode.hh:35
EvtSpinAmp _amp
Definition EvtMRes.hh:42
vector< EvtMNode * > _children
Definition EvtMRes.hh:39
EvtMLineShape * _lineshape
Definition EvtMRes.hh:45
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:61
vector< int > iterinit() const
bool iterate(vector< int > &index) const
bool iterateallowed(vector< int > &index) const
vector< int > iterallowedinit() const
bool allowed(const vector< int > &index) const
void extcont(const EvtSpinAmp &, int, int)
static int getSpin2(spintype stype)
double get(int i) const
double d3mag() const