BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtMultibody.cc
Go to the documentation of this file.
1#include "EvtGenBase/EvtPatches.hh"
2#include "EvtGenBase/EvtParticle.hh"
3#include "EvtGenBase/EvtGenKine.hh"
4#include "EvtGenBase/EvtPDL.hh"
5#include "EvtGenBase/EvtReport.hh"
6#include "EvtGenBase/EvtResonance.hh"
7#include "EvtGenBase/EvtResonance2.hh"
8#include "EvtGenModels/EvtMultibody.hh"
9#include "EvtGenBase/EvtConst.hh"
10#include "EvtGenBase/EvtdFunction.hh"
11#include "EvtGenBase/EvtKine.hh"
12
14{
15 if( _decayTree != NULL ) delete _decayTree;
16 _decayTree=NULL;
17}
18
19void EvtMultibody::getName(std::string& model_name)
20{
21 model_name = "D_MULTIBODY";
22}
23
25{
26 return new EvtMultibody;
27}
28
30{
31 int N = getNArg();
32
33 _decayTree = new EvtMTree( getDaugs(), getNDaug() );
34
35 for(int i=0; i<N-1; ++i) {
36 if(getArgStr( i )=="RESONANCE") {
37 _decayTree->addtree( getArgStr( ++i ) );
38 } else {
39 report(ERROR,"EvtGen")
40 << "Syntax error at " << getArgStr( i ) << std::endl;
41 ::abort();
42 }
43 }
44}
45
46// Set the maximum probability amplitude - if function is left blank then the
47// program will search for it. This however is not deterministic and therefore
48// in the release cannot be in place.
50{
51 // setProbMax(1.0);
52}
53
55{
56 // Initialize the phase space before doing anything else!
58 std::vector<EvtVector4R> product;
59
60 for(int i=0; i<getNDaug(); ++i)
61 product.push_back(p->getDaug(i)->getP4Lab());
62
63 EvtSpinAmp amp = _decayTree->amplitude( product );
64
65 int * ilist = new int[amp.rank()];
66
67 // Set up the rotation matrix for the root particle
69
72
73 std::vector<EvtSpinType::spintype> types(2, type);
74 EvtSpinAmp newamp( types, EvtComplex(0.0, 0.0) );
75 std::vector<int> index = newamp.iterallowedinit();
76 do {
77 newamp(index) = R.Get((index[0]+twospin)/2,(index[1]+twospin)/2);
78 } while( newamp.iterateallowed( index ) );
79
80 newamp.extcont(amp, 1, 0);
81 amp=newamp;
82
83 index = amp.iterallowedinit();
84 std::vector<int> spins = amp.dims();
85
86 do {
87 for( int i=0; i<index.size(); ++i ) {
88 ilist[i]=index[i]+spins[i];
89 }
90
91 vertex( ilist, amp( index ) );
92 } while( amp.iterateallowed( index ) );
93
94 delete [] ilist;
95}
#define NULL
ostream & report(Severity severity, const char *facility)
EvtSpinAmp amplitude(const vector< EvtVector4R > &product) const
static EvtSpinType::spintype getSpinType(EvtId i)
virtual EvtSpinDensity rotateToHelicityBasis() const =0
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
bool iterateallowed(vector< int > &index) const
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition: TUtil.h:27