]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTWeightFctn.cxx
Incrementing class versions
[u/mrichter/AliRoot.git] / HBTAN / AliHBTWeightFctn.cxx
index 2d2b91fd42eb70e784ad2d09163bcab53f6794d7..23ac322f7e67364bf3056d12629a9bacdb17a923 100644 (file)
@@ -2,19 +2,18 @@
 /* $Id$ */
 //_________________________________________________________________________
 //
-// class 
+// class AliHBTWeightQInvFctn
 //
-//This class allows to obtain Q_inv correlation function with weights
-//calculated by Lednicky's alghorithm.
-//Numerator is filled with weighted events. Weights are attributed to reconstructed tracks.
-//Weights are calculated with corresponding simulated particles momenta.
-//Denominator is filled with mixing unweighted reconstructed tracks.
-//One needs both pairs 
-//(simulated and recontructed), thus function is of class AliHBTTwoPairFctn1D.
-//Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru)
-#include "AliHBTWeightsPID.h"
-
-//--for test--AliHBTWeightQInvFctn* yyy= new AliHBTWeightQInvFctn();
+// This class allows to obtain Q_inv correlation function with weights
+// calculated by Lednicky's alghorithm.
+// Numerator is filled with weighted events. Weights are attributed to reconstructed tracks.
+// Weights are calculated with corresponding simulated particles momenta.
+// Denominator is filled with mixing unweighted reconstructed tracks.
+// One needs both pairs 
+// (simulated and recontructed), thus function is of class AliHBTTwoPairFctn1D.
+// Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru)
+//
+////////////////////////////////////////////////////////////////////////////////
 
 ClassImp( AliHBTWeightQInvFctn )
 
@@ -28,11 +27,12 @@ AliHBTWeightQInvFctn::AliHBTWeightQInvFctn(Int_t nbins, Double_t maxXval, Double
  Rename("wqinvcf","Q_{inv} Weight Correlation Function");
 }
 /****************************************************************/
+
 void  AliHBTWeightQInvFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -52,17 +52,21 @@ void  AliHBTWeightQInvFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Ali
 {
   // Fills the denominator using mixed pairs
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
      fDenominator->Fill(trackpair->GetQInv());
   }
 }
 /**************************************************************/
+
 TH1* AliHBTWeightQInvFctn::GetResult()
 { 
 //returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /**************************************************************************************/
@@ -80,11 +84,12 @@ AliHBTWeightQOutFctn::AliHBTWeightQOutFctn(Int_t nbins, Double_t maxXval, Double
  Rename("wqoutcf","Q_{out} Weight Correlation Function");
 }
 /****************************************************************/
+
 void AliHBTWeightQOutFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)  
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -95,7 +100,7 @@ void AliHBTWeightQOutFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliH
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQOutCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQOutLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -104,18 +109,20 @@ void AliHBTWeightQOutFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliH
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQOutCMSLC());
+     fDenominator->Fill(trackpair->GetQOutLCMS());
   }
 }
 /**************************************************************/
+
 TH1* AliHBTWeightQOutFctn::GetResult() 
-                                                                               
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -131,11 +138,12 @@ AliHBTWeightQLongFctn::AliHBTWeightQLongFctn(Int_t nbins, Double_t maxXval, Doub
  Rename("wqlongcf","Q_{long} Weight Correlation Function");
 }
 /****************************************************************/
+
 void AliHBTWeightQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
 //process particles from same events (fills numerator)
+ //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -146,7 +154,7 @@ void AliHBTWeightQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, Ali
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQLongCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQLongLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -155,18 +163,19 @@ void AliHBTWeightQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Ali
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQLongCMSLC());
+     fDenominator->Fill(trackpair->GetQLongLCMS());
   }
 }
 /**************************************************************/
-TH1* AliHBTWeightQLongFctn::GetResult() 
-                                                                               
+TH1* AliHBTWeightQLongFctn::GetResult()
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -184,11 +193,12 @@ AliHBTWeightQSideFctn::AliHBTWeightQSideFctn(Int_t nbins, Double_t maxXval, Doub
  Rename("wqsidecf","Q_{side} Weight Correlation Function");
 }
 /****************************************************************/
+
 void AliHBTWeightQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -199,7 +209,7 @@ void AliHBTWeightQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, Ali
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQSideCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQSideLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -208,18 +218,20 @@ void  AliHBTWeightQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Al
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQSideCMSLC());
+     fDenominator->Fill(trackpair->GetQSideLCMS());
   }
 }
 /**************************************************************/
+
 TH1* AliHBTWeightQSideFctn::GetResult() 
-                                                                               
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -236,11 +248,12 @@ AliHBTWeightTwoKStarFctn::AliHBTWeightTwoKStarFctn(Int_t nbins, Double_t maxXval
  Rename("wtwokstarcf","2*K^{*} Weight Correlation Function");
 }
 /****************************************************************/
+
 void AliHBTWeightTwoKStarFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -260,7 +273,7 @@ void  AliHBTWeightTwoKStarFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
      fDenominator->Fill(2.0*(trackpair->GetKStar()));
@@ -270,8 +283,10 @@ void  AliHBTWeightTwoKStarFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 TH1* AliHBTWeightTwoKStarFctn::GetResult() 
                                                                                
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -290,11 +305,12 @@ AliHBTWeightQOutQSideFctn::AliHBTWeightQOutQSideFctn(Int_t nxbins, Double_t maxX
  Rename("wqoutqsidecf","Q_{out} Q_{side} Weight Correlation Function 2D");
 }    
 /*************************************************************************************/ 
+
 void AliHBTWeightQOutQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -305,7 +321,7 @@ void AliHBTWeightQOutQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair,
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQOutCMSLC(),trackpair->GetQSideCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -314,17 +330,20 @@ void AliHBTWeightQOutQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQOutCMSLC(),trackpair->GetQSideCMSLC());
+     fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS());
   }
 }
 /**************************************************************/
+
 TH1* AliHBTWeightQOutQSideFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 /*************************************************************************************/ 
@@ -343,11 +362,12 @@ AliHBTWeightQOutQLongFctn::AliHBTWeightQOutQLongFctn(Int_t nxbins, Double_t maxX
  Rename("wqoutqlongcf","Q_{out} Q_{long} Weight Correlation Function 2D");
 }    
 /*************************************************************************************/ 
+
 void AliHBTWeightQOutQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -358,7 +378,7 @@ void AliHBTWeightQOutQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair,
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQOutCMSLC(),trackpair->GetQLongCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -367,18 +387,20 @@ void AliHBTWeightQOutQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQOutCMSLC(),trackpair->GetQLongCMSLC());
+     fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS());
   }
 }
 /**************************************************************/
 
 TH1* AliHBTWeightQOutQLongFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 /*************************************************************************************/ 
@@ -397,11 +419,12 @@ AliHBTWeightQSideQLongFctn::AliHBTWeightQSideQLongFctn(Int_t nxbins, Double_t ma
  Rename("wqsideqlongcf","Q_{side} Q_{long} Weight Correlation Function 2D");
 }    
 /*************************************************************************************/ 
+
 void AliHBTWeightQSideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
   //process particles from same events (fills numerator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)     
   {
 //    Double_t weightPID=1.;
@@ -412,7 +435,7 @@ void AliHBTWeightQSideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair
          weight=partpair->GetWeight();
       }   
 //    Double_t weight=weightHBT*weightPID;
-    fNumerator->Fill(trackpair->GetQSideCMSLC(),trackpair->GetQLongCMSLC(),weight);
+    fNumerator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS(),weight);
   }
 } 
 /****************************************************************/
@@ -421,15 +444,98 @@ void AliHBTWeightQSideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair
 {
   //process particles from diff events (fills denominator)
   trackpair = CheckPair(trackpair);
-  partpair  = CheckPair(partpair);
+//  partpair  = CheckPair(partpair);
   if ( trackpair && partpair)  
   {
-     fDenominator->Fill(trackpair->GetQSideCMSLC(),trackpair->GetQLongCMSLC());
+     fDenominator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS());
   }
 }
 /**************************************************************/
+
 TH1* AliHBTWeightQSideQLongFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
+}
+/*************************************************************/
+/*************************************************************/
+/*************************************************************/ 
+
+ClassImp(AliHBTWeightQOutSQideQLongFctn)
+
+AliHBTWeightQOutSQideQLongFctn::AliHBTWeightQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
+                                                   Int_t nYbins, Double_t maxYval, Double_t minYval,
+                                                   Int_t nZbins, Double_t maxZval, Double_t minZval):
+ AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
+{
+  //ctor
+  fWriteNumAndDen = kTRUE;//change default behaviour
+  Rename("wqoslcf","Q_{out}-Q_{side}-Q_{long} Weight Correlation Fctn");
+}
+/*************************************************************/
+
+void AliHBTWeightQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+//Fills numerator
+  //process particles from same events (fills numerator)
+  trackpair = CheckPair(trackpair);
+//  partpair  = CheckPair(partpair);
+  if ( trackpair && partpair)     
+  {
+//    Double_t weightPID=1.;
+    Double_t weight = 1.0;
+    if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
+         ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
+      {   
+         weight=partpair->GetWeight();//here we take weight from the particle pair
+      }   
+//    Double_t weight=weightHBT*weightPID;
+    Double_t out = trackpair->GetQOutLCMS();
+    Double_t side = trackpair->GetQSideLCMS();
+    Double_t lon = trackpair->GetQLongLCMS();
+    
+    if (fAbs)
+     {
+       out = TMath::Abs(out);
+       side = TMath::Abs(side);
+       lon = TMath::Abs(lon);
+     }
+    
+    fNumerator->Fill(out,side,lon,weight);//here we fill in q's corresponding to track pair 
+                                          //weight calculated for the simulated one
+  }
 }
+/*************************************************************/
+
+void AliHBTWeightQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+  //process particles from diff events (fills denominator)
+  trackpair = CheckPair(trackpair);
+//  partpair  = CheckPair(partpair);
+  if ( trackpair && partpair)  
+   {
+    Double_t out = trackpair->GetQOutLCMS();
+    Double_t side = trackpair->GetQSideLCMS();
+    Double_t lon = trackpair->GetQLongLCMS();
+    
+    if (fAbs)
+     {
+       out = TMath::Abs(out);
+       side = TMath::Abs(side);
+       lon = TMath::Abs(lon);
+     }
+   
+    fDenominator->Fill(out,side,lon);
+   }
+}
+/*************************************************************/
+
+TH1* AliHBTWeightQOutSQideQLongFctn::GetResult()
+{
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
+}