]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTPair.cxx
Update rawdata format for trigger (Christian)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPair.cxx
index 388246b6c42dcfc23905105a16ccd47236c89c6d..9ba86ca5082a55449e602f24d63c276a4105fec0 100644 (file)
 #include "AliHBTPair.h"
-#include "AliHBTParticle.h"
+//_________________________________________________________________________
+///////////////////////////////////////////////////////////////////////////
+//
+// class AliHBTPair
+//
+// class implements pair of particles and taking care of caluclation (almost)
+// all of pair properties (Qinv, InvMass,...)
+// 
+// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "AliVAODParticle.h"
+#include "AliHBTWeights.h"
 
 ClassImp(AliHBTPair)
 
-//value of rev 
 /************************************************************************/
-AliHBTPair::AliHBTPair(Bool_t rev)
+AliHBTPair::AliHBTPair(Bool_t rev):
+ AliAODPair(rev),
+ fWeight(0.0),
+ fWeightNotCalc(kTRUE)
  {
-//value of rev defines if it is Swaped
-//if you pass kTRUE swpaped pair will NOT be created
-//though you wont be able to get the swaped pair from this pair
-
-  if(!rev) fSwapedPair = new AliHBTPair(kTRUE); //if false create swaped pair
-  else fSwapedPair = 0x0; //if true set the pointer to NULL
+//Constructor
   
  }
 /************************************************************************/
-Double_t AliHBTPair::GetInvMass()
-{
-//Returns qinv value for a pair
-  if(fInvMassNotCalc)
-   {
-     CalculateInvMassSqr(); //method is inline so we not waste th time for jumping into method 
-     
-     if(fInvMassSqr<0)  fInvMass = TMath::Sqrt(-fInvMassSqr);
-     else fInvMass = TMath::Sqrt(fInvMassSqr); 
-     
-     fInvMassNotCalc = kFALSE;
-   }
-  return fInvMass;
-}
-/************************************************************************/
-Double_t AliHBTPair::GetQSideCMSLC()
-{
-  //return Q Side in Central Of Mass System in Longitudialy Comoving Frame
-  if (fQSideCMSLCNotCalc)
-   {
-    fQSideCMSLC = (fPart1->Px()*fPart2->Py()-fPart2->Px()*fPart1->Py())/GetKt();
-    fQSideCMSLCNotCalc = kFALSE;
-   }
-  return fQSideCMSLC;
-}
-/************************************************************************/
-Double_t AliHBTPair::GetQOutCMSLC()
-{
- if(fQOutCMSLCNotCalc)
-  {
-   CalculateSums();
-   CalculateDiffs();
-   Double_t k2 = fPxSum*fPxDiff+fPySum*fPyDiff;
-   fQOutCMSLC = 0.5*k2/GetKt();
-   fQOutCMSLCNotCalc = kFALSE;
-  }
- return fQOutCMSLC;
-}
-/************************************************************************/
-Double_t AliHBTPair::GetQLongCMSLC()
-{
- if (fQLongCMSLCNotCalc)
-  {
-    CalculateSums();
-    CalculateDiffs();
-    Double_t beta = fPzSum/fESum;
-    Double_t gamma = 1.0/TMath::Sqrt(1.0 - beta*beta);
-    fQLongCMSLC = gamma*( fPzDiff - beta*fEDiff );
-    fQLongCMSLCNotCalc = kFALSE;
-  }
- return fQLongCMSLC; 
-}
+
+AliHBTPair::AliHBTPair(AliVAODParticle* part1, AliVAODParticle* part2, Bool_t rev):
+ AliAODPair(part1,part2,rev),
+ fWeight(0.0),
+ fWeightNotCalc(kTRUE)
+ {
+//constructor
+  
+ }
 /************************************************************************/
-Double_t AliHBTPair::GetKt()
+AliHBTPair::AliHBTPair(const AliHBTPair& in):
+ AliAODPair(in),
+ fWeight(in.fWeight),
+ fWeightNotCalc(in.fWeightNotCalc)
 {
-  if(fKtNotCalc)
-   { 
-     CalculateSums();
-     fKt =  0.5*TMath::Hypot(fPxSum,fPySum);
-     fKtNotCalc = kFALSE;
-   }
-  return fKt;
+ //cpy constructor
 }
 /************************************************************************/
 
-Double_t AliHBTPair::GetKStar()
+AliHBTPair& AliHBTPair::operator=(const AliHBTPair& in)
 {
-  if (fKStarNotCalc)
-   { 
-    
-    CalculateSums();
-
-    Double_t Ptrans = fPxSum*fPxSum + fPySum*fPySum;
-    Double_t Mtrans = fESum*fESum - fPzSum*fPzSum;
-    Double_t Pinv =   TMath::Sqrt(Mtrans - Ptrans);
-
-    Double_t Q = ( fPart1->GetMass()*fPart1->GetMass() - fPart2->GetMass()*fPart2->GetMass())/Pinv;
-    
-    CalculateQInvL();
-    
-    Q = TMath::Sqrt( Q*Q - fQInvL);
-    fKStar = Q/2.;
-    fKStarNotCalc = kFALSE;
-   }
-  return fKStar;
+ //Assigment operator
+ in.Copy(*this);
+ return *this;
 }
 /************************************************************************/
 
-Double_t AliHBTPair::GetQInv()
+Double_t AliHBTPair::GetWeight()
 {
-  if(fQInvNotCalc)
+  //returns and buffers weight for this pair
+  if (fWeightNotCalc)
    {
-    CalculateQInvL();
-    fQInv = TMath::Sqrt(TMath::Abs(fQInvL));
-    fQInvNotCalc = kFALSE;
+      fWeight = AliHBTWeights::Weight(this);
+      fWeightNotCalc = kFALSE;  
    }
-  return fQInv;
+  return fWeight; 
 }
-
 /************************************************************************/
-/************************************************************************/
-
-/************************************************************************/
-
-
-
-
-
-
-