#include <EvtMHelAmp.hh>
Inheritance diagram for EvtMHelAmp:
Public Member Functions | |
EvtMHelAmp (const EvtId &id, EvtMLineShape *, const vector< EvtMNode * > &, const vector< EvtComplex > &) | |
virtual | ~EvtMHelAmp () |
EvtSpinAmp | amplitude (const vector< EvtVector4R > &product) const |
EvtMNode * | duplicate () const |
int | getnchild () const |
virtual EvtComplex | line (const vector< EvtVector4R > &product) const |
EvtVector4R | get4vector (const vector< EvtVector4R > &product) const |
int | getspin () const |
EvtSpinType::spintype | getspintype () const |
EvtId | getid () const |
const vector< int > & | getresonance () const |
void | setparent (EvtMNode *parent) |
EvtMNode * | getparent () const |
Protected Attributes | |
vector< EvtMNode * > | _children |
EvtSpinAmp | _amp |
EvtMLineShape * | _lineshape |
EvtId | _id |
int | _twospin |
vector< int > | _resonance |
EvtMNode * | _parent |
Private Attributes | |
vector< EvtComplex > | _elem |
Definition at line 6 of file EvtMHelAmp.hh.
EvtMHelAmp::EvtMHelAmp | ( | const EvtId & | id, | |
EvtMLineShape * | , | |||
const vector< EvtMNode * > & | , | |||
const vector< EvtComplex > & | ||||
) |
Definition at line 8 of file EvtMHelAmp.cc.
References EvtMRes::_amp, EvtMRes::_children, _elem, EvtMNode::_id, EvtMRes::_lineshape, EvtMNode::_parent, EvtMNode::_resonance, EvtMNode::_twospin, abs, EvtSpinAmp::allowed(), calibUtil::ERROR, EvtSpinType::getSpin2(), EvtMNode::getspintype(), EvtPDL::getSpinType(), genRecEmupikp::i, EvtSpinAmp::iterate(), EvtSpinAmp::iterinit(), ganga-rec::j, report(), and type.
Referenced by duplicate().
00010 { 00011 _id = id; 00012 _twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) ); 00013 _parent = NULL; 00014 _lineshape = lineshape; 00015 00016 _elem = elem; 00017 00018 vector<EvtSpinType::spintype> type; 00019 for( int i=0; i<children.size(); ++i ) { 00020 _children.push_back( children[i] ); 00021 type.push_back( children[i]->getspintype() ); 00022 const vector<int> &res = children[i]->getresonance(); 00023 for( int j=0; j<res.size(); ++j ) 00024 _resonance.push_back( res[j] ); 00025 children[i]->setparent( this ); 00026 } 00027 00028 // XXX New code - bugs could appear here XXX 00029 _amp = EvtSpinAmp( type ); 00030 vector<int> index = _amp.iterinit(); 00031 int i = 0; 00032 do { 00033 if( !_amp.allowed(index) ) 00034 _amp( index ) = 0.0; 00035 else if( abs(index[0] - index[1]) > _twospin ) 00036 _amp( index ) = 0.0; 00037 else { 00038 _amp( index ) = elem[i]; 00039 ++i; 00040 } 00041 } while( _amp.iterate( index ) ); 00042 if(elem.size() != i) { 00043 report(ERROR,"EvtGen") 00044 <<"Wrong number of elements input in helicity amplitude."<<endl; 00045 ::abort(); 00046 } 00047 00048 if( children.size() > 2 ) { 00049 report(ERROR,"EvtGen") 00050 <<"Helicity amplitude formalism can only handle two body resonances" 00051 <<endl; 00052 ::abort(); 00053 } 00054 }
virtual EvtMHelAmp::~EvtMHelAmp | ( | ) | [inline, virtual] |
EvtSpinAmp EvtMHelAmp::amplitude | ( | const vector< EvtVector4R > & | product | ) | const [virtual] |
Implements EvtMNode.
Definition at line 56 of file EvtMHelAmp.cc.
References EvtMRes::_amp, EvtMRes::_children, EvtMNode::_parent, EvtMNode::_twospin, abs, conj(), EvtVector4R::d3mag(), EvtDecayAngle(), EvtDecayAnglePhi(), EvtSpinAmp::extcont(), EvtVector4R::get(), EvtMNode::get4vector(), EvtMNode::getparent(), EvtMNode::getspintype(), EvtSpinAmp::iterallowedinit(), EvtSpinAmp::iterateallowed(), q, EvtConst::twoPi, and wignerD().
00058 { 00059 EvtVector4R d = _children[0]->get4vector(product); 00060 double phi, theta; 00061 00062 if( _parent == NULL ) { 00063 00064 // This means that we're calculating the first level and we need to just 00065 // calculate the polar and azymuthal angles daughters in rest frame of 00066 // this (root) particle (this is automatic). 00067 phi = atan2( d.get(1), d.get(2) ); 00068 theta = acos( d.get(3)/d.d3mag() ); 00069 00070 } else { 00071 00072 // We have parents therefore calculate things in correct coordinate 00073 // system 00074 EvtVector4R p = _parent->get4vector(product); 00075 EvtVector4R q = get4vector(product); 00076 00077 // See if we have a grandparent - if no then the z-axis is defined by 00078 // the z-axis of the root particle 00079 EvtVector4R g = _parent->getparent()==NULL ? 00080 EvtVector4R(0.0, 0.0, 0.0, 1.0) : 00081 _parent->getparent()->get4vector(product); 00082 00083 theta = acos(EvtDecayAngle(p, q, d)); 00084 phi = EvtDecayAnglePhi( g, p, q, d ); 00085 00086 } 00087 00088 vector<EvtSpinType::spintype> types( 3 ); 00089 types[0] = getspintype(); 00090 types[1] = _children[0]->getspintype(); 00091 types[2] = _children[1]->getspintype(); 00092 EvtSpinAmp amp( types, EvtComplex(0.0, 0.0) ); 00093 vector<int> index = amp.iterallowedinit(); 00094 00095 do { 00096 if( abs(index[1]-index[2]) > _twospin ) continue; 00097 amp(index) += 00098 conj(wignerD(_twospin,index[0],index[1]-index[2],phi,theta,0.0)) * 00099 _amp(index[1],index[2]); 00100 } while(amp.iterateallowed(index)); 00101 00102 EvtSpinAmp amp0 = _children[0]->amplitude(product); 00103 EvtSpinAmp amp1 = _children[1]->amplitude(product); 00104 00105 amp.extcont( amp0, 1, 0 ); 00106 amp.extcont( amp1, 1, 0 ); 00107 00108 amp *= sqrt( ( _twospin + 1 ) / ( 2 * EvtConst::twoPi ) ) * 00109 _children[0]->line(product) * _children[1]->line(product); 00110 00111 return amp; 00112 }
EvtMNode * EvtMHelAmp::duplicate | ( | ) | const [virtual] |
Implements EvtMNode.
Definition at line 114 of file EvtMHelAmp.cc.
References EvtMRes::_children, _elem, EvtMNode::_id, EvtMRes::_lineshape, EvtMLineShape::duplicate(), EvtMHelAmp(), genRecEmupikp::i, and EvtMLineShape::setres().
00115 { 00116 vector<EvtMNode *> children; 00117 00118 for( int i=0; i<_children.size(); ++i ) { 00119 children.push_back( _children[i]->duplicate() ); 00120 } 00121 00122 EvtMLineShape * lineshape = _lineshape->duplicate(); 00123 EvtMHelAmp * ret = new EvtMHelAmp( _id, lineshape, children, _elem ); 00124 lineshape->setres( ret ); 00125 00126 return ret; 00127 }
EvtVector4R EvtMNode::get4vector | ( | const vector< EvtVector4R > & | product | ) | const [inherited] |
Definition at line 4 of file EvtMNode.cc.
References EvtMNode::_resonance, and iter().
Referenced by amplitude(), and EvtMBreitWigner::shape().
00006 { 00007 00008 EvtVector4R res(0.0, 0.0, 0.0, 0.0); 00009 vector<int>::const_iterator iter; 00010 00011 for( iter = _resonance.begin(); iter != _resonance.end(); ++iter ) 00012 res += product[ *iter ]; 00013 00014 return res; 00015 00016 }
EvtId EvtMNode::getid | ( | ) | const [inline, inherited] |
int EvtMRes::getnchild | ( | ) | const [inline, virtual, inherited] |
Implements EvtMNode.
Definition at line 31 of file EvtMRes.hh.
References EvtMRes::_children.
00031 { return _children.size(); }
EvtMNode* EvtMNode::getparent | ( | ) | const [inline, inherited] |
Definition at line 44 of file EvtMNode.hh.
References EvtMNode::_parent.
Referenced by amplitude().
00044 { return _parent; }
const vector<int>& EvtMNode::getresonance | ( | ) | const [inline, inherited] |
Definition at line 41 of file EvtMNode.hh.
References EvtMNode::_resonance.
00041 { return _resonance; }
int EvtMNode::getspin | ( | ) | const [inline, inherited] |
EvtSpinType::spintype EvtMNode::getspintype | ( | ) | const [inline, inherited] |
Definition at line 35 of file EvtMNode.hh.
References EvtMNode::_id, and EvtPDL::getSpinType().
Referenced by EvtMParticle::amplitude(), amplitude(), and EvtMHelAmp().
00035 { return EvtPDL::getSpinType( _id ); }
virtual EvtComplex EvtMRes::line | ( | const vector< EvtVector4R > & | product | ) | const [inline, virtual, inherited] |
Implements EvtMNode.
Definition at line 33 of file EvtMRes.hh.
References EvtMRes::_lineshape, and EvtMLineShape::shape().
00034 { return _lineshape->shape( product ); }
void EvtMNode::setparent | ( | EvtMNode * | parent | ) | [inline, inherited] |
EvtSpinAmp EvtMRes::_amp [protected, inherited] |
vector<EvtMNode *> EvtMRes::_children [protected, inherited] |
Definition at line 39 of file EvtMRes.hh.
Referenced by amplitude(), duplicate(), EvtMHelAmp(), and EvtMRes::getnchild().
vector<EvtComplex> EvtMHelAmp::_elem [private] |
EvtId EvtMNode::_id [protected, inherited] |
Definition at line 58 of file EvtMNode.hh.
Referenced by EvtMParticle::duplicate(), duplicate(), EvtMHelAmp(), EvtMParticle::EvtMParticle(), EvtMNode::getid(), and EvtMNode::getspintype().
EvtMLineShape* EvtMRes::_lineshape [protected, inherited] |
Definition at line 45 of file EvtMRes.hh.
Referenced by duplicate(), EvtMHelAmp(), and EvtMRes::line().
EvtMNode* EvtMNode::_parent [protected, inherited] |
Definition at line 68 of file EvtMNode.hh.
Referenced by amplitude(), EvtMHelAmp(), EvtMNode::getparent(), and EvtMNode::setparent().
vector<int> EvtMNode::_resonance [protected, inherited] |
Definition at line 65 of file EvtMNode.hh.
Referenced by EvtMParticle::duplicate(), EvtMHelAmp(), EvtMParticle::EvtMParticle(), EvtMNode::get4vector(), and EvtMNode::getresonance().
int EvtMNode::_twospin [protected, inherited] |
Definition at line 61 of file EvtMNode.hh.
Referenced by EvtMParticle::amplitude(), amplitude(), EvtMHelAmp(), EvtMParticle::EvtMParticle(), and EvtMNode::getspin().