1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 2000 Caltech, UCSB
11 // Module: EvtHelAmp.cc
13 // Description: Decay model for implementation of generic 2 body
14 // decay specified by the partial wave amplitudes
17 // Modification history:
19 // fkw February 2, 2001 changes to satisfy KCC
20 // RYD September 7, 2000 Module created
22 //------------------------------------------------------------------------
24 #include "EvtGenBase/EvtPatches.hh"
26 #include "EvtGenBase/EvtParticle.hh"
27 #include "EvtGenBase/EvtGenKine.hh"
28 #include "EvtGenBase/EvtPDL.hh"
29 #include "EvtGenBase/EvtVector4C.hh"
30 #include "EvtGenBase/EvtTensor4C.hh"
31 #include "EvtGenBase/EvtReport.hh"
32 #include "EvtGenModels/EvtPartWave.hh"
33 #include "EvtGenBase/EvtEvalHelAmp.hh"
34 #include "EvtGenBase/EvtId.hh"
36 #include "EvtGenBase/EvtConst.hh"
37 #include "EvtGenBase/EvtKine.hh"
38 #include "EvtGenBase/EvtCGCoefSingle.hh"
41 EvtPartWave::~EvtPartWave() {}
43 std::string EvtPartWave::getName(){
50 EvtDecayBase* EvtPartWave::clone(){
52 return new EvtPartWave;
56 void EvtPartWave::init(){
60 //find out how many states each particle have
61 int _nA=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getParentId()));
62 int _nB=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(0)));
63 int _nC=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(1)));
66 report(INFO,"EvtGen")<<"_nA,_nB,_nC:"
67 <<_nA<<","<<_nB<<","<<_nC<<endl;
70 //find out what 2 times the spin is
71 int _JA2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getParentId()));
72 int _JB2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(0)));
73 int _JC2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(1)));
76 report(INFO,"EvtGen")<<"_JA2,_JB2,_JC2:"
77 <<_JA2<<","<<_JB2<<","<<_JC2<<endl;
82 int* _lambdaA2=new int[_nA];
83 int* _lambdaB2=new int[_nB];
84 int* _lambdaC2=new int[_nC];
86 EvtComplexPtr* _HBC=new EvtComplexPtr[_nB];
88 for(ib=0;ib<_nB;ib++){
89 _HBC[ib]=new EvtComplex[_nC];
94 //find the allowed helicities (actually 2*times the helicity!)
96 fillHelicity(_lambdaA2,_nA,_JA2);
97 fillHelicity(_lambdaB2,_nB,_JB2);
98 fillHelicity(_lambdaC2,_nC,_JC2);
101 report(INFO,"EvtGen")<<"Helicity states of particle A:"<<endl;
103 report(INFO,"EvtGen")<<_lambdaA2[i]<<endl;
106 report(INFO,"EvtGen")<<"Helicity states of particle B:"<<endl;
108 report(INFO,"EvtGen")<<_lambdaB2[i]<<endl;
111 report(INFO,"EvtGen")<<"Helicity states of particle C:"<<endl;
113 report(INFO,"EvtGen")<<_lambdaC2[i]<<endl;
116 report(INFO,"EvtGen")<<"Will now figure out the valid (M_LS) states:"<<endl;
120 int Lmin=std::max(_JA2-_JB2-_JC2,std::max(_JB2-_JA2-_JC2,_JC2-_JA2-_JB2));
122 //int Lmin=_JA2-_JB2-_JC2;
123 int Lmax=_JA2+_JB2+_JC2;
127 int _nPartialWaveAmp=0;
132 for (L=Lmin;L<=Lmax;L+=2){
133 int Smin=abs(L-_JA2);
134 if (Smin<abs(_JB2-_JC2)) Smin=abs(_JB2-_JC2);
136 if (Smax>abs(_JB2+_JC2)) Smax=abs(_JB2+_JC2);
138 for (S=Smin;S<=Smax;S+=2){
139 _nL[_nPartialWaveAmp]=L;
140 _nS[_nPartialWaveAmp]=S;
144 report(INFO,"EvtGen")<<"M["<<L<<"]["<<S<<"]"<<endl;
149 checkNArg(_nPartialWaveAmp*2);
155 double partampsqtot=0.0;
157 for(i=0;i<_nPartialWaveAmp;i++){
158 _M[i]=getArg(argcounter)*exp(EvtComplex(0.0,getArg(argcounter+1)));;
160 partampsqtot+=abs2(_M[i]);
162 report(INFO,"EvtGen")<<"M["<<_nL[i]<<"]["<<_nS[i]<<"]="<<_M[i]<<endl;
166 //Now calculate the helicity amplitudes
168 double helampsqtot=0.0;
170 for(ib=0;ib<_nB;ib++){
171 for(ic=0;ic<_nC;ic++){
173 if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2){
174 for(i=0;i<_nPartialWaveAmp;i++){
177 int lambda2=_lambdaB2[ib];
178 int lambda3=_lambdaC2[ic];
182 int m1=lambda2-lambda3;
183 EvtCGCoefSingle c1(s2,s3);
184 EvtCGCoefSingle c2(L,S);
187 report(INFO,"EvtGen") << "s2,lambda2:"<<s2<<" "<<lambda2<<endl;
189 //fkw changes to satisfy KCC
190 double fkwTmp = (L+1.0)/(s1+1.0);
194 EvtComplex tmp=sqrt(fkwTmp)
195 *c1.coef(S,m1,s2,s3,lambda2,-lambda3)
196 *c2.coef(s1,m1,L,S,0,m1)*_M[i];
201 report(INFO,"EvtGen")<<"_HBC["<<ib<<"]["<<ic<<"]="<<_HBC[ib][ic]<<endl;
204 helampsqtot+=abs2(_HBC[ib][ic]);
208 if (fabs(helampsqtot-partampsqtot)/(helampsqtot+partampsqtot)>1e-6){
209 report(ERROR,"EvtGen")<<"In EvtPartWave for decay "
210 << EvtPDL::name(getParentId()) << " -> "
211 << EvtPDL::name(getDaug(0)) << " "
212 << EvtPDL::name(getDaug(1)) << std::endl;
213 report(ERROR,"EvtGen")<<"With arguments: "<<std::endl;
214 for(i=0;i*2<getNArg();i++){
215 report(ERROR,"EvtGen") <<"M("<<_nL[i]<<","<<_nS[i]<<")="
216 // <<getArg(2*i)<<" "<<getArg(2*i+1)<<std::endl;
219 report(ERROR,"EvtGen")<< "The total probability in the partwave basis is: "
220 << partampsqtot << std::endl;
221 report(ERROR,"EvtGen")<< "The total probability in the helamp basis is: "
222 << helampsqtot << std::endl;
223 report(ERROR,"EvtGen")<< "Most likely this is because the specified partwave amplitudes "
225 report(ERROR,"EvtGen")<< "project onto unphysical helicities of photons or neutrinos. "
227 report(ERROR,"EvtGen")<< "Seriously consider if your specified amplitudes are correct. "
233 _evalHelAmp=new EvtEvalHelAmp(getParentId(),
241 void EvtPartWave::initProbMax(){
243 double maxprob=_evalHelAmp->probMax();
246 report(INFO,"EvtGen")<<"Calculated probmax"<<maxprob<<endl;
254 void EvtPartWave::decay( EvtParticle *p){
256 //first generate simple phase space
257 p->initializePhaseSpace(getNDaug(),getDaugs());
259 _evalHelAmp->evalAmp(p,_amp2);
267 void EvtPartWave::fillHelicity(int* lambda2,int n,int J2){
271 //photon is special case!