Redesigned Code for Azimuthally Sesitive HBT (AsHBT) (G.Galazka)
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2004 14:35:36 +0000 (14:35 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2004 14:35:36 +0000 (14:35 +0000)
HBTAN/AliHBTPositionRandomizer.cxx
HBTAN/AliHBTPositionRandomizer.h
HBTAN/AliHBTWeightasCorrFctn.cxx [new file with mode: 0644]
HBTAN/AliHBTWeightasCorrFctn.h [new file with mode: 0644]
HBTAN/AliHBTasCorrFctn.cxx [new file with mode: 0644]
HBTAN/AliHBTasCorrFctn.h [new file with mode: 0644]
HBTAN/HBTAnalysisLinkDef.h
HBTAN/libHBTAN.pkg

index 29ea2ae0c42a3aa44c0c1c71eb49dc22a40113ec..2e6d6ad81310bc562c83685092edc475f89aa19e 100644 (file)
@@ -180,6 +180,14 @@ void AliHBTPositionRandomizer::SetEventVertex(Double_t x, Double_t y,Double_t z)
   fVY = y;
   fVZ = z;
 }
+
+
+void AliHBTPositionRandomizer::SetEllipse(Double_t rx, Double_t ryz)
+{
+   delete fRandomizer;
+   fRandomizer = new AliHBTRndmEllipse(rx,ryz);
+}
+
 /*********************************************************************/
 //_____________________________________________________________________
 ///////////////////////////////////////////////////////////////////////
@@ -215,6 +223,16 @@ AliHBTRndmGaussBall::AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz):
 }
 /*********************************************************************/
 
+
+AliHBTRndmEllipse::AliHBTRndmEllipse(Float_t rmin, Float_t rmax):
+ fRmin(rmin),
+ fRmax(rmax)
+{
+     //constructor
+}
+
+/*********************************************************************/
+
 void AliHBTRndmGaussBall::Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*/*particle*/) const
 {
 //randomizez gauss for each coordinate separately
@@ -240,3 +258,18 @@ void AliHBTRndmCyllSurf::Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODPa
    y = sf*particle->Py();
    z = gRandom->Uniform(-fL,fL);
 }
+
+/*********************************************************************/
+/*********************************************************************/
+
+void AliHBTRndmEllipse::Randomize(Double_t& x, Double_t& y, Double_t& z,AliVAODParticle*p) const
+{
+    // p=0; //workaround - fix this damn little thingy
+   double R;
+     double phi=p->Phi();
+     
+     R=fRmin+(fRmax-fRmin)*TMath::Sin(phi);
+     x=R*TMath::Sin(phi);
+     y=R*TMath::Cos(phi);
+     z=z;
+}
index 70ef85f1a1a26ed0a05432748b0538f81113be0c..92b26ee5305651a587d440d6fe057074fcbc2f06 100644 (file)
@@ -17,7 +17,7 @@ class TH1I;
 class AliHBTPositionRandomizer: public AliReader
 {
  public:
-   enum EModelTypes{kGausBall,kCylinder,kCylinderSurf};
+   enum EModelTypes{kGausBall,kCylinder,kCylinderSurf,kEllipse};
    AliHBTPositionRandomizer();
    AliHBTPositionRandomizer(AliReader* reader);
    AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in);
@@ -49,13 +49,14 @@ class AliHBTPositionRandomizer: public AliReader
    void SetGaussianBall(Double_t r);
    void SetGaussianBall(Double_t rx, Double_t ry, Double_t rz);
    void SetCyllinderSurface(Double_t r, Double_t l);
+   void SetEllipse(Double_t rmin, Double_t rmax);
    
    void AddToPosition(Bool_t flag){fAddToExistingPos = flag;}
    void RandomizeTracks(Bool_t flag){fRandomizeTracks = flag;}
    
    
  protected:
-   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p);
+   void Randomize(Double_t& x,Double_t& y,Double_t&z,AliVAODParticle*p);
    Int_t ReadNext(){return (fReader)?fReader->Next():1;}
    
  private:
@@ -82,7 +83,7 @@ class AliHBTRndm: public TObject
    AliHBTRndm(){}
    virtual ~AliHBTRndm(){}
    virtual void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p) const = 0;
-   ClassDef(AliHBTRndm,1)
+     ClassDef(AliHBTRndm,1)
 };
 
 class AliHBTRndmGaussBall: public AliHBTRndm
@@ -115,5 +116,22 @@ class AliHBTRndmCyllSurf: public AliHBTRndm
    ClassDef(AliHBTRndmCyllSurf,1)
 };
 
+class AliHBTRndmEllipse: public AliHBTRndm
+{
+  public:
+   AliHBTRndmEllipse():fRmin(0.),fRmax(0.){};
+   AliHBTRndmEllipse(Float_t rmin, Float_t rmax);
+   virtual ~AliHBTRndmEllipse(){}
+   
+   void Randomize(Double_t& x,Double_t& y, Double_t& z, AliVAODParticle* particle) const;
+  private:
+   Float_t fRmin; //Radius in x direction
+   Float_t fRmax; //Radius in y direction
+   ClassDef(AliHBTRndmEllipse,1)
+};
+
+
+
 #endif
 
diff --git a/HBTAN/AliHBTWeightasCorrFctn.cxx b/HBTAN/AliHBTWeightasCorrFctn.cxx
new file mode 100644 (file)
index 0000000..de77f93
--- /dev/null
@@ -0,0 +1,363 @@
+#include "AliHBTWeightasCorrFctn.h"
+#include <TH1.h>
+#include <Riostream.h>
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightasCorrFctn.h                             //
+//                                                   //
+// Class for calculating 3D Weightas correlation        //
+// functions                                         //
+//                                                   //
+///////////////////////////////////////////////////////
+
+ClassImp(AliHBTWeightasCorrFctn)
+
+     AliHBTWeightasCorrFctn::AliHBTWeightasCorrFctn(const char* name, const char* title):
+ AliHBTTwoPairFctn1D(name,title),
+
+     fNum(0x0),
+     fDen(0x0),
+     fRat(0x0)
+
+{
+//ctor
+}
+     
+/******************************************************************/
+AliHBTWeightasCorrFctn::AliHBTWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+ AliHBTTwoPairFctn1D(name,title,nbins,maxXval,minXval),
+
+
+     fNum(new TObjArray()),
+     fDen(new TObjArray()),
+     fRat(new TObjArray())
+{
+     SetParams(nbins,maxXval, minXval);
+}
+
+/******************************************************************/
+AliHBTWeightasCorrFctn::AliHBTWeightasCorrFctn(const AliHBTWeightasCorrFctn& in):
+ AliHBTTwoPairFctn1D(in),
+
+
+
+     fNum((in.fNum)?(TObjArray*)in.fNum->Clone():0x0),
+     fDen((in.fDen)?(TObjArray*)in.fDen->Clone():0x0),
+     fRat((in.fRat)?(TObjArray*)in.fRat->Clone():0x0)
+ {
+//ctor
+}
+
+/******************************************************************/
+
+AliHBTWeightasCorrFctn::~AliHBTWeightasCorrFctn()
+{
+ //dtor
+
+     delete fNum;
+     delete fDen;
+     delete fRat;
+     
+}
+
+/******************************************************************/
+void AliHBTWeightasCorrFctn::Write()
+{
+//out    
+     Int_t i;
+//     Int_t n=GetNumberOfIntervals();
+     Double_t scale;
+
+     for(i=0;i<fNumberOfIntervals;i++){
+         TH1D *num = ((TH1D*)fNum->At(i));
+         TH1D *den = ((TH1D*)fDen->At(i));
+         TH1D &rat = *((TH1D*)fRat->At(i));
+         scale = Scale(num,den);
+         Info("Write():","Scale in interval %d = %lf",i,scale);
+         rat.Divide(num,den,scale);
+         
+         
+         num->Write();
+         den->Write();
+         rat.Write();
+     }
+
+}
+
+//-------------------------------------
+void AliHBTWeightasCorrFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+    //Fills the numerator using pair from the same event
+     trackpair = CheckPair(trackpair);
+     if(partpair == 0x0) return;
+     if(trackpair == 0x0) return;
+     
+     Double_t weight = 1.0;
+
+     int n = fNumberOfIntervals;
+     Double_t rplane=0.;   //reaction plane angle - 2 B determined
+     Double_t phi=(trackpair->Particle1()->Phi()+trackpair->Particle2()->Phi())/2.-rplane; //deltaphi bo nie mam nic innego pod reka
+
+     phi=phi*360/(2*TMath::Pi());
+     Double_t q=GetValue(trackpair, partpair);
+     Int_t ntv;
+     ntv =  (int)(phi*n/(360.));
+     
+     TH1D *num = ((TH1D*)fNum->At(ntv));
+     
+        
+     if ( trackpair && partpair)
+     {
+         if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
+              ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
+         {
+              weight=partpair->GetWeight();
+//            Info("ProcessSameEvent","weight=%lf",weight);
+         }
+         num->Fill(q,weight);
+     }
+}
+
+/****************************************************************/
+void AliHBTWeightasCorrFctn::Init()
+{
+     BuildHistos();
+}
+/****************************************************************/
+
+
+void AliHBTWeightasCorrFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+     
+     Double_t rplane=0.;   //reaction plane angle - 2 B determined
+     Double_t phi=(trackpair->Particle1()->Phi()+trackpair->Particle2()->Phi())/2.-rplane; //deltaphi bo nie mam nic innego pod reka
+     phi=phi*360/(2*TMath::Pi());
+     Double_t qout=GetValue(trackpair, partpair);
+
+     int n = fNumberOfIntervals;
+     
+     Int_t ntv;
+     ntv =  (int)(phi*n/(360.));
+
+     TH1D &den = *((TH1D*)fDen->At(ntv));
+     if ( trackpair && partpair)
+     {
+          den.Fill(qout);
+     }
+}
+
+
+/******************************************************************/
+
+
+void AliHBTWeightasCorrFctn::SetParams(Int_t nbins, Float_t maxXval, Float_t minXval){
+     fnbins=nbins;
+     fmaxXval= maxXval;
+     fminXval=minXval;
+}
+TH1* AliHBTWeightasCorrFctn::GetResult()
+{
+       
+     TH1D *den = ((TH1D*)fDen->UncheckedAt(1));
+     return den;
+ }
+
+
+
+
+ClassImp(AliHBTQOutWeightasCorrFctn)
+     
+     AliHBTQOutWeightasCorrFctn::AliHBTQOutWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTWeightasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQOutWeightasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumOut";
+     TString nameDen = "DenOut";
+     TString nameRat = "RatOut";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumOut");
+         nameDen = TString("DenOut");
+         nameRat = TString("RatOut");
+         
+     }
+
+     
+ }
+
+ClassImp(AliHBTQSideWeightasCorrFctn)
+     
+     AliHBTQSideWeightasCorrFctn::AliHBTQSideWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTWeightasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQSideWeightasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumSide";
+     TString nameDen = "DenSide";
+     TString nameRat = "RatSide";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumSide");
+         nameDen = TString("DenSide");
+         nameRat = TString("RatSide");
+         
+     }
+
+     
+ }
+
+ClassImp(AliHBTQLongWeightasCorrFctn)
+     
+     AliHBTQLongWeightasCorrFctn::AliHBTQLongWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTWeightasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQLongWeightasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumLong";
+     TString nameDen = "DenLong";
+     TString nameRat = "RatLong";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumLong");
+         nameDen = TString("DenLong");
+         nameRat = TString("RatLong");
+         
+     }
+
+     
+ }
diff --git a/HBTAN/AliHBTWeightasCorrFctn.h b/HBTAN/AliHBTWeightasCorrFctn.h
new file mode 100644 (file)
index 0000000..76037f8
--- /dev/null
@@ -0,0 +1,106 @@
+#ifndef ALIHBTWEIGHTASCORRFCTN_H
+#define ALIHBTWEIGHTASCORRFCTN_H
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightasCorrFctn.h                           //
+//                                                   //
+// Class for calculating 3D Weightas correlation       //
+// functions                                         //
+// author: Grzegorz.Galazka@cern.ch                  //
+///////////////////////////////////////////////////////
+
+#include "AliHBTFunction.h"
+
+class AliHBTWeightasCorrFctn: public AliHBTTwoPairFctn1D
+{
+public:
+     AliHBTWeightasCorrFctn(const char* name = "asejdzbitiCF", 
+                      const char* title= "as Correlation Function");
+
+     AliHBTWeightasCorrFctn(const char* name, const char* title,
+                      Int_t nbins, Float_t maxXval, Float_t minXval);
+     AliHBTWeightasCorrFctn(const AliHBTWeightasCorrFctn& in);
+     
+     virtual ~AliHBTWeightasCorrFctn();
+     
+     void Init();
+     void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
+     void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
+    
+     void Write();
+     
+     void SetNumberOfIntervals(Int_t N){fNumberOfIntervals = N;}
+     
+     Int_t GetNumberOfIntervals(){return fNumberOfIntervals;}
+    
+     
+     TH1*     GetResult();
+   
+protected:
+     
+     virtual Double_t GetValue(AliHBTPair* tpair, AliHBTPair* ppair) const = 0;
+     virtual void BuildHistos() = 0;
+     
+     void SetParams(Int_t nbins,Float_t maxXval,Float_t minXval);
+     int Getnbins(){ return fnbins;}
+     double GetmaxXval(){return fmaxXval;}
+     double GetminXval(){return fminXval;}
+     
+     TObjArray* fNum; // numerators array
+     TObjArray* fDen; // denominators array
+     TObjArray* fRat;// correl. fnctns array
+     
+     
+private:
+     int fnbins; //number of bins in histograms
+     Int_t fNumberOfIntervals;   //number of intervals
+     double fmaxXval; //max histogram's X value 
+     double fminXval; //min histogram's X value
+     
+     ClassDef(AliHBTWeightasCorrFctn,1)
+};
+
+class AliHBTQOutWeightasCorrFctn: public AliHBTWeightasCorrFctn{
+public:
+     AliHBTQOutWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+     
+     virtual  ~AliHBTQOutWeightasCorrFctn(){};
+    
+     
+protected:
+     Double_t GetValue(AliHBTPair* pair, AliHBTPair* ppair) const {ppair=0; return pair->GetQOutLCMS();}
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQOutWeightasCorrFctn,1)
+};
+
+class AliHBTQSideWeightasCorrFctn: public AliHBTWeightasCorrFctn{
+public:
+     AliHBTQSideWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+     virtual  ~AliHBTQSideWeightasCorrFctn(){};
+         
+protected:
+     Double_t GetValue(AliHBTPair* pair, AliHBTPair* ppair) const {ppair=0;return pair->GetQSideLCMS();}
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQSideWeightasCorrFctn,1)
+};
+
+
+class AliHBTQLongWeightasCorrFctn: public AliHBTWeightasCorrFctn{
+public:
+     AliHBTQLongWeightasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+
+     virtual  ~AliHBTQLongWeightasCorrFctn(){};
+     
+protected:
+     Double_t GetValue(AliHBTPair* pair,AliHBTPair* ppair) const {ppair=0;return pair->GetQLongLCMS();}
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQLongWeightasCorrFctn,1)
+};
+
+
+#endif
diff --git a/HBTAN/AliHBTasCorrFctn.cxx b/HBTAN/AliHBTasCorrFctn.cxx
new file mode 100644 (file)
index 0000000..f97d553
--- /dev/null
@@ -0,0 +1,349 @@
+#include "AliHBTasCorrFctn.h"
+#include <TH1.h>
+#include <Riostream.h>
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTasCorrFctn.h                             //
+//                                                   //
+// Class for calculating 3D as correlation        //
+// functions                                         //
+//                                                   //
+///////////////////////////////////////////////////////
+
+ClassImp(AliHBTasCorrFctn)
+
+     AliHBTasCorrFctn::AliHBTasCorrFctn(const char* name, const char* title):
+ AliHBTOnePairFctn1D(name,title),
+
+     fNum(0x0),
+     fDen(0x0),
+     fRat(0x0)
+
+{
+//ctor
+}
+     
+/******************************************************************/
+AliHBTasCorrFctn::AliHBTasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+ AliHBTOnePairFctn1D(name,title,nbins,maxXval,minXval),
+
+
+     fNum(new TObjArray()),
+     fDen(new TObjArray()),
+     fRat(new TObjArray())
+{
+     SetParams(nbins,maxXval, minXval);
+}
+
+/******************************************************************/
+AliHBTasCorrFctn::AliHBTasCorrFctn(const AliHBTasCorrFctn& in):
+ AliHBTOnePairFctn1D(in),
+
+
+
+     fNum((in.fNum)?(TObjArray*)in.fNum->Clone():0x0),
+     fDen((in.fDen)?(TObjArray*)in.fDen->Clone():0x0),
+     fRat((in.fRat)?(TObjArray*)in.fRat->Clone():0x0)
+ {
+//ctor
+}
+
+/******************************************************************/
+
+AliHBTasCorrFctn::~AliHBTasCorrFctn()
+{
+ //dtor
+
+     delete fNum;
+     delete fDen;
+     delete fRat;
+     
+}
+
+/******************************************************************/
+void AliHBTasCorrFctn::Write()
+{
+//out    
+     Int_t i;
+//     Int_t n=GetNumberOfIntervals();
+     Double_t scale;
+
+     for(i=0;i<fNumberOfIntervals;i++){
+         TH1D *num = ((TH1D*)fNum->At(i));
+         TH1D *den = ((TH1D*)fDen->At(i));
+         TH1D &rat = *((TH1D*)fRat->At(i));
+         scale = Scale(num,den);
+         Info("Write():","Scale in interval %d = %lf",i,scale);
+         rat.Divide(num,den,scale);
+         
+         
+         num->Write();
+         den->Write();
+         rat.Write();
+     }
+
+}
+
+//-------------------------------------
+void AliHBTasCorrFctn::ProcessSameEventParticles(AliHBTPair* pair)
+{
+    //Fills the numerator using pair from the same event
+    pair = CheckPair(pair);
+    if(pair == 0x0) return;
+  //   int n = GetNumberOfIntervals();
+     int n = fNumberOfIntervals;
+     Double_t rplane=0.;   //reaction plane angle - 2 B determined
+     Double_t phi=(pair->Particle1()->Phi()+pair->Particle2()->Phi())/2.-rplane; //deltaphi bo nie mam nic innego pod reka
+     phi=phi*360/(2*TMath::Pi());
+     Double_t q=GetValue(pair);
+     Int_t ntv;
+     ntv =  (int)(phi*n/(360.));
+     
+     TH1D *num = ((TH1D*)fNum->At(ntv));
+
+     num->Fill(q);
+  
+}
+
+/****************************************************************/
+void AliHBTasCorrFctn::Init()
+{
+     BuildHistos();
+}
+/****************************************************************/
+
+
+void AliHBTasCorrFctn::ProcessDiffEventParticles(AliHBTPair* pair)
+{
+     
+     Double_t rplane=0.;   //reaction plane angle - 2 B determined
+     Double_t phi=(pair->Particle1()->Phi()+pair->Particle2()->Phi())/2.-rplane; //deltaphi bo nie mam nic innego pod reka
+     phi=phi*360/(2*TMath::Pi());
+     Double_t qout=GetValue(pair);
+
+//     int n=GetNumberOfIntervals();   
+     int n = fNumberOfIntervals;
+     
+     Int_t ntv;
+     ntv =  (int)(phi*n/(360.));
+
+     TH1D &den = *((TH1D*)fDen->At(ntv));
+
+     
+     den.Fill(qout);
+}
+
+
+/******************************************************************/
+
+
+void AliHBTasCorrFctn::SetParams(Int_t nbins, Float_t maxXval, Float_t minXval){
+     fnbins=nbins;
+     fmaxXval= maxXval;
+     fminXval=minXval;
+}
+TH1* AliHBTasCorrFctn::GetResult()
+{
+       
+     TH1D *den = ((TH1D*)fDen->UncheckedAt(1));
+     return den;
+ }
+
+
+
+ClassImp(AliHBTQOutasCorrFctn)
+     
+     AliHBTQOutasCorrFctn::AliHBTQOutasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQOutasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumOut";
+     TString nameDen = "DenOut";
+     TString nameRat = "RatOut";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumOut");
+         nameDen = TString("DenOut");
+         nameRat = TString("RatOut");
+         
+     }
+
+     
+ }
+
+ClassImp(AliHBTQSideasCorrFctn)
+     
+     AliHBTQSideasCorrFctn::AliHBTQSideasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQSideasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumSide";
+     TString nameDen = "DenSide";
+     TString nameRat = "RatSide";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumSide");
+         nameDen = TString("DenSide");
+         nameRat = TString("RatSide");
+         
+     }
+
+     
+ }
+
+ClassImp(AliHBTQLongasCorrFctn)
+     
+     AliHBTQLongasCorrFctn::AliHBTQLongasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+AliHBTasCorrFctn(name,title,nbins,maxXval,minXval)
+
+{
+//ct0r
+}
+
+void AliHBTQLongasCorrFctn::BuildHistos()
+{
+    
+     Int_t i;
+     int n=GetNumberOfIntervals();
+     int nbins=Getnbins();
+
+     double max = GetmaxXval();
+     double min = GetminXval();
+     char buff[10];
+     
+
+     
+     TH1D *Num;
+     TH1D *Den;
+     TH1D *Rat;
+     
+     TString nameNum = "NumLong";
+     TString nameDen = "DenLong";
+     TString nameRat = "RatLong";
+     
+     for(i=0;i<n;i++){
+         
+         sprintf(buff,"%d",i);
+
+         nameNum +=TString(buff);
+
+         nameDen +=TString(buff);
+         nameRat +=TString(buff);
+         
+         
+         Num = new TH1D(nameNum.Data(),nameNum.Data(),nbins,min,max);
+         Den = new TH1D(nameDen.Data(),nameDen.Data(),nbins,min,max);
+         Rat = new TH1D(nameRat.Data(),nameRat.Data(),nbins,min,max);
+         
+         Num->Sumw2();
+         Den->Sumw2();
+         Rat->Sumw2();
+         
+         Num->Reset();
+         Den->Reset();
+         Rat->Reset();
+         
+         fNum->Add(Num);
+         fDen->Add(Den);
+         fRat->Add(Rat);
+         
+         nameNum = TString("NumLong");
+         nameDen = TString("DenLong");
+         nameRat = TString("RatLong");
+         
+     }
+
+     
+ }
diff --git a/HBTAN/AliHBTasCorrFctn.h b/HBTAN/AliHBTasCorrFctn.h
new file mode 100644 (file)
index 0000000..356b185
--- /dev/null
@@ -0,0 +1,106 @@
+#ifndef ALIHBTASCORRFCTN_H
+#define ALIHBTASCORRFCTN_H
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTasCorrFctn.h                                //
+//                                                   //
+// Class for calculating 3D as correlation           //
+// functions                                         //
+//author: Grzegorz.Galazka@cern.ch                   //
+///////////////////////////////////////////////////////
+
+#include "AliHBTFunction.h"
+
+class AliHBTasCorrFctn: public AliHBTOnePairFctn1D
+{
+public:
+     AliHBTasCorrFctn(const char* name = "asejdzbitiCF", 
+                      const char* title= "as Correlation Function");
+
+     AliHBTasCorrFctn(const char* name, const char* title,
+                      Int_t nbins, Float_t maxXval, Float_t minXval);
+     AliHBTasCorrFctn(const AliHBTasCorrFctn& in);
+     
+     virtual ~AliHBTasCorrFctn();
+     
+     void Init();
+     void ProcessSameEventParticles(AliHBTPair* pair);
+     void ProcessDiffEventParticles(AliHBTPair* pair);
+     void Write();
+     
+     void SetNumberOfIntervals(Int_t N){fNumberOfIntervals = N;}
+     
+     Int_t GetNumberOfIntervals(){return fNumberOfIntervals;}
+    
+     
+     TH1*     GetResult();
+   
+protected:
+     
+     virtual Double_t GetValue(AliHBTPair* pair) const = 0; 
+     virtual void BuildHistos() = 0; 
+     int Getnbins(){ return fnbins;}         // this are workarounds for my lame coding
+     double GetmaxXval(){return fmaxXval;}   // these methods are uset to build histograms 
+     double GetminXval(){return fminXval;}   // with set by user number of bins etc. 
+     void SetParams(Int_t nbins,Float_t maxXval,Float_t minXval); //
+     
+     TObjArray* fNum; // numerators array
+     TObjArray* fDen; // denominators array
+     TObjArray* fRat;// correl. fnctns array
+     
+     
+private:
+     int fnbins; //number of bins in histograms
+     Int_t fNumberOfIntervals;   //number of intervals
+     double fmaxXval; //max histogram's X value 
+     double fminXval; //min histogram's X value
+     
+     ClassDef(AliHBTasCorrFctn,1)
+};
+
+class AliHBTQOutasCorrFctn: public AliHBTasCorrFctn{
+public:
+     AliHBTQOutasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+     
+     virtual  ~AliHBTQOutasCorrFctn(){};
+    
+     
+protected:
+     Double_t GetValue(AliHBTPair* pair) const {return pair->GetQOutLCMS();}
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQOutasCorrFctn,1)
+};
+
+class AliHBTQSideasCorrFctn: public AliHBTasCorrFctn{
+public:
+     AliHBTQSideasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+//     AliHBTSideasCorrFctn(const AliHBTasCorrFctn& in);
+     
+     virtual  ~AliHBTQSideasCorrFctn(){};
+         
+protected:
+     Double_t GetValue(AliHBTPair* pair) const {return pair->GetQSideLCMS();} 
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQSideasCorrFctn,1)
+};
+
+
+class AliHBTQLongasCorrFctn: public AliHBTasCorrFctn{
+public:
+     AliHBTQLongasCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval);
+
+     virtual  ~AliHBTQLongasCorrFctn(){};
+     
+protected:
+     Double_t GetValue(AliHBTPair* pair) const {return pair->GetQLongLCMS();}
+     void BuildHistos();
+private:   
+     ClassDef(AliHBTQLongasCorrFctn,1)
+};
+
+
+#endif
index 10441a0a71ad8792d87d92cf3adfb53aa1e7524d..374004b18b182d32a93893efc2d38f2a1c7dd964 100644 (file)
 
 #pragma link C++ class AliHBTAvSeparCorrelFctn+;
 
-#pragma link C++ class AliHBTashbtCorrFctn+; //gg
-#pragma link C++ class AliHBTWeightashbtCorrFctn+; //gg
+#pragma link C++ class AliHBTasCorrFctn+; //gg
+#pragma link C++ class AliHBTQOutasCorrFctn+;
+#pragma link C++ class AliHBTQSideasCorrFctn+;
+#pragma link C++ class AliHBTQLongasCorrFctn+;
+#pragma link C++ class AliHBTWeightasCorrFctn+; //gg
+#pragma link C++ class AliHBTQOutWeightasCorrFctn+;
+#pragma link C++ class AliHBTQSideWeightasCorrFctn+;
+#pragma link C++ class AliHBTQLongWeightasCorrFctn+;
+
 #pragma link C++ class AliHBTInvMassCorrelFctn+;
 #pragma link C++ class AliHBTCorrFitFctn+;
 
 #pragma link C++ class AliHBTRndm+;
 #pragma link C++ class AliHBTRndmGaussBall+;
 #pragma link C++ class AliHBTRndmCyllSurf+;
+#pragma link C++ class AliHBTRndmEllipse+;
 #pragma link C++ class AliHBTMonVyDistributionVsVxFctn+;
 #pragma link C++ class AliHBTMonRtDistributionVsVzFctn+;
 
index c59b0bbe6e8a7d2221a653664a0c60812d540951..4b182aaa7ed54de95be534181af394325d53a116 100644 (file)
@@ -9,7 +9,7 @@ AliHBTWeightsPID.cxx            AliHBTWeightTheorFctn.cxx \
 AliHBTPositionRandomizer.cxx    \
 AliHBTCorrFitFctn.cxx AliHBTPIDPurityFctns.cxx \
 AliHBTCorrectQInvCorrelFctn.cxx AliHBTCorrectOSLCorrelFctn.cxx \
-AliHBTashbtCorrFctn.cxx AliHBTWeightashbtCorrFctn.cxx
+AliHBTasCorrFctn.cxx AliHBTWeightasCorrFctn.cxx
 
 FSRCS   = fsiini.F  fsiw.F  led_bldata.F  ltran12.F