Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtMHelAmp.cpp
Show All 28 Lines | |||||
using std::endl; | using std::endl; | ||||
EvtMHelAmp::EvtMHelAmp( const EvtId& id, EvtMLineShape* lineshape, | EvtMHelAmp::EvtMHelAmp( const EvtId& id, EvtMLineShape* lineshape, | ||||
const vector<EvtMNode*>& children, | const vector<EvtMNode*>& children, | ||||
const vector<EvtComplex>& elem ) | const vector<EvtComplex>& elem ) | ||||
{ | { | ||||
_id = id; | _id = id; | ||||
_twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) ); | _twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) ); | ||||
_parent = NULL; | _parent = nullptr; | ||||
_lineshape = lineshape; | _lineshape = lineshape; | ||||
_elem = elem; | _elem = elem; | ||||
vector<EvtSpinType::spintype> type; | vector<EvtSpinType::spintype> type; | ||||
for ( size_t i = 0; i < children.size(); ++i ) { | for ( size_t i = 0; i < children.size(); ++i ) { | ||||
_children.push_back( children[i] ); | _children.push_back( children[i] ); | ||||
type.push_back( children[i]->getspintype() ); | type.push_back( children[i]->getspintype() ); | ||||
Show All 31 Lines | EvtMHelAmp::EvtMHelAmp( const EvtId& id, EvtMLineShape* lineshape, | ||||
} | } | ||||
} | } | ||||
EvtSpinAmp EvtMHelAmp::amplitude( const vector<EvtVector4R>& product ) const | EvtSpinAmp EvtMHelAmp::amplitude( const vector<EvtVector4R>& product ) const | ||||
{ | { | ||||
EvtVector4R d = _children[0]->get4vector( product ); | EvtVector4R d = _children[0]->get4vector( product ); | ||||
double phi, theta; | double phi, theta; | ||||
if ( _parent == NULL ) { | if ( _parent == nullptr ) { | ||||
// This means that we're calculating the first level and we need to just | // This means that we're calculating the first level and we need to just | ||||
// calculate the polar and azymuthal angles daughters in rest frame of | // calculate the polar and azymuthal angles daughters in rest frame of | ||||
// this (root) particle (this is automatic). | // this (root) particle (this is automatic). | ||||
phi = atan2( d.get( 1 ), d.get( 2 ) ); | phi = atan2( d.get( 1 ), d.get( 2 ) ); | ||||
theta = acos( d.get( 3 ) / d.d3mag() ); | theta = acos( d.get( 3 ) / d.d3mag() ); | ||||
} else { | } else { | ||||
// We have parents therefore calculate things in correct coordinate | // We have parents therefore calculate things in correct coordinate | ||||
// system | // system | ||||
EvtVector4R p = _parent->get4vector( product ); | EvtVector4R p = _parent->get4vector( product ); | ||||
EvtVector4R q = get4vector( product ); | EvtVector4R q = get4vector( product ); | ||||
// See if we have a grandparent - if no then the z-axis is defined by | // See if we have a grandparent - if no then the z-axis is defined by | ||||
// the z-axis of the root particle | // the z-axis of the root particle | ||||
EvtVector4R g = _parent->getparent() == NULL | EvtVector4R g = _parent->getparent() == nullptr | ||||
? EvtVector4R( 0.0, 0.0, 0.0, 1.0 ) | ? EvtVector4R( 0.0, 0.0, 0.0, 1.0 ) | ||||
: _parent->getparent()->get4vector( product ); | : _parent->getparent()->get4vector( product ); | ||||
theta = acos( EvtDecayAngle( p, q, d ) ); | theta = acos( EvtDecayAngle( p, q, d ) ); | ||||
phi = EvtDecayAnglePhi( g, p, q, d ); | phi = EvtDecayAnglePhi( g, p, q, d ); | ||||
} | } | ||||
vector<EvtSpinType::spintype> types( 3 ); | vector<EvtSpinType::spintype> types( 3 ); | ||||
Show All 40 Lines |