]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAODPair.h
Two new functions provided by the HMPID team (K.Shileev)
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODPair.h
index f8de3c9cbed7ae00def663c9d19eee50ff96d8bd..289346623e892eba52f8ecf27fd44e8f691db30f 100644 (file)
@@ -7,7 +7,7 @@
 //
 // 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
 //
 ////////////////////////////////////////////////////////////////////////////
 
@@ -48,10 +48,16 @@ class AliAODPair: public TObject
    
    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();
@@ -61,8 +67,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
@@ -102,7 +118,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
@@ -129,6 +150,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
@@ -155,10 +177,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
 } 
@@ -182,6 +204,7 @@ void AliAODPair::Changed()
  fQtNotCalc        = kTRUE;
  fKtNotCalc         = kTRUE;
  fKStarNotCalc      = kTRUE;
+ fKStarCompNotCalc  = kTRUE;
  fQInvLNotCalc      = kTRUE;
  fGammaLCMSNotCalc = kTRUE;
  fAvarageDistanceNotCalc = kTRUE;
@@ -228,6 +251,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()
@@ -244,10 +307,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);
 }