/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtdFunctionSingle.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 2000      Caltech, UCSB
00010 //
00011 // Module: EvtdFunctionSingle.cc
00012 //
00013 // Description: Evaluates one Wigner d-Functions.
00014 //
00015 // Modification history:
00016 //
00017 //    fkw           February 2, 2001     changes to satisfy KCC
00018 //    RYD            August 10, 2000         Module created
00019 //
00020 //------------------------------------------------------------------------
00021 // 
00022 #include "EvtGenBase/EvtPatches.hh"
00023 #include <stdlib.h>
00024 #include <math.h>
00025 #include <iostream>
00026 #include <assert.h>
00027 #include "EvtGenBase/EvtdFunctionSingle.hh"
00028 
00029 EvtdFunctionSingle::EvtdFunctionSingle(){
00030   _j=0;
00031   _m1=0;
00032   _m2=0;
00033   _coef=0;
00034   _kmin=0;
00035   _kmax=0;
00036 }
00037 
00038 
00039 EvtdFunctionSingle::~EvtdFunctionSingle(){
00040   if (_coef!=0) delete [] _coef;
00041 }
00042 
00043 
00044 void EvtdFunctionSingle::init(int j,int m1,int m2){
00045 
00046   assert(abs(m2)>=abs(m1));
00047   assert(m2>=0);
00048 
00049   _j=j;
00050   _m1=m1;
00051   _m2=m2;
00052 
00053   _kmin=_m2-_m1;
00054   _kmax=_j-_m1;
00055 
00056   assert(_kmin<=_kmax);
00057 
00058   _coef=new double[(_kmax-_kmin)/2+1];
00059 
00060   int k;
00061 
00062   for(k=_kmin;k<=_kmax;k+=2){
00063     int sign=1;
00064     if ((k-_m2+_m1)%4!=0) sign=-sign;
00065     //fkw change to satisfy KCC
00066     double fkwTmp = fact((_j+_m2)/2)*fact((_j-_m2)/2)
00067                    *fact((_j+_m1)/2)*fact((_j-_m1)/2);
00068     _coef[(k-_kmin)/2]=sign*sqrt(fkwTmp)/
00069       (fact((_j+_m2-k)/2)*fact(k/2)*fact((_j-_m1-k)/2)*fact((k-_m2+_m1)/2));
00070 
00071     //fkw _coef[(k-_kmin)/2]=sign*sqrt(fact((_j+_m2)/2)*fact((_j-_m2)/2)*
00072     //fkw                       fact((_j+_m1)/2)*fact((_j-_m1)/2))/
00073     //fkw  (fact((_j+_m2-k)/2)*fact(k/2)*fact((_j-_m1-k)/2)*fact((k-_m2+_m1)/2));
00074 
00075     //report(INFO,"EvtGen") << "k, coef:"<<k/2<<" "<<_coef[(k-_kmin)/2]<<endl;
00076   }
00077 
00078 }
00079 
00080 
00081 double EvtdFunctionSingle::d(int j,int m1,int m2, double theta){
00082 
00083   //report(INFO,"EvtGen") << "j,m1,m2:"<<j<<","<<m1<<","<<m2<<" theta:"<<theta<<endl;
00084 
00085   assert(j==_j);
00086   assert(m1==_m1);
00087   assert(m2==_m2);
00088 
00089   double c2=cos(0.5*theta);
00090   double s2=sin(0.5*theta);
00091 
00092   double d=0.0;
00093   
00094   int k;
00095   for(k=_kmin;k<=_kmax;k+=2){
00096     d+=_coef[(k-_kmin)/2]*pow(c2,(2*_j-2*k+m2-m1)/2)*pow(s2,(2*k-m2+m1)/2);
00097   }
00098 
00099   return d;
00100   
00101 }
00102 
00103 
00104 int EvtdFunctionSingle::fact(int n){
00105 
00106   assert(n>=0);
00107 
00108   int f=1;
00109 
00110   int k;
00111   for(k=2;k<=n;k++) f*=k;
00112 
00113   return f;
00114 
00115 }
00116 
00117 
00118 

Generated on Tue Nov 29 23:12:12 2016 for BOSS_7.0.2 by  doxygen 1.4.7