new correlation functions for non-id HBT added
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jul 2004 07:07:07 +0000 (07:07 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jul 2004 07:07:07 +0000 (07:07 +0000)
HBTAN/AliHBTNonId3DCorrFctn.cxx [new file with mode: 0644]
HBTAN/AliHBTNonId3DCorrFctn.h [new file with mode: 0644]
HBTAN/AliHBTWeightNonId3DCorrFctn.cxx [new file with mode: 0644]
HBTAN/AliHBTWeightNonId3DCorrFctn.h [new file with mode: 0644]
HBTAN/AliHBTWeightNonId3DTheorCorrFctn.cxx [new file with mode: 0644]
HBTAN/AliHBTWeightNonId3DTheorCorrFctn.h [new file with mode: 0644]
HBTAN/HBTAnalysisLinkDef.h
HBTAN/libHBTAN.pkg

diff --git a/HBTAN/AliHBTNonId3DCorrFctn.cxx b/HBTAN/AliHBTNonId3DCorrFctn.cxx
new file mode 100644 (file)
index 0000000..e79be27
--- /dev/null
@@ -0,0 +1,407 @@
+#include "AliHBTNonId3DCorrFctn.h"
+#include <TH1.h>
+#include <Riostream.h>
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTNonId3DCorrFctn.h                           //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions                                         //
+//                                                   //
+///////////////////////////////////////////////////////
+
+ClassImp(AliHBTNonId3DCorrFctn)
+
+AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const char* name, const char* title):
+ AliHBTOnePairFctn1D(name,title),
+ fNumOutP(0x0),
+ fDenOutP(0x0),
+ fRatOutP(0x0),
+ fNumOutN(0x0),
+ fDenOutN(0x0),
+ fRatOutN(0x0),
+ fRatOut(0x0),
+ fRatOutNOverP(0x0),
+ fNumSideP(0x0),
+ fDenSideP(0x0),
+ fRatSideP(0x0),
+ fNumSideN(0x0),
+ fDenSideN(0x0),
+ fRatSideN(0x0),
+ fRatSide(0x0),
+ fRatSideNOverP(0x0),
+ fNumLongP(0x0),
+ fDenLongP(0x0),
+ fRatLongP(0x0),
+ fNumLongN(0x0),
+ fDenLongN(0x0),
+ fRatLongN(0x0),
+ fRatLong(0x0),
+ fRatLongNOverP(0x0)
+{
+//ctor
+}
+/******************************************************************/
+AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
+ AliHBTOnePairFctn1D(name,title,nbins,maxXval,minXval),
+ fNumOutP(0x0),
+ fDenOutP(0x0),
+ fRatOutP(0x0),
+ fNumOutN(0x0),
+ fDenOutN(0x0),
+ fRatOutN(0x0),
+ fRatOut(0x0),
+ fRatOutNOverP(0x0),
+ fNumSideP(0x0),
+ fDenSideP(0x0),
+ fRatSideP(0x0),
+ fNumSideN(0x0),
+ fDenSideN(0x0),
+ fRatSideN(0x0),
+ fRatSide(0x0),
+ fRatSideNOverP(0x0),
+ fNumLongP(0x0),
+ fDenLongP(0x0),
+ fRatLongP(0x0),
+ fNumLongN(0x0),
+ fDenLongN(0x0),
+ fRatLongN(0x0),
+ fRatLong(0x0),
+ fRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const AliHBTNonId3DCorrFctn& in):
+ AliHBTOnePairFctn1D(in),
+ fNumOutP(0x0),
+ fDenOutP(0x0),
+ fRatOutP(0x0),
+ fNumOutN(0x0),
+ fDenOutN(0x0),
+ fRatOutN(0x0),
+ fRatOut(0x0),
+ fRatOutNOverP(0x0),
+ fNumSideP(0x0),
+ fDenSideP(0x0),
+ fRatSideP(0x0),
+ fNumSideN(0x0),
+ fDenSideN(0x0),
+ fRatSideN(0x0),
+ fRatSide(0x0),
+ fRatSideNOverP(0x0),
+ fNumLongP(0x0),
+ fDenLongP(0x0),
+ fRatLongP(0x0),
+ fNumLongN(0x0),
+ fDenLongN(0x0),
+ fRatLongN(0x0),
+ fRatLong(0x0),
+ fRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+
+AliHBTNonId3DCorrFctn::~AliHBTNonId3DCorrFctn()
+{
+ //dtor
+ delete fNumOutP;
+ delete fDenOutP;
+ delete fRatOutP;
+ delete fNumOutN;
+ delete fDenOutN;
+ delete fRatOutN;
+ delete fRatOut;
+ delete fRatOutNOverP;
+ delete fNumSideP;
+ delete fDenSideP;
+ delete fRatSideP;
+ delete fNumSideN;
+ delete fDenSideN;
+ delete fRatSideN;
+ delete fRatSide;
+ delete fRatSideNOverP;
+ delete fNumLongP;
+ delete fDenLongP;
+ delete fRatLongP;
+ delete fNumLongN;
+ delete fDenLongN;
+ delete fRatLongN;
+ delete fRatLong;
+ delete fRatLongNOverP;
+}
+
+/******************************************************************/
+void AliHBTNonId3DCorrFctn::WriteFunction()
+{
+    
+ Double_t outPscale = Scale(fNumOutP,fDenOutP);
+ cout<<"outPscale = "<<outPscale<<endl;
+ fRatOutP->Divide(fNumOutP,fDenOutP,outPscale);
+
+ Double_t outNscale = Scale(fNumOutN,fDenOutN);
+ cout<<"outNscale = "<<outNscale<<endl;
+ fRatOutN->Divide(fNumOutN,fDenOutN,outNscale);
+
+ fRatOutNOverP->Divide(fRatOutN,fRatOutP);
+
+
+ Double_t sidePscale = Scale(fNumSideP,fDenSideP);
+ fRatSideP->Divide(fNumSideP,fDenSideP,sidePscale);
+
+ Double_t sideNscale = Scale(fNumSideN,fDenSideN);
+ fRatSideN->Divide(fNumSideN,fDenSideN,sideNscale);
+
+ fRatSideNOverP->Divide(fRatSideN,fRatSideP);
+
+
+ Double_t longPscale = Scale(fNumLongP,fDenLongP);
+ fRatLongP->Divide(fNumLongP,fDenLongP,longPscale);
+
+ Double_t longNscale = Scale(fNumLongN,fDenLongN);
+ fRatLongN->Divide(fNumLongN,fDenLongN,longNscale);
+
+ fRatLongNOverP->Divide(fRatLongN,fRatLongP);
+
+ fNumOutP->Write();
+ fDenOutP->Write();
+ fRatOutP->Write();
+ fNumOutN->Write();
+ fDenOutN->Write();
+ fRatOutN->Write();
+ fRatOut->Write();
+ fRatOutNOverP->Write();
+
+ fNumSideP->Write();
+ fDenSideP->Write();
+ fRatSideP->Write();
+ fNumSideN->Write();
+ fDenSideN->Write();
+ fRatSideN->Write();
+ fRatSide->Write();
+ fRatSideNOverP->Write();
+
+ fNumLongP->Write();
+ fDenLongP->Write();
+ fRatLongP->Write();
+ fNumLongN->Write();
+ fDenLongN->Write();
+ fRatLongN->Write();
+ fRatLong->Write();
+ fRatLongNOverP->Write();
+
+}
+
+//-------------------------------------
+void AliHBTNonId3DCorrFctn::ProcessSameEventParticles(AliHBTPair* pair)
+{
+    //Fills the numerator using pair from the same event
+    pair = CheckPair(pair);
+    if(pair == 0x0) return;
+    double tKStar = fabs(pair->GetKStar());
+    double tKStarOut = pair->GetKStarOut();
+    double tKStarSide = pair->GetKStarSide();
+    double tKStarLong = pair->GetKStarLong();
+
+    if(tKStarOut>0.)
+    {
+       fNumOutP->Fill(tKStar);
+    }
+    else
+    {
+       fNumOutN->Fill(tKStar);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fNumSideP->Fill(tKStar);
+    }
+    else
+    {
+       fNumSideN->Fill(tKStar);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fNumLongP->Fill(tKStar);
+    }
+    else
+    {
+       fNumLongN->Fill(tKStar);
+    }
+}
+
+/****************************************************************/
+void AliHBTNonId3DCorrFctn::Init()
+{
+    AliHBTOnePairFctn1D::Init();
+ fNumOutP->Reset();
+ fDenOutP->Reset();
+ fRatOutP->Reset();
+ fNumOutN->Reset();
+ fDenOutN->Reset();
+ fRatOutN->Reset();
+ fRatOut->Reset();
+ fRatOutNOverP->Reset();
+
+ fNumSideP->Reset();
+ fDenSideP->Reset();
+ fRatSideP->Reset();
+ fNumSideN->Reset();
+ fDenSideN->Reset();
+ fRatSideN->Reset();
+ fRatSide->Reset();
+ fRatSideNOverP->Reset();
+
+ fNumLongP->Reset();
+ fDenLongP->Reset();
+ fRatLongP->Reset();
+ fNumLongN->Reset();
+ fDenLongN->Reset();
+ fRatLongN->Reset();
+ fRatLong->Reset();
+ fRatLongNOverP->Reset();
+}
+/****************************************************************/
+
+
+void AliHBTNonId3DCorrFctn::ProcessDiffEventParticles(AliHBTPair* pair)
+{
+
+    double tKStar = fabs(pair->GetKStar());
+    double tKStarOut = pair->GetKStarOut();
+    double tKStarSide = pair->GetKStarSide();
+    double tKStarLong = pair->GetKStarLong();
+
+    if(tKStarOut>0.)
+    {
+       fDenOutP->Fill(tKStar);
+    }
+    else
+    {
+       fDenOutN->Fill(tKStar);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fDenSideP->Fill(tKStar);
+    }
+    else
+    {
+       fDenSideN->Fill(tKStar);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fDenLongP->Fill(tKStar);
+    }
+    else
+    {
+       fDenLongN->Fill(tKStar);
+    }
+
+}
+
+
+/******************************************************************/
+
+void AliHBTNonId3DCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min)
+{
+    
+    AliHBTFunction1D::BuildHistos(nbins,max,min);
+    
+    TString nameNumOutP = "NumOutP";
+    TString nameDenOutP = "DenOutP";
+    TString nameRatOutP = "RatOutP";
+    TString nameNumOutN = "NumOutN";
+    TString nameDenOutN = "DenOutN";
+    TString nameRatOutN = "RatOutN";
+    TString nameRatOut =  "RatOut";
+    TString nameRatOutNOverP = "RatOutNOverP";
+    TString nameNumSideP = "NumSideP";
+    TString nameDenSideP = "DenSideP";
+    TString nameRatSideP = "RatSideP";
+    TString nameNumSideN = "NumSideN";
+    TString nameDenSideN = "DenSideN";
+    TString nameRatSideN = "RatSideN";
+    TString nameRatSide = "RatSide";
+    TString nameRatSideNOverP = "RatSideNOverP";
+    TString nameNumLongP = "NumLongP";
+    TString nameDenLongP = "DenLongP";
+    TString nameRatLongP = "RatLongP";
+    TString nameNumLongN = "NumLongN";
+    TString nameDenLongN = "DenLongN";
+    TString nameRatLongN = "RatLongN";
+    TString nameRatLong = "RatLong";
+    TString nameRatLongNOverP = "RatLongNOverP";
+
+    fNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max);
+    fDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max);
+    fRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max);
+
+    fNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max);
+    fDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max);
+    fRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max);
+
+    fRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max);
+    fRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max);
+
+    fNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max);
+    fDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max);
+    fRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max);
+
+    fNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max);
+    fDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max);
+    fRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max);
+
+    fRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max);
+    fRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max);
+
+    fNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max);
+    fDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max);
+    fRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max);
+
+    fNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max);
+    fDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max);
+    fRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max);
+
+    fRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max);
+    fRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max);
+
+
+    fNumOutP->Sumw2();
+    fDenOutP->Sumw2();
+    fRatOutP->Sumw2();
+    fNumOutN->Sumw2();
+    fDenOutN->Sumw2();
+    fRatOutN->Sumw2();
+    fRatOut->Sumw2();
+    fRatOutNOverP->Sumw2();
+    fNumSideP->Sumw2();
+    fDenSideP->Sumw2();
+    fRatSideP->Sumw2();
+    fNumSideN->Sumw2();
+    fDenSideN->Sumw2();
+    fRatSideN->Sumw2();
+    fRatSide->Sumw2();
+    fRatSideNOverP->Sumw2();
+    fNumLongP->Sumw2();
+    fDenLongP->Sumw2();
+    fRatLongP->Sumw2();
+    fNumLongN->Sumw2();
+    fDenLongN->Sumw2();
+    fRatLongN->Sumw2();
+    fRatLong->Sumw2();
+    fRatLongNOverP->Sumw2();
+}
+
+ TH1* AliHBTNonId3DCorrFctn::GetResult()
+ {
+     return fRatOutN;
+ }
diff --git a/HBTAN/AliHBTNonId3DCorrFctn.h b/HBTAN/AliHBTNonId3DCorrFctn.h
new file mode 100644 (file)
index 0000000..4fcc7fd
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef ALIHBTNONID3DCORRFCTN_H
+#define ALIHBTNONID3DCORRFCTN_H
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTNonId3DCorrFctn.h                           //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions                                         //
+//                                                   //
+///////////////////////////////////////////////////////
+
+#include "AliHBTFunction.h"
+
+
+class AliHBTNonId3DCorrFctn: public AliHBTOnePairFctn1D
+{
+  public:
+   AliHBTNonId3DCorrFctn(const char* name = "nonid3DCF", 
+                         const char* title= "3D Non-Id Correlation Function");
+
+   AliHBTNonId3DCorrFctn(const char* name, const char* title,
+                        Int_t nbins, Float_t maxXval, Float_t minXval);
+   AliHBTNonId3DCorrFctn(const AliHBTNonId3DCorrFctn& in);
+
+   virtual ~AliHBTNonId3DCorrFctn();
+
+   void Init();
+   void ProcessSameEventParticles(AliHBTPair* pair);
+   void ProcessDiffEventParticles(AliHBTPair* pair);
+
+   void WriteFunction();
+   
+      TH1*     GetResult();
+   
+ protected:
+
+   Double_t GetValue(AliHBTPair* pair) {return pair->GetQInv();}
+   void BuildHistos(Int_t nbins, Float_t max, Float_t min);
+   
+   TH1D* fNumOutP;
+   TH1D* fDenOutP;
+   TH1D* fRatOutP;
+   TH1D* fNumOutN;
+   TH1D* fDenOutN;
+   TH1D* fRatOutN;
+   TH1D* fRatOut;
+   TH1D* fRatOutNOverP;
+
+   TH1D* fNumSideP;
+   TH1D* fDenSideP;
+   TH1D* fRatSideP;
+   TH1D* fNumSideN;
+   TH1D* fDenSideN;
+   TH1D* fRatSideN;
+   TH1D* fRatSide;
+   TH1D* fRatSideNOverP;
+
+   TH1D* fNumLongP;
+   TH1D* fDenLongP;
+   TH1D* fRatLongP;
+   TH1D* fNumLongN;
+   TH1D* fDenLongN;
+   TH1D* fRatLongN;
+   TH1D* fRatLong;
+   TH1D* fRatLongNOverP;
+   
+    
+  private:
+  
+    ClassDef(AliHBTNonId3DCorrFctn,1)
+};
+
+#endif
diff --git a/HBTAN/AliHBTWeightNonId3DCorrFctn.cxx b/HBTAN/AliHBTWeightNonId3DCorrFctn.cxx
new file mode 100644 (file)
index 0000000..0d34f0f
--- /dev/null
@@ -0,0 +1,432 @@
+#include "AliHBTWeightNonId3DCorrFctn.h"
+#include <TH1.h>
+#include <Riostream.h>
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightNonId3DCorrFctn.h                     //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions using methods of weights                //
+//                                                   //
+///////////////////////////////////////////////////////
+
+ClassImp(AliHBTWeightNonId3DCorrFctn)
+
+AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const char* name, const char* title):
+ AliHBTTwoPairFctn1D(name,title),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+/******************************************************************/
+AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const char* name, const char* title, 
+                                                        Int_t nbinsX, Float_t maxXval, Float_t minXval):   
+ AliHBTTwoPairFctn1D(name,title,nbinsX,maxXval,minXval),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const AliHBTWeightNonId3DCorrFctn& in):
+ AliHBTTwoPairFctn1D(in),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+
+AliHBTWeightNonId3DCorrFctn::~AliHBTWeightNonId3DCorrFctn()
+{
+ //dtor
+ delete fWeightNumOutP;
+ delete fWeightDenOutP;
+ delete fWeightRatOutP;
+ delete fWeightNumOutN;
+ delete fWeightDenOutN;
+ delete fWeightRatOutN;
+ delete fWeightRatOut;
+ delete fWeightRatOutNOverP;
+ delete fWeightNumSideP;
+ delete fWeightDenSideP;
+ delete fWeightRatSideP;
+ delete fWeightNumSideN;
+ delete fWeightDenSideN;
+ delete fWeightRatSideN;
+ delete fWeightRatSide;
+ delete fWeightRatSideNOverP;
+ delete fWeightNumLongP;
+ delete fWeightDenLongP;
+ delete fWeightRatLongP;
+ delete fWeightNumLongN;
+ delete fWeightDenLongN;
+ delete fWeightRatLongN;
+ delete fWeightRatLong;
+ delete fWeightRatLongNOverP;
+}
+
+//-------------------------------------
+void AliHBTWeightNonId3DCorrFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+    //Fills the numerator using pair from the same event
+    partpair = CheckPair(partpair);
+    trackpair = CheckPair(trackpair);
+    if(partpair == 0x0) return;
+    if(trackpair == 0x0) return;
+    double tKStar = fabs(trackpair->GetKStar());
+    double tKStarOut = trackpair->GetKStarOut();
+    double tKStarSide = trackpair->GetKStarSide();
+    double tKStarLong = trackpair->GetKStarLong();
+
+    Double_t weight = 1.0;
+    
+  if ( trackpair && partpair)
+  {
+    if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
+         ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
+    {
+       weight=partpair->GetWeight();
+    }
+    
+    if(tKStarOut>0.)
+    {
+       fWeightNumOutP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumOutN->Fill(tKStar,weight);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fWeightNumSideP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumSideN->Fill(tKStar,weight);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fWeightNumLongP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumLongN->Fill(tKStar,weight);
+    }
+  }
+  
+}
+
+/****************************************************************/
+
+
+void AliHBTWeightNonId3DCorrFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
+{
+
+  trackpair = CheckPair(trackpair);
+  partpair  = CheckPair(partpair);
+
+  double tKStar = fabs(partpair->GetKStar());
+  double tKStarOut = trackpair->GetKStarOut();
+  double tKStarSide = trackpair->GetKStarSide();
+  double tKStarLong = trackpair->GetKStarLong();
+
+  if ( trackpair && partpair)
+  {
+    if(tKStarOut>0.)
+    {
+       fWeightDenOutP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenOutN->Fill(tKStar);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fWeightDenSideP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenSideN->Fill(tKStar);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fWeightDenLongP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenLongN->Fill(tKStar);
+    }
+  }
+  
+}
+
+
+/****************************************************************/
+void AliHBTWeightNonId3DCorrFctn::Init()
+{
+    AliHBTTwoPairFctn1D::Init();
+ fWeightNumOutP->Reset();
+ fWeightDenOutP->Reset();
+ fWeightRatOutP->Reset();
+ fWeightNumOutN->Reset();
+ fWeightDenOutN->Reset();
+ fWeightRatOutN->Reset();
+ fWeightRatOut->Reset();
+ fWeightRatOutNOverP->Reset();
+
+ fWeightNumSideP->Reset();
+ fWeightDenSideP->Reset();
+ fWeightRatSideP->Reset();
+ fWeightNumSideN->Reset();
+ fWeightDenSideN->Reset();
+ fWeightRatSideN->Reset();
+ fWeightRatSide->Reset();
+ fWeightRatSideNOverP->Reset();
+
+ fWeightNumLongP->Reset();
+ fWeightDenLongP->Reset();
+ fWeightRatLongP->Reset();
+ fWeightNumLongN->Reset();
+ fWeightDenLongN->Reset();
+ fWeightRatLongN->Reset();
+ fWeightRatLong->Reset();
+ fWeightRatLongNOverP->Reset();
+}
+/******************************************************************/
+
+void AliHBTWeightNonId3DCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min)
+{
+    
+    AliHBTFunction1D::BuildHistos(nbins,max,min);
+    
+    TString nameNumOutP = "WeightNumOutP";
+    TString nameDenOutP = "WeightDenOutP";
+    TString nameRatOutP = "WeightRatOutP";
+    TString nameNumOutN = "WeightNumOutN";
+    TString nameDenOutN = "WeightDenOutN";
+    TString nameRatOutN = "WeightRatOutN";
+    TString nameRatOut =  "WeightRatOut";
+    TString nameRatOutNOverP = "WeightRatOutNOverP";
+    TString nameNumSideP = "WeightNumSideP";
+    TString nameDenSideP = "WeightDenSideP";
+    TString nameRatSideP = "WeightRatSideP";
+    TString nameNumSideN = "WeightNumSideN";
+    TString nameDenSideN = "WeightDenSideN";
+    TString nameRatSideN = "WeightRatSideN";
+    TString nameRatSide = "WeightRatSide";
+    TString nameRatSideNOverP = "WeightRatSideNOverP";
+    TString nameNumLongP = "WeightNumLongP";
+    TString nameDenLongP = "WeightDenLongP";
+    TString nameRatLongP = "WeightRatLongP";
+    TString nameNumLongN = "WeightNumLongN";
+    TString nameDenLongN = "WeightDenLongN";
+    TString nameRatLongN = "WeightRatLongN";
+    TString nameRatLong = "WeightRatLong";
+    TString nameRatLongNOverP = "WeightRatLongNOverP";
+
+    fWeightNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max);
+    fWeightDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max);
+    fWeightRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max);
+
+    fWeightNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max);
+    fWeightDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max);
+    fWeightRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max);
+
+    fWeightRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max);
+    fWeightRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max);
+
+    fWeightNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max);
+    fWeightDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max);
+    fWeightRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max);
+
+    fWeightNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max);
+    fWeightDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max);
+    fWeightRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max);
+
+    fWeightRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max);
+    fWeightRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max);
+
+    fWeightNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max);
+    fWeightDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max);
+    fWeightRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max);
+
+    fWeightNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max);
+    fWeightDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max);
+    fWeightRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max);
+
+    fWeightRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max);
+    fWeightRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max);
+
+
+    fWeightNumOutP->Sumw2();
+    fWeightDenOutP->Sumw2();
+    fWeightRatOutP->Sumw2();
+    fWeightNumOutN->Sumw2();
+    fWeightDenOutN->Sumw2();
+    fWeightRatOutN->Sumw2();
+    fWeightRatOut->Sumw2();
+    fWeightRatOutNOverP->Sumw2();
+    fWeightNumSideP->Sumw2();
+    fWeightDenSideP->Sumw2();
+    fWeightRatSideP->Sumw2();
+    fWeightNumSideN->Sumw2();
+    fWeightDenSideN->Sumw2();
+    fWeightRatSideN->Sumw2();
+    fWeightRatSide->Sumw2();
+    fWeightRatSideNOverP->Sumw2();
+    fWeightNumLongP->Sumw2();
+    fWeightDenLongP->Sumw2();
+    fWeightRatLongP->Sumw2();
+    fWeightNumLongN->Sumw2();
+    fWeightDenLongN->Sumw2();
+    fWeightRatLongN->Sumw2();
+    fWeightRatLong->Sumw2();
+    fWeightRatLongNOverP->Sumw2();
+}
+
+/******************************************************************/
+
+TH1* AliHBTWeightNonId3DCorrFctn::GetResult()
+{
+    return fWeightRatOutN;
+}
+
+/******************************************************************/
+
+void AliHBTWeightNonId3DCorrFctn::WriteFunction()
+{
+
+ Double_t outPscale = Scale(fWeightNumOutP,fWeightDenOutP);
+ cout<<"WoutPscale = "<<outPscale<<endl;
+ fWeightRatOutP->Divide(fWeightNumOutP,fWeightDenOutP,outPscale);
+
+ Double_t outNscale = Scale(fWeightNumOutN,fWeightDenOutN);
+ cout<<"WoutNscale = "<<outNscale<<endl;
+ fWeightRatOutN->Divide(fWeightNumOutN,fWeightDenOutN,outNscale);
+
+ fWeightRatOutNOverP->Divide(fWeightRatOutN,fWeightRatOutP);
+
+
+ Double_t sidePscale = Scale(fWeightNumSideP,fWeightDenSideP);
+ fWeightRatSideP->Divide(fWeightNumSideP,fWeightDenSideP,sidePscale);
+
+ Double_t sideNscale = Scale(fWeightNumSideN,fWeightDenSideN);
+ fWeightRatSideN->Divide(fWeightNumSideN,fWeightDenSideN,sideNscale);
+
+ fWeightRatSideNOverP->Divide(fWeightRatSideN,fWeightRatSideP);
+
+
+ Double_t longPscale = Scale(fWeightNumLongP,fWeightDenLongP);
+ fWeightRatLongP->Divide(fWeightNumLongP,fWeightDenLongP,longPscale);
+
+ Double_t longNscale = Scale(fWeightNumLongN,fWeightDenLongN);
+ fWeightRatLongN->Divide(fWeightNumLongN,fWeightDenLongN,longNscale);
+
+ fWeightRatLongNOverP->Divide(fWeightRatLongN,fWeightRatLongP);
+
+ fWeightNumOutP->Write();
+ fWeightDenOutP->Write();
+ fWeightRatOutP->Write();
+ fWeightNumOutN->Write();
+ fWeightDenOutN->Write();
+ fWeightRatOutN->Write();
+ fWeightRatOut->Write();
+ fWeightRatOutNOverP->Write();
+
+ fWeightNumSideP->Write();
+ fWeightDenSideP->Write();
+ fWeightRatSideP->Write();
+ fWeightNumSideN->Write();
+ fWeightDenSideN->Write();
+ fWeightRatSideN->Write();
+ fWeightRatSide->Write();
+ fWeightRatSideNOverP->Write();
+
+ fWeightNumLongP->Write();
+ fWeightDenLongP->Write();
+ fWeightRatLongP->Write();
+ fWeightNumLongN->Write();
+ fWeightDenLongN->Write();
+ fWeightRatLongN->Write();
+ fWeightRatLong->Write();
+ fWeightRatLongNOverP->Write();
+
+}
+
diff --git a/HBTAN/AliHBTWeightNonId3DCorrFctn.h b/HBTAN/AliHBTWeightNonId3DCorrFctn.h
new file mode 100644 (file)
index 0000000..55c4c12
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef ALIHBTWEIGHTNONID3DCORRFCTN_H
+#define ALIHBTWEIGHTNONID3DCORRFCTN_H
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightNonId3DCorrFctn.h                     //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions using method of weights                 //
+//                                                   //
+///////////////////////////////////////////////////////
+
+#include "AliHBTFunction.h"
+
+
+class AliHBTWeights;
+
+class AliHBTWeightNonId3DCorrFctn: public AliHBTTwoPairFctn1D
+{
+  public:
+   AliHBTWeightNonId3DCorrFctn(const char* name = "nonid3DCF", 
+                              const char* title= "3D Non-Id Correlation Function");
+
+   AliHBTWeightNonId3DCorrFctn(const char* name, const char* title,
+                              Int_t nbinsX, Float_t maxXval, Float_t minXval);
+   AliHBTWeightNonId3DCorrFctn(const AliHBTWeightNonId3DCorrFctn& in);
+
+   virtual ~AliHBTWeightNonId3DCorrFctn();
+
+   void Init(); // InitFunction();
+   void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
+   void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
+
+   void WriteFunction();
+   
+   TH1*     GetResult();
+   
+ protected:
+
+   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair) {return trackpair->GetQInv()-partpair->GetQInv();}
+   void BuildHistos(Int_t nbins, Float_t max, Float_t min);
+   
+   TH1D* fWeightNumOutP;
+   TH1D* fWeightDenOutP;
+   TH1D* fWeightRatOutP;
+   TH1D* fWeightNumOutN;
+   TH1D* fWeightDenOutN;
+   TH1D* fWeightRatOutN;
+   TH1D* fWeightRatOut;
+   TH1D* fWeightRatOutNOverP;
+
+   TH1D* fWeightNumSideP;
+   TH1D* fWeightDenSideP;
+   TH1D* fWeightRatSideP;
+   TH1D* fWeightNumSideN;
+   TH1D* fWeightDenSideN;
+   TH1D* fWeightRatSideN;
+   TH1D* fWeightRatSide;
+   TH1D* fWeightRatSideNOverP;
+
+   TH1D* fWeightNumLongP;
+   TH1D* fWeightDenLongP;
+   TH1D* fWeightRatLongP;
+   TH1D* fWeightNumLongN;
+   TH1D* fWeightDenLongN;
+   TH1D* fWeightRatLongN;
+   TH1D* fWeightRatLong;
+   TH1D* fWeightRatLongNOverP;
+   
+    
+  private:
+  
+    ClassDef(AliHBTWeightNonId3DCorrFctn,1)
+};
+
+#endif
diff --git a/HBTAN/AliHBTWeightNonId3DTheorCorrFctn.cxx b/HBTAN/AliHBTWeightNonId3DTheorCorrFctn.cxx
new file mode 100644 (file)
index 0000000..d8be030
--- /dev/null
@@ -0,0 +1,425 @@
+#include "AliHBTWeightNonId3DTheorCorrFctn.h"
+#include <TH1.h>
+#include <Riostream.h>
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightNonId3DTheorCorrFctn.h                     //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions using methods of weights                //
+//                                                   //
+///////////////////////////////////////////////////////
+
+ClassImp(AliHBTWeightNonId3DTheorCorrFctn)
+
+AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const char* name, const char* title):
+ AliHBTOnePairFctn1D(name,title),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+/******************************************************************/
+AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const char* name, const char* title, 
+                                                        Int_t nbinsX, Float_t maxXval, Float_t minXval):   
+ AliHBTOnePairFctn1D(name,title,nbinsX,maxXval,minXval),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const AliHBTWeightNonId3DTheorCorrFctn& in):
+ AliHBTOnePairFctn1D(in),
+ fWeightNumOutP(0x0),
+ fWeightDenOutP(0x0),
+ fWeightRatOutP(0x0),
+ fWeightNumOutN(0x0),
+ fWeightDenOutN(0x0),
+ fWeightRatOutN(0x0),
+ fWeightRatOut(0x0),
+ fWeightRatOutNOverP(0x0),
+ fWeightNumSideP(0x0),
+ fWeightDenSideP(0x0),
+ fWeightRatSideP(0x0),
+ fWeightNumSideN(0x0),
+ fWeightDenSideN(0x0),
+ fWeightRatSideN(0x0),
+ fWeightRatSide(0x0),
+ fWeightRatSideNOverP(0x0),
+ fWeightNumLongP(0x0),
+ fWeightDenLongP(0x0),
+ fWeightRatLongP(0x0),
+ fWeightNumLongN(0x0),
+ fWeightDenLongN(0x0),
+ fWeightRatLongN(0x0),
+ fWeightRatLong(0x0),
+ fWeightRatLongNOverP(0x0)
+{
+//ctor
+}
+
+/******************************************************************/
+
+AliHBTWeightNonId3DTheorCorrFctn::~AliHBTWeightNonId3DTheorCorrFctn()
+{
+ //dtor
+ delete fWeightNumOutP;
+ delete fWeightDenOutP;
+ delete fWeightRatOutP;
+ delete fWeightNumOutN;
+ delete fWeightDenOutN;
+ delete fWeightRatOutN;
+ delete fWeightRatOut;
+ delete fWeightRatOutNOverP;
+ delete fWeightNumSideP;
+ delete fWeightDenSideP;
+ delete fWeightRatSideP;
+ delete fWeightNumSideN;
+ delete fWeightDenSideN;
+ delete fWeightRatSideN;
+ delete fWeightRatSide;
+ delete fWeightRatSideNOverP;
+ delete fWeightNumLongP;
+ delete fWeightDenLongP;
+ delete fWeightRatLongP;
+ delete fWeightNumLongN;
+ delete fWeightDenLongN;
+ delete fWeightRatLongN;
+ delete fWeightRatLong;
+ delete fWeightRatLongNOverP;
+}
+
+//-------------------------------------
+void AliHBTWeightNonId3DTheorCorrFctn::ProcessSameEventParticles(AliHBTPair* partpair)
+{
+    //Fills the numerator using pair from the same event
+    partpair = CheckPair(partpair);
+    if(partpair == 0x0) return;
+    double tKStar = fabs(partpair->GetKStar());
+    double tKStarOut = partpair->GetKStarOut();
+    double tKStarSide = partpair->GetKStarSide();
+    double tKStarLong = partpair->GetKStarLong();
+
+    Double_t weight = 1.0;
+    
+  if (partpair)
+  {
+       weight=partpair->GetWeight();
+    
+    if(tKStarOut>0.)
+    {
+       fWeightNumOutP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumOutN->Fill(tKStar,weight);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fWeightNumSideP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumSideN->Fill(tKStar,weight);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fWeightNumLongP->Fill(tKStar,weight);
+    }
+    else
+    {
+       fWeightNumLongN->Fill(tKStar,weight);
+    }
+  }
+  
+}
+
+/****************************************************************/
+
+
+void AliHBTWeightNonId3DTheorCorrFctn::ProcessDiffEventParticles(AliHBTPair* partpair)
+{
+
+  partpair  = CheckPair(partpair);
+
+  double tKStar = fabs(partpair->GetKStar());
+  double tKStarOut = partpair->GetKStarOut();
+  double tKStarSide = partpair->GetKStarSide();
+  double tKStarLong = partpair->GetKStarLong();
+
+  if (partpair)
+  {
+    if(tKStarOut>0.)
+    {
+       fWeightDenOutP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenOutN->Fill(tKStar);
+    }
+
+    if(tKStarSide>0.)
+    {
+       fWeightDenSideP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenSideN->Fill(tKStar);
+    }
+
+    if(tKStarLong>0.)
+    {
+       fWeightDenLongP->Fill(tKStar);
+    }
+    else
+    {
+       fWeightDenLongN->Fill(tKStar);
+    }
+  }
+  
+}
+
+
+/****************************************************************/
+void AliHBTWeightNonId3DTheorCorrFctn::Init()
+{
+    AliHBTOnePairFctn1D::Init();
+ fWeightNumOutP->Reset();
+ fWeightDenOutP->Reset();
+ fWeightRatOutP->Reset();
+ fWeightNumOutN->Reset();
+ fWeightDenOutN->Reset();
+ fWeightRatOutN->Reset();
+ fWeightRatOut->Reset();
+ fWeightRatOutNOverP->Reset();
+
+ fWeightNumSideP->Reset();
+ fWeightDenSideP->Reset();
+ fWeightRatSideP->Reset();
+ fWeightNumSideN->Reset();
+ fWeightDenSideN->Reset();
+ fWeightRatSideN->Reset();
+ fWeightRatSide->Reset();
+ fWeightRatSideNOverP->Reset();
+
+ fWeightNumLongP->Reset();
+ fWeightDenLongP->Reset();
+ fWeightRatLongP->Reset();
+ fWeightNumLongN->Reset();
+ fWeightDenLongN->Reset();
+ fWeightRatLongN->Reset();
+ fWeightRatLong->Reset();
+ fWeightRatLongNOverP->Reset();
+}
+/******************************************************************/
+
+void AliHBTWeightNonId3DTheorCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min)
+{
+    
+    AliHBTFunction1D::BuildHistos(nbins,max,min);
+    
+    TString nameNumOutP = "WeightNumOutP";
+    TString nameDenOutP = "WeightDenOutP";
+    TString nameRatOutP = "WeightRatOutP";
+    TString nameNumOutN = "WeightNumOutN";
+    TString nameDenOutN = "WeightDenOutN";
+    TString nameRatOutN = "WeightRatOutN";
+    TString nameRatOut =  "WeightRatOut";
+    TString nameRatOutNOverP = "WeightRatOutNOverP";
+    TString nameNumSideP = "WeightNumSideP";
+    TString nameDenSideP = "WeightDenSideP";
+    TString nameRatSideP = "WeightRatSideP";
+    TString nameNumSideN = "WeightNumSideN";
+    TString nameDenSideN = "WeightDenSideN";
+    TString nameRatSideN = "WeightRatSideN";
+    TString nameRatSide = "WeightRatSide";
+    TString nameRatSideNOverP = "WeightRatSideNOverP";
+    TString nameNumLongP = "WeightNumLongP";
+    TString nameDenLongP = "WeightDenLongP";
+    TString nameRatLongP = "WeightRatLongP";
+    TString nameNumLongN = "WeightNumLongN";
+    TString nameDenLongN = "WeightDenLongN";
+    TString nameRatLongN = "WeightRatLongN";
+    TString nameRatLong = "WeightRatLong";
+    TString nameRatLongNOverP = "WeightRatLongNOverP";
+
+    fWeightNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max);
+    fWeightDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max);
+    fWeightRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max);
+
+    fWeightNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max);
+    fWeightDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max);
+    fWeightRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max);
+
+    fWeightRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max);
+    fWeightRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max);
+
+    fWeightNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max);
+    fWeightDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max);
+    fWeightRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max);
+
+    fWeightNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max);
+    fWeightDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max);
+    fWeightRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max);
+
+    fWeightRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max);
+    fWeightRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max);
+
+    fWeightNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max);
+    fWeightDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max);
+    fWeightRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max);
+
+    fWeightNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max);
+    fWeightDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max);
+    fWeightRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max);
+
+    fWeightRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max);
+    fWeightRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max);
+
+
+    fWeightNumOutP->Sumw2();
+    fWeightDenOutP->Sumw2();
+    fWeightRatOutP->Sumw2();
+    fWeightNumOutN->Sumw2();
+    fWeightDenOutN->Sumw2();
+    fWeightRatOutN->Sumw2();
+    fWeightRatOut->Sumw2();
+    fWeightRatOutNOverP->Sumw2();
+    fWeightNumSideP->Sumw2();
+    fWeightDenSideP->Sumw2();
+    fWeightRatSideP->Sumw2();
+    fWeightNumSideN->Sumw2();
+    fWeightDenSideN->Sumw2();
+    fWeightRatSideN->Sumw2();
+    fWeightRatSide->Sumw2();
+    fWeightRatSideNOverP->Sumw2();
+    fWeightNumLongP->Sumw2();
+    fWeightDenLongP->Sumw2();
+    fWeightRatLongP->Sumw2();
+    fWeightNumLongN->Sumw2();
+    fWeightDenLongN->Sumw2();
+    fWeightRatLongN->Sumw2();
+    fWeightRatLong->Sumw2();
+    fWeightRatLongNOverP->Sumw2();
+}
+
+/******************************************************************/
+
+TH1* AliHBTWeightNonId3DTheorCorrFctn::GetResult()
+{
+    return fWeightRatOutN;
+}
+
+/******************************************************************/
+
+void AliHBTWeightNonId3DTheorCorrFctn::WriteFunction()
+{
+
+ Double_t outPscale = Scale(fWeightNumOutP,fWeightDenOutP);
+ cout<<"WoutPscale = "<<outPscale<<endl;
+ fWeightRatOutP->Divide(fWeightNumOutP,fWeightDenOutP,outPscale);
+
+ Double_t outNscale = Scale(fWeightNumOutN,fWeightDenOutN);
+ cout<<"WoutNscale = "<<outNscale<<endl;
+ fWeightRatOutN->Divide(fWeightNumOutN,fWeightDenOutN,outNscale);
+
+ fWeightRatOutNOverP->Divide(fWeightRatOutN,fWeightRatOutP);
+
+
+ Double_t sidePscale = Scale(fWeightNumSideP,fWeightDenSideP);
+ fWeightRatSideP->Divide(fWeightNumSideP,fWeightDenSideP,sidePscale);
+
+ Double_t sideNscale = Scale(fWeightNumSideN,fWeightDenSideN);
+ fWeightRatSideN->Divide(fWeightNumSideN,fWeightDenSideN,sideNscale);
+
+ fWeightRatSideNOverP->Divide(fWeightRatSideN,fWeightRatSideP);
+
+
+ Double_t longPscale = Scale(fWeightNumLongP,fWeightDenLongP);
+ fWeightRatLongP->Divide(fWeightNumLongP,fWeightDenLongP,longPscale);
+
+ Double_t longNscale = Scale(fWeightNumLongN,fWeightDenLongN);
+ fWeightRatLongN->Divide(fWeightNumLongN,fWeightDenLongN,longNscale);
+
+ fWeightRatLongNOverP->Divide(fWeightRatLongN,fWeightRatLongP);
+
+ fWeightNumOutP->Write();
+ fWeightDenOutP->Write();
+ fWeightRatOutP->Write();
+ fWeightNumOutN->Write();
+ fWeightDenOutN->Write();
+ fWeightRatOutN->Write();
+ fWeightRatOut->Write();
+ fWeightRatOutNOverP->Write();
+
+ fWeightNumSideP->Write();
+ fWeightDenSideP->Write();
+ fWeightRatSideP->Write();
+ fWeightNumSideN->Write();
+ fWeightDenSideN->Write();
+ fWeightRatSideN->Write();
+ fWeightRatSide->Write();
+ fWeightRatSideNOverP->Write();
+
+ fWeightNumLongP->Write();
+ fWeightDenLongP->Write();
+ fWeightRatLongP->Write();
+ fWeightNumLongN->Write();
+ fWeightDenLongN->Write();
+ fWeightRatLongN->Write();
+ fWeightRatLong->Write();
+ fWeightRatLongNOverP->Write();
+
+}
+
diff --git a/HBTAN/AliHBTWeightNonId3DTheorCorrFctn.h b/HBTAN/AliHBTWeightNonId3DTheorCorrFctn.h
new file mode 100644 (file)
index 0000000..0fbdd99
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef ALIHBTWEIGHTNONID3DTHEORCORRFCTN_H
+#define ALIHBTWEIGHTNONID3DTHEORCORRFCTN_H
+
+///////////////////////////////////////////////////////
+//                                                   //
+// AliHBTWeightNonId3DCorrFctn.h                     //
+//                                                   //
+// Class for calculating 3D non-id correlation       //
+// functions using method of weights                 //
+//                                                   //
+///////////////////////////////////////////////////////
+
+#include "AliHBTFunction.h"
+
+
+class AliHBTWeights;
+
+class AliHBTWeightNonId3DTheorCorrFctn: public AliHBTOnePairFctn1D
+{
+  public:
+   AliHBTWeightNonId3DTheorCorrFctn(const char* name = "nonid3DCF", 
+                              const char* title= "3D Non-Id Theoretical Correlation Function");
+
+   AliHBTWeightNonId3DTheorCorrFctn(const char* name, const char* title,
+                              Int_t nbinsX, Float_t maxXval, Float_t minXval);
+   AliHBTWeightNonId3DTheorCorrFctn(const AliHBTWeightNonId3DTheorCorrFctn& in);
+
+   virtual ~AliHBTWeightNonId3DTheorCorrFctn();
+
+   void Init(); // InitFunction();
+   void ProcessSameEventParticles(AliHBTPair* partpair);
+   void ProcessDiffEventParticles(AliHBTPair* partpair);
+
+   void WriteFunction();
+   
+   TH1*     GetResult();
+   
+ protected:
+
+   Double_t GetValue(AliHBTPair* partpair) {return partpair->GetQInv();}
+   void BuildHistos(Int_t nbins, Float_t max, Float_t min);
+   
+   TH1D* fWeightNumOutP;
+   TH1D* fWeightDenOutP;
+   TH1D* fWeightRatOutP;
+   TH1D* fWeightNumOutN;
+   TH1D* fWeightDenOutN;
+   TH1D* fWeightRatOutN;
+   TH1D* fWeightRatOut;
+   TH1D* fWeightRatOutNOverP;
+
+   TH1D* fWeightNumSideP;
+   TH1D* fWeightDenSideP;
+   TH1D* fWeightRatSideP;
+   TH1D* fWeightNumSideN;
+   TH1D* fWeightDenSideN;
+   TH1D* fWeightRatSideN;
+   TH1D* fWeightRatSide;
+   TH1D* fWeightRatSideNOverP;
+
+   TH1D* fWeightNumLongP;
+   TH1D* fWeightDenLongP;
+   TH1D* fWeightRatLongP;
+   TH1D* fWeightNumLongN;
+   TH1D* fWeightDenLongN;
+   TH1D* fWeightRatLongN;
+   TH1D* fWeightRatLong;
+   TH1D* fWeightRatLongNOverP;
+   
+    
+  private:
+  
+    ClassDef(AliHBTWeightNonId3DTheorCorrFctn,1)
+};
+
+#endif
index 7eec6e3..3d83b78 100644 (file)
 
 #pragma link C++ class AliHBTAvSeparCorrelFctn+;
 
+#pragma link C++ class AliHBTNonId3DCorrFctn+;          // zch
+#pragma link C++ class AliHBTWeightNonId3DCorrFctn+;    // zch
+#pragma link C++ class AliHBTWeightNonId3DTheorCorrFctn+;    // zch
+
 #pragma link C++ class AliHBTInvMassCorrelFctn+;
 #pragma link C++ class AliHBTCorrFitFctn+;
 
index 976dd77..c0ff0ba 100644 (file)
@@ -8,7 +8,8 @@ AliHBTLLWeights.cxx             AliHBTWeightFctn.cxx \
 AliHBTWeightsPID.cxx            AliHBTWeightTheorFctn.cxx \
 AliHBTPositionRandomizer.cxx    \
 AliHBTCorrFitFctn.cxx AliHBTPIDPurityFctns.cxx \
-AliHBTCorrectQInvCorrelFctn.cxx AliHBTCorrectOSLCorrelFctn.cxx 
+AliHBTCorrectQInvCorrelFctn.cxx AliHBTCorrectOSLCorrelFctn.cxx \
+AliHBTNonId3DCorrFctn.cxx AliHBTWeightNonId3DCorrFctn.cxx AliHBTWeightNonId3DTheorCorrFctn.cxx
 
 
 FSRCS   = fsiini.F  fsiw.F  led_bldata.F  ltran12.F