Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtMHelAmp Class Reference

#include <EvtMHelAmp.hh>

Inheritance diagram for EvtMHelAmp:

EvtMRes EvtMNode List of all members.

Public Member Functions

EvtSpinAmp amplitude (const vector< EvtVector4R > &product) const
EvtMNodeduplicate () const
 EvtMHelAmp (const EvtId &id, EvtMLineShape *, const vector< EvtMNode * > &, const vector< EvtComplex > &)
EvtVector4R get4vector (const vector< EvtVector4R > &product) const
EvtId getid () const
int getnchild () const
EvtMNodegetparent () const
const vector< int > & getresonance () const
int getspin () const
EvtSpinType::spintype getspintype () const
virtual EvtComplex line (const vector< EvtVector4R > &product) const
void setparent (EvtMNode *parent)
virtual ~EvtMHelAmp ()

Protected Attributes

EvtSpinAmp _amp
vector< EvtMNode * > _children
EvtId _id
EvtMLineShape_lineshape
EvtMNode_parent
vector< int > _resonance
int _twospin

Private Attributes

vector< EvtComplex_elem

Constructor & Destructor Documentation

EvtMHelAmp::EvtMHelAmp const EvtId id,
EvtMLineShape ,
const vector< EvtMNode * > &  ,
const vector< EvtComplex > & 
 

00009 {
00010     _id = id;
00011     _twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) );
00012     _parent = NULL;
00013     _lineshape = lineshape;
00014     
00015     _elem = elem;
00016 
00017     vector<EvtSpinType::spintype> type;
00018     for( int i=0; i<children.size(); ++i ) {
00019         _children.push_back( children[i] );
00020         type.push_back( children[i]->getspintype() );
00021         const vector<int> &res = children[i]->getresonance();
00022         for( int j=0; j<res.size(); ++j )
00023             _resonance.push_back( res[j] );
00024         children[i]->setparent( this );
00025     }
00026    
00027     // XXX New code - bugs could appear here XXX
00028     _amp = EvtSpinAmp( type );
00029     vector<int> index = _amp.iterinit();
00030     int i = 0;
00031     do {
00032         if( !_amp.allowed(index) )
00033            _amp( index ) = 0.0;
00034         else if( abs(index[0] - index[1]) > _twospin )
00035             _amp( index ) = 0.0;
00036         else {
00037             _amp( index ) = elem[i];
00038             ++i;
00039         }
00040     } while( _amp.iterate( index ) );
00041     if(elem.size() != i) {
00042         report(ERROR,"EvtGen")
00043             <<"Wrong number of elements input in helicity amplitude."<<endl;
00044         ::abort();
00045     }
00046 
00047     if( children.size() > 2 ) {
00048         report(ERROR,"EvtGen")
00049             <<"Helicity amplitude formalism can only handle two body resonances"
00050             <<endl;
00051         ::abort();
00052     }
00053 }

virtual EvtMHelAmp::~EvtMHelAmp  )  [inline, virtual]
 

00012 {};


Member Function Documentation

EvtSpinAmp EvtMHelAmp::amplitude const vector< EvtVector4R > &  product  )  const [virtual]
 

Implements EvtMNode.

00057 {
00058     EvtVector4R d = _children[0]->get4vector(product);
00059     double phi, theta;
00060     
00061     if( _parent == NULL ) {
00062 
00063         // This means that we're calculating the first level and we need to just
00064         // calculate the polar and azymuthal angles daughters in rest frame of
00065         // this (root) particle (this is automatic).
00066         phi = atan2( d.get(1), d.get(2) ); 
00067         theta = acos( d.get(3)/d.d3mag() );
00068 
00069     } else {
00070 
00071         // We have parents therefore calculate things in correct coordinate
00072         // system
00073         EvtVector4R p = _parent->get4vector(product);
00074         EvtVector4R q = get4vector(product);
00075 
00076         // See if we have a grandparent - if no then the z-axis is defined by
00077         // the z-axis of the root particle
00078         EvtVector4R g = _parent->getparent()==NULL ?
00079             EvtVector4R(0.0, 0.0, 0.0, 1.0) :
00080             _parent->getparent()->get4vector(product);
00081 
00082         theta = acos(EvtDecayAngle(p, q, d));
00083         phi = EvtDecayAnglePhi( g, p, q, d );
00084 
00085     }
00086 
00087     vector<EvtSpinType::spintype> types( 3 );
00088     types[0] = getspintype();
00089     types[1] = _children[0]->getspintype();
00090     types[2] = _children[1]->getspintype();
00091     EvtSpinAmp amp( types, EvtComplex(0.0, 0.0) );
00092     vector<int> index = amp.iterallowedinit();
00093 
00094     do {
00095         if( abs(index[1]-index[2]) > _twospin ) continue;
00096         amp(index) +=
00097             conj(wignerD(_twospin,index[0],index[1]-index[2],phi,theta,0.0)) *
00098             _amp(index[1],index[2]); 
00099     } while(amp.iterateallowed(index));
00100 
00101     EvtSpinAmp amp0 = _children[0]->amplitude(product);
00102     EvtSpinAmp amp1 = _children[1]->amplitude(product);
00103 
00104     amp.extcont( amp0, 1, 0 );
00105     amp.extcont( amp1, 1, 0 );
00106 
00107     amp *= sqrt( ( _twospin + 1 ) / ( 2 * EvtConst::twoPi ) ) *
00108         _children[0]->line(product) * _children[1]->line(product);
00109 
00110     return amp;
00111 }

EvtMNode * EvtMHelAmp::duplicate  )  const [virtual]
 

Implements EvtMNode.

00114 {
00115     vector<EvtMNode *> children;
00116 
00117     for( int i=0; i<_children.size(); ++i ) {
00118         children.push_back( _children[i]->duplicate() );
00119     }
00120     
00121     EvtMLineShape * lineshape = _lineshape->duplicate();
00122     EvtMHelAmp * ret = new EvtMHelAmp( _id, lineshape, children, _elem );
00123     lineshape->setres( ret );
00124 
00125     return ret;
00126 }

EvtVector4R EvtMNode::get4vector const vector< EvtVector4R > &  product  )  const [inherited]
 

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]
 

00038 { return _id; }

int EvtMRes::getnchild  )  const [inline, virtual, inherited]
 

Implements EvtMNode.

00031 { return _children.size(); }

EvtMNode* EvtMNode::getparent  )  const [inline, inherited]
 

00044 { return _parent; }

const vector<int>& EvtMNode::getresonance  )  const [inline, inherited]
 

00041 { return _resonance; }

int EvtMNode::getspin  )  const [inline, inherited]
 

00034 { return _twospin; }

EvtSpinType::spintype EvtMNode::getspintype  )  const [inline, inherited]
 

00035 { return EvtPDL::getSpinType( _id ); }

virtual EvtComplex EvtMRes::line const vector< EvtVector4R > &  product  )  const [inline, virtual, inherited]
 

Implements EvtMNode.

00034         { return _lineshape->shape( product ); }

void EvtMNode::setparent EvtMNode parent  )  [inline, inherited]
 

00043 { _parent = parent; }


Member Data Documentation

EvtSpinAmp EvtMRes::_amp [protected, inherited]
 

vector<EvtMNode *> EvtMRes::_children [protected, inherited]
 

vector<EvtComplex> EvtMHelAmp::_elem [private]
 

EvtId EvtMNode::_id [protected, inherited]
 

EvtMLineShape* EvtMRes::_lineshape [protected, inherited]
 

EvtMNode* EvtMNode::_parent [protected, inherited]
 

vector<int> EvtMNode::_resonance [protected, inherited]
 

int EvtMNode::_twospin [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:07:22 2011 for BOSS6.5.5 by  doxygen 1.3.9.1