CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtMultibody.cc
Go to the documentation of this file.
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}
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
EvtId getParentId()
Definition: EvtDecayBase.hh:60
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
std::string getArgStr(int j)
Definition: EvtDecayBase.hh:75
void addtree(const string &args)
Definition: EvtMTree.cc:379
EvtSpinAmp amplitude(const vector< EvtVector4R > &product) const
Definition: EvtMTree.cc:395
void getName(std::string &name)
Definition: EvtMultibody.cc:19
virtual ~EvtMultibody()
Definition: EvtMultibody.cc:13
void initProbMax()
Definition: EvtMultibody.cc:49
EvtDecayBase * clone()
Definition: EvtMultibody.cc:24
void decay(EvtParticle *p)
Definition: EvtMultibody.cc:54
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:683
virtual EvtSpinDensity rotateToHelicityBasis() const =0
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
bool iterateallowed(vector< int > &index) const
Definition: EvtSpinAmp.cc:411
int rank() const
Definition: EvtSpinAmp.hh:64
vector< int > iterallowedinit() const
Definition: EvtSpinAmp.cc:421
void extcont(const EvtSpinAmp &, int, int)
Definition: EvtSpinAmp.cc:489
const vector< int > & dims() const
Definition: EvtSpinAmp.hh:67
static int getSpin2(spintype stype)
Definition: EvtSpinType.hh:34