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