/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenModels/EvtHelAmp.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) 1998      Caltech, UCSB
00010 //
00011 // Module: EvtHelAmp.cc
00012 //
00013 // Description: Decay model for implementation of generic 2 body
00014 //              decay specified by the helicity amplitudes
00015 //
00016 //
00017 // Modification history:
00018 //
00019 //    RYD       March 14, 1999       Module created
00020 //
00021 //------------------------------------------------------------------------
00022 // 
00023 #include "EvtGenBase/EvtPatches.hh"
00024 #include <stdlib.h>
00025 #include "EvtGenBase/EvtParticle.hh"
00026 #include "EvtGenBase/EvtGenKine.hh"
00027 #include "EvtGenBase/EvtPDL.hh"
00028 #include "EvtGenBase/EvtReport.hh"
00029 #include "EvtGenModels/EvtHelAmp.hh"
00030 #include "EvtGenBase/EvtId.hh"
00031 #include <string>
00032 #include "EvtGenBase/EvtConst.hh"
00033 #include "EvtGenBase/EvtEvalHelAmp.hh"
00034 using std::endl;
00035 
00036 
00037 EvtHelAmp::~EvtHelAmp() {
00038 
00039   delete _evalHelAmp;
00040 
00041 }
00042 
00043 void EvtHelAmp::getName(std::string& model_name){
00044 
00045   model_name="HELAMP";     
00046 
00047 }
00048 
00049 
00050 EvtDecayBase* EvtHelAmp::clone(){
00051 
00052   return new EvtHelAmp;
00053 
00054 }
00055 
00056 void EvtHelAmp::init(){
00057 
00058   checkNDaug(2);
00059 
00060 
00061   //find out how many states each particle have
00062   int _nA=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getParentId()));
00063   int _nB=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(0)));
00064   int _nC=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(1)));
00065 
00066   if (verbose()){
00067     report(INFO,"EvtGen")<<"_nA,_nB,_nC:"
00068                          <<_nA<<","<<_nB<<","<<_nC<<endl;
00069   }
00070 
00071   //find out what 2 times the spin is
00072   int _JA2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getParentId()));
00073   int _JB2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(0)));
00074   int _JC2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(1)));
00075 
00076   if (verbose()){
00077     report(INFO,"EvtGen")<<"_JA2,_JB2,_JC2:"
00078                          <<_JA2<<","<<_JB2<<","<<_JC2<<endl;
00079   }
00080 
00081   //allocate memory
00082   int* _lambdaA2=new int[_nA];
00083   int* _lambdaB2=new int[_nB];
00084   int* _lambdaC2=new int[_nC];
00085 
00086   EvtComplexPtr* _HBC=new EvtComplexPtr[_nB];
00087   int ib,ic;
00088   for(ib=0;ib<_nB;ib++){
00089     _HBC[ib]=new EvtComplex[_nC];
00090   }
00091 
00092   int i;
00093   //find the allowed helicities (actually 2*times the helicity!)
00094   fillHelicity(_lambdaA2,_nA,_JA2,getParentId());
00095   fillHelicity(_lambdaB2,_nB,_JB2,getDaug(0));
00096   fillHelicity(_lambdaC2,_nC,_JC2,getDaug(1));
00097 
00098   if (verbose()){
00099     report(INFO,"EvtGen")<<"Helicity states of particle A:"<<endl;
00100     for(i=0;i<_nA;i++){
00101       report(INFO,"EvtGen")<<_lambdaA2[i]<<endl;
00102     }
00103 
00104     report(INFO,"EvtGen")<<"Helicity states of particle B:"<<endl;
00105     for(i=0;i<_nB;i++){
00106       report(INFO,"EvtGen")<<_lambdaB2[i]<<endl;
00107     }
00108 
00109     report(INFO,"EvtGen")<<"Helicity states of particle C:"<<endl;
00110     for(i=0;i<_nC;i++){
00111       report(INFO,"EvtGen")<<_lambdaC2[i]<<endl;
00112     }
00113   }
00114 
00115   //now read in the helicity amplitudes
00116 
00117   int argcounter=0;
00118 
00119   for(ib=0;ib<_nB;ib++){
00120     for(ic=0;ic<_nC;ic++){
00121       _HBC[ib][ic]=0.0;
00122       if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) argcounter+=2;
00123     }
00124   }
00125 
00126   checkNArg(argcounter);
00127 
00128   argcounter=0;
00129 
00130   for(ib=0;ib<_nB;ib++){
00131     for(ic=0;ic<_nC;ic++){
00132       if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
00133         _HBC[ib][ic]=getArg(argcounter)*exp(EvtComplex(0.0,getArg(argcounter+1)));;
00134         argcounter+=2;
00135         if (verbose()){
00136           report(INFO,"EvtGen")<<"_HBC["<<ib<<"]["<<ic<<"]="
00137                                <<_HBC[ib][ic]<<endl;
00138         }
00139       }
00140     }
00141   }
00142 
00143   _evalHelAmp=new EvtEvalHelAmp(EvtPDL::getSpinType(getParentId()),
00144                                 EvtPDL::getSpinType(getDaug(0)),
00145                                 EvtPDL::getSpinType(getDaug(1)),
00146                                 _HBC);
00147   
00148   // Note: these are not class data members but local variables.
00149   delete [] _lambdaA2;
00150   delete [] _lambdaB2;
00151   delete [] _lambdaC2;
00152   for(int ib=0;ib<_nB;ib++){
00153     delete [] _HBC[ib];
00154   }
00155   delete [] _HBC;  // _HBC is copied in ctor of EvtEvalHelAmp above.
00156 
00157 }
00158 
00159 
00160 void EvtHelAmp::initProbMax(){
00161 
00162   double maxprob=_evalHelAmp->probMax();
00163 
00164   if (verbose()){
00165     report(INFO,"EvtGen")<<"Calculated probmax"<<maxprob<<endl;
00166   }
00167 
00168   setProbMax(maxprob);
00169 
00170 }
00171 
00172 
00173 void EvtHelAmp::decay( EvtParticle *p){
00174 
00175   //first generate simple phase space
00176   p->initializePhaseSpace(getNDaug(),getDaugs());
00177 
00178   _evalHelAmp->evalAmp(p,_amp2);
00179     
00180   return ;
00181 
00182 }
00183 
00184 
00185 void EvtHelAmp::fillHelicity(int* lambda2,int n,int J2, EvtId id){
00186   
00187   int i;
00188   
00189   //photon is special case!
00190   if (n==2&&J2==2) {
00191     lambda2[0]=2;
00192     lambda2[1]=-2;
00193     return;
00194   }
00195   
00196   //and so is the neutrino!
00197   if (n==1&&J2==1) {
00198     if (EvtPDL::getStdHep(id)>0){
00199         //particle i.e. lefthanded
00200       lambda2[0]=-1;
00201     }else{
00202         //anti particle i.e. righthanded
00203       lambda2[0]=1;
00204     }
00205     return;
00206   }
00207 
00208   assert(n==J2+1);
00209 
00210   for(i=0;i<n;i++){
00211     lambda2[i]=n-i*2-1;
00212   }
00213 
00214   return;
00215 
00216 }
00217 
00218 
00219 
00220 
00221 
00222 
00223 

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