+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
+ Int_t nybins, Float_t ymax, Float_t ymin,
+ Int_t nzbins, Float_t zmax, Float_t zmin)
+{
+//build histograms
+ if (AliVAODParticle::GetDebug()>1) Info("BuildHistos","Enetered BuildHistos(...)");
+
+ AliHBTFunction3D::BuildHistos(nxbins,xmax,xmin,nybins,ymax,ymin,nzbins,zmax,zmin);
+
+ TString numstr = fName + " Smeared Numerator"; //title and name of the numerator histogram
+ TString denstr = fName + " Smeared Denominator";//title and name of the denominator histogram
+
+ fSmearedNumer = new TH3F(numstr.Data(),numstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+ fSmearedDenom = new TH3F(denstr.Data(),denstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+ fSmearedNumer->Sumw2();
+ fSmearedDenom->Sumw2();
+
+ if (fMeasCorrelFctn == 0x0)
+ {
+ numstr = fName + " Measured Numerator"; //title and name of the numerator histogram
+ denstr = fName + " Measured Denominator";//title and name of the denominator histogram
+
+ fMeasNumer = new TH3F(numstr.Data(),numstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+ fMeasDenom = new TH3F(denstr.Data(),denstr.Data(),nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
+ fMeasNumer->Sumw2();
+ fMeasDenom->Sumw2();
+ }
+
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::Init()
+{
+//Init
+ AliHBTOnePairFctn3D::Init();
+ Info("Init","");
+ if ( (fSmearedNumer == 0x0) || (fSmearedDenom == 0x0) )
+ {
+ if (fNumerator == 0x0) Fatal("Init","Sth. goes wrong");
+ Int_t nxbins = fNumerator->GetNbinsX();
+ Float_t xmax = fNumerator->GetXaxis()->GetXmax();
+ Float_t xmin = fNumerator->GetXaxis()->GetXmin();
+ Int_t nybins = fNumerator->GetNbinsY();
+ Float_t ymax = fNumerator->GetYaxis()->GetXmax();
+ Float_t ymin = fNumerator->GetYaxis()->GetXmin();
+ Int_t nzbins = fNumerator->GetNbinsZ();
+ Float_t zmax = fNumerator->GetZaxis()->GetXmax();
+ Float_t zmin = fNumerator->GetZaxis()->GetXmin();
+ BuildHistos(nxbins,xmax,xmin, nybins,ymax,ymin, nzbins,zmax,zmin);
+ }
+
+ fSmearedNumer->Reset();
+ fSmearedDenom->Reset();
+ if (fMeasNumer) fMeasNumer->Reset();
+ if (fMeasDenom) fMeasDenom->Reset();
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::SetInitialValues(Double_t lambda, Double_t rout, Double_t rside, Double_t rlong)
+{
+ //Sets assumed parameters
+ fLambda = lambda;
+ fROutSq = rout*rout;
+ fRSideSq = rside*rside;
+ fRLongSq = rlong*rlong;
+}
+
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::ProcessSameEventParticles(AliHBTPair* pair)
+{
+ //Processes particles that originates from the same event
+
+ return; //we already heave the measured in hand
+
+
+ if (fMeasNumer == 0x0) return;
+ pair = CheckPair(pair);
+ if( pair == 0x0) return;
+ fMeasNumer->Fill(pair->GetQInv());
+}
+/******************************************************************/
+
+void AliHBTCorrectOSLCorrelFctn::ProcessDiffEventParticles(AliHBTPair* pair)
+{
+//Process different events
+ static AliAODParticle part1, part2;
+ static AliHBTPair smearedpair(&part1,&part2);
+
+ pair = CheckPair(pair);
+ if( pair == 0x0) return;
+
+ Double_t cc = GetCoulombCorrection(pair);
+
+ Double_t qout,qside,qlong;
+ GetValues(pair,qout,qside,qlong);
+
+ //measured histogram -> if we are interested
+ //only if fMeasCorrelFctn is not specified by user
+
+// if (fMeasDenom) fMeasDenom->Fill(qout,qside,qlong,cc);
+
+ Smear(pair,smearedpair);
+ Double_t modelval = GetModelValue(qout,qside,qlong);
+ //Ideal histogram
+ fNumerator->Fill(qout,qside,qlong,modelval*cc);
+ fDenominator->Fill(qout,qside,qlong,cc);
+
+ //Smeared histogram
+
+ Double_t smearedqout,smearedqside,smearedqlong;
+
+ GetValues(&smearedpair,smearedqout,smearedqside,smearedqlong);
+
+ fSmearedNumer->Fill(smearedqout,smearedqside,smearedqlong,modelval);
+
+ Double_t smearedcc = GetCoulombCorrection(&smearedpair);
+ fSmearedDenom->Fill(smearedqout,smearedqside,smearedqlong,smearedcc);
+
+}
+/******************************************************************/