BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPartWave.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 2000 Caltech, UCSB
10//
11// Module: EvtHelAmp.cc
12//
13// Description: Decay model for implementation of generic 2 body
14// decay specified by the partial wave amplitudes
15//
16//
17// Modification history:
18//
19// fkw February 2, 2001 changes to satisfy KCC
20// RYD September 7, 2000 Module created
21//
22//------------------------------------------------------------------------
23//
24#include "EvtPartWave.hh"
37#include <algorithm>
38#include <stdlib.h>
39#include <string>
40using std::endl;
42
43void EvtPartWave::getName( std::string& model_name ) { model_name = "PARTWAVE"; }
44
46
48
49 checkNDaug( 2 );
50
51 // find out how many states each particle have
55
56 if ( verbose() )
57 { report( INFO, "EvtGen" ) << "_nA,_nB,_nC:" << _nA << "," << _nB << "," << _nC << endl; }
58
59 // find out what 2 times the spin is
63
64 if ( verbose() )
65 {
66 report( INFO, "EvtGen" ) << "_JA2,_JB2,_JC2:" << _JA2 << "," << _JB2 << "," << _JC2
67 << endl;
68 }
69
70 // allocate memory
71 int* _lambdaA2 = new int[_nA];
72 int* _lambdaB2 = new int[_nB];
73 int* _lambdaC2 = new int[_nC];
74
75 EvtComplexPtr* _HBC = new EvtComplexPtr[_nB];
76 int ib, ic;
77 for ( ib = 0; ib < _nB; ib++ ) { _HBC[ib] = new EvtComplex[_nC]; }
78
79 int i;
80 // find the allowed helicities (actually 2*times the helicity!)
81
82 fillHelicity( _lambdaA2, _nA, _JA2 );
83 fillHelicity( _lambdaB2, _nB, _JB2 );
84 fillHelicity( _lambdaC2, _nC, _JC2 );
85
86 if ( verbose() )
87 {
88 report( INFO, "EvtGen" ) << "Helicity states of particle A:" << endl;
89 for ( i = 0; i < _nA; i++ ) { report( INFO, "EvtGen" ) << _lambdaA2[i] << endl; }
90
91 report( INFO, "EvtGen" ) << "Helicity states of particle B:" << endl;
92 for ( i = 0; i < _nB; i++ ) { report( INFO, "EvtGen" ) << _lambdaB2[i] << endl; }
93
94 report( INFO, "EvtGen" ) << "Helicity states of particle C:" << endl;
95 for ( i = 0; i < _nC; i++ ) { report( INFO, "EvtGen" ) << _lambdaC2[i] << endl; }
96
97 report( INFO, "EvtGen" ) << "Will now figure out the valid (M_LS) states:" << endl;
98 }
99
100 int Lmin =
101 std::max( _JA2 - _JB2 - _JC2, std::max( _JB2 - _JA2 - _JC2, _JC2 - _JA2 - _JB2 ) );
102 if ( Lmin < 0 ) Lmin = 0;
103 // int Lmin=_JA2-_JB2-_JC2;
104 int Lmax = _JA2 + _JB2 + _JC2;
105
106 int L;
107
108 int _nPartialWaveAmp = 0;
109
110 int _nL[50];
111 int _nS[50];
112
113 for ( L = Lmin; L <= Lmax; L += 2 )
114 {
115 int Smin = abs( L - _JA2 );
116 if ( Smin < abs( _JB2 - _JC2 ) ) Smin = abs( _JB2 - _JC2 );
117 int Smax = L + _JA2;
118 if ( Smax > abs( _JB2 + _JC2 ) ) Smax = abs( _JB2 + _JC2 );
119 int S;
120 for ( S = Smin; S <= Smax; S += 2 )
121 {
122 _nL[_nPartialWaveAmp] = L;
123 _nS[_nPartialWaveAmp] = S;
124
125 _nPartialWaveAmp++;
126 if ( verbose() ) { report( INFO, "EvtGen" ) << "M[" << L << "][" << S << "]" << endl; }
127 }
128 }
129
130 checkNArg( _nPartialWaveAmp * 2 );
131
132 int argcounter = 0;
133
134 EvtComplex _M[50];
135
136 for ( i = 0; i < _nPartialWaveAmp; i++ )
137 {
138 _M[i] = getArg( argcounter ) * exp( EvtComplex( 0.0, getArg( argcounter + 1 ) ) );
139 ;
140 argcounter += 2;
141 if ( verbose() )
142 { report( INFO, "EvtGen" ) << "M[" << _nL[i] << "][" << _nS[i] << "]=" << _M[i] << endl; }
143 }
144
145 // Now calculate the helicity amplitudes
146
147 for ( ib = 0; ib < _nB; ib++ )
148 {
149 for ( ic = 0; ic < _nC; ic++ )
150 {
151 _HBC[ib][ic] = 0.0;
152 if ( abs( _lambdaB2[ib] - _lambdaC2[ic] ) <= _JA2 )
153 {
154 for ( i = 0; i < _nPartialWaveAmp; i++ )
155 {
156 int L = _nL[i];
157 int S = _nS[i];
158 int lambda2 = _lambdaB2[ib];
159 int lambda3 = _lambdaC2[ic];
160 int s1 = _JA2;
161 int s2 = _JB2;
162 int s3 = _JC2;
163 int m1 = lambda2 - lambda3;
164 EvtCGCoefSingle c1( s2, s3 );
165 EvtCGCoefSingle c2( L, S );
166
167 if ( verbose() )
168 { report( INFO, "EvtGen" ) << "s2,lambda2:" << s2 << " " << lambda2 << endl; }
169 // fkw changes to satisfy KCC
170 double fkwTmp = ( L + 1.0 ) / ( s1 + 1.0 );
171
172 if ( S >= abs( m1 ) )
173 {
174
175 EvtComplex tmp = sqrt( fkwTmp ) * c1.coef( S, m1, s2, s3, lambda2, -lambda3 ) *
176 c2.coef( s1, m1, L, S, 0, m1 ) * _M[i];
177 // fkw EvtComplex
178 // tmp=sqrt((L+1)/(s1+1))*c1.coef(S,m1,s2,s3,lambda2,-lambda3)*c2.coef(s1,m1,L,S,0,m1)*_M[i];
179 _HBC[ib][ic] += tmp;
180 }
181 }
182 if ( verbose() )
183 {
184 report( INFO, "EvtGen" )
185 << "_HBC[" << ib << "][" << ic << "]=" << _HBC[ib][ic] << endl;
186 }
187 }
188 }
189 }
190
191 _evalHelAmp = new EvtEvalHelAmp( EvtPDL::getSpinType( getParentId() ),
193 EvtPDL::getSpinType( getDaug( 1 ) ), _HBC );
194}
195
197
198 double maxprob = _evalHelAmp->probMax();
199
200 if ( verbose() ) { report( INFO, "EvtGen" ) << "Calculated probmax" << maxprob << endl; }
201
202 setProbMax( maxprob );
203}
204
206
207 // first generate simple phase space
209
210 _evalHelAmp->evalAmp( p, _amp2 );
211
212 return;
213}
214
215void EvtPartWave::fillHelicity( int* lambda2, int n, int J2 ) {
216
217 int i;
218
219 // photon is special case!
220 if ( n == 2 && J2 == 2 )
221 {
222 lambda2[0] = 2;
223 lambda2[1] = -2;
224 return;
225 }
226
227 assert( n == J2 + 1 );
228
229 for ( i = 0; i < n; i++ ) { lambda2[i] = n - i * 2 - 1; }
230
231 return;
232}
const Int_t n
EvtComplex exp(const EvtComplex &c)
EvtComplex * EvtComplexPtr
Definition EvtComplex.hh:68
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ INFO
Definition EvtReport.hh:52
double coef(int J, int M, int j1, int j2, int m1, int m2)
double getArg(int j)
void setProbMax(double prbmx)
EvtId getParentId()
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
EvtId getDaug(int i)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
void initProbMax()
void getName(std::string &name)
void decay(EvtParticle *p)
virtual ~EvtPartWave()
EvtDecayBase * clone()
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static int getSpin2(spintype stype)
static int getSpinStates(spintype stype)
double * m1
Definition qcdloop1.h:83