]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTFunction.cxx
Bug corrections. New monitoring functions added (Q's VS QInv)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTFunction.cxx
index 3abac754ed80eae59ba7163019c4b44b63d3f4eb..767834a3fdcee3fd57585a8658440e4bd76fb56b 100644 (file)
@@ -1038,11 +1038,13 @@ void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHB
 {
   // Fills the numerator using pairs from the same event
   partpair  = CheckPair(partpair);
-  if( partpair ) 
-   { 
-     Double_t x = GetValue(trackpair,partpair);
-     fNumerator->Fill(x);
-   }
+  if( partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x = GetValue(trackpair,partpair);
+  fNumerator->Fill(x);
 }
 /******************************************************************/
 
@@ -1050,11 +1052,13 @@ void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHB
 {
   // Fills the denumerator usin mixed pairs
   partpair  = CheckPair(partpair);
-  if( partpair )
-   { 
-     Double_t x = GetValue(trackpair,partpair);
-     fDenominator->Fill(x);
-   }
+  if( partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x = GetValue(trackpair,partpair);
+  fDenominator->Fill(x);
 }
 /******************************************************************/
 /******************************************************************/
@@ -1106,12 +1110,14 @@ void AliHBTTwoPairFctn2D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHB
 {
 //processes pair of particles coming from a same events (real pair)
   partpair  = CheckPair(partpair);  //check cuts
-  if( partpair ) 
-   { 
-     Double_t x,y;
-     GetValues(trackpair,partpair,x,y);
-     fNumerator->Fill(x,y);
-   }
+  if (partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x,y;
+  GetValues(trackpair,partpair,x,y);
+  fNumerator->Fill(x,y);
 }
 /******************************************************************/
 
@@ -1119,12 +1125,14 @@ void AliHBTTwoPairFctn2D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHB
 {
 //processes pair of particles coming from a different events (mixed pair)
   partpair  = CheckPair(partpair);
-  if( partpair ) 
-   { 
-     Double_t x,y;
-     GetValues(trackpair,partpair,x,y);
-     fDenominator->Fill(x,y);
-   }
+  if (partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x,y;
+  GetValues(trackpair,partpair,x,y);
+  fDenominator->Fill(x,y);
 }
 
 /******************************************************************/
@@ -1179,12 +1187,15 @@ void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHB
 {
   // Fills th numerator using pairs from the same event
   partpair  = CheckPair(partpair);
-  if( partpair ) 
-   { 
-     Double_t x,y,z;
-     GetValues(trackpair,partpair,x,y,z);
-     fNumerator->Fill(x,y,z);
-   }
+  if( partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x,y,z;
+  GetValues(trackpair,partpair,x,y,z);
+  fNumerator->Fill(x,y,z);
+   
 }
 /******************************************************************/
 
@@ -1192,13 +1203,14 @@ void AliHBTTwoPairFctn3D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHB
 {
   // Fills the denumerator using mixed pairs
   partpair  = CheckPair(partpair);
-  if( partpair ) 
-   { 
-     Double_t x,y,z;
-     GetValues(trackpair,partpair,x,y,z);
-     fDenominator->Fill(x,y,z);
-   }
-
+  if( partpair == 0x0) return;
+  
+  if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
+    trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+    
+  Double_t x,y,z;
+  GetValues(trackpair,partpair,x,y,z);
+  fDenominator->Fill(x,y,z);
 }
 
 /******************************************************************/