]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding model correlation functions.
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Mar 2008 09:53:46 +0000 (09:53 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Mar 2008 09:53:46 +0000 (09:53 +0000)
  - For analysis of non-identical particles with the double ratio method
  - Identical particles, binned in spherical coordinates (qinv, phi,
  cos(theta)) for the spherical harmonics decomposition
  - Identical particles, binned in spherical coordinates in the LCMS frame

PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.h [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.h [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.h [new file with mode: 0644]

diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx
new file mode 100644 (file)
index 0000000..66930b2
--- /dev/null
@@ -0,0 +1,179 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoModelCorrFctn3DLCMSSpherical: a class to calculate 3D correlation //
+// for pairs of identical particles, binned in spherical coordinates.    //
+// In analysis the function should be first created in a macro, then     //
+// added to the analysis, and at the end of the macro the procedure to   //
+// write out histograms should be called.                                //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoModelCorrFctn3DLCMSSpherical.h"
+#include "AliFemtoModelManager.h"
+#include <TMath.h>
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoModelCorrFctn3DLCMSSpherical)
+#endif
+
+//____________________________
+  AliFemtoModelCorrFctn3DLCMSSpherical::AliFemtoModelCorrFctn3DLCMSSpherical(char* title, const int& nqbins, const float& QLo, const float& QHi, const int& nphibins, const int& ncthetabins):
+  fTrueNumeratorSph(0),
+  fFakeNumeratorSph(0),
+  fDenominatorSph(0),
+  fPairCut(0x0)
+{
+  // set up numerator
+  char tTitNum[100] = "NumTrue";
+  strcat(tTitNum,title);
+  fTrueNumeratorSph = new TH3D(tTitNum,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+  // set up numerator
+  char tTitNumF[100] = "NumFake";
+  strcat(tTitNumF,title);
+  fFakeNumeratorSph = new TH3D(tTitNumF,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+  // set up denominator
+  char tTitDen[100] = "Den";
+  strcat(tTitDen,title);
+  fDenominatorSph = new TH3D(tTitDen,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+
+  // to enable error bar calculation...
+  fTrueNumeratorSph->Sumw2();
+  fFakeNumeratorSph->Sumw2();
+  fDenominatorSph->Sumw2();
+}
+
+AliFemtoModelCorrFctn3DLCMSSpherical::AliFemtoModelCorrFctn3DLCMSSpherical(const AliFemtoModelCorrFctn3DLCMSSpherical& aCorrFctn) :
+  AliFemtoModelCorrFctn(),
+  fTrueNumeratorSph(0),
+  fFakeNumeratorSph(0),
+  fDenominatorSph(0),
+  fPairCut(0x0)
+{
+  // Copy constructor
+  fTrueNumeratorSph = new TH3D(*aCorrFctn.fTrueNumeratorSph);
+  fFakeNumeratorSph = new TH3D(*aCorrFctn.fFakeNumeratorSph);
+  fDenominatorSph = new TH3D(*aCorrFctn.fDenominatorSph);
+  fPairCut = aCorrFctn.fPairCut;
+}
+//____________________________
+AliFemtoModelCorrFctn3DLCMSSpherical::~AliFemtoModelCorrFctn3DLCMSSpherical(){
+  // Destructor
+  delete fTrueNumeratorSph;
+  delete fFakeNumeratorSph;
+  delete fDenominatorSph;
+}
+//_________________________
+AliFemtoModelCorrFctn3DLCMSSpherical& AliFemtoModelCorrFctn3DLCMSSpherical::operator=(const AliFemtoModelCorrFctn3DLCMSSpherical& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (fTrueNumeratorSph) delete fTrueNumeratorSph;
+  fTrueNumeratorSph = new TH3D(*aCorrFctn.fTrueNumeratorSph);
+  if (fFakeNumeratorSph) delete fFakeNumeratorSph;
+  fFakeNumeratorSph = new TH3D(*aCorrFctn.fFakeNumeratorSph);
+  if (fDenominatorSph) delete fDenominatorSph;
+  fDenominatorSph = new TH3D(*aCorrFctn.fDenominatorSph);
+  
+  fPairCut = aCorrFctn.fPairCut;
+  
+  return *this;
+}
+
+//_________________________
+void AliFemtoModelCorrFctn3DLCMSSpherical::WriteOutHistos(){
+  // Write out all histograms to file
+  fTrueNumeratorSph->Write();
+  fFakeNumeratorSph->Write();
+  fDenominatorSph->Write();
+}
+//______________________________
+TList* AliFemtoModelCorrFctn3DLCMSSpherical::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fTrueNumeratorSph); 
+  tOutputList->Add(fFakeNumeratorSph); 
+  tOutputList->Add(fDenominatorSph);  
+
+  return tOutputList;
+}
+
+//_________________________
+void AliFemtoModelCorrFctn3DLCMSSpherical::Finish(){
+  // here is where we should normalize, fit, etc...
+}
+
+//____________________________
+AliFemtoString AliFemtoModelCorrFctn3DLCMSSpherical::Report(){
+  // Construct the report
+  string stemp = "LCMS Frame Spherical 3D Model Correlation Function Report:\n";
+  char ctemp[100];
+  sprintf(ctemp,"Number of entries in numerator:\t%E\n",fTrueNumeratorSph->GetEntries());
+  stemp += ctemp;
+  sprintf(ctemp,"Number of entries in denominator:\t%E\n",fDenominatorSph->GetEntries());
+  stemp += ctemp;
+
+  if (fPairCut){
+    sprintf(ctemp,"Here is the PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+    stemp += fPairCut->Report();
+  }
+  else{
+    sprintf(ctemp,"No PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+  }
+
+  //  
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoModelCorrFctn3DLCMSSpherical::AddRealPair( AliFemtoPair* pair){
+  // perform operations on real pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  Double_t weight = fManager->GetWeight(pair);
+
+
+  double tKO = (pair->QOutCMS());
+  double tKS = (pair->QSideCMS());
+  double tKL = (pair->QLongCMS());
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fTrueNumeratorSph->Fill(tKR,tKP,tKC,weight);
+}
+//____________________________
+void AliFemtoModelCorrFctn3DLCMSSpherical::AddMixedPair( AliFemtoPair* pair){
+  // perform operations on mixed pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  Double_t weight = fManager->GetWeight(pair);
+
+  double tKO = (pair->QOutCMS());
+  double tKS = (pair->QSideCMS());
+  double tKL = (pair->QLongCMS());
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fFakeNumeratorSph->Fill(tKR,tKP,tKC,weight);
+  fDenominatorSph->Fill(tKR,tKP,tKC);
+}
+
+
diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.h b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.h
new file mode 100644 (file)
index 0000000..f3814f4
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoModelCorrFctn3DSpherical: a class to calculate 3D correlation //
+// for pairs of identical particles, binned in spherical coordinates     //
+// (q_inv, phi, cos(theta))                                              //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOMODELCORRFCTN3DLCMSSPHERICAL_H
+#define ALIFEMTOMODELCORRFCTN3DLCMSSPHERICAL_H
+
+#include "AliFemtoModelCorrFctn.h"
+#include "AliFemtoPairCut.h"
+#include "TH3D.h"
+
+class AliFemtoModelCorrFctn3DLCMSSpherical : public AliFemtoModelCorrFctn {
+public:
+  AliFemtoModelCorrFctn3DLCMSSpherical(char* title, 
+                             const int& nqbins, const float& QLo, const float& QHi,
+                             const int& nphibins, const int& ncthetabins);
+  AliFemtoModelCorrFctn3DLCMSSpherical(const AliFemtoModelCorrFctn3DLCMSSpherical& aCorrFctn);
+  virtual ~AliFemtoModelCorrFctn3DLCMSSpherical();
+
+  AliFemtoModelCorrFctn3DLCMSSpherical& operator=(const AliFemtoModelCorrFctn3DLCMSSpherical& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair( AliFemtoPair* aPair);
+  virtual void AddMixedPair( AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  void WriteOutHistos();
+  virtual TList* GetOutputList();
+
+  void SetSpecificPairCut(AliFemtoPairCut* aCut);
+
+private:
+  // here are a whole bunch of histos that get filled if we do resolution correction
+  TH3D* fTrueNumeratorSph;         // numerator
+  TH3D* fFakeNumeratorSph;         // numerator
+  TH3D* fDenominatorSph;       // denominator
+
+  AliFemtoPairCut* fPairCut;    //! this is a PairCut specific to THIS CorrFctn, not the Analysis
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoModelCorrFctn3DLCMSSpherical, 1)
+#endif
+};
+
+inline  void AliFemtoModelCorrFctn3DLCMSSpherical::SetSpecificPairCut(AliFemtoPairCut* pc){fPairCut=pc;}
+
+#endif
+
diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx
new file mode 100644 (file)
index 0000000..c2d66ca
--- /dev/null
@@ -0,0 +1,179 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoModelCorrFctn3DSpherical: a class to calculate 3D correlation //
+// for pairs of identical particles, binned in spherical coordinates.    //
+// In analysis the function should be first created in a macro, then     //
+// added to the analysis, and at the end of the macro the procedure to   //
+// write out histograms should be called.                                //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoModelCorrFctn3DSpherical.h"
+#include "AliFemtoModelManager.h"
+#include <TMath.h>
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoModelCorrFctn3DSpherical)
+#endif
+
+//____________________________
+AliFemtoModelCorrFctn3DSpherical::AliFemtoModelCorrFctn3DSpherical(char* title, const int& nqbins, const float& QLo, const float& QHi, const int& nphibins, const int& ncthetabins):
+  AliFemtoModelCorrFctn(),
+  fTrueNumeratorSph(0),
+  fFakeNumeratorSph(0),
+  fDenominatorSph(0),
+  fPairCut(0x0)
+{
+  // set up numerator
+  char tTitNum[100] = "NumTrue";
+  strcat(tTitNum,title);
+  fTrueNumeratorSph = new TH3D(tTitNum,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+  // set up numerator
+  char tTitNumF[100] = "NumFake";
+  strcat(tTitNumF,title);
+  fFakeNumeratorSph = new TH3D(tTitNumF,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+  // set up denominator
+  char tTitDen[100] = "Den";
+  strcat(tTitDen,title);
+  fDenominatorSph = new TH3D(tTitDen,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+
+  // to enable error bar calculation...
+  fTrueNumeratorSph->Sumw2();
+  fFakeNumeratorSph->Sumw2();
+  fDenominatorSph->Sumw2();
+}
+
+AliFemtoModelCorrFctn3DSpherical::AliFemtoModelCorrFctn3DSpherical(const AliFemtoModelCorrFctn3DSpherical& aCorrFctn) :
+  AliFemtoModelCorrFctn(aCorrFctn),
+  fTrueNumeratorSph(0),
+  fFakeNumeratorSph(0),
+  fDenominatorSph(0),
+  fPairCut(0x0)
+{
+  // Copy constructor
+  fTrueNumeratorSph = new TH3D(*aCorrFctn.fTrueNumeratorSph);
+  fFakeNumeratorSph = new TH3D(*aCorrFctn.fFakeNumeratorSph);
+  fDenominatorSph = new TH3D(*aCorrFctn.fDenominatorSph);
+  fPairCut = aCorrFctn.fPairCut;
+}
+//____________________________
+AliFemtoModelCorrFctn3DSpherical::~AliFemtoModelCorrFctn3DSpherical(){
+  // Destructor
+  delete fTrueNumeratorSph;
+  delete fFakeNumeratorSph;
+  delete fDenominatorSph;
+}
+//_________________________
+AliFemtoModelCorrFctn3DSpherical& AliFemtoModelCorrFctn3DSpherical::operator=(const AliFemtoModelCorrFctn3DSpherical& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (fTrueNumeratorSph) delete fTrueNumeratorSph;
+  fTrueNumeratorSph = new TH3D(*aCorrFctn.fTrueNumeratorSph);
+  if (fFakeNumeratorSph) delete fFakeNumeratorSph;
+  fFakeNumeratorSph = new TH3D(*aCorrFctn.fFakeNumeratorSph);
+  if (fDenominatorSph) delete fDenominatorSph;
+  fDenominatorSph = new TH3D(*aCorrFctn.fDenominatorSph);
+  
+  fPairCut = aCorrFctn.fPairCut;
+  
+  return *this;
+}
+
+//_________________________
+void AliFemtoModelCorrFctn3DSpherical::WriteOutHistos(){
+  // Write out all histograms to file
+  fTrueNumeratorSph->Write();
+  fFakeNumeratorSph->Write();
+  fDenominatorSph->Write();
+}
+//______________________________
+TList* AliFemtoModelCorrFctn3DSpherical::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fTrueNumeratorSph); 
+  tOutputList->Add(fFakeNumeratorSph); 
+  tOutputList->Add(fDenominatorSph);  
+
+  return tOutputList;
+}
+
+//_________________________
+void AliFemtoModelCorrFctn3DSpherical::Finish(){
+  // here is where we should normalize, fit, etc...
+}
+
+//____________________________
+AliFemtoString AliFemtoModelCorrFctn3DSpherical::Report(){
+  // Construct the report
+  string stemp = "PRF Frame Spherical 3D Model Correlation Function Report:\n";
+  char ctemp[100];
+  sprintf(ctemp,"Number of entries in numerator:\t%E\n",fTrueNumeratorSph->GetEntries());
+  stemp += ctemp;
+  sprintf(ctemp,"Number of entries in denominator:\t%E\n",fDenominatorSph->GetEntries());
+  stemp += ctemp;
+
+  if (fPairCut){
+    sprintf(ctemp,"Here is the PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+    stemp += fPairCut->Report();
+  }
+  else{
+    sprintf(ctemp,"No PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+  }
+
+  //  
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoModelCorrFctn3DSpherical::AddRealPair( AliFemtoPair* pair){
+  // perform operations on real pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  Double_t weight = fManager->GetWeight(pair);
+
+  double tKO = pair->KOut();
+  double tKS = pair->KSide();
+  double tKL = pair->KLong();
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fTrueNumeratorSph->Fill(tKR,tKP,tKC,weight);
+}
+//____________________________
+void AliFemtoModelCorrFctn3DSpherical::AddMixedPair( AliFemtoPair* pair){
+  // perform operations on mixed pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  Double_t weight = fManager->GetWeight(pair);
+
+  double tKO = pair->KOut();
+  double tKS = pair->KSide();
+  double tKL = pair->KLong();
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fFakeNumeratorSph->Fill(tKR,tKP,tKC,weight);
+  fDenominatorSph->Fill(tKR,tKP,tKC);
+}
+
+
diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.h b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.h
new file mode 100644 (file)
index 0000000..9819288
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoModelCorrFctn3DSpherical: a class to calculate 3D correlation //
+// for pairs of identical particles, binned in spherical coordinates     //
+// (q_inv, phi, cos(theta))                                              //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOMODELCORRFCTN3DSPHERICAL_H
+#define ALIFEMTOMODELCORRFCTN3DSPHERICAL_H
+
+#include "AliFemtoModelCorrFctn.h"
+#include "AliFemtoPairCut.h"
+#include "TH3D.h"
+
+class AliFemtoModelCorrFctn3DSpherical : public AliFemtoModelCorrFctn {
+public:
+  AliFemtoModelCorrFctn3DSpherical(char* title, 
+                             const int& nqbins, const float& QLo, const float& QHi,
+                             const int& nphibins, const int& ncthetabins);
+  AliFemtoModelCorrFctn3DSpherical(const AliFemtoModelCorrFctn3DSpherical& aCorrFctn);
+  virtual ~AliFemtoModelCorrFctn3DSpherical();
+
+  AliFemtoModelCorrFctn3DSpherical& operator=(const AliFemtoModelCorrFctn3DSpherical& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair( AliFemtoPair* aPair);
+  virtual void AddMixedPair( AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  void WriteOutHistos();
+  virtual TList* GetOutputList();
+
+  void SetSpecificPairCut(AliFemtoPairCut* aCut);
+
+private:
+  // here are a whole bunch of histos that get filled if we do resolution correction
+  TH3D* fTrueNumeratorSph;         // numerator
+  TH3D* fFakeNumeratorSph;         // numerator
+  TH3D* fDenominatorSph;       // denominator
+
+  AliFemtoPairCut* fPairCut;    //! this is a PairCut specific to THIS CorrFctn, not the Analysis
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoModelCorrFctn3DSpherical, 1)
+#endif
+};
+
+inline  void AliFemtoModelCorrFctn3DSpherical::SetSpecificPairCut(AliFemtoPairCut* pc){fPairCut=pc;}
+
+#endif
+
diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx
new file mode 100644 (file)
index 0000000..3045a5c
--- /dev/null
@@ -0,0 +1,382 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoModelCorrFctnNonIdDR - correlation function for non-identical      //
+// particles which uses k* as a function variable. Stores the correlation     //
+// function separately for positive and negative signs of k* projections into //
+// out, side and long directions, enabling the calculations of double ratios  //
+// Uses pair weight to simulate the model correlation function.               //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoModelCorrFctnNonIdDR.h"
+#include "AliFemtoModelManager.h"
+//#include "AliFemtoHisto.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoModelCorrFctnNonIdDR)
+#endif
+
+//____________________________
+AliFemtoModelCorrFctnNonIdDR::AliFemtoModelCorrFctnNonIdDR(char* title, const int& nbins, const float& QinvLo, const float& QinvHi):
+  AliFemtoModelCorrFctn(title, nbins, QinvLo, QinvHi),
+  fNumTOutP(0), 
+  fNumTOutN(0),  
+  fNumTSideP(0), 
+  fNumTSideN(0), 
+  fNumTLongP(0), 
+  fNumTLongN(0), 
+  fNumFOutP(0), 
+  fNumFOutN(0),  
+  fNumFSideP(0), 
+  fNumFSideN(0), 
+  fNumFLongP(0), 
+  fNumFLongN(0), 
+  fDenOutP(0),  
+  fDenOutN(0),  
+  fDenSideP(0), 
+  fDenSideN(0), 
+  fDenLongP(0), 
+  fDenLongN(0)
+{
+  // Default constructor
+  char bufname[200];
+
+  // set up true numerators
+  snprintf(bufname, 200, "NumTOutP%s", title);
+  fNumTOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumTOutN%s", title);
+  fNumTOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumTSideP%s", title);
+  fNumTSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumTSideN%s", title);
+  fNumTSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumTLongP%s", title);
+  fNumTLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumTLongN%s", title);
+  fNumTLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+
+  // set up fake numerators
+  snprintf(bufname, 200, "NumFOutP%s", title);
+  fNumFOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumFOutN%s", title);
+  fNumFOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumFSideP%s", title);
+  fNumFSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumFSideN%s", title);
+  fNumFSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumFLongP%s", title);
+  fNumFLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumFLongN%s", title);
+  fNumFLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+
+  // set up denominators
+  snprintf(bufname, 200, "DenOutP%s", title);
+  fDenOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenOutN%s", title);
+  fDenOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenSideP%s", title);
+  fDenSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenSideN%s", title);
+  fDenSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenLongP%s", title);
+  fDenLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenLongN%s", title);
+  fDenLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+
+  // to enable error bar calculation...
+  fNumTOutP->Sumw2(); 
+  fNumTOutN->Sumw2();  
+  fNumTSideP->Sumw2(); 
+  fNumTSideN->Sumw2(); 
+  fNumTLongP->Sumw2(); 
+  fNumTLongN->Sumw2(); 
+  fNumFOutP->Sumw2(); 
+  fNumFOutN->Sumw2();  
+  fNumFSideP->Sumw2(); 
+  fNumFSideN->Sumw2(); 
+  fNumFLongP->Sumw2(); 
+  fNumFLongN->Sumw2(); 
+  fDenOutP->Sumw2();  
+  fDenOutN->Sumw2();  
+  fDenSideP->Sumw2(); 
+  fDenSideN->Sumw2(); 
+  fDenLongP->Sumw2(); 
+  fDenLongN->Sumw2();
+}
+
+//____________________________
+AliFemtoModelCorrFctnNonIdDR::AliFemtoModelCorrFctnNonIdDR(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn) :
+  AliFemtoModelCorrFctn(),
+  fNumTOutP(0), 
+  fNumTOutN(0),  
+  fNumTSideP(0), 
+  fNumTSideN(0), 
+  fNumTLongP(0), 
+  fNumTLongN(0), 
+  fNumFOutP(0), 
+  fNumFOutN(0),  
+  fNumFSideP(0), 
+  fNumFSideN(0), 
+  fNumFLongP(0), 
+  fNumFLongN(0), 
+  fDenOutP(0),  
+  fDenOutN(0),  
+  fDenSideP(0), 
+  fDenSideN(0), 
+  fDenLongP(0), 
+  fDenLongN(0)
+{
+  // copy constructor
+  if (aCorrFctn.fNumTOutP)
+    fNumTOutP = new TH1D(*aCorrFctn.fNumTOutP);
+  if (aCorrFctn.fNumTOutN)
+    fNumTOutN = new TH1D(*aCorrFctn.fNumTOutN);
+  if (aCorrFctn.fNumTSideP)
+    fNumTSideP = new TH1D(*aCorrFctn.fNumTSideP);
+  if (aCorrFctn.fNumTSideN)
+    fNumTSideN = new TH1D(*aCorrFctn.fNumTSideN);
+  if (aCorrFctn.fNumTLongP)
+    fNumTLongP = new TH1D(*aCorrFctn.fNumTLongP);
+  if (aCorrFctn.fNumTLongN)
+    fNumTLongN = new TH1D(*aCorrFctn.fNumTLongN);
+
+  if (aCorrFctn.fNumFOutP)
+    fNumFOutP = new TH1D(*aCorrFctn.fNumFOutP);
+  if (aCorrFctn.fNumFOutN)
+    fNumFOutN = new TH1D(*aCorrFctn.fNumFOutN);
+  if (aCorrFctn.fNumFSideP)
+    fNumFSideP = new TH1D(*aCorrFctn.fNumFSideP);
+  if (aCorrFctn.fNumFSideN)
+    fNumFSideN = new TH1D(*aCorrFctn.fNumFSideN);
+  if (aCorrFctn.fNumFLongP)
+    fNumFLongP = new TH1D(*aCorrFctn.fNumFLongP);
+  if (aCorrFctn.fNumFLongN)
+    fNumFLongN = new TH1D(*aCorrFctn.fNumFLongN);
+
+  if (aCorrFctn.fDenOutP)
+    fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
+  if (aCorrFctn.fDenOutN)
+    fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
+  if (aCorrFctn.fDenSideP)
+    fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
+  if (aCorrFctn.fDenSideN)
+    fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
+  if (aCorrFctn.fDenLongP)
+    fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
+  if (aCorrFctn.fDenLongN)
+    fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
+}
+//____________________________
+AliFemtoModelCorrFctnNonIdDR::~AliFemtoModelCorrFctnNonIdDR(){
+  // Destructor
+  delete fNumTOutP; 
+  delete fNumTOutN;  
+  delete fNumTSideP; 
+  delete fNumTSideN; 
+  delete fNumTLongP; 
+  delete fNumTLongN; 
+  delete fNumFOutP; 
+  delete fNumFOutN;  
+  delete fNumFSideP; 
+  delete fNumFSideN; 
+  delete fNumFLongP; 
+  delete fNumFLongN; 
+  delete fDenOutP;  
+  delete fDenOutN;  
+  delete fDenSideP; 
+  delete fDenSideN; 
+  delete fDenLongP; 
+  delete fDenLongN;
+}
+//_________________________
+AliFemtoModelCorrFctnNonIdDR& AliFemtoModelCorrFctnNonIdDR::operator=(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (aCorrFctn.fNumTOutP)
+    fNumTOutP = new TH1D(*aCorrFctn.fNumTOutP);
+  if (aCorrFctn.fNumTOutN)
+    fNumTOutN = new TH1D(*aCorrFctn.fNumTOutN);
+  if (aCorrFctn.fNumTSideP)
+    fNumTSideP = new TH1D(*aCorrFctn.fNumTSideP);
+  if (aCorrFctn.fNumTSideN)
+    fNumTSideN = new TH1D(*aCorrFctn.fNumTSideN);
+  if (aCorrFctn.fNumTLongP)
+    fNumTLongP = new TH1D(*aCorrFctn.fNumTLongP);
+  if (aCorrFctn.fNumTLongN)
+    fNumTLongN = new TH1D(*aCorrFctn.fNumTLongN);
+
+  if (aCorrFctn.fNumFOutP)
+    fNumFOutP = new TH1D(*aCorrFctn.fNumFOutP);
+  if (aCorrFctn.fNumFOutN)
+    fNumFOutN = new TH1D(*aCorrFctn.fNumFOutN);
+  if (aCorrFctn.fNumFSideP)
+    fNumFSideP = new TH1D(*aCorrFctn.fNumFSideP);
+  if (aCorrFctn.fNumFSideN)
+    fNumFSideN = new TH1D(*aCorrFctn.fNumFSideN);
+  if (aCorrFctn.fNumFLongP)
+    fNumFLongP = new TH1D(*aCorrFctn.fNumFLongP);
+  if (aCorrFctn.fNumFLongN)
+    fNumFLongN = new TH1D(*aCorrFctn.fNumFLongN);
+
+  if (aCorrFctn.fDenOutP)
+    fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
+  if (aCorrFctn.fDenOutN)
+    fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
+  if (aCorrFctn.fDenSideP)
+    fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
+  if (aCorrFctn.fDenSideN)
+    fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
+  if (aCorrFctn.fDenLongP)
+    fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
+  if (aCorrFctn.fDenLongN)
+    fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
+
+  return *this;
+}
+
+//_________________________
+void AliFemtoModelCorrFctnNonIdDR::Finish(){
+  // here is where we should normalize, fit, etc...
+  // we should NOT Draw() the histos (as I had done it below),
+  // since we want to insulate ourselves from root at this level
+  // of the code.  Do it instead at root command line with browser.
+  //  fNumerator->Draw();
+  //fDenominator->Draw();
+  //fRatio->Draw();
+  //  fRatio->Divide(fNumerator,fDenominator,1.0,1.0);
+
+}
+
+//____________________________
+AliFemtoString AliFemtoModelCorrFctnNonIdDR::Report(){
+  // construct report
+  string stemp = "Non-identical particles Model Correlation Function Report:\n";
+  char ctemp[100];
+  sprintf(ctemp,"Number of entries in numerators:\t%E\n",fNumTOutP->GetEntries()+fNumTOutN->GetEntries());
+  stemp += ctemp;
+  sprintf(ctemp,"Number of entries in denominators:\t%E\n",fDenOutP->GetEntries()+fDenOutN->GetEntries());
+  stemp += ctemp;
+  //  stemp += mCoulombWeight->Report();
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoModelCorrFctnNonIdDR::AddRealPair(AliFemtoPair* pair){
+  // add true pair
+  double tKStar = pair->KStar();
+  Double_t weight = fManager->GetWeight(pair);
+
+  if (pair->KOut()>0.0)
+    fNumTOutP->Fill(tKStar, weight);
+  else
+    fNumTOutN->Fill(tKStar, weight);
+
+  if (pair->KSide()>0.0)
+    fNumTSideP->Fill(tKStar, weight);
+  else
+    fNumTSideN->Fill(tKStar, weight);
+
+  if (pair->KLong()>0.0)
+    fNumTLongP->Fill(tKStar, weight);
+  else
+    fNumTLongN->Fill(tKStar, weight);
+
+}
+//____________________________
+void AliFemtoModelCorrFctnNonIdDR::AddMixedPair(AliFemtoPair* pair){
+  // add mixed (background) pair
+  double tKStar = pair->KStar();
+  Double_t weight = fManager->GetWeight(pair);
+
+  if (pair->KOut()>0.0)
+    fNumFOutP->Fill(tKStar, weight);
+  else
+    fNumFOutN->Fill(tKStar, weight);
+
+  if (pair->KSide()>0.0)
+    fNumFSideP->Fill(tKStar, weight);
+  else
+    fNumFSideN->Fill(tKStar, weight);
+
+  if (pair->KLong()>0.0)
+    fNumFLongP->Fill(tKStar, weight);
+  else
+    fNumFLongN->Fill(tKStar, weight);
+
+  if (pair->KOut()>0.0)
+    fDenOutP->Fill(tKStar);
+  else
+    fDenOutN->Fill(tKStar);
+
+  if (pair->KSide()>0.0)
+    fDenSideP->Fill(tKStar);
+  else
+    fDenSideN->Fill(tKStar);
+
+  if (pair->KLong()>0.0)
+    fDenLongP->Fill(tKStar);
+  else
+    fDenLongN->Fill(tKStar);
+}
+//____________________________
+void AliFemtoModelCorrFctnNonIdDR::Write(){
+  // Write out histos
+  fNumTOutP->Write(); 
+  fNumTOutN->Write();  
+  fNumTSideP->Write(); 
+  fNumTSideN->Write(); 
+  fNumTLongP->Write(); 
+  fNumTLongN->Write(); 
+  fNumFOutP->Write(); 
+  fNumFOutN->Write();  
+  fNumFSideP->Write(); 
+  fNumFSideN->Write(); 
+  fNumFLongP->Write(); 
+  fNumFLongN->Write(); 
+  fDenOutP->Write();  
+  fDenOutN->Write();  
+  fDenSideP->Write(); 
+  fDenSideN->Write(); 
+  fDenLongP->Write(); 
+  fDenLongN->Write();
+}
+
+TList* AliFemtoModelCorrFctnNonIdDR::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fNumTOutP); 
+  tOutputList->Add(fNumTOutN);  
+  tOutputList->Add(fNumTSideP); 
+  tOutputList->Add(fNumTSideN); 
+  tOutputList->Add(fNumTLongP); 
+  tOutputList->Add(fNumTLongN); 
+  tOutputList->Add(fNumFOutP); 
+  tOutputList->Add(fNumFOutN);  
+  tOutputList->Add(fNumFSideP); 
+  tOutputList->Add(fNumFSideN); 
+  tOutputList->Add(fNumFLongP); 
+  tOutputList->Add(fNumFLongN); 
+  tOutputList->Add(fDenOutP);  
+  tOutputList->Add(fDenOutN);  
+  tOutputList->Add(fDenSideP); 
+  tOutputList->Add(fDenSideN); 
+  tOutputList->Add(fDenLongP); 
+  tOutputList->Add(fDenLongN);
+
+  return tOutputList;
+}
+
+//_______________________
+AliFemtoModelCorrFctn* AliFemtoModelCorrFctnNonIdDR::Clone()
+{
+  // Create clone
+  AliFemtoModelCorrFctnNonIdDR *tCopy = new AliFemtoModelCorrFctnNonIdDR(*this);
+  
+  return tCopy;
+}
diff --git a/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.h b/PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.h
new file mode 100644 (file)
index 0000000..c7a9149
--- /dev/null
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoModelCorrFctnNonIdDR - correlation function for non-identical      //
+// particles which uses k* as a function variable. Stores the correlation     //
+// function separately for positive and negative signs of k* projections into //
+// out, side and long directions, enabling the calculations of double ratios  //
+// Uses pair weight to simulate the model correlation function.               //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#ifndef ALIFEMTOMODELCORRFCTNNONIDDR_H
+#define ALIFEMTOMODELCORRFCTNNONIDDR_H
+
+#include "TH1D.h"
+#include "AliFemtoModelCorrFctn.h"
+
+class AliFemtoModelCorrFctnNonIdDR : public AliFemtoModelCorrFctn {
+public:
+  AliFemtoModelCorrFctnNonIdDR(char* title, const int& nbins, const float& QinvLo, const float& QinvHi);
+  AliFemtoModelCorrFctnNonIdDR(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn);
+  virtual ~AliFemtoModelCorrFctnNonIdDR();
+
+  AliFemtoModelCorrFctnNonIdDR& operator=(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair(AliFemtoPair* aPair);
+  virtual void AddMixedPair(AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  virtual AliFemtoModelCorrFctn* Clone();
+
+  virtual TList* GetOutputList();
+  void Write();
+
+private:
+  TH1D *fNumTOutP;     // True numerator for pair with positive k*out
+  TH1D *fNumTOutN;     // True numerator for pair with negative k*out
+  TH1D *fNumTSideP;    // True numerator for pair with positive k*side
+  TH1D *fNumTSideN;    // True numerator for pair with negative k*side
+  TH1D *fNumTLongP;    // True numerator for pair with positive k*long
+  TH1D *fNumTLongN;    // True numerator for pair with negative k*long
+
+  TH1D *fNumFOutP;     // Fake numerator for pair with positive k*out
+  TH1D *fNumFOutN;     // Fake numerator for pair with negative k*out
+  TH1D *fNumFSideP;    // Fake numerator for pair with positive k*side
+  TH1D *fNumFSideN;    // Fake numerator for pair with negative k*side
+  TH1D *fNumFLongP;    // Fake numerator for pair with positive k*long
+  TH1D *fNumFLongN;    // Fake numerator for pair with negative k*long
+
+  TH1D *fDenOutP;     // Denominator for pair with positive k*out
+  TH1D *fDenOutN;     // Denominator for pair with negative k*out
+  TH1D *fDenSideP;    // Denominator for pair with positive k*side
+  TH1D *fDenSideN;    // Denominator for pair with negative k*side
+  TH1D *fDenLongP;    // Denominator for pair with positive k*long
+  TH1D *fDenLongN;    // Denominator for pair with negative k*long
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoModelCorrFctnNonIdDR, 1)
+#endif
+};
+
+
+#endif
+