]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTCrab.cxx
ClassDef is incremented
[u/mrichter/AliRoot.git] / HBTAN / AliHBTCrab.cxx
index 165c9f65fab9156de2f9f49109da557965f9025f..f9676c30811653714889dfef082a303d2f633229 100644 (file)
 /////////////////////////////////////////////////////////////////////////
  
 #include "AliHBTPair.h"
-
+#include "AliVAODParticle.h"
+#include "TDatabasePDG.h"
 #include <TMath.h>
-#include <TPDGCode.h>
 
 #include "volya_complex.h"
 
-//#include <complex>
-//using namespace std;
 AliHBTCrab* AliHBTCrab::fgCrab = 0x0;
 
 const Double_t AliHBTCrab::fgkWcons = 1./0.1973;
@@ -25,7 +23,7 @@ const Double_t AliHBTCrab::fgkROOT2=1.41421356237309504880;
 #ifdef __DECCXX
 const complex AliHBTCrab::fgkCI(0.0,1.0);
 #else
-const double_complex AliHBTCrab::fgkCI(0.0,1.0);
+const doublecomplex AliHBTCrab::fgkCI(0.0,1.0);
 #endif
 
 /************************************************************/
@@ -57,16 +55,55 @@ void AliHBTCrab::Set()
 }
 //===================================================================
 
-AliHBTCrab::AliHBTCrab():
-fBreitWigner(kFALSE),
-fReducedMom(kTRUE),
-fMaxMomentum(100.0)
+AliHBTCrab::AliHBTCrab() :
+  fBreitWigner(kFALSE),
+  fReducedMom(kTRUE),
+  fMaxMomentum(100.0),
+  fPid1(0),
+  fPid2(0),
+  fMass1(0),
+  fMass2(0),
+  fInteractionWsym(0),
+  fInteractionWanti(0),
+  fInteractionWnosym(0),
+  fInteractionDelk(0),
+  fInteractionNkmax(0)
 {
   //ctor
+  if(fgCrab)
+   {
+     Fatal("AliHBTCrab","Do not use constructor directly. Use Instance() instead.");
+   }
 }
 //===================================================================
+
+AliHBTCrab::AliHBTCrab(const AliHBTCrab &/*source*/) :
+  AliHBTWeights(),
+  fBreitWigner(kFALSE),
+  fReducedMom(kTRUE),
+  fMaxMomentum(100.0),
+  fPid1(0),
+  fPid2(0),
+  fMass1(0),
+  fMass2(0),
+  fInteractionWsym(0),
+  fInteractionWanti(0),
+  fInteractionWnosym(0),
+  fInteractionDelk(0),
+  fInteractionNkmax(0)
+{
+  //ctor
+}
+//===================================================================
+AliHBTCrab & AliHBTCrab::operator=(const AliHBTCrab& /*source*/)
+{
+//cpy constructor
+ return *AliHBTCrab::Instance();
+}
+
 void AliHBTCrab::Init(Int_t pid1,Int_t pid2)
 {
+//Initialization method
   fMass1 = TDatabasePDG::Instance()->GetParticle(pid1)->Mass();
   fMass2 = TDatabasePDG::Instance()->GetParticle(pid2)->Mass();
   fInteractionWsym = 1.0;
@@ -78,6 +115,7 @@ void AliHBTCrab::Init(Int_t pid1,Int_t pid2)
   fPid1 = pid1;   
   fPid2 = pid2;
 }
+//===================================================================
 
 Bool_t AliHBTCrab::SetConfig(const AliHBTPair* pair)
 {
@@ -93,7 +131,7 @@ Bool_t AliHBTCrab::SetConfig(const AliHBTPair* pair)
 }
 //===================================================================
 
-Double_t AliHBTCrab::GetWeight(const AliHBTPair* partpair)
+Double_t AliHBTCrab::GetWeight(AliHBTPair* partpair)
 {
 //returns the weight
   Double_t qred, r, qdotr, mom;
@@ -114,7 +152,7 @@ Double_t AliHBTCrab::GetWeight(const AliHBTPair* partpair)
 
 void AliHBTCrab::GetComQuantities(const AliHBTPair* pair, 
        double *qred,double *r,double *qdotr,double *mom, int *test)
- {
+{
 //************************************
 //  ALICE //
 
@@ -126,15 +164,15 @@ void AliHBTCrab::GetComQuantities(const AliHBTPair* pair,
  static const Double_t kCmToFm = 1.e13;
 // static const Double_t cmtoOneOverGeV = kCmToFm*fgkWcons;
  
- AliHBTParticle *part1 = pair->Particle1();
- AliHBTParticle *part2 = pair->Particle2();
+ AliVAODParticle *part1 = pair->Particle1();
+ AliVAODParticle *part2 = pair->Particle2();
 
- p1[0] = part1->Energy()*1000.0;
+ p1[0] = part1->E()*1000.0;
  p1[1] = part1->Px()*1000.0;
  p1[2] = part1->Py()*1000.0;
  p1[3] = part1->Pz()*1000.0;
  
- p2[0] = part2->Energy()*1000.0;
+ p2[0] = part2->E()*1000.0;
  p2[1] = part2->Px()*1000.0;
  p2[2] = part2->Py()*1000.0;
  p2[3] = part2->Pz()*1000.0;
@@ -208,7 +246,7 @@ void AliHBTCrab::GetComQuantities(const AliHBTPair* pair,
   else //identical
   {
   //  const double  kdotp=fMass2*fMass2-fMass1*fMass1;
-   const double  kdotp = part2->GetMass()*part2->GetMass()- part1->GetMass()*part1->GetMass();
+   const double  kdotp = part2->Mass()*part2->Mass()- part1->Mass()*part1->Mass();
    *test=1;
    *mom=-(p2[0]-p1[0])*(p2[0]-p1[0]);
    ptot2=(p1[0]+p2[0])*(p1[0]+p2[0]);
@@ -263,13 +301,13 @@ double  AliHBTCrab::CorrCalc(double trueqred,double trueqdotr,double truer)
 //  double xx,xxprime,xxjj,p1,zk;
 //  int jj,kk,ipart,ipartcount,ispin;
   int kk;
-  double wsym_leftover,wanti_leftover,wnosym_leftover;
+  double wsymleftover,wantileftover,wnosymleftover;
   double qred,qdotr,r;
 //  const double rmass=fMass1*fMass2/(fMass1+fMass2);
 #ifdef __DECCXX
   complex cphi1,cphi2,cphis,cphia;
 #else
-  double_complex cphi1,cphi2,cphis,cphia;
+  doublecomplex cphi1,cphi2,cphis,cphia;
 #endif
 
   arg=trueqdotr/197.323-2.0*TMath::Pi()*TMath::Floor(trueqdotr/(197.323*2.0*TMath::Pi()));
@@ -306,13 +344,13 @@ double  AliHBTCrab::CorrCalc(double trueqred,double trueqdotr,double truer)
   /* If there are corrections for strong interactions, add the
      change for each partial wave.  If npartial = 0 then there
      are no strong int. corrections. */
-  wsym_leftover=fInteractionWsym;
-  wanti_leftover=fInteractionWanti;
-  wnosym_leftover=fInteractionWnosym;
+  wsymleftover=fInteractionWsym;
+  wantileftover=fInteractionWanti;
+  wnosymleftover=fInteractionWnosym;
 
-  corr0=corr0+real(wsym_leftover*cphis*conj(cphis)
-                  +wanti_leftover*cphia*conj(cphia)
-                  +wnosym_leftover*cphi1*conj(cphi1));
+  corr0=corr0+real(wsymleftover*cphis*conj(cphis)
+                  +wantileftover*cphia*conj(cphia)
+                  +wnosymleftover*cphi1*conj(cphi1));
 OUTSIDE_INTERACTION_RANGE:
 
 #ifdef BREIT_WIGNER
@@ -324,17 +362,21 @@ OUTSIDE_INTERACTION_RANGE:
 
 #ifdef __DECCXX
 complex AliHBTCrab::CGamma(complex c){
+/* This calc.s gamma functions which are in the form gamma(n+i*y)
+   where n is an int and y is real. */
+// This code is written by Scott Pratt
+// taken from http://www.nscl.msu.edu/~pratt/freecodes/crab/home.html
 #else
-double_complex AliHBTCrab::CGamma(double_complex c){
-#endif
-  /* This calc.s gamma functions which are in the form gamma(n+i*y)
-     where n is an int and y is real. */
+doublecomplex AliHBTCrab::CGamma(doublecomplex c){
+/* This calc.s gamma functions which are in the form gamma(n+i*y)
+   where n is an int and y is real. */
 // This code is written by Scott Pratt
 // taken from http://www.nscl.msu.edu/~pratt/freecodes/crab/home.html
+#endif
 #ifdef __DECCXX
   complex cg,cphase;
 #else
-  double_complex cg,cphase;
+  doublecomplex cg,cphase;
 #endif
   int mm,j;
   double x,y,phase,delp,cgmag;