]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAODPair.h
Additional protection: do not search for alignable object if the CPV is not in the...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODPair.h
index c70c0209723ccbf4425db5bd218b11e8cb039a92..5957f2a7fbf1c02f4c789efabc4a5c6182f01655 100644 (file)
@@ -1,5 +1,10 @@
 #ifndef AliAODPair_H
 #define AliAODPair_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
 //_________________________________________________________________________
 ///////////////////////////////////////////////////////////////////////////
 //
 //
 // class implements pair of particles and taking care of caluclation (almost)
 // all of pair properties (Qinv, InvMass,...)
-// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
+// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
 //
 ////////////////////////////////////////////////////////////////////////////
 
+#include <TMath.h>
 #include <TObject.h>
-#include "AliVAODParticle.h"
 
+#include "AliVAODParticle.h"
 
 class AliAODPair: public TObject
 {
@@ -41,14 +47,23 @@ class AliAODPair: public TObject
    virtual Double_t GetQSideLCMS(); //returns Q Side CMS longitudionally co-moving
    virtual Double_t GetQOutLCMS(); //returns Q out CMS longitudionally co-moving
    virtual Double_t GetQLongLCMS(); //returns Q Long CMS longitudionally co-moving
+   virtual Double_t GetQtLCMS(); //returns Q transverse CMS longitudionally co-moving
+   
+   virtual Double_t GetQt(); //returns Q transverse to Kt
    
    
    virtual Double_t GetKt();  //returns K transverse
    virtual Double_t GetKStar();
+   virtual Double_t GetKStarOut();  //z.ch.
+   virtual Double_t GetKStarSide(); //z.ch.
+   virtual Double_t GetKStarLong(); //z.ch.
    
+
    virtual Double_t GetAvarageDistance();//returns avarage distnace between two tracks
    
-   virtual Double_t GetDeltaP(); //return difference of momenta
+   virtual Double_t GetDeltaE(); //return difference of Energies
+   virtual Double_t GetDeltaP(); //return difference of momenta (scalar difference)
+   virtual Double_t GetDeltaPvector(); //return legth of difference vector of momenta
    virtual Double_t GetDeltaPt();
    virtual Double_t GetDeltaPx();
    virtual Double_t GetDeltaPy();
@@ -58,8 +73,18 @@ class AliAODPair: public TObject
    virtual Double_t GetDeltaPhi();
    
    virtual Double_t GetGammaToLCMS();
+   virtual Double_t GetGammaToTransverse();
    virtual Double_t GetPIDProb() const {return fPart1->GetPidProb()*fPart2->GetPidProb();}
    
+   virtual Double_t GetRStar() ;
+   virtual Double_t GetR() ;//returns distance between particle production points   
+   
+   void   MirrorSecond();
+   void   DeleteSecond();
+   
+   void   Print(const Option_t* option ) const {TObject::Print(option);}
+   void   Print() ;
+   
  protected:
    AliVAODParticle* fPart1;  //pointer to first particle
    AliVAODParticle* fPart2;  //pointer to second particle
@@ -79,6 +104,13 @@ class AliAODPair: public TObject
    
    Double_t fQLongLCMS; //value of Q long CMS longitudially co-moving
    Bool_t   fQLongLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair
+   
+   Double_t fQtLCMS; //value of Qt CMS longitudially co-moving (hypot(qsidelcms,qoutlcms))
+   Bool_t   fQtLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair
+
+   Double_t fQt; //value of Qt, projection of 3-mom diff to Kt
+   Bool_t   fQtNotCalc;//flag indicating if fQt is already calculated for this pair
+   
 /************************************************************/
 /************************************************************/
    Double_t fQInv;  //half of differnece of 4-momenta
@@ -92,7 +124,12 @@ class AliAODPair: public TObject
    
    Double_t fKStar; // KStar
    Bool_t   fKStarNotCalc;// flag indicating if fKStar is calculated
-   
+   Double_t fKStarOut; // KStarOut   z.ch.
+   Double_t fKStarSide;// KStarSide  z.ch.
+   Double_t fKStarLong;// KStarLong  z.ch.
+
+   Bool_t   fKStarCompNotCalc; // flag indicating if CalcuteKStarComp() is calculated  z.ch.
+
    Double_t fPInv;  //invariant momentum
    
    Double_t fQSide; //Q Side
@@ -119,6 +156,7 @@ class AliAODPair: public TObject
    Double_t fESum;// Sum of energies
    Bool_t   fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair
    void     CalculateSums();
+   void     CalculateKStarComp();
    
    Double_t fPxDiff;// Difference of Px momenta
    Double_t fPyDiff;// Difference of Px momenta
@@ -145,10 +183,10 @@ void AliAODPair::SetParticles(AliVAODParticle* p1,AliVAODParticle* p2)
 {
  //sets the particle to the pair
  
- fPart1 = p1;
+ fPart1 = p1; 
  fPart2 = p2;
  if (fSwappedPair) //if we have Swapped (so we are not)
-   fSwappedPair->SetParticles(p2,p1); //set particles for him too
+   fSwappedPair->SetParticles(fPart2,p1); //set particles for him too
  Changed();
  //and do nothing until will be asked for
 } 
@@ -168,8 +206,11 @@ void AliAODPair::Changed()
  fQSideLCMSNotCalc = kTRUE;
  fQOutLCMSNotCalc  = kTRUE;
  fQLongLCMSNotCalc = kTRUE;
+ fQtLCMSNotCalc    = kTRUE;
+ fQtNotCalc        = kTRUE;
  fKtNotCalc         = kTRUE;
  fKStarNotCalc      = kTRUE;
+ fKStarCompNotCalc  = kTRUE;
  fQInvLNotCalc      = kTRUE;
  fGammaLCMSNotCalc = kTRUE;
  fAvarageDistanceNotCalc = kTRUE;
@@ -216,6 +257,46 @@ void AliAODPair::CalculateSums()
      fSumsNotCalc = kFALSE;
     }
  }
+/****************************************************************/
+inline
+void AliAODPair::CalculateKStarComp()
+{
+  
+  if (fKStarCompNotCalc)
+    {
+      CalculateSums();
+
+      Double_t ptrans = fPxSum*fPxSum + fPySum*fPySum;
+      Double_t mtrans = fESum*fESum - fPzSum*fPzSum;
+      Double_t pinv  =  TMath::Sqrt(mtrans - ptrans);
+      ptrans         =  TMath::Sqrt(ptrans);
+      mtrans         =  TMath::Sqrt(mtrans);
+      
+      Double_t px1   = fPart1->Px();
+      Double_t py1   = fPart1->Py();
+      Double_t pz1   = fPart1->Pz();
+      Double_t pE1   = fPart1->E();
+
+      // boost to LCMS
+      Double_t beta  = fPzSum / fESum;
+      Double_t gamma = fESum / mtrans;
+
+      fKStarLong     = gamma * (pz1 - beta * pE1);
+      double   temp  = gamma * (pE1 - beta * pz1);
+
+      // rotate in transverse plane
+      fKStarSide = (-px1*fPySum + py1*fPxSum)/ptrans;
+      fKStarOut  = ( px1*fPxSum + py1*fPySum)/ptrans;
+      // go from LCMS to CMS
+      gamma = mtrans/pinv;
+      beta  = ptrans/mtrans;
+      fKStarOut  = gamma * (fKStarOut - beta * temp);
+
+      fKStarCompNotCalc = kFALSE;
+    }
+}
+
 /****************************************************************/
 inline 
 void AliAODPair::CalculateDiffs()
@@ -232,10 +313,27 @@ void AliAODPair::CalculateDiffs()
  }
 
 /****************************************************************/
+
+inline 
+Double_t AliAODPair::GetDeltaE() 
+{
+ //returns difference of energies
+  return fPart1->E() - fPart2->E();
+}
+/****************************************************************/
+
+inline 
+Double_t AliAODPair::GetDeltaP() 
+{
+ //returns difference of momenta (scalars)
+ return fPart1->P() - fPart2->P();
+}
+/****************************************************************/
+
 inline 
-Double_t AliAODPair::GetDeltaP() //return difference of momenta
+Double_t AliAODPair::GetDeltaPvector() //return difference of momenta
 {
- //returns difference of momenta (length of vector)
+ //returns legth of the momenta difference vector 
  CalculateDiffs();
  return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff);
 }