Retrofeed from 4-01-Release
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Feb 2005 11:36:00 +0000 (11:36 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Feb 2005 11:36:00 +0000 (11:36 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTAnalysis.h
HBTAN/AliHBTCorrFitFctn.cxx
HBTAN/AliHBTCorrFitFctn.h
HBTAN/AliHBTCorrectOSLCorrelFctn.cxx
HBTAN/AliHBTCorrectOSLCorrelFctn.h
HBTAN/AliHBTCorrectQInvCorrelFctn.cxx
HBTAN/AliHBTCorrectQInvCorrelFctn.h
HBTAN/AliHBTFunction.cxx
HBTAN/AliHBTQDistributionFctns.cxx
HBTAN/HBTAnalysisLinkDef.h

index ef5c309..2e27aa8 100644 (file)
@@ -19,6 +19,8 @@
 ////////////////////////////////////////////////////////////////////////////
 //_________________________________________________________
 
+#include <Riostream.h>
+#include <AliESD.h>
 
 #include <TSystem.h>
 #include <TFile.h>
@@ -539,8 +541,6 @@ Int_t AliHBTAnalysis::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
   
   register UInt_t ii;
   
-  
-
   if ( !partEvent )
    {
      Error("ProcessSim","Can not get event");
@@ -663,7 +663,6 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
   AliHBTPair * tmptrackpair;
   
   register UInt_t ii;
-  
 
   if ( !trackEvent )
    {
@@ -679,7 +678,7 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
      /******   filling numerators    ********/
      /***************************************/
      if ( (j%fDisplayMixingInfo) == 0)
-        Info("ProcessTracksAndParticles",
+        Info("ProcessRec",
              "Mixing Particle %d with Particles from the same event",j);
 
      track1= trackEvent->GetParticle(j);
@@ -700,7 +699,7 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
      for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
        fParticleMonitorFunctions[ii]->Process(track1);
 
-     if ( fNParticleFunctions == 0 ) continue;
+     if ( fNTrackFunctions == 0 ) continue;
 
      for (Int_t k =j+1; k < trackEvent->GetNumberOfParticles() ; k++)
       {
@@ -719,7 +718,7 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
             }
 
         for(ii = 0;ii<fNTrackFunctions;ii++)
-               fParticleFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
+               fTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
 
        //end of 2nd loop over Particles from the same event  
       }//for (Int_t k =j+1; k < trackEvent->GetNumberOfParticles() ; k++)
@@ -730,39 +729,39 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
      if (fBufferSize == 0) continue;
 
      fTrackBuffer->ResetIter();
-         Int_t m = 0;
-         while (( trackEvent2 = fTrackBuffer->Next() ))
+     Int_t m = 0;
+     while (( trackEvent2 = fTrackBuffer->Next() ))
+      {
+        m++;
+        if ( (j%fDisplayMixingInfo) == 0)
+           Info("ProcessRec",
+                "Mixing Particle %d from current event with Particles from event %d",j,-m);
+        for(Int_t l = 0; l<trackEvent2->GetNumberOfParticles();l++)   //  ... on all Particles
           {
-            m++;
-            if ( (j%fDisplayMixingInfo) == 0)
-               Info("ProcessParticles",
-                    "Mixing Particle %d from current event with Particles from event %d",j,-m);
-            for(Int_t l = 0; l<trackEvent2->GetNumberOfParticles();l++)   //  ... on all Particles
-              {
-
-                track2= trackEvent2->GetParticle(l);
-                trackpair->SetParticles(track1,track2);
-
-                if( fPairCut->Rejected(trackpair) ) //check pair cut
-                  { //do not meets crietria of the 
-                    if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) )
-                      continue;
-                    else 
-                     {
-                       tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
-                     }
-                  }
-                else
-                 {//meets criteria of the pair cut
-                  tmptrackpair = trackpair;
+
+            track2= trackEvent2->GetParticle(l);
+            trackpair->SetParticles(track1,track2);
+
+            if( fPairCut->Rejected(trackpair) ) //check pair cut
+              { //do not meets crietria of the 
+                if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) )
+                  continue;
+                else 
+                 {
+                   tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
                  }
-                 
-                for(ii = 0;ii<fNTrackFunctions;ii++)
-                  fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
-                 
-             }//for(Int_t l = 0; l<N2;l++)   //  ... on all Particles
-          }
-       }
+              }
+            else
+             {//meets criteria of the pair cut
+              tmptrackpair = trackpair;
+             }
+
+            for(ii = 0;ii<fNTrackFunctions;ii++)
+              fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
+
+         }//for(Int_t l = 0; l<N2;l++)   //  ... on all Particles
+      }
+   }
   delete fTrackBuffer->Push(trackEvent1);
  //end of loop over events  
   return 0;
@@ -1741,5 +1740,3 @@ void AliHBTAnalysis::PressAnyKey()
    }
 }
 
-/*************************************************************************************/ 
-
index c3e1757..850acfa 100644 (file)
@@ -83,6 +83,7 @@ class AliHBTAnalysis: public AliAnalysis
      void   SetApparentVertex(Double_t x, Double_t y, Double_t z);//Sets apparent vertex
      
      static void PressAnyKey();//small utility function that helps to make comfortable macros
+
      
    protected:
      
index 5b77f06..144c7cf 100644 (file)
@@ -11,11 +11,33 @@ ClassImp(AliHBTCorrFitFctn)
 
 /*****************************************************************/
 
-AliHBTCorrFitFctn::AliHBTCorrFitFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
- AliHBTTwoPairFctn1D(nbins,maxXval,minXval),
+AliHBTCorrFitFctn::AliHBTCorrFitFctn():
+ AliHBTOnePairFctn1D(),
+ fNtuple(0x0),
+ fNPairsFitArea(0),
+ fNMaxPairsFitArea(3000000),
+ fFitRangeMax(0.05),
+ fNPairsNormArea(0),
+ fNMaxPairsNormArea(1000000),
+ fNormRangeMin(0.05),
+ fNormRangeMax(0.1)
+{
+//ctor
+ fWriteNumAndDen = kTRUE;//change default behaviour
+ Rename("wqinvcfCorrFit","Lednicky Weught Theoretical Q_{inv} Correlation Function");
+} 
+/*****************************************************************/
+
+AliHBTCorrFitFctn::AliHBTCorrFitFctn(Int_t  fit, Int_t  norm):
+ AliHBTOnePairFctn1D(100,0.1,0.0),
  fNtuple(new TNtuple("pair", "pair", "px1:py1:pz1:e1:px2:py2:pz2:e2")),
  fNPairsFitArea(0),
- fNPairsNormArea(0)
+ fNMaxPairsFitArea(fit),
+ fFitRangeMax(0.05),
+ fNPairsNormArea(0),
+ fNMaxPairsNormArea(norm),
+ fNormRangeMin(0.05),
+ fNormRangeMax(0.1)
 {
 //ctor
  fWriteNumAndDen = kTRUE;//change default behaviour
@@ -23,63 +45,64 @@ AliHBTCorrFitFctn::AliHBTCorrFitFctn(Int_t nbins, Double_t maxXval, Double_t min
 } 
 /*****************************************************************/
 
-void AliHBTCorrFitFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+void AliHBTCorrFitFctn::ProcessSameEventParticles(AliHBTPair* /*trackpair*/)
 {
  //Fills the numerator using pair from the same event
 //   partpair = CheckPair(partpair);
-   if(partpair == 0x0) return; 
-   trackpair = CheckPair(trackpair);
-   if(trackpair == 0x0) return; 
-   
-   Double_t q = trackpair->GetQInv();
-   
-   Double_t weight = partpair->GetWeight();
-   fNumerator->Fill(q,weight);
-   
+   return;
 
 }
 /****************************************************************/
 
-void  AliHBTCorrFitFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+void  AliHBTCorrFitFctn::ProcessDiffEventParticles(AliHBTPair* trackpair)
 {
   // Fills the denominator using mixed pairs
   trackpair = CheckPair(trackpair);
-//  partpair  = CheckPair(partpair);
-  if ( trackpair && partpair)
-   {
-     Double_t q = trackpair->GetQInv();
-
-     Bool_t fill = kFALSE;
-    
-     if ( (q < 0.15) && (fNPairsFitArea < 2.e+5))
-       {
-         fNPairsFitArea++;
-         fill = kTRUE;
-       }
+  if ( trackpair == 0x0) return;
+  
+  Double_t q = 2.* trackpair->GetKStar();
 
-     if ( (q > 0.15) && (q < 0.3) && (fNPairsFitArea < 1.e+5))
-       {
-         fNPairsNormArea++;
-         fill = kTRUE;
-       }
+  Bool_t fill = kFALSE;
 
-     if (fill)
-      {  
-        const AliVAODParticle& p1 = *(trackpair->Particle1());
-        const AliVAODParticle& p2 = *(trackpair->Particle2());
-        fNtuple->Fill(p1.Px(),p1.Py(),p1.Pz(),p1.E(),
-                      p2.Px(),p2.Py(),p2.Pz(),p2.E());
-      }
+  if ( q < fFitRangeMax )
+   {
+    if (fNPairsFitArea < fNMaxPairsFitArea)
+     {
+       fNPairsFitArea++;
+       fill = kTRUE;
+     }
+    else
+     {
+       Info("ProcessDiffEventParticles","Fit area already full");
+     } 
+   }
+   
+  if ( (q > fNormRangeMin) && (q < fNormRangeMax) )
+   { 
+    if  ( fNPairsNormArea < fNMaxPairsNormArea) 
+     {
+       fNPairsNormArea++;
+       fill = kTRUE;
+     }
+   }
+  if (fill)
+   {  
+     const AliVAODParticle& p1 = *(trackpair->Particle1());
+     const AliVAODParticle& p2 = *(trackpair->Particle2());
+     fNtuple->Fill(p1.Px(),p1.Py(),p1.Pz(),p1.E(),
+                   p2.Px(),p2.Py(),p2.Pz(),p2.E());
 
-       fDenominator->Fill(q);
+     fDenominator->Fill(q);  
    }
+
+
 }
 /*****************************************************************/
 
 TH1* AliHBTCorrFitFctn::GetResult()
 {
-//returns ratio of numerator and denominator
- return GetRatio(Scale());
+//returns denominator
+ return fDenominator;
 }
 /**************************************************************/
 
index f15eb73..f9ec72f 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef ALIHBTCORRFITFCTN_H
 #define ALIHBTCORRFITFCTN_H
+
 //____________________________________________________________
 ///////////////////////////////////////////////////////////////
 //                                                           //
 #include "AliHBTFunction.h"
 #include <TNtuple.h>
 
-class AliHBTCorrFitFctn: public AliHBTTwoPairFctn1D
+class AliHBTCorrFitFctn: public AliHBTOnePairFctn1D
 {
 //Q Invaraint Correlation Function
 //It writes Ntuple that is input for CorrFit
  public:
-   AliHBTCorrFitFctn(Int_t nbins = 300, Double_t maxXval = 0.3, Double_t minXval = 0.0);
+   AliHBTCorrFitFctn();
+   AliHBTCorrFitFctn(Int_t  fit, Int_t  norm);
    virtual ~AliHBTCorrFitFctn(){delete fNtuple;}
-   void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
-   void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
+   void ProcessSameEventParticles(AliHBTPair* trackpair);
+   void ProcessDiffEventParticles(AliHBTPair* trackpair);
    
    TH1* GetResult();
    void WriteFunction();
+
+   void SetMaxNumberOfPairs(Int_t  fit, Int_t  norm){fNMaxPairsFitArea = fit; fNMaxPairsNormArea = norm;}
+   void SetFitRange(Float_t max) {fFitRangeMax = max;}
+   void SetNormalizationRange(Float_t min, Float_t max) { fNormRangeMin = min; fNormRangeMax= max;}
  protected:
-   Double_t GetValue(AliHBTPair* /*trackpair*/, AliHBTPair* /*partpair*/) const {return 0.0;}//not usable
+   Double_t GetValue(AliHBTPair* /*trackpair*/) const {return 0.0;}//not usable
    
    TNtuple* fNtuple;//ntuple for storig pairs
-   Int_t    fNPairsFitArea;//number of pairs in fitting area
+
+   Int_t    fNPairsFitArea;//current number of pairs in fitting area
+   Int_t    fNMaxPairsFitArea;//current number of pairs in fitting area
+   Float_t  fFitRangeMax;
+   
    Int_t    fNPairsNormArea;//number of pairs in normalization area
+   Int_t    fNMaxPairsNormArea;//number of pairs in normalization area
+   Float_t  fNormRangeMin;
+   Float_t  fNormRangeMax;
   public:
    ClassDef(AliHBTCorrFitFctn,1)
 };
index 4821ff3..958862d 100644 (file)
@@ -1,8 +1,4 @@
 #include "AliHBTCorrectOSLCorrelFctn.h"
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
 //____________________
 ///////////////////////////////////////////////////////
 //                                                   //
 //                                                   //
 ///////////////////////////////////////////////////////
 
+#include <TH3.h>
+
+#include <AliAODParticle.h>
+#include <AliHBTPair.h>
 
 AliHBTCorrectOSLCorrelFctn::AliHBTCorrectOSLCorrelFctn(const char* name, const char* title):
  AliHBTOnePairFctn3D(name,title),
+ AliHBTCorrectedCorrelFctn(),
  fMeasCorrelFctn(0x0),
  fSmearedNumer(0x0),
  fSmearedDenom(0x0),
  fMeasNumer(0x0),
- fMeasDenom(0x0)
+ fMeasDenom(0x0),
+ fLambda(0.0),
+ fROutSq(0.0),
+ fRSideSq(0.0),
+ fRLongSq(0.0)
 {
 //ctor
+  fWriteNumAndDen = kTRUE;//change default behaviour
 }
 /******************************************************************/
 
+AliHBTCorrectOSLCorrelFctn::AliHBTCorrectOSLCorrelFctn(const Char_t *name, const Char_t *title,
+                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):
+ AliHBTOnePairFctn3D(name,title,nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval),
+ AliHBTCorrectedCorrelFctn(),
+ fMeasCorrelFctn(0x0),
+ fSmearedNumer(0x0),
+ fSmearedDenom(0x0),
+ fMeasNumer(0x0),
+ fMeasDenom(0x0),
+ fLambda(0.0),
+ fROutSq(0.0),
+ fRSideSq(0.0),
+ fRLongSq(0.0)
+{
+//ctor
+  fWriteNumAndDen = kTRUE;//change default behaviour}
+}
+
+/******************************************************************/
 AliHBTCorrectOSLCorrelFctn::AliHBTCorrectOSLCorrelFctn(const AliHBTCorrectOSLCorrelFctn& in):
  AliHBTOnePairFctn3D(in),
+ AliHBTCorrectedCorrelFctn(),
  fMeasCorrelFctn(0x0),
  fSmearedNumer(0x0),
  fSmearedDenom(0x0),
  fMeasNumer(0x0),
- fMeasDenom(0x0)
+ fMeasDenom(0x0),
+ fLambda(0.0),
+ fROutSq(0.0),
+ fRSideSq(0.0),
+ fRLongSq(0.0)
 {
 //cpy constructor
  in.Copy(*this);
@@ -49,5 +81,160 @@ AliHBTCorrectOSLCorrelFctn::~AliHBTCorrectOSLCorrelFctn()
  delete fMeasNumer;
  delete fMeasDenom;
 }
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
+                            Int_t nybins, Float_t ymax, Float_t ymin,
+                    Int_t nzbins, Float_t zmax, Float_t zmin)
+{
+//build histograms
+  if (AliVAODParticle::GetDebug()>1) Info("BuildHistos","Enetered BuildHistos(...)");
+  
+  AliHBTFunction3D::BuildHistos(nxbins,xmax,xmin,nybins,ymax,ymin,nzbins,zmax,zmin);
+  
+  TString numstr = fName + " Smeared Numerator";  //title and name of the numerator histogram
+  TString denstr = fName + " Smeared Denominator";//title and name of the denominator histogram
+  
+  fSmearedNumer = new TH3F(numstr.Data(),numstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+  fSmearedDenom = new TH3F(denstr.Data(),denstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+  fSmearedNumer->Sumw2();
+  fSmearedDenom->Sumw2();
+  
+  if (fMeasCorrelFctn == 0x0)
+   { 
+     numstr = fName + " Measured Numerator";  //title and name of the numerator histogram
+     denstr = fName + " Measured Denominator";//title and name of the denominator histogram
+    
+     fMeasNumer = new TH3F(numstr.Data(),numstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+     fMeasDenom = new TH3F(denstr.Data(),denstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+     fMeasNumer->Sumw2();
+     fMeasDenom->Sumw2();
+   }
+
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::Init()
+{
+//Init
+  AliHBTOnePairFctn3D::Init();
+  Info("Init","");
+  if ( (fSmearedNumer == 0x0) || (fSmearedDenom == 0x0) )
+   {
+     if (fNumerator == 0x0) Fatal("Init","Sth. goes wrong");
+     Int_t nxbins = fNumerator->GetNbinsX();
+     Float_t xmax = fNumerator->GetXaxis()->GetXmax();
+     Float_t xmin = fNumerator->GetXaxis()->GetXmin();
+     Int_t nybins = fNumerator->GetNbinsY();
+     Float_t ymax = fNumerator->GetYaxis()->GetXmax();
+     Float_t ymin = fNumerator->GetYaxis()->GetXmin();
+     Int_t nzbins = fNumerator->GetNbinsZ();
+     Float_t zmax = fNumerator->GetZaxis()->GetXmax();
+     Float_t zmin = fNumerator->GetZaxis()->GetXmin();
+     BuildHistos(nxbins,xmax,xmin, nybins,ymax,ymin, nzbins,zmax,zmin);
+   }
+   
+  fSmearedNumer->Reset();
+  fSmearedDenom->Reset();
+  if (fMeasNumer) fMeasNumer->Reset();
+  if (fMeasDenom) fMeasDenom->Reset();
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::SetInitialValues(Double_t lambda, Double_t rout, Double_t rside, Double_t rlong)
+{
+  //Sets assumed parameters
+ fLambda = lambda;
+ fROutSq = rout*rout;
+ fRSideSq = rside*rside;
+ fRLongSq = rlong*rlong;
+}
+
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::ProcessSameEventParticles(AliHBTPair* pair)
+{
+ //Processes particles that originates from the same event
+  
+  return; //we already heave the measured in hand
+  if (fMeasNumer == 0x0) return;
+  pair = CheckPair(pair);
+  if( pair == 0x0) return;
+  fMeasNumer->Fill(pair->GetQInv());
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::ProcessDiffEventParticles(AliHBTPair* pair)
+{
+//Process different events 
+  static AliAODParticle part1, part2;
+  static AliHBTPair smearedpair(&part1,&part2);
+  
+  pair = CheckPair(pair);
+  if( pair == 0x0) return;
+  
+  Double_t cc = GetCoulombCorrection(pair);
+
+  Double_t qout,qside,qlong;
+  GetValues(pair,qout,qside,qlong);
+
+  //measured histogram -> if we are interested 
+  //only if fMeasCorrelFctn is not specified by user
+
+//  if (fMeasDenom) fMeasDenom->Fill(qout,qside,qlong,cc);
+
+  Smear(pair,smearedpair);
+  Double_t modelval = GetModelValue(qout,qside,qlong);  
+  //Ideal histogram
+  fNumerator->Fill(qout,qside,qlong,modelval*cc);
+  fDenominator->Fill(qout,qside,qlong,cc);
+  
+  //Smeared histogram
+
+  Double_t smearedqout,smearedqside,smearedqlong;
+  
+  GetValues(&smearedpair,smearedqout,smearedqside,smearedqlong);
+  
+  fSmearedNumer->Fill(smearedqout,smearedqside,smearedqlong,modelval);
+  
+  Double_t smearedcc = GetCoulombCorrection(&smearedpair);
+  fSmearedDenom->Fill(smearedqout,smearedqside,smearedqlong,smearedcc);
+  
+}
+/******************************************************************/
 
+void AliHBTCorrectOSLCorrelFctn::WriteFunction()
+{
+  AliHBTFunction::WriteFunction();
+  if (fSmearedNumer) fSmearedNumer->Write();
+  if (fSmearedDenom) fSmearedDenom->Write();
+
+}
 /******************************************************************/
+
+TH1* AliHBTCorrectOSLCorrelFctn::GetResult()
+{
+  //reuturns result histogram
+   delete fRatio;
+   fRatio = GetRatio(Scale());
+   return fRatio;
+}
+
+void AliHBTCorrectOSLCorrelFctn::GetValues(AliHBTPair* pair, Double_t& x, Double_t& y, Double_t& z) const 
+{
+    //calculates values of that function
+  //qout qside and qlong
+  
+  x=pair->GetQOutLCMS(); 
+  y=pair->GetQSideLCMS(); 
+  z=pair->GetQLongLCMS();
+  if (fAbs)
+   {
+     x = TMath::Abs(x);
+     y = TMath::Abs(y);
+     z = TMath::Abs(z);
+   }
+
+}
index e69a12b..ad3a97e 100644 (file)
@@ -9,31 +9,70 @@
 // taking to the account resolution of the           //
 // detector and coulomb effects.                     //
 //                                                   //
+//          N[meas]   N[ideal]/D[ideal]
+//  C(Q) =  ------- * -----------------
+//          D[meas]   N[smear]/D[smear]
+//
+// if smeared is eqal to the measured than  we get ideal.
 ///////////////////////////////////////////////////////
 
-#include "AliHBTFunction.h"
+#include "AliHBTCorrectQInvCorrelFctn.h"
 
 
-class AliHBTCorrectOSLCorrelFctn: public AliHBTOnePairFctn3D
+class AliHBTCorrectOSLCorrelFctn: public AliHBTOnePairFctn3D, public AliHBTCorrectedCorrelFctn
 {
   public:
-   AliHBTCorrectOSLCorrelFctn(const char* name = "qinvcorrectedCF", 
-                               const char* title= "Corrected Q_{inv} Correlation Fonction");
+   AliHBTCorrectOSLCorrelFctn(const char* name = "qoslcorrectedCF", 
+                              const char* title= "Corrected Q_{out}-Q_{side}-Q_{long} Correlation Fonction");
+
+  AliHBTCorrectOSLCorrelFctn(const Char_t *name, const Char_t *title,
+                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);
+                  
    AliHBTCorrectOSLCorrelFctn(const AliHBTCorrectOSLCorrelFctn& in);
    virtual ~AliHBTCorrectOSLCorrelFctn();
+
+   void     ProcessSameEventParticles(AliHBTPair* pair);//process particles from same event (real pair)
+   void     ProcessDiffEventParticles(AliHBTPair* pair);//process particles coming from different events (mixed pairs)
+
+   void     SetInitialValues(Double_t lambda, Double_t rout, Double_t rside, Double_t rlong);
+   void     Init();
+   void     WriteFunction();//overloaded 
+
+   TH1*     GetResult();//returns the result histogram
+   void     GetValues(AliHBTPair* pair, Double_t& x, Double_t& y, Double_t& z) const ;
+   
+   Double_t GetModelValue(Double_t qout, Double_t qside, Double_t qlong) const;
+   
    
   protected:
-    TH3D* fMeasCorrelFctn; //!Measured correlation function
+
+    void BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
+                     Int_t nybins, Float_t ymax, Float_t ymin,
+        Int_t nzbins, Float_t zmax, Float_t zmin);
+
+    TH3F* fMeasCorrelFctn; //!Measured correlation function
     
-    TH3D* fSmearedNumer; //! Numerator of smeard q
-    TH3D* fSmearedDenom; //! Denominator of smeard q
-    TH3D* fMeasNumer;  //! Numerator of ideal q calculated on basis of model equation
-    TH3D* fMeasDenom;  //! Denominator of ideal q calculated on basis of model equation
+    TH3F* fSmearedNumer; //! Numerator of smeard q
+    TH3F* fSmearedDenom; //! Denominator of smeard q
+    TH3F* fMeasNumer;  //! Numerator of ideal q calculated on basis of model equation
+    TH3F* fMeasDenom;  //! Denominator of ideal q calculated on basis of model equation
 
+    Double_t fLambda;
+    Double_t fROutSq;
+    Double_t fRSideSq;
+    Double_t fRLongSq;
     
   private:
   
     ClassDef(AliHBTCorrectOSLCorrelFctn,1)
 };
 
+inline Double_t AliHBTCorrectOSLCorrelFctn::GetModelValue(Double_t qout, Double_t qside, Double_t qlong) const
+{
+ //returns model value of the cf
+  return 1.0 + fLambda*TMath::Exp(( fROutSq*qout*qout + fRSideSq*qside*qside + fRLongSq*qlong*qlong) / (-0.038936366329));
+}
+
 #endif
index 7cf01f4..b99f23f 100644 (file)
 //                                                   //
 ///////////////////////////////////////////////////////
 
-//Parameters fit from pi+ pi+ resolution analysis for pair with qinv<50MeV
-// chi2/NFD = 97/157
-// FCN=98.0971 FROM MIGRAD    STATUS=CONVERGED     332 CALLS         333 TOTAL
-//   EDM=2.13364e-12    STRATEGY= 1  ERROR MATRIX UNCERTAINTY   2.4 per cent
-//  EXT PARAMETER                                   STEP         FIRST
-//  NO.   NAME         VALUE          ERROR         SIZE      DERIVATIVE
-//   1   fThetaA     2.72546e-03   1.43905e-04  -0.00000e+00   5.54375e-02
-//   2   fThetaB     1.87116e-04   5.11862e-05   0.00000e+00   3.66500e-01
-//   3  fThetaAlpha -2.36868e+00   1.83230e-01   0.00000e+00  -7.01301e-05
-
-// FCN=120.603 FROM MIGRAD    STATUS=CONVERGED     117 CALLS         118 TOTAL
-//  EDM=2.5153e-12    STRATEGY= 1  ERROR MATRIX UNCERTAINTY   2.4 per cent
-//  EXT PARAMETER                                   STEP         FIRST
-//  NO.   NAME         VALUE          ERROR         SIZE      DERIVATIVE
-//   1   fPhiA       1.93913e-03   1.31059e-04  -0.00000e+00  -5.87280e-02
-//   2   fPhiA       2.48687e-04   5.41251e-05   0.00000e+00  -1.87361e-01
-//   3  fPhiAlpha   -2.22649e+00   1.44503e-01   0.00000e+00   8.97538e-06
+// dPt/Pt
+// root [19] rms->Fit(f,"","",0.1,2)
+//  FCN=7.0017 FROM MIGRAD    STATUS=CONVERGED     126 CALLS         127 TOTAL
+//                      EDM=2.28804e-15    STRATEGY= 1      ERROR MATRIX ACCURATE
+//    EXT PARAMETER                                   STEP         FIRST
+//  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
+//    1  p0           5.78220e-03   3.14576e-05   4.97822e-09  -1.90059e-05
+//    2  p1           3.98063e-05   1.61877e-06   1.04380e-10   1.91454e-04
+//    3  p2          -2.78008e+00   2.13581e-02   1.66031e-06   3.16574e-06
+//    4  p3           5.07594e-04   4.79619e-05   1.29793e-08  -2.29242e-05
+
+
+// Phi
+// root [17] rms->Fit(f,"","",0.15,2.5)
+// Warning in <TH1D::Fit>: Abnormal termination of minimization.
+// FCN=33.4898 FROM MIGRAD    STATUS=FAILED         91 CALLS          92 TOTAL
+//                     EDM=1.19154e-15    STRATEGY= 1      ERR MATRIX APPROXIMATE
+//    EXT PARAMETER                APPROXIMATE        STEP         FIRST
+//   NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
+//    1  p0           5.87693e-04   5.04254e-06   2.49187e-09   5.84546e-04
+//    2  p1           2.16488e-06   3.68880e-07   6.41507e-11  -7.36564e-02
+//    3  p2          -3.10218e+00   1.01695e-01   2.00177e-05   7.54285e-07
+//    4  p3          -1.79892e-05   5.44067e-06   2.15870e-09   4.11441e-04
+
+
+
+// Theta
+// root [14] rms->Fit(f,"","",0.1,3)
+//  FCN=8.9981 FROM MIGRAD    STATUS=CONVERGED      79 CALLS          80 TOTAL
+//                      EDM=3.03049e-17    STRATEGY= 1      ERR MATRIX NOT POS-DEF
+//  EXT PARAMETER                APPROXIMATE        STEP         FIRST
+//  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
+//     1  p0          -1.68773e-02   2.67644e-05   8.04770e-09   4.48079e-05
+//     2  p1           1.78440e-02   2.65467e-05   8.50867e-09   6.43012e-05
+//     3  p2          -5.26559e-02   5.06308e-04   2.28595e-07  -1.63963e-05
+//     4  p3           2.00940e-04   1.14440e-05   3.98737e-09   1.78198e-05
+
 
 #include <TH1.h>
 #include <TH3.h>
 #include <AliAODParticle.h>
 
 
+ClassImp(AliHBTCorrectedCorrelFctn)
+
+AliHBTCorrectedCorrelFctn::AliHBTCorrectedCorrelFctn():
+  fDPtOverPtA(5.78220e-03),
+  fDPtOverPtB(3.98063e-05),
+  fDPtOverPtAlpha(-2.78008),
+  fDPtOverPtC(5.07594e-04),
+  fThetaA(5.87693e-04),
+  fThetaB(2.16488e-06),
+  fThetaAlpha(-3.10218e+00),
+  fThetaC(-1.79892e-05),
+  fPhiA(-1.68773e-02),
+  fPhiB(1.78440e-02),
+  fPhiAlpha(-5.26559e-02),
+  fPhiC(2.00940e-04)
+{
+  //ctor
+}
+
+/******************************************************************/
+void AliHBTCorrectedCorrelFctn::Smear(AliHBTPair* pair,AliHBTPair& smeared)
+{
+//Smears pair
+  Smear(pair->Particle1(),smeared.Particle1());
+  Smear(pair->Particle2(),smeared.Particle2());
+  smeared.Changed();
+}
+/******************************************************************/
+
+void AliHBTCorrectedCorrelFctn::Smear(AliVAODParticle* part, AliVAODParticle* smeared)
+{
+ //Smears momenta
+  Double_t sin2theta = TMath::Sin(part->Theta());
+  sin2theta = sin2theta*sin2theta;
+  Double_t pt = part->Pt();
+  
+  Double_t sigmapt = fDPtOverPtA + fDPtOverPtB*TMath::Power(pt,fDPtOverPtAlpha) + fDPtOverPtC*pt;
+  Double_t dPtDivPt = gRandom->Gaus(0.0,sigmapt);
+  Double_t dphi = gRandom->Gaus(0.0,fPhiA+fPhiB*TMath::Power(pt,fPhiAlpha) + fPhiC*pt);
+  Double_t dtheta = gRandom->Gaus(0.0,fPhiA+fPhiB*TMath::Power(pt,fThetaAlpha) +fThetaC*pt);
+  
+  Double_t smearedPx = part->Px()*(1.0+dPtDivPt) - part->Py()*dphi;
+//  fourmom.setX(px*(1.0+dPtDivPt) - py*dphi);
+  Double_t smearedPy = part->Py()*(1.0+dPtDivPt) - part->Px()*dphi;
+//  fourmom.setY(py*(1.0+dPtDivPt) + px*dphi);
+  Double_t smearedPz = part->Pz()*(1.0+dPtDivPt) - pt*dtheta/sin2theta;
+//  fourmom.setZ(pz*(1.0+dPtDivPt) - pT*dtheta/sin2theta);
+  
+  Double_t mass2 = part->Mass()*part->Mass();
+  Double_t e = mass2 + smearedPx*smearedPx + 
+                       smearedPy*smearedPy + 
+                       smearedPz*smearedPz;
+          
+  smeared->SetMomentum(smearedPx,smearedPy,smearedPz,TMath::Sqrt(e));
+}
+
+/****************************************************************/
+/****************************************************************/
+/****************************************************************/
+
+
 ClassImp(AliHBTCorrectQInvCorrelFctn)
 
 AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(const char* name,const char* title):
@@ -49,13 +130,6 @@ AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(const char* name,const
   fMeasDenom(0x0),
   fSmearedNumer(0x0),
   fSmearedDenom(0x0),
-  fDPtOverPtRMS(0.004),
-  fThetaA(2.72e-03),
-  fThetaB(1.87e-04),
-  fThetaAlpha(-2.4),
-  fPhiA(1.94e-03),
-  fPhiB(2.5e-04),
-  fPhiAlpha(-2.2),
   fR2(0.0),
   fLambda(0.0),
   fRConvergenceTreshold(0.3),
@@ -75,13 +149,6 @@ AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(TH1D* measqinv,const ch
   fMeasDenom(0x0),
   fSmearedNumer(0x0),
   fSmearedDenom(0x0),
-  fDPtOverPtRMS(0.004),
-  fThetaA(2.72e-03),
-  fThetaB(1.87e-04),
-  fThetaAlpha(-2.4),
-  fPhiA(1.94e-03),
-  fPhiB(2.5e-04),
-  fPhiAlpha(-2.2),
   fR2(0.0),
   fLambda(0.0),
   fRConvergenceTreshold(0.3),
@@ -94,18 +161,12 @@ AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(TH1D* measqinv,const ch
 AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(const char* name, const char* title,
                    Int_t nbins, Float_t maxXval, Float_t minXval):
   AliHBTOnePairFctn1D(name,title,nbins,maxXval,minXval),
+  AliHBTCorrectedCorrelFctn(),
   fMeasCorrelFctn(0x0),
   fMeasNumer(0x0),
   fMeasDenom(0x0),
   fSmearedNumer(0x0),
   fSmearedDenom(0x0),
-  fDPtOverPtRMS(0.004),
-  fThetaA(2.72e-03),
-  fThetaB(1.87e-04),
-  fThetaAlpha(-2.4),
-  fPhiA(1.94e-03),
-  fPhiB(2.5e-04),
-  fPhiAlpha(-2.2),
   fR2(0.0),
   fLambda(0.0),
   fRConvergenceTreshold(0.3),
@@ -116,18 +177,12 @@ AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(const char* name, const
 /******************************************************************/
 AliHBTCorrectQInvCorrelFctn::AliHBTCorrectQInvCorrelFctn(const AliHBTCorrectQInvCorrelFctn& in):
   AliHBTOnePairFctn1D(in),
+  AliHBTCorrectedCorrelFctn(),
   fMeasCorrelFctn(0x0),
   fMeasNumer(0x0),
   fMeasDenom(0x0),
   fSmearedNumer(0x0),
   fSmearedDenom(0x0),
-  fDPtOverPtRMS(0),
-  fThetaA(0),
-  fThetaB(0),
-  fThetaAlpha(0),
-  fPhiA(0),
-  fPhiB(0),
-  fPhiAlpha(0),
   fR2(0.0),
   fLambda(0.0),
   fRConvergenceTreshold(0),
@@ -226,41 +281,6 @@ void AliHBTCorrectQInvCorrelFctn::ProcessDiffEventParticles(AliHBTPair* pair)
   
 }
 /******************************************************************/
-void AliHBTCorrectQInvCorrelFctn::Smear(AliHBTPair* pair,AliHBTPair& smeared)
-{
-//Smears pair
-  Smear(pair->Particle1(),smeared.Particle1());
-  Smear(pair->Particle2(),smeared.Particle2());
-  smeared.Changed();
-}
-/******************************************************************/
-
-void AliHBTCorrectQInvCorrelFctn::Smear(AliVAODParticle* part, AliVAODParticle* smeared)
-{
- //Smears momenta
-  Double_t sin2theta = TMath::Sin(part->Theta());
-  sin2theta = sin2theta*sin2theta;
-  Double_t pt = part->Pt();
-
-  double dPtDivPt = gRandom->Gaus(0.0,fDPtOverPtRMS);
-  double dphi = gRandom->Gaus(0.0,fPhiA+fPhiB*TMath::Power(pt,fPhiAlpha));
-  double dtheta = gRandom->Gaus(0.0,fPhiA+fPhiB*TMath::Power(pt,fThetaAlpha));
-  
-  Double_t smearedPx = part->Px()*(1.0+dPtDivPt) - part->Py()*dphi;
-//  fourmom.setX(px*(1.0+dPtDivPt) - py*dphi);
-  Double_t smearedPy = part->Py()*(1.0+dPtDivPt) - part->Px()*dphi;
-//  fourmom.setY(py*(1.0+dPtDivPt) + px*dphi);
-  Double_t smearedPz = part->Pz()*(1.0+dPtDivPt) - pt*dtheta/sin2theta;
-//  fourmom.setZ(pz*(1.0+dPtDivPt) - pT*dtheta/sin2theta);
-  
-  Double_t mass2 = part->Mass()*part->Mass();
-  Double_t e = mass2 + smearedPx*smearedPx + 
-                       smearedPy*smearedPy + 
-                       smearedPz*smearedPz;
-          
-  smeared->SetMomentum(smearedPx,smearedPy,smearedPz,TMath::Sqrt(e));
-}
-/******************************************************************/
 
 void AliHBTCorrectQInvCorrelFctn::SetInitialValues(Double_t lambda, Double_t r)
 {
index 6de1bdf..71e25e3 100644 (file)
 
 #include "AliHBTFunction.h"
 
-class AliHBTCorrectQInvCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTCorrectedCorrelFctn: public AliHBTCorrelFunction
+{
+  public:
+    AliHBTCorrectedCorrelFctn();
+    virtual ~AliHBTCorrectedCorrelFctn(){}
+
+
+    void Smear(AliHBTPair* pair,AliHBTPair& smeared);
+    void Smear(AliVAODParticle* part, AliVAODParticle* smeared);
+
+    Double_t GetCoulombCorrection(AliHBTPair* /*pair*/){return 1.0;}
+
+  
+  protected:
+
+    //Parameters of Pt RMS
+    //linear dependence dPt/Pt from Pt itself 
+    Float_t fDPtOverPtA; //A of dPt/Pt 
+    Float_t fDPtOverPtB; //A of dPt/Pt 
+    Float_t fDPtOverPtAlpha; //A of dPt/Pt 
+    Float_t fDPtOverPtC; //A of dPt/Pt 
+    
+    //We assume that RMS of Theta and Phisangle depends on Pt Like A+B*(Pt)^Alpha
+    //Idea copied from Star HBT Maker (Fabrice Retiere)
+    //Parameters comes from Monte Carlo Resolution Analysis
+
+    Float_t fThetaA; //"A" parameter of theta RMS dependence
+    Float_t fThetaB; //"B" parameter of theta RMS dependence
+    Float_t fThetaAlpha; //"Alpha" parameter (power) of theta RMS dependence
+    Float_t fThetaC; //"C" parameter of theta RMS dependence
+
+    Float_t fPhiA;//"A" parameter of phi RMS dependence
+    Float_t fPhiB;//"B" parameter of phi RMS dependence
+    Float_t fPhiAlpha;//"Alpha" parameter (power) of phi RMS dependence
+    Float_t fPhiC;//"C" parameter of phi RMS dependence
+
+    ClassDef(AliHBTCorrectedCorrelFctn,1)
+};
+
+
+class AliHBTCorrectQInvCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrectedCorrelFctn
 {
   public:
     AliHBTCorrectQInvCorrelFctn(const char* name = "qinvcorrectedCF", 
@@ -50,10 +90,7 @@ class AliHBTCorrectQInvCorrelFctn: public AliHBTOnePairFctn1D
     
   protected:
     virtual void BuildHistos(Int_t nbins, Float_t max, Float_t min);
-    Double_t GetCoulombCorrection(AliHBTPair* /*pair*/){return 1.0;}
     Double_t GetValue(AliHBTPair * pair) const {return pair->GetQInv();}
-    void Smear(AliHBTPair* pair,AliHBTPair& smeared);
-    void Smear(AliVAODParticle* part, AliVAODParticle* smeared);
     Double_t GetModelValue(Double_t qinv);
 
     //Our ideal numerator 
@@ -64,22 +101,6 @@ class AliHBTCorrectQInvCorrelFctn: public AliHBTOnePairFctn1D
     TH1D* fSmearedNumer; //! Numerator of smeard q
     TH1D* fSmearedDenom; //! Denominator of smeard q
     
-    //Parameters of Pt RMS
-    //linear dependence dPt/Pt from Pt itself 
-    Float_t fDPtOverPtRMS; //RMS of dPt/Pt 
-    
-    //We assume that RMS of Theta and Phisangle depends on Pt Like A+B*(Pt)^Alpha
-    //Idea copied from Star HBT Maker (Fabrice Retiere)
-    //Parameters comes from Monte Carlo Resolution Analysis
-
-    Float_t fThetaA; //"A" parameter of theta RMS dependence
-    Float_t fThetaB; //"B" parameter of theta RMS dependence
-    Float_t fThetaAlpha; //"Alpha" parameter (power) of theta RMS dependence
-
-    Float_t fPhiA;//"A" parameter of phi RMS dependence
-    Float_t fPhiB;//"B" parameter of phi RMS dependence
-    Float_t fPhiAlpha;//"Alpha" parameter (power) of phi RMS dependence
-    
     Double_t fR2;//square of radius
     Double_t fLambda;//Interception parameter
 
index ccd96e4..712acd9 100644 (file)
@@ -733,6 +733,21 @@ void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
                       Int_t nzbins, Float_t zmax, Float_t zmin)
 {
   //Builds numerator and denominator histograms (3d-case)
+  
+   if (AliVAODParticle::GetDebug()>1) Info("BuildHistos","Enetered AliHBTFunction3D::BuildHistos(...)");
+   
+   if (fNumerator )
+    {
+      delete fNumerator;
+      fNumerator = 0x0;
+    }
+
+   if (fDenominator )
+    {
+      delete fDenominator;
+      fDenominator = 0x0;
+    }
+   
    TString numstr = fName + " Numerator";  //title and name of the 
                                            //numerator histogram
    TString denstr = fName + " Denominator";//title and name of the 
index 4987141..42f74ac 100644 (file)
@@ -135,8 +135,6 @@ AliHBTRStarDistribution::AliHBTRStarDistribution(Int_t nXbins, Double_t maxXval,
 
 ClassImp(AliHBTRDistribution)
 
-AliHBTRDistribution x;
-
 AliHBTRDistribution::AliHBTRDistribution(Int_t nXbins, Double_t maxXval, Double_t minXval):
  AliHBTOnePairFctn1D(nXbins,maxXval,minXval)
 {
index d23ef2c..b1d14fb 100644 (file)
@@ -61,6 +61,7 @@
 #pragma link C++ class AliHBTInvMassCorrelFctn+;
 #pragma link C++ class AliHBTCorrFitFctn+;
 
+#pragma link C++ class AliHBTCorrectedCorrelFctn+;
 #pragma link C++ class AliHBTCorrectQInvCorrelFctn+;
 #pragma link C++ class AliHBTCorrectOSLCorrelFctn+;