BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtMultibody.cc
Go to the documentation of this file.
1#include "EvtMultibody.hh"
12
14 if ( _decayTree != NULL ) delete _decayTree;
15 _decayTree = NULL;
16}
17
18void EvtMultibody::getName( std::string& model_name ) { model_name = "D_MULTIBODY"; }
19
21
23 int N = getNArg();
24
25 _decayTree = new EvtMTree( getDaugs(), getNDaug() );
26
27 for ( int i = 0; i < N - 1; ++i )
28 {
29 if ( getArgStr( i ) == "RESONANCE" ) { _decayTree->addtree( getArgStr( ++i ) ); }
30 else
31 {
32 report( ERROR, "EvtGen" ) << "Syntax error at " << getArgStr( i ) << std::endl;
33 ::abort();
34 }
35 }
36}
37
38// Set the maximum probability amplitude - if function is left blank then the
39// program will search for it. This however is not deterministic and therefore
40// in the release cannot be in place.
42 // setProbMax(1.0);
43}
44
46 // Initialize the phase space before doing anything else!
48 std::vector<EvtVector4R> product;
49
50 for ( int i = 0; i < getNDaug(); ++i ) product.push_back( p->getDaug( i )->getP4Lab() );
51
52 EvtSpinAmp amp = _decayTree->amplitude( product );
53
54 int* ilist = new int[amp.rank()];
55
56 // Set up the rotation matrix for the root particle
58
61
62 std::vector<EvtSpinType::spintype> types( 2, type );
63 EvtSpinAmp newamp( types, EvtComplex( 0.0, 0.0 ) );
64 std::vector<int> index = newamp.iterallowedinit();
65 do {
66 newamp( index ) = R.Get( ( index[0] + twospin ) / 2, ( index[1] + twospin ) / 2 );
67 } while ( newamp.iterateallowed( index ) );
68
69 newamp.extcont( amp, 1, 0 );
70 amp = newamp;
71
72 index = amp.iterallowedinit();
73 std::vector<int> spins = amp.dims();
74
75 do {
76 for ( int i = 0; i < index.size(); ++i ) { ilist[i] = index[i] + spins[i]; }
77
78 vertex( ilist, amp( index ) );
79 } while ( amp.iterateallowed( index ) );
80
81 delete[] ilist;
82}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
void vertex(const EvtComplex &amp)
EvtId getParentId()
EvtId * getDaugs()
std::string getArgStr(int j)
void getName(std::string &name)
virtual ~EvtMultibody()
void initProbMax()
EvtDecayBase * clone()
void decay(EvtParticle *p)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
EvtVector4R getP4Lab()
virtual EvtSpinDensity rotateToHelicityBasis() const =0
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
bool iterateallowed(vector< int > &index) const
int rank() const
Definition EvtSpinAmp.hh:62
vector< int > iterallowedinit() const
void extcont(const EvtSpinAmp &, int, int)
const vector< int > & dims() const
Definition EvtSpinAmp.hh:65
static int getSpin2(spintype stype)