EvtEvalHelAmp Class Reference

#include <EvtEvalHelAmp.hh>

List of all members.

Public Member Functions

 EvtEvalHelAmp (EvtSpinType::spintype A, EvtSpinType::spintype B, EvtSpinType::spintype C, EvtComplexPtrPtr HBC)
virtual ~EvtEvalHelAmp ()
double probMax ()
void evalAmp (EvtParticle *p, EvtAmp &amp)

Private Member Functions

void fillHelicity (int *lambda2, int n, int J2)
void setUpRotationMatrices (EvtParticle *p, double theta, double phi)
void applyRotationMatrices ()

Private Attributes

int _nA
int _nB
int _nC
EvtComplexPtrPtr _HBC
int _JA2
int _JB2
int _JC2
int * _lambdaA2
int * _lambdaB2
int * _lambdaC2
EvtComplexPtrPtr _RA
EvtComplexPtrPtr _RB
EvtComplexPtrPtr _RC
EvtComplexPtrPtrPtr _amp
EvtComplexPtrPtrPtr _amp1
EvtComplexPtrPtrPtr _amp3


Detailed Description

Definition at line 33 of file EvtEvalHelAmp.hh.


Constructor & Destructor Documentation

EvtEvalHelAmp::EvtEvalHelAmp ( EvtSpinType::spintype  A,
EvtSpinType::spintype  B,
EvtSpinType::spintype  C,
EvtComplexPtrPtr  HBC 
)

Definition at line 89 of file EvtEvalHelAmp.cc.

References _amp, _amp1, _amp3, _HBC, _JA2, _JB2, _JC2, _lambdaA2, _lambdaB2, _lambdaC2, _nA, _nB, _nC, _RA, _RB, _RC, fillHelicity(), EvtSpinType::getSpin2(), and EvtSpinType::getSpinStates().

00092                                                   {
00093 
00094   //find out how many states each particle have
00095   _nA=EvtSpinType::getSpinStates(typeA);
00096   _nB=EvtSpinType::getSpinStates(typeB);
00097   _nC=EvtSpinType::getSpinStates(typeC);
00098 
00099   //find out what 2 times the spin is
00100   _JA2=EvtSpinType::getSpin2(typeA);
00101   _JB2=EvtSpinType::getSpin2(typeB);
00102   _JC2=EvtSpinType::getSpin2(typeC);
00103 
00104 
00105   //allocate memory
00106   _lambdaA2=new int[_nA];
00107   _lambdaB2=new int[_nB];
00108   _lambdaC2=new int[_nC];
00109 
00110   _HBC=new EvtComplexPtr[_nB];
00111   int ia,ib,ic;
00112   for(ib=0;ib<_nB;ib++){
00113     _HBC[ib]=new EvtComplex[_nC];
00114   }
00115 
00116 
00117   _RA=new EvtComplexPtr[_nA];
00118   for(ia=0;ia<_nA;ia++){
00119     _RA[ia]=new EvtComplex[_nA];
00120   }
00121   _RB=new EvtComplexPtr[_nB];
00122   for(ib=0;ib<_nB;ib++){
00123     _RB[ib]=new EvtComplex[_nB];
00124   }
00125   _RC=new EvtComplexPtr[_nC];
00126   for(ic=0;ic<_nC;ic++){
00127     _RC[ic]=new EvtComplex[_nC];
00128   }
00129   
00130   _amp=new EvtComplexPtrPtr[_nA];
00131   _amp1=new EvtComplexPtrPtr[_nA];
00132   _amp3=new EvtComplexPtrPtr[_nA];
00133   for(ia=0;ia<_nA;ia++){
00134     _amp[ia]=new EvtComplexPtr[_nB];
00135     _amp1[ia]=new EvtComplexPtr[_nB];
00136     _amp3[ia]=new EvtComplexPtr[_nB];
00137     for(ib=0;ib<_nB;ib++){
00138       _amp[ia][ib]=new EvtComplex[_nC];
00139       _amp1[ia][ib]=new EvtComplex[_nC];
00140       _amp3[ia][ib]=new EvtComplex[_nC];
00141     }
00142   }
00143 
00144   //find the allowed helicities (actually 2*times the helicity!)
00145 
00146   fillHelicity(_lambdaA2,_nA,_JA2);
00147   fillHelicity(_lambdaB2,_nB,_JB2);
00148   fillHelicity(_lambdaC2,_nC,_JC2);
00149 
00150   for(ib=0;ib<_nB;ib++){
00151     for(ic=0;ic<_nC;ic++){
00152       _HBC[ib][ic]=HBC[ib][ic];
00153     }
00154   }
00155 }

EvtEvalHelAmp::~EvtEvalHelAmp (  )  [virtual]

Definition at line 40 of file EvtEvalHelAmp.cc.

References _amp, _amp1, _amp3, _HBC, _lambdaA2, _lambdaB2, _lambdaC2, _nA, _nB, _nC, _RA, _RB, and _RC.

00040                               {
00041 
00042   //allocate memory
00043   delete [] _lambdaA2;
00044   delete [] _lambdaB2;
00045   delete [] _lambdaC2;
00046 
00047   int ia,ib,ic;
00048   for(ib=0;ib<_nB;ib++){
00049     delete [] _HBC[ib];
00050   }
00051 
00052   delete [] _HBC;
00053 
00054 
00055   for(ia=0;ia<_nA;ia++){
00056     delete [] _RA[ia];
00057   }
00058   delete [] _RA;
00059 
00060   for(ib=0;ib<_nB;ib++){
00061     delete [] _RB[ib];
00062   }
00063   delete [] _RB;
00064 
00065   for(ic=0;ic<_nC;ic++){
00066     delete [] _RC[ic];
00067   }
00068   delete [] _RC;
00069 
00070  
00071   for(ia=0;ia<_nA;ia++){
00072     for(ib=0;ib<_nB;ib++){
00073       delete [] _amp[ia][ib];
00074       delete [] _amp1[ia][ib];
00075       delete [] _amp3[ia][ib];
00076     }
00077     delete [] _amp[ia];
00078     delete [] _amp1[ia];
00079     delete [] _amp3[ia];
00080   }
00081 
00082   delete [] _amp;
00083   delete [] _amp1;
00084   delete [] _amp3;
00085 
00086 }


Member Function Documentation

void EvtEvalHelAmp::applyRotationMatrices (  )  [private]

Definition at line 423 of file EvtEvalHelAmp.cc.

References _amp, _amp1, _amp3, _nA, _nB, _nC, _RA, _RB, _RC, genRecEmupikp::i, and subSeperate::temp.

Referenced by evalAmp().

00423                                          {
00424 
00425   int ia,ib,ic,i;
00426   
00427   EvtComplex temp;
00428 
00429 
00430 
00431   for(ia=0;ia<_nA;ia++){
00432     for(ib=0;ib<_nB;ib++){
00433       for(ic=0;ic<_nC;ic++){
00434         temp=0;
00435         for(i=0;i<_nC;i++){
00436           temp+=_RC[i][ic]*_amp[ia][ib][i];
00437         }
00438         _amp1[ia][ib][ic]=temp;
00439       }
00440     }
00441   }
00442 
00443 
00444 
00445   for(ia=0;ia<_nA;ia++){
00446     for(ic=0;ic<_nC;ic++){
00447       for(ib=0;ib<_nB;ib++){
00448         temp=0;
00449         for(i=0;i<_nB;i++){
00450           temp+=_RB[i][ib]*_amp1[ia][i][ic];
00451         }
00452         _amp3[ia][ib][ic]=temp;
00453       }
00454     }
00455   }
00456   
00457 
00458 
00459   for(ib=0;ib<_nB;ib++){
00460     for(ic=0;ic<_nC;ic++){
00461       for(ia=0;ia<_nA;ia++){
00462         temp=0;
00463         for(i=0;i<_nA;i++){
00464           temp+=_RA[i][ia]*_amp3[i][ib][ic];
00465         }
00466         _amp[ia][ib][ic]=temp;
00467       }
00468     }
00469   }
00470 
00471 
00472 }

void EvtEvalHelAmp::evalAmp ( EvtParticle p,
EvtAmp amp 
)

Definition at line 202 of file EvtEvalHelAmp.cc.

References _amp, _HBC, _JA2, _lambdaA2, _lambdaB2, _lambdaC2, _nA, _nB, _nC, abs, applyRotationMatrices(), conj(), EvtdFunction::d(), exp(), EvtParticle::getDaug(), EvtHelSys::getHelAng(), EvtParticle::getP4(), Bes_Common::INFO, EvtConst::pi, report(), setUpRotationMatrices(), and EvtAmp::vertex().

Referenced by EvtPartWave::decay(), EvtKstarstargamma::decay(), and EvtHelAmp::decay().

00202                                                        {
00203 
00204   //find theta and phi of the first daughter
00205   
00206   EvtVector4R pB=p->getDaug(0)->getP4();
00207   EvtVector4R pC=p->getDaug(1)->getP4();
00208   EvtVector4R pP=pB+pC;
00209 
00210   EvtHelSys angles(pP,pB);
00211   double theta=angles.getHelAng(1);
00212   double phi  =angles.getHelAng(2);
00213 //  double theta=acos(pB.get(3)/pB.d3mag());  //pingrg ,2007,4,15
00214 //  double phi=atan2(pB.get(2),pB.get(1));
00215 
00216   double c=sqrt((_JA2+1)/(4*EvtConst::pi));
00217 
00218   int ia,ib,ic;
00219 
00220   double prob1=0.0;
00221 
00222   for(ia=0;ia<_nA;ia++){
00223     for(ib=0;ib<_nB;ib++){
00224       for(ic=0;ic<_nC;ic++){
00225         _amp[ia][ib][ic]=0.0;
00226         if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
00227           double dfun=EvtdFunction::d(_JA2,_lambdaA2[ia],
00228                                       _lambdaB2[ib]-_lambdaC2[ic],theta);
00229 
00230           _amp[ia][ib][ic]=c*_HBC[ib][ic]*
00231             exp(EvtComplex(0.0,phi*0.5*(_lambdaA2[ia]-_lambdaB2[ib]+
00232                                         _lambdaC2[ic])))*dfun;
00233         }
00234         prob1+=real(_amp[ia][ib][ic]*conj(_amp[ia][ib][ic]));
00235       }
00236     }
00237   }
00238 
00239   setUpRotationMatrices(p,theta,phi);
00240 
00241   applyRotationMatrices();
00242 
00243   double prob2=0.0;
00244 
00245   for(ia=0;ia<_nA;ia++){
00246     for(ib=0;ib<_nB;ib++){
00247       for(ic=0;ic<_nC;ic++){
00248         prob2+=real(_amp[ia][ib][ic]*conj(_amp[ia][ib][ic]));
00249         if (_nA==1){
00250           if (_nB==1){
00251             if (_nC==1){
00252               amp.vertex(_amp[ia][ib][ic]);
00253             }
00254             else{
00255               amp.vertex(ic,_amp[ia][ib][ic]);
00256             }
00257           }
00258           else{
00259             if (_nC==1){
00260               amp.vertex(ib,_amp[ia][ib][ic]);
00261             }
00262             else{
00263               amp.vertex(ib,ic,_amp[ia][ib][ic]);
00264               //report(INFO,"EvtGen") << "ib,ic:"<<ib<<" "<<ic<<" "<<_amp[ia][ib][ic]<<endl;
00265             }
00266           }
00267         }else{
00268           if (_nB==1){
00269             if (_nC==1){
00270               amp.vertex(ia,_amp[ia][ib][ic]);
00271             }
00272             else{
00273               amp.vertex(ia,ic,_amp[ia][ib][ic]);
00274             }
00275           }
00276           else{
00277             if (_nC==1){
00278               amp.vertex(ia,ib,_amp[ia][ib][ic]);
00279             }
00280             else{
00281               amp.vertex(ia,ib,ic,_amp[ia][ib][ic]);
00282             }
00283           }
00284         }
00285       }
00286     }
00287   }
00288 
00289   if (fabs(prob1-prob2)>0.000001*prob1){
00290     report(INFO,"EvtGen") << "prob1,prob2:"<<prob1<<" "<<prob2<<endl;
00291     ::abort();
00292   }
00293 
00294   return ;
00295 
00296 }

void EvtEvalHelAmp::fillHelicity ( int *  lambda2,
int  n,
int  J2 
) [private]

Definition at line 299 of file EvtEvalHelAmp.cc.

References genRecEmupikp::i.

Referenced by EvtEvalHelAmp().

00299                                                          {
00300   
00301   int i;
00302   
00303   //photon is special case!
00304   if (n==2&&J2==2) {
00305     lambda2[0]=2;
00306     lambda2[1]=-2;
00307     return;
00308   }
00309   
00310   assert(n==J2+1);
00311 
00312   for(i=0;i<n;i++){
00313     lambda2[i]=n-i*2-1;
00314   }
00315 
00316   return;
00317 
00318 }

double EvtEvalHelAmp::probMax (  ) 

Definition at line 162 of file EvtEvalHelAmp.cc.

References _amp, _HBC, _JA2, _lambdaA2, _lambdaB2, _lambdaC2, _nA, _nB, _nC, abs, conj(), EvtdFunction::d(), and EvtConst::pi.

Referenced by EvtPartWave::initProbMax(), and EvtHelAmp::initProbMax().

00162                              {
00163 
00164   double c=1.0/sqrt(4*EvtConst::pi/(_JA2+1));
00165 
00166   int ia,ib,ic;
00167 
00168 
00169   double theta;
00170   int itheta;
00171 
00172   double maxprob=0.0;
00173 
00174   for(itheta=-10;itheta<=10;itheta++){
00175     theta=acos(0.099999*itheta);
00176     for(ia=0;ia<_nA;ia++){
00177       double prob=0.0;
00178       for(ib=0;ib<_nB;ib++){
00179         for(ic=0;ic<_nC;ic++){
00180           _amp[ia][ib][ic]=0.0;
00181           if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
00182             _amp[ia][ib][ic]=c*_HBC[ib][ic]*
00183               EvtdFunction::d(_JA2,_lambdaA2[ia],
00184                               _lambdaB2[ib]-_lambdaC2[ic],theta);
00185             prob+=real(_amp[ia][ib][ic]*conj(_amp[ia][ib][ic]));
00186           }
00187         }
00188       }
00189       
00190       prob*=sqrt(1.0*_nA);
00191       
00192       if (prob>maxprob) maxprob=prob;
00193 
00194     }
00195   }
00196 
00197   return maxprob;
00198 
00199 }

void EvtEvalHelAmp::setUpRotationMatrices ( EvtParticle p,
double  theta,
double  phi 
) [private]

Definition at line 321 of file EvtEvalHelAmp.cc.

References _JA2, _JB2, _JC2, _nA, _nB, _nC, _RA, _RB, _RC, conj(), calibUtil::ERROR, EvtParticle::getDaug(), genRecEmupikp::i, ganga-rec::j, EvtConst::pi, rb::R(), report(), and EvtParticle::rotateToHelicityBasis().

Referenced by evalAmp().

00321                                                                                 {
00322 
00323   switch(_JA2){
00324 
00325   case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
00326 
00327     {
00328 
00329       EvtSpinDensity R=p->rotateToHelicityBasis();
00330 
00331       
00332       int i,j,n;
00333       
00334       n=R.GetDim();
00335       
00336       assert(n==_nA);
00337         
00338       
00339       for(i=0;i<n;i++){
00340         for(j=0;j<n;j++){
00341           _RA[i][j]=R.Get(i,j);
00342         }
00343       }
00344 
00345     }
00346 
00347     break;
00348 
00349   default:
00350     report(ERROR,"EvtGen") << "Spin2(_JA2)="<<_JA2<<" not supported!"<<endl;
00351     ::abort();
00352   }
00353   
00354   
00355   switch(_JB2){
00356 
00357 
00358   case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
00359 
00360     {
00361       
00362       int i,j,n;
00363 
00364       EvtSpinDensity R=p->getDaug(0)->rotateToHelicityBasis(phi,theta,-phi);
00365       
00366       n=R.GetDim();
00367       
00368       assert(n==_nB);
00369         
00370       //report(INFO,"EvtGen") << "RB:"<< R <<endl; 
00371      
00372       for(i=0;i<n;i++){
00373         for(j=0;j<n;j++){
00374           _RB[i][j]=conj(R.Get(i,j));
00375         }
00376       }
00377 
00378     }
00379 
00380     break;
00381 
00382   default:
00383     report(ERROR,"EvtGen") << "Spin2(_JB2)="<<_JB2<<" not supported!"<<endl;
00384     ::abort();
00385   }
00386   
00387   switch(_JC2){
00388 
00389   case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
00390 
00391     {
00392 
00393       int i,j,n;
00394 
00395       EvtSpinDensity R=p->getDaug(1)->rotateToHelicityBasis(phi,EvtConst::pi+theta,phi-EvtConst::pi);
00396             
00397       n=R.GetDim();
00398 
00399       //report(INFO,"EvtGen") << "RC:"<< R <<endl;
00400 
00401       assert(n==_nC);
00402 
00403       for(i=0;i<n;i++){
00404         for(j=0;j<n;j++){
00405           _RC[i][j]=conj(R.Get(i,j));
00406         }
00407       }
00408 
00409     }
00410 
00411     break;
00412 
00413   default:
00414     report(ERROR,"EvtGen") << "Spin2(_JC2)="<<_JC2<<" not supported!"<<endl;
00415     ::abort();
00416   }
00417   
00418   
00419 
00420 }


Member Data Documentation

EvtComplexPtrPtrPtr EvtEvalHelAmp::_amp [private]

Definition at line 71 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), evalAmp(), EvtEvalHelAmp(), probMax(), and ~EvtEvalHelAmp().

EvtComplexPtrPtrPtr EvtEvalHelAmp::_amp1 [private]

Definition at line 71 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), EvtEvalHelAmp(), and ~EvtEvalHelAmp().

EvtComplexPtrPtrPtr EvtEvalHelAmp::_amp3 [private]

Definition at line 71 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), EvtEvalHelAmp(), and ~EvtEvalHelAmp().

EvtComplexPtrPtr EvtEvalHelAmp::_HBC [private]

Definition at line 59 of file EvtEvalHelAmp.hh.

Referenced by evalAmp(), EvtEvalHelAmp(), probMax(), and ~EvtEvalHelAmp().

int EvtEvalHelAmp::_JA2 [private]

Definition at line 62 of file EvtEvalHelAmp.hh.

Referenced by evalAmp(), EvtEvalHelAmp(), probMax(), and setUpRotationMatrices().

int EvtEvalHelAmp::_JB2 [private]

Definition at line 62 of file EvtEvalHelAmp.hh.

Referenced by EvtEvalHelAmp(), and setUpRotationMatrices().

int EvtEvalHelAmp::_JC2 [private]

Definition at line 62 of file EvtEvalHelAmp.hh.

Referenced by EvtEvalHelAmp(), and setUpRotationMatrices().

int* EvtEvalHelAmp::_lambdaA2 [private]

Definition at line 65 of file EvtEvalHelAmp.hh.

Referenced by evalAmp(), EvtEvalHelAmp(), probMax(), and ~EvtEvalHelAmp().

int * EvtEvalHelAmp::_lambdaB2 [private]

Definition at line 65 of file EvtEvalHelAmp.hh.

Referenced by evalAmp(), EvtEvalHelAmp(), probMax(), and ~EvtEvalHelAmp().

int * EvtEvalHelAmp::_lambdaC2 [private]

Definition at line 65 of file EvtEvalHelAmp.hh.

Referenced by evalAmp(), EvtEvalHelAmp(), probMax(), and ~EvtEvalHelAmp().

int EvtEvalHelAmp::_nA [private]

Definition at line 56 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), evalAmp(), EvtEvalHelAmp(), probMax(), setUpRotationMatrices(), and ~EvtEvalHelAmp().

int EvtEvalHelAmp::_nB [private]

Definition at line 56 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), evalAmp(), EvtEvalHelAmp(), probMax(), setUpRotationMatrices(), and ~EvtEvalHelAmp().

int EvtEvalHelAmp::_nC [private]

Definition at line 56 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), evalAmp(), EvtEvalHelAmp(), probMax(), setUpRotationMatrices(), and ~EvtEvalHelAmp().

EvtComplexPtrPtr EvtEvalHelAmp::_RA [private]

Definition at line 68 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), EvtEvalHelAmp(), setUpRotationMatrices(), and ~EvtEvalHelAmp().

EvtComplexPtrPtr EvtEvalHelAmp::_RB [private]

Definition at line 68 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), EvtEvalHelAmp(), setUpRotationMatrices(), and ~EvtEvalHelAmp().

EvtComplexPtrPtr EvtEvalHelAmp::_RC [private]

Definition at line 68 of file EvtEvalHelAmp.hh.

Referenced by applyRotationMatrices(), EvtEvalHelAmp(), setUpRotationMatrices(), and ~EvtEvalHelAmp().


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