/**************************************************************************
- * Author: Panos Christakoglou. *
+ * Author: Andrey Ivanov. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
// This class include into LRC library for Long-Range Correlation analysis
// it is base class for NN, PtN, PtPt
// implements base methods for thees classes
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch ,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
#include "AliLRCAnalysis.h"
-#include "Riostream.h"
#include "TFile.h"
#include "AliLRCFit.h"
#include "TProfile.h"
#include "TH2D.h"
#include "TPaveText.h"
#include "TF1.h"
-#include "TMath.h"
+#include "math.h"
#include "TStyle.h"
-
class gStyle;
-class math;
+
ClassImp(AliLRCAnalysis)
* AliLRCAnalysis class
******************************************************/
-AliLRCAnalysis::AliLRCAnalysis(): fPrAbs(new TH1D()), fPrRel(new TH1D()), fPrf(new TH1D()), fPrb(new TH1D()), fileHist(new TFile()), fdptb(.0), fEntries(0), fSx((char*)" "), fSy((char*)" "), fxFitMin(.0), fxFitMax(.0), farel(.0), fbrel(.0), farelError(0.), fbrelError(0.), fXi2rel(.0), faabs(.0), fbabs(.0), faabsError(0.), fbabsError(0.), fXi2abs(.0){
+AliLRCAnalysis::AliLRCAnalysis():TObject(), fPrAbs(new TH1D()), fPrRel(new TH1D()), fPrf(new TH1D()), fPrb(new TH1D()), fileHist(new TFile()), fdptb(.0), fEntries(0), fSx((char*)" "), fSy((char*)" "), fxFitMin(.0), fxFitMax(.0), fNsigma(2.), farel(.0), fbrel(.0), farelError(.0), fbrelError(.0), fXi2rel(.0), faabs(.0), fbabs(.0), faabsError(.0), fbabsError(.0), fXi2abs(.0),fFitMethod(0){
//Empty constructor
}
-AliLRCAnalysis::AliLRCAnalysis(const AliLRCAnalysis& a):fPrAbs(a.fPrAbs), fPrRel(a.fPrRel), fPrf(a.fPrf), fPrb(a.fPrb), fileHist(a.fileHist), fdptb(a.fdptb), fEntries(a.fEntries), fSx(a.fSx), fSy(a.fSy), fxFitMin(a.fxFitMin), fxFitMax(a.fxFitMax), farel(a.farel), fbrel(a.fbrel), farelError(a.farelError), fbrelError(a.fbrelError), fXi2rel(a.fXi2rel), faabs(a.faabs), fbabs(a.fbabs), faabsError(a.faabsError), fbabsError(a.fbabsError), fXi2abs(a.fXi2abs){
+AliLRCAnalysis::AliLRCAnalysis(const AliLRCAnalysis& a):TObject(a),fPrAbs(a.fPrAbs), fPrRel(a.fPrRel), fPrf(a.fPrf), fPrb(a.fPrb), fileHist(a.fileHist), fdptb(a.fdptb), fEntries(a.fEntries), fSx(a.fSx), fSy(a.fSy), fxFitMin(a.fxFitMin), fxFitMax(a.fxFitMax), fNsigma(a.fNsigma), farel(a.farel), fbrel(a.fbrel), farelError(a.farelError), fbrelError(a.fbrelError), fXi2rel(a.fXi2rel), faabs(a.faabs), fbabs(a.fbabs),faabsError(a.faabsError), fbabsError(a.fbabsError), fXi2abs(a.fXi2abs),fFitMethod(a.fFitMethod){
//Constructor
}
AliLRCAnalysis& AliLRCAnalysis::operator= (const AliLRCAnalysis& a){
//Operator =
if(this!=&a){
+ TObject::operator= (a);
fPrAbs = a.fPrAbs;
fPrRel = a.fPrRel;
fPrf = a.fPrf;
fEntries = a.fEntries;
fxFitMin = a.fxFitMin;
fxFitMax = a.fxFitMax;
+ fNsigma = a.fNsigma;
farel = a.farel;
fbrel = a.fbrel;
farelError = a.farelError;
- fbrelError = a.fbrelError;
+ fbrelError = a.fbrelError;
fXi2rel = a.fXi2rel;
faabs = a.faabs;
fbabs = a.fbabs;
faabsError = a.faabsError;
- fbabsError = a.fbabsError;
+ fbabsError = a.fbabsError;
fXi2abs = a.fXi2abs;
+ fFitMethod = a.fFitMethod;
}
return *this;
}
-
AliLRCAnalysis::~AliLRCAnalysis() {
//Destructor
delete fPrAbs;
delete fPrb;
}
-double AliLRCAnalysis::HI2(TH1D * const h, double a, double b, double xmin, double xmax) const {
-//hi square calculation of approximation 1d hist with ax+b between xmin and xmax
- int trueN = 0;
- double fhi2=0;
- double num;
- double fN=h->GetNbinsX();
- double f = h->GetXaxis()->GetXmin();
- double fdf = (h->GetXaxis()->GetXmax()-f)/fN;
- int fNmin = int((xmin-f)/fdf)+1;
- int fNmax = int((xmax-f)/fdf)+1;
- for(int i=fNmin; i<=fNmax; i++) {
- double fw = h->GetBinError(i);
- if(fw){
- num = b*(i*fdf-fdf/2+f)+a-h->GetBinContent(i);
- fhi2 = fhi2 + (num*num) / (fw*fw);
- trueN++;
- }
- }
- //cout << "trueN " << trueN << endl;
- return trueN > 2 ? fhi2/(trueN-2.) : -1;
-}
-
-double AliLRCAnalysis::HI2(TH1D * const h, double a, double b) const {
-//hi square calculation of approximation 1d hist with ax+b
- int trueN = 0;
- double fhi2=0;
- double num;
- int fN=h->GetNbinsX();
- double f = h->GetXaxis()->GetXmin();
- double fdf = (h->GetXaxis()->GetXmax()-f)/fN;
- int fNmin = 1;
- int fNmax = fN;
- for(int i=fNmin; i<=fNmax; i++) {
- double fw = h->GetBinError(i);
- if(fw){
- num = b*(i*fdf-fdf/2+f)+a-h->GetBinContent(i);
- fhi2 = fhi2 + (num*num) / (fw*fw);
- trueN++;
- }
- }
- //cout << "trueN2 " << trueN << endl;
- return trueN > 2 ? fhi2/(trueN-2.) : -1;
-}
void AliLRCAnalysis::CreateHist(char *name, char *nameAbs, char *nameRel, char *atitleF, char *atitleB, char *rtitleF, char *rtitleB, TH2D* sourceHist) {
fSx = atitleF;
fSy = atitleB;
double mnf = fPrf->GetMean();
- fxFitMin = mnf-2*TMath::Sqrt(mnf);
- fxFitMax = mnf+2*TMath::Sqrt(mnf);
+ double rms = fPrf->GetRMS();
+ fxFitMin = mnf-fNsigma*rms;//sqrt(rms);
+ fxFitMax = mnf+fNsigma*rms;//sqrt(rms);//mnf+2*sqrt(rms);
//delete profX;
}
void AliLRCAnalysis::SetBinsRange(int binMin, int binMax){
//Set the bin range
TH1D* h=fPrf;
- Int_t n=h->GetNbinsX();
+ int n=h->GetNbinsX();
fxFitMin = h->GetXaxis()->GetXmin();
fxFitMax = h->GetXaxis()->GetXmax();
double df = (fxFitMax-fxFitMin)/n;
this->fxFitMax = xMax;
return true;
}
+bool AliLRCAnalysis::SetFitRangeMin(double xMin){
+//Set the fit range min
+ fxFitMin = xMin;
+ return true;
+}
+
+bool AliLRCAnalysis::SetFitRangeMax(double xMax){
+//Set the fit range min
+ //this->fxFitMax = xMax;
+
+ TH1D* h=fPrf;
+ double maxBorder = 0.;
+
+ for ( int binI = h->GetNbinsX(); binI > 0; binI-- )
+ {
+ if ( h->GetBinContent(binI) != 0 )
+ {
+ maxBorder = h->GetBinLowEdge(binI+1) ;
+ break;
+ }
+ }
+ fxFitMax = TMath::Max( fxFitMin, TMath::Min( xMax, maxBorder ) );
+
+ return true;
+}
+
void AliLRCAnalysis::SetFullFitRange(){
//Set fitting on full range
TH1D* h=fPrf;
fxFitMin = h->GetXaxis()->GetXmin();
- //fxFitMax = h->GetXaxis()->GetXmax();
for ( int binI = h->GetNbinsX(); binI > 0; binI-- )
{
void AliLRCAnalysis::SetXmax(double xMax){
fxFitMax = xMax;
}
+void AliLRCAnalysis::SetNsigma(double nSigma){
+//Sets fiting range in forward value RMSs
+ fNsigma = nSigma;
+ double mnf = fPrf->GetMean();
+ double rms = fPrf->GetRMS();
+ fxFitMin = mnf-fNsigma*rms;
+ fxFitMax = mnf+fNsigma*rms;
+// cout << "### Fit params: N sigma is " << fNsigma
+// << ", mean = " << mnf << ", rms = " << rms << ", minFitX = " << fxFitMin << ", maxFitX = " << fxFitMax << endl;
+}
+
+void AliLRCAnalysis::SetFitMethod(int id){
+//Choose fit method
+ fFitMethod = id;
+}
+double AliLRCAnalysis::GetFitXmin() const
+{
+ return fxFitMin;
+}
+
+double AliLRCAnalysis::GetFitXmax() const
+{
+ return fxFitMax;
+}
double AliLRCAnalysis::GetArel() const {
return farel;
}
void AliLRCAnalysis::Calculate(){
//Calculate all
- double mnf;
- fPrAbs->SetStats(0);
- fPrAbs->Fit("pol1", "0", "", fxFitMin, fxFitMax);
- TF1 *fitt1 = fPrAbs->GetFunction("pol1");
- faabs = fitt1->GetParameter(0);
- fbabs = fitt1->GetParameter(1);
- faabsError = fitt1->GetParError(0);
- fbabsError = fitt1->GetParError(1);
- fXi2abs = HI2(fPrAbs, fitt1->GetParameter(0), fitt1->GetParameter(1), fxFitMin, fxFitMax);
-
- mnf = fPrf->GetMean();
- fPrRel->SetStats(0);
- AliLRCFit *fit1 = new AliLRCFit(fPrRel, fxFitMin/mnf, fxFitMax/mnf);
- TF1 *f1 = new TF1("f1", "[0] + [1]*x", 0, fPrRel->GetXaxis()->GetXmax());
- f1->SetParameter(0,fit1->Geta());
- f1->SetParameter(1,fit1->Getb());
- fPrRel->Fit("f1", "0", "", fxFitMin/mnf, fxFitMax/mnf);
+ double mnf = fPrf->GetMean();
+
+ // new fit for abs
+ AliLRCFit *fit1 = new AliLRCFit(fPrRel, fxFitMin/mnf, fxFitMax/mnf, 1.);
+ AliLRCFit *fit2 = new AliLRCFit(fPrAbs, fxFitMin, fxFitMax, 0.);
farel = fit1->Geta();
fbrel = fit1->Getb();
- farelError = fit1->Getda();
- fbrelError = fit1->Getdb();
+
+ faabs = fit2->Geta();
+ fbabs = fit2->Getb();
+
+ if ( fFitMethod==0 )
+ {
+ faabsError = fit2->Getda();
+ fbabsError = fit2->Getdb();
+
+ farelError = fit1->Getda();
+ fbrelError = fit1->Getdb();
+ }
+ if ( fFitMethod==1 )
+ {
+ faabsError = fit2->Getda1();
+ fbabsError = fit2->Getdb1();
+
+ farelError = fit1->Getda1();
+ fbrelError = fit1->Getdb1();
+ }
+
fXi2rel = fit1->Gethi2();
+ fXi2abs = fit2->Gethi2();
}
void AliLRCAnalysis::DrawAbs() {
//Draw abs var hist with ALL info
- int * mas = new int [N_PL_FLAGS];
- for ( int i = 0; i < N_PL_FLAGS; i++ )
+ int * mas = new int [fgkPlotFlags];
+ for ( int i = 0; i < fgkPlotFlags; i++ )
mas[i] = 1;
DrawAbsPure( mas, 1 );
delete []mas;
}
-void AliLRCAnalysis::DrawAbs( int * mas ) {
+void AliLRCAnalysis::DrawAbs( const int * const mas ) {
//Draw abs var hist with REQUESTED BY ARRAY info
DrawAbsPure( mas, 1 );
}
void AliLRCAnalysis::DrawAbsPure( const int * const mDrawArray, bool drawPaveLabel ) {
+ Calculate();
// Draw abs var histrogram
- //double mnf;
- double y1, y2, x1, x2;
- Int_t i, n;
- char str[50];
- //mnf = fPrf->GetMean();
- fPrAbs->SetStats(0);
- fPrAbs->Fit("pol1", "", "", fxFitMin, fxFitMax);
- //fPrAbs->Fit("pol1");
- TF1 *fit1 = fPrAbs->GetFunction("pol1");
- y1=fPrAbs->GetBinContent(1)-fPrAbs->GetBinError(1);
- y2=fPrAbs->GetBinContent(1)+fPrAbs->GetBinError(1);
-
- n=fPrAbs->GetNbinsX();
- for(i=2; i<=n; i++){
- if(fPrAbs->GetBinContent(i)-fPrAbs->GetBinError(i)<y1)
- y1=fPrAbs->GetBinContent(i)-fPrAbs->GetBinError(i);
- if(fPrAbs->GetBinContent(i)+fPrAbs->GetBinError(i)>y2)
- y2=fPrAbs->GetBinContent(i)+fPrAbs->GetBinError(i);
- }
- fPrAbs->DrawCopy();
-
- x1 = fPrAbs->GetXaxis()->GetXmin();
- x2 = fPrAbs->GetXaxis()->GetXmax();
-
-
- if ( drawPaveLabel )
- {
- int nDatas = 0;
- for ( int j = 0; j < 9; j++)
- if ( mDrawArray[j] ) nDatas++;
- double aXshift = (x2-x1)/7;
- double aYshift = (y2-y1)/20;
-
- TPaveText *pt1 = new TPaveText(x1+(x2-x1)/2 + aXshift, y1+aYshift, x2-(x2-x1)/6 + aXshift, y1+(y2-y1)/3*2/9*nDatas + aYshift);
-
- sprintf(str, "Entries = %i", fEntries);
- if ( mDrawArray[0] ) pt1->AddText(str);
- sprintf(str, "a = %g #pm %g", GetRoundWithError(fit1->GetParameter(0), fit1->GetParError(0)), GetRoundWithPrecision(fit1->GetParError(0), 2)); //fit1->GetParameter(0), fit1->GetParError(0));
- if ( mDrawArray[1] ) pt1->AddText(str);
- sprintf(str, "b = %g #pm %g", GetRoundWithError(fit1->GetParameter(1), fit1->GetParError(1)), GetRoundWithPrecision(fit1->GetParError(1), 2)); //fit1->GetParameter(1), fit1->GetParError(1));
- if ( mDrawArray[2] ) pt1->AddText(str);
- sprintf(str, "#hat{#chi}^{2} = #chi^{2}/(n-2) = %g", GetRoundWithPrecision(HI2(fPrAbs, fit1->GetParameter(0), fit1->GetParameter(1), fxFitMin, fxFitMax), 3));
- if ( mDrawArray[3] ) pt1->AddText(str);
- sprintf(str, "<%s> = %g " , fSx, GetRoundWithPrecision(fPrf->GetMean(), 3));
- if ( mDrawArray[4] ) pt1->AddText(str);
-
- sprintf(str, "<%s> = %g", fSy, GetRoundWithPrecision(fPrb->GetMean(),3));
- if ( mDrawArray[5] ) pt1->AddText(str);
-
- sprintf(str, "<<%s>> = %g " , fSx, GetRoundWithPrecision(fPrf->GetRMS(), 3));
- if ( mDrawArray[6] ) pt1->AddText(str);
- sprintf(str, "<<%s>> = %g", fSy, GetRoundWithPrecision(fPrb->GetRMS(), 3));
- if ( mDrawArray[7] ) pt1->AddText(str);
-
- if ( fdptb ) {
- sprintf(str, "d%s = %g", fSy, GetRoundWithPrecision(fdptb, 3));
- if ( mDrawArray[8] ) pt1->AddText(str);
- }
-
- pt1->SetTextAlign(12);
- pt1->SetTextFont(42);
- pt1->SetFillColor(4000);
- //pt1->SetFillStyle(4100);
- pt1->SetShadowColor(4000);
- pt1->SetBorderSize(0);
-
- pt1->DrawClone("same");
- }
+ DrawHist( mDrawArray, drawPaveLabel, faabs, fbabs, faabsError, fbabsError, fPrAbs, 0 );
}
void AliLRCAnalysis::DrawRel() {
//Draw rel var hist with ALL info
- int * mas = new int [N_PL_FLAGS];
- for ( int i = 0; i < N_PL_FLAGS; i++ )
+ int * mas = new int [fgkPlotFlags];
+ for ( int i = 0; i < fgkPlotFlags; i++ )
mas[i] = 1;
DrawRelPure( mas, 1 );
delete []mas;
}
-void AliLRCAnalysis::DrawRel( int * mas ) {
+void AliLRCAnalysis::DrawRel( const int * const mas ) {
//Draw rel var hist with REQUESTED BY ARRAY info
DrawRelPure( mas, 1 );
}
void AliLRCAnalysis::DrawRelPure( const int * const mDrawArray, bool drawPaveLabel ) {
+ Calculate();
// Draw rel var histogram
- double mnf;
+ DrawHist( mDrawArray, drawPaveLabel, farel, fbrel, farelError, fbrelError, fPrRel, 1 );
+}
+void AliLRCAnalysis::DrawHist( const int * const mDrawArray, bool drawPaveLabel, double aCoef, double bCoef,
+ double aCoefError, double bCoefError, TH1D* profToDraw, int histType ) {
+// Method called by DrawRelPure or DrawAbsPure to draw corresponding LRC histo
+ double mnf = fPrf->GetMean();
double y1, y2, x1, x2;
Int_t i, n;
char str[50];
-
- mnf = fPrf->GetMean();
-
- fPrRel->SetStats(0);
- AliLRCFit *fit1 = new AliLRCFit(fPrRel, fxFitMin/mnf, fxFitMax/mnf);
- TF1 *f1 = new TF1("f1", "[0] + [1]*x", 0, fPrRel->GetXaxis()->GetXmax());
- f1->SetParameter(0,fit1->Geta());
- f1->SetParameter(1,fit1->Getb());
- fPrRel->Fit("f1", "", "", fxFitMin/mnf, fxFitMax/mnf);
- y1=fPrRel->GetBinContent(1)-fPrRel->GetBinError(1);
- y2=fPrRel->GetBinContent(1)+fPrRel->GetBinError(1);
- n=fPrRel->GetNbinsX();
- for(i=2; i<=n; i++) {
- if(fPrRel->GetBinContent(i)-fPrRel->GetBinError(i)<y1)
- y1=fPrRel->GetBinContent(i)-fPrRel->GetBinError(i);
- if(fPrRel->GetBinContent(i)+fPrRel->GetBinError(i)>y2)
- y2=fPrRel->GetBinContent(i)+fPrRel->GetBinError(i);
- }
- fPrRel->DrawCopy();
+ //mnf = fPrf->GetMean();
+ profToDraw->SetStats(0);
+ //profToDraw->Fit("pol1", "", "", fxFitMin, fxFitMax);
+ //profToDraw->Fit("pol1");
+ //TF1 *fit1 = profToDraw->GetFunction("pol1");
+
+ //draw fit line
+ TF1 *f1 = 0x0;
+ if ( histType == 0 ) {
+ f1 = new TF1( "f1", "[0]+[1]*x", fxFitMin, fxFitMax);
+ f1->SetLineColor(kRed);
+ }
+ else if ( histType == 1 ) {
+ f1 = new TF1( "f1", "[0]+[1]*(x-1)", fxFitMin/mnf, fxFitMax/mnf);
+ f1->SetLineColor(kGreen);
+ }
+ f1->SetParameters(aCoef,bCoef);
+ //cout << " set draw params: a=" << aCoef << " b=" << bCoef << endl;
+
+ y1=profToDraw->GetBinContent(1)-profToDraw->GetBinError(1);
+ y2=profToDraw->GetBinContent(1)+profToDraw->GetBinError(1);
+ n=profToDraw->GetNbinsX();
+
+ for(i=2; i<=n; i++)
+ {
+ if(profToDraw->GetBinContent(i)-profToDraw->GetBinError(i)<y1)
+ y1=profToDraw->GetBinContent(i)-profToDraw->GetBinError(i);
+ if(profToDraw->GetBinContent(i)+profToDraw->GetBinError(i)>y2)
+ y2=profToDraw->GetBinContent(i)+profToDraw->GetBinError(i);
+ }
- x1 = fPrRel->GetXaxis()->GetXmin();
- x2 = fPrRel->GetXaxis()->GetXmax();
+ profToDraw->DrawCopy();
+ f1->DrawCopy("same");
+ x1 = profToDraw->GetXaxis()->GetXmin();
+ x2 = profToDraw->GetXaxis()->GetXmax();
+
if ( drawPaveLabel )
{
int nDatas = 0;
if ( mDrawArray[j] ) nDatas++;
double aXshift = (x2-x1)/7;
double aYshift = (y2-y1)/20;
-
+
TPaveText *pt1 = new TPaveText(x1+(x2-x1)/2 + aXshift, y1+aYshift, x2-(x2-x1)/6 + aXshift, y1+(y2-y1)/3*2/9*nDatas + aYshift);
- sprintf(str, "Entries = %i", fEntries);
+ sprintf(str, "Events = %i", fEntries);
if ( mDrawArray[0] ) pt1->AddText(str);
- sprintf(str, "a = %g #pm %g", GetRoundWithError(fit1->Geta(), fit1->Getda()), GetRoundWithPrecision(fit1->Getda(), 2)); //fit1->GetParameter(0), fit1->GetParError(0));
+ sprintf(str, "a = %g #pm %g", GetRoundWithError( aCoef, aCoefError ), GetRoundWithPrecision(aCoefError, 2)); //fit1->GetParameter(0), fit1->GetParError(0));
if ( mDrawArray[1] ) pt1->AddText(str);
- sprintf(str, "b = %g #pm %g", GetRoundWithError(fit1->Getb(), fit1->Getdb()), GetRoundWithPrecision(fit1->Getdb(), 2)); //fit1->GetParameter(1), fit1->GetParError(1));
+ sprintf(str, "b = %g #pm %g", GetRoundWithError( bCoef, bCoefError ), GetRoundWithPrecision(bCoefError, 2)); //fit1->GetParameter(1), fit1->GetParError(1));
if ( mDrawArray[2] ) pt1->AddText(str);
- sprintf(str, "#hat{#chi}^{2} = #chi^{2}/(n-2) = %g", GetRoundWithPrecision(fit1->Gethi2(), 3));
+ sprintf(str, "#hat{#chi}^{2} = #chi^{2}/(n-2) = %g", GetRoundWithPrecision(fXi2abs, 3));
if ( mDrawArray[3] ) pt1->AddText(str);
sprintf(str, "<%s> = %g " , fSx, GetRoundWithPrecision(fPrf->GetMean(), 3));
if ( mDrawArray[4] ) pt1->AddText(str);
sprintf(str, "d%s = %g", fSy, GetRoundWithPrecision(fdptb, 3));
if ( mDrawArray[8] ) pt1->AddText(str);
}
-
+
pt1->SetTextAlign(12);
pt1->SetTextFont(42);
pt1->SetFillColor(4000);
pt1->SetShadowColor(4000);
pt1->SetBorderSize(0);
- pt1->DrawClone();//"s(0,0)");
+ pt1->DrawClone("same");
}
}
fPrAbs->SetBinContent(i, profX->GetBinContent(i));
if(fPrf->GetBinContent(i)!=0)
{
- fPrAbs->SetBinError(i,TMath::Sqrt(profX->GetBinContent(i)/fPrf->GetBinContent(i)));
+ fPrAbs->SetBinError(i,sqrt(profX->GetBinContent(i)/fPrf->GetBinContent(i)));
}
fPrRel->SetBinContent(i, fPrAbs->GetBinContent(i)/fPrb->GetMean());
fPrRel->SetBinError(i,fPrAbs->GetBinError(i)/fPrb->GetMean());
if(fPrf->GetBinContent(i)!=0)
{
pt = profX->GetBinContent(i);
- fPrAbs->SetBinError(i,ptd*TMath::Sqrt(Integral(nb,i))/fPrf->GetBinContent(i));
+ fPrAbs->SetBinError(i,ptd*sqrt(Integral(nb,i))/fPrf->GetBinContent(i));
}
fPrRel->SetBinContent(i, fPrAbs->GetBinContent(i)/fPrb->GetMean());
fPrRel->SetBinError(i,fPrAbs->GetBinError(i)/fPrb->GetMean());
}
-void AliLRCAnalysis::SetErrors(TH2D* source, const char *name, double ptd, TProfile* nb){
+void AliLRCAnalysis::SetErrors(TH2D* source, const char *name, double ptd, const TProfile* nb){
//Calculate arrors for ptn and ptpt
TProfile* profX = (TProfile*) source->ProfileX(name, 1, source->GetNbinsY());
fdptb = ptd;
if(fPrf->GetBinContent(i)!=0)
{
pt = profX->GetBinContent(i);
- fPrAbs->SetBinError(i,ptd*TMath::Sqrt(nb->GetBinContent(i)/fPrf->GetBinContent(i)));
+ fPrAbs->SetBinError(i,ptd*sqrt(nb->GetBinContent(i)/fPrf->GetBinContent(i)));
}
fPrRel->SetBinContent(i, fPrAbs->GetBinContent(i)/fPrb->GetMean());
fPrRel->SetBinError(i,fPrAbs->GetBinError(i)/fPrb->GetMean());
}
-double AliLRCAnalysis::GetRoundWithError( double value, double error ){
+double AliLRCAnalysis::GetRoundWithError( double value, double error ) const {
//Rounding error and value with DEFAULT precision
return GetRoundValueErrorPrecision( value, error, 2 );
}
-double AliLRCAnalysis::GetRoundWithError( double value, double error, int pres ){
+double AliLRCAnalysis::GetRoundWithError( double value, double error, int pres ) const {
//Rounding error and value with REQUESTED precision
return GetRoundValueErrorPrecision( value, error, pres );
}
-double AliLRCAnalysis::GetRoundWithPrecision( double value, int pres ){
+double AliLRCAnalysis::GetRoundWithPrecision( double value, int pres ) const {
//Rounding error and value with requested precision
return GetRoundValueErrorPrecision( value, 0, pres );
}
bool noError = false;
pres -= 1;
- cout << "Before rounding: " << value << " " << error << endl;
+ //cout << "Before rounding: " << value << " " << error << endl;
if ( !error)
{
error = value;
noError = true;
}
- while ( ((int)error)%10 == 0 || i == 10 )
+ while ( ((int)error)%10 == 0 && i < 6 )
{
i++;
error*=10;
if ( noError )
{
- cout << "After rounding: " << error << endl;
+ //cout << "After rounding: " << error << endl;
return error;
}
else
adding = 1;
value = (double)((int)value + adding)/order;
- cout << "After rounding: " << value << " " << error << endl;
+ //cout << "After rounding: " << value << " " << error << endl;
return value; //taking into account ERROR
}
}
+TH1D* AliLRCAnalysis::GetAbsHisto() const
+{
+//Returns final histo in absolute variables
+return fPrAbs;
+}
+TH1D* AliLRCAnalysis::GetRelHisto() const
+{
+//Returns final histo in relative variables
+return fPrRel;
+}
+
+TH1D* AliLRCAnalysis::GetForwardValueDist() const
+{
+//Returns destribution of value used in forward window
+return fPrf;
+}
+TH1D* AliLRCAnalysis::GetBackwardValueDist() const
+{
+//Returns destribution of value used in backward window
+return fPrb;
+}
+
+
-#ifndef ALILRCANALYSIS_H
-#define ALILRCANALYSIS_H
-
//-------------------------------------------------------------------------
-// Description:
-// This class is included into LRC library for Long-Range Correlation analysis
-// it is base class for NN, PtN, PtPt
-// implements base methods for thees classes
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Description:
+// This class is included into LRC library for Long-Range Correlation analysis
+// it is base class for NN, PtN, PtPt
+// implements base methods for thees classes
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
+#ifndef ALILRCANALYSIS_H
+#define ALILRCANALYSIS_H
/* See cxx source for full Copyright notice */
+#include "TObject.h"
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
-
-#define N_PL_FLAGS 10
-#include "TObject.h"
class TFile;
-class AliLRCFit;
class TProfile;
class TH1D;
class TH2D;
-class TPaveText;
-class TF1;
-class math;
-class TStyle;
-class AliLRCAnalysis{
- public:
- void DrawAbs();
- void DrawAbs( int * mas );
- void DrawAbsPure( const int * const mas, bool drawPaveLabel );
- void DrawRel();
- void DrawRel( int * mas );
- void DrawRelPure( const int * const mas, bool drawPaveLabel );
-
- void SetXmin(double xMin);
- void SetXmax(double xMax);
- void SetBinsRange(int binMin, int binMax);
- double GetArel() const;
- double GetBrel() const;
- double GetArelError() const;
- double GetBrelError() const;
- double GetXi2rel() const;
- double GetAabs() const;
- double GetBabs() const;
- double GetAabsError() const;
- double GetBabsError() const;
- double GetXi2abs() const;
- void Calculate();
- bool SetFitRange(double xMin, double xMax);
- void SetFullFitRange();
-
- double GetRoundWithError( double value, double error );
- double GetRoundWithError( double value, double error, int pres );
- double GetRoundWithPrecision( double value, int pres );
-
- double GetRoundValueErrorPrecision( double value, double error, int pres ) const;
-
-
- AliLRCAnalysis();
- AliLRCAnalysis(const AliLRCAnalysis& a);
- AliLRCAnalysis& operator= (const AliLRCAnalysis& a);
- virtual ~AliLRCAnalysis();
-
- protected:
- TH1D* fPrAbs; //Work 1d histogramm in absolute var
- TH1D* fPrRel; //Work 1d histogramm in rellation var
- TH1D* fPrf; //Forward distribution
- TH1D* fPrb; //Backward distribution
- TFile* fileHist; // File with histrogramms
- double fdptb; //Work var for error calculation
- int fEntries; //Number of bins
- double HI2(TH1D * const h, double a, double b, double xmin, double xmax) const;
- double HI2(TH1D * const h, double a, double b) const;
- double Integral(TH2D* source, int nbin) const;
- //Creating profile from histogramm
- void CreateHist(char *name, char *nameAbs, char *nameRel, char *atitleF, char *atitleB,char *rtitleF, char *rtitleB,TH2D* sourceHist);
- void SetGraphics() const;
- void SetErrors(TH2D* source, const char *name);
- void SetErrors(TH2D* source, const char *name, double ptd, TH2D* nb);
- void SetErrors(TH2D* source, const char *name, double ptd, TProfile* nb);
-
-
- private:
- char* fSx; // Title of x axis
- char* fSy; // Title of y axis
- double fxFitMin; // FitMin minimum of fit baundary
- double fxFitMax; // FitMax maximum of fit baundary
- double farel; // ax = b the a relative
- double fbrel; // ax = b the b reletive
- double farelError; // a relative error
- double fbrelError; // b reletive error
- double fXi2rel; // chi square reletive
- double faabs; // ax = b the a absolut
- double fbabs; // ax = b the b absolut
- double faabsError; // a absolut error
- double fbabsError; // b absolut error
- double fXi2abs; // chi square absolut
-
- ClassDef(AliLRCAnalysis,0) // macro for rootcint
+
+class AliLRCAnalysis :public TObject{
+ public:
+ void DrawAbs();
+ void DrawAbs(const int * const mas );
+ void DrawAbsPure( const int * const mas, bool drawPaveLabel );
+ void DrawRel();
+ void DrawRel( const int * const mas );
+ void DrawRelPure( const int * const mas, bool drawPaveLabel );
+ void DrawHist( const int * const mDrawArray, bool drawPaveLabel, double aCoef, double bCoef
+ , double aCoefError, double bCoefError, TH1D* profToDraw, int histType );
+
+ void SetXmin(double xMin);
+ void SetXmax(double xMax);
+ void SetNsigma(double nSigma);
+ void SetBinsRange(int binMin, int binMax);
+ double GetArel() const;
+ double GetBrel() const;
+ double GetArelError() const;
+ double GetBrelError() const;
+ double GetXi2rel() const;
+ double GetAabs() const;
+ double GetBabs() const;
+ double GetAabsError() const;
+ double GetBabsError() const;
+ double GetXi2abs() const;
+ double GetFitXmin() const;
+ double GetFitXmax() const;
+ void Calculate();
+ bool SetFitRange(double xMin, double xMax);
+ bool SetFitRangeMin(double xMin);
+ bool SetFitRangeMax(double xMax);
+ void SetFullFitRange();
+ void SetFitMethod(int id);
+
+ double GetRoundWithError( double value, double error ) const ;
+ double GetRoundWithError( double value, double error, int pres ) const;
+ double GetRoundWithPrecision( double value, int pres ) const;
+
+ double GetRoundValueErrorPrecision( double value, double error, int pres ) const;
+ TH1D* GetAbsHisto() const;
+ TH1D* GetRelHisto() const;
+ TH1D* GetForwardValueDist() const;
+ TH1D* GetBackwardValueDist() const;
+
+ AliLRCAnalysis();
+ AliLRCAnalysis(const AliLRCAnalysis& a);
+ AliLRCAnalysis& operator= (const AliLRCAnalysis& a);
+ virtual ~AliLRCAnalysis();
+
+protected:
+ TH1D* fPrAbs; //Work 1d histogramm in absolute var
+ TH1D* fPrRel; //Work 1d histogramm in rellation var
+ TH1D* fPrf; //Forward distribution
+ TH1D* fPrb; //Backward distribution
+ TFile* fileHist; // File with histrogramms
+ double fdptb; //Work var for error calculation
+ int fEntries; //Number of bins
+ double Integral(TH2D* source, int nbin) const;
+ //Creating profile from histogramm
+ void CreateHist(char *name, char *nameAbs, char *nameRel, char *atitleF, char *atitleB,char *rtitleF, char *rtitleB,TH2D* sourceHist);
+ void SetGraphics() const;
+ void SetErrors(TH2D* source, const char *name);
+ void SetErrors(TH2D* source, const char *name, double ptd, TH2D* nb);
+ void SetErrors(TH2D* source, const char *name, double ptd, const TProfile* nb);
+
+ private:
+ static const int fgkPlotFlags = 10; // Size of flags array used to chouse vat variables should be shown on a plot
+ char* fSx; // Title of x axis
+ char* fSy; // Title of y axis
+ double fxFitMin; // FitMin minimum of fit baundary
+ double fxFitMax; // FitMax maximum of fit baundary
+ double fNsigma; // N sigma for fit range
+ double farel; // ax = b the a relative
+ double fbrel; // ax = b the b reletive
+ double farelError; // a relative error
+ double fbrelError; // b reletive error
+ double fXi2rel; // chi square reletive
+ double faabs; // ax = b the a absolut
+ double fbabs; // ax = b the b absolut
+ double faabsError; // a absolut error
+ double fbabsError; // b absolut error
+ double fXi2abs; // chi square absolut
+ int fFitMethod; // 0 - 1st variant, 1 - 2nd variant
+
+ ClassDef(AliLRCAnalysis,0) // macro for rootcint
};
#endif
/**************************************************************************
- * Author: Panos Christakoglou. *
+ * Author: Andrey Ivanov. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
// This class include into LRC library for Long-Range Correlation analysis
// it makes fit of the 1d histogramm
// calculates ax+b coefficients with error and hi square
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
/* $Id$ */
#include "AliLRCFit.h"
#include "TH1D.h"
-#include "TMath.h"
+#include "math.h"
class TH1D;
ClassImp(AliLRCFit)
-AliLRCFit::AliLRCFit():fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
+AliLRCFit::AliLRCFit():TObject(),fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
//Empty constructor
}
-AliLRCFit::AliLRCFit(TH1D * const h):fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
+AliLRCFit::AliLRCFit(TH1D * const h,double xShift):TObject(),fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
//Constructor make fit of 1d histogramm
- fxmin = h->GetXaxis()->GetXmin();
- fxmax = h->GetXaxis()->GetXmax();
- fN=h->GetNbinsX();
- fNmin=1;
- fNmax=fN;
- fnum = h->GetXaxis()->GetXmin();
- fdf = (h->GetXaxis()->GetXmax()-fnum)/fN;
- for(int i=1; i<=fN; i++){
- f=i*fdf-fdf/2+fnum;
- fw = h->GetBinError(i);
- if(fw){
- fz = h->GetBinContent(i);
- fS1 = fS1 + 1/(fw*fw);
- fSz = fSz + fz/(fw*fw);
- fSfz = fSfz + f*fz/(fw*fw);
- fSf = fSf + f/(fw*fw);
- fSf2 = fSf2 + (f*f)/(fw*fw);
- }
- }
- fdelta = fS1*fSf2 - fSf*fSf;
- fb = (fS1*fSfz - fSf*fSz)/fdelta;
- fa = ((fSf2-fSf)*fSz - (fSf-fS1)*fSfz)/fdelta;
- fda = TMath::Sqrt((fS1+fSf2-2*fSf)/fdelta);
- fdb = TMath::Sqrt(fS1/fdelta);
- fdb1 = 0;
- fda1 = 0;
- f = h->GetXaxis()->GetXmin();
- for(int i=1; i<=fN; i++){
- f=i*fdf-fdf/2+fnum;
- fw = h->GetBinError(i);
- if(fw){
- fz = h->GetBinContent(i);
- fdb1 = fdb1 + ((fS1*f - fSf)*(fS1*f - fSf)/(fw*fw)) * ((fz-fa-fb*(f-1))*(fz-fa-fb*(f-1))/(fw*fw));
- fda1 = fda1 + (((fSf2-fSf)-(fSf-fS1)*f)*((fSf2-fSf)-(fSf-fS1)*f)/(fw*fw)) * ((fz-fa+fb-fb*f)*(fz-fa+fb-fb*f)/(fw*fw));
- fhi2 = fhi2 + ((fz-(fa-fb)-fb*f) * (fz-(fa-fb)-fb*f)) / (fw*fw);
- fTrueN++;
- }
- }
- fdb1 = TMath::Sqrt(fdb1/(fdelta*fdelta));
- fda1 = TMath::Sqrt(fda1/(fdelta*fdelta));
- fhi2 = fTrueN > 2 ? fhi2 / (fTrueN-2) : -1;
+AliLRCFit(h,h->GetXaxis()->GetXmin(),h->GetXaxis()->GetXmax(),xShift);
}
-AliLRCFit::AliLRCFit(TH1D * const h, double xmin, double xmax):fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
+AliLRCFit::AliLRCFit(TH1D * const h, double xmin, double xmax,double xShift):TObject(),fN (0), fTrueN(0), fNmin (0), fNmax(0), fS1(.0), fSz(.0), fSfz(.0), fSf(.0), fSf2(.0), fhi2(.0), fw(.0), fz(.0), f(.0), fnum(.0), fdf(.0), fdelta(.0), fa(.0), fb(.0), fda(.0), fdb(.0), fda1(.0), fdb1(.0), fxmin(.0), fxmax(.0){
//Constructor make fit of 1d histogramm between xmin and xmax
- fxmin = xmin;
- fxmax = xmax;
- fN=h->GetNbinsX();
- fnum = h->GetXaxis()->GetXmin();
- fdf = (h->GetXaxis()->GetXmax()-fnum)/fN;
- fNmin=int((xmin-f)/fdf)+1;
- fNmax=int((xmax-f)/fdf)+1;
- for(int i=fNmin; i<=fNmax; i++){
- f=i*fdf-fdf/2+fnum;
- fw = h->GetBinError(i);
- if(fw){
- fz = h->GetBinContent(i);
- fS1 = fS1 + 1/(fw*fw);
- fSz = fSz + fz/(fw*fw);
- fSfz = fSfz + f*fz/(fw*fw);
- fSf = fSf + f/(fw*fw);
- fSf2 = fSf2 + (f*f)/(fw*fw);
- }
- }
- fdelta = fS1*fSf2 - fSf*fSf;
- fb = (fS1*fSfz - fSf*fSz)/fdelta;
- fa = ((fSf2-fSf)*fSz - (fSf-fS1)*fSfz)/fdelta;
- fda = TMath::Sqrt((fS1+fSf2-2*fSf)/fdelta);
- fdb = TMath::Sqrt(fS1/fdelta);
- fdb1 = 0;
- fda1 = 0;
- for(int i=fNmin; i<=fNmax; i++){
- f=i*fdf-fdf/2+fnum;
- fw = h->GetBinError(i);
- if(fw){
- fz = h->GetBinContent(i);
- fdb1 = fdb1 + ((fS1*f - fSf)*(fS1*f - fSf)/(fw*fw)) * ((fz-fa-fb*(f-1))*(fz-fa-fb*(f-1))/(fw*fw));
- fda1 = fda1 + (((fSf2-fSf)-(fSf-fS1)*f)*((fSf2-fSf)-(fSf-fS1)*f)/(fw*fw)) * ((fz-fa+fb-fb*f)*(fz-fa+fb-fb*f)/(fw*fw));
- fhi2 = fhi2 + ((fz-(fa-fb)-fb*f) * (fz-(fa-fb)-fb*f)) / (fw*fw);
- fTrueN++;
- }
- }
- fdb1 = TMath::Sqrt(fdb1/(fdelta*fdelta));
- fda1 = TMath::Sqrt(fda1/(fdelta*fdelta));
- fhi2 = fTrueN > 2 ? fhi2 / (fTrueN-2) : -1;
+ fNmin=h->GetXaxis()->FindBin(xmin);
+ fNmax=h->GetXaxis()->FindBin(xmax);
+ //double xShift=0;
+ for(int i=fNmin; i<=fNmax; i++){
+ fw = h->GetBinError(i);
+ f= h->GetBinCenter(i)-xShift;
+ fz= h->GetBinContent(i);
+ if(fw){
+ fTrueN++;
+ fS1 += 1.0/(fw*fw);
+ fSz += fz/(fw*fw);
+ fSf += f/(fw*fw);
+ fSfz += f*fz/(fw*fw);
+ fSf2 += (f*f)/(fw*fw);
+ }
+ }
+ if(fTrueN<2)return;
+ fdelta = fS1*fSf2 - fSf*fSf;
+ fa = (fSf2*fSz - fSf*fSfz)/fdelta;
+ fb = (fS1*fSfz - fSf*fSz)/fdelta;
+ fda = sqrt(fSf2/fdelta);
+ fdb = sqrt(fS1/fdelta);
+ fdb1 = 0;
+ fda1 = 0;
+ fhi2 = 0;
+ for(int i=fNmin; i<=fNmax; i++){
+ fw = h->GetBinError(i);
+ f= h->GetBinCenter(i)-xShift;
+ fz= h->GetBinContent(i);
+ if(fw){
+ double fDletaZ2=fz-fa-fb*f;
+ fDletaZ2*=fDletaZ2;
+ fhi2 += fDletaZ2/(fw*fw);
+ fda1 += ( fDletaZ2/(fdelta*fdelta) ) * ((fSf2 - fSf*f)/ (fw*fw))*((fSf2 - fSf*f)/ (fw*fw));
+ fdb1 += ( fDletaZ2/(fdelta*fdelta) ) * ((fS1*f - fSf)/ (fw*fw))*((fS1*f - fSf)/ (fw*fw));
+ }
+ }
+ fda1 = sqrt( fda1 );
+ fdb1 = sqrt( fdb1 );
+ fhi2 = fTrueN > 2 ? fhi2 / (fTrueN-2) : -1;
}
AliLRCFit::~AliLRCFit() {
double AliLRCFit::Getxmin() const {return fxmin;}
double AliLRCFit::Getxmax() const {return fxmax;}
int AliLRCFit::GetN() const {return fN;}
-
+double AliLRCFit::GetFitRange() const
+{
+//Returns range between xmin and xmax
+return (fxmax-fxmin);
+}
-#ifndef ALILRCFIT_H
-#define ALILRCFIT_H
-
//-------------------------------------------------------------------------
// Description:
// This class include into LRC library for Long-Range Correlation analysis
// it makes fit of the 1d histogramm
// calculates ax+b coefficients with error and hi square
// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
+#ifndef ALILRCFIT_H
+#define ALILRCFIT_H
/* See cxx source for full Copyright notice */
-
+#include "TObject.h"
/* $Id$ */
-#include "TObject.h"
class TH1D;
-class AliLRCFit {
- public:
- AliLRCFit();
- AliLRCFit(TH1D * const h);
- AliLRCFit(TH1D * const h, double xmin, double xmax);
- virtual ~AliLRCFit();
+class AliLRCFit:public TObject{
+ public:
+ AliLRCFit();
+ AliLRCFit(TH1D * const h, double xshift = -1.0);
+ AliLRCFit(TH1D * const h, double xmin, double xmax, double xshift = -1.0);
+ virtual ~AliLRCFit();
+ double GetFitRange() const;
+ double Geta() const;
+ double Getb() const;
+ double Getda() const;
+ double Getdb() const;
+ double Getda1() const;
+ double Getdb1() const;
+ double Gethi2() const;
+ double Getf() const;
+ double Getxmin() const;
+ double Getxmax() const;
+ int GetN() const;
+
+ private:
+ int fN; //Number of bins
+ int fTrueN; //Number of bins between xmin and xmax
+ int fNmin; //xmin bin
+ int fNmax; //xmax bin
+ double fS1; // work wariable
+ double fSz; // work wariable
+ double fSfz; // work wariable
+ double fSf; // work wariable
+ double fSf2; // work wariable
+ double fhi2; // hi square
+ double fw; // work wariable
+ double fz; // work wariable
+ double f; // work wariable
+ double fnum; // work wariable
+ double fdf; // work wariable
+ double fdelta; // work wariable
+ double fa; // coefficient a of ax+b
+ double fb; // coefficient b of ax+b
+ double fda; //error of coefficient a of ax+b
+ double fdb; //error of coefficient b of ax+b
+ double fda1; // work wariable
+ double fdb1; // work wariable
+ double fxmin; // xmin
+ double fxmax; // xmax
+ ClassDef(AliLRCFit,0) // macro for rootcint
- double Geta() const;
- double Getb() const;
- double Getda() const;
- double Getdb() const;
- double Getda1() const;
- double Getdb1() const;
- double Gethi2() const;
- double Getf() const;
- double Getxmin() const;
- double Getxmax() const;
- int GetN() const;
-
- private:
- int fN; //Number of bins
- int fTrueN; //Number of bins between xmin and xmax
- int fNmin; //xmin bin
- int fNmax; //xmax bin
- double fS1; // work wariable
- double fSz; // work wariable
- double fSfz; // work wariable
- double fSf; // work wariable
- double fSf2; // work wariable
- double fhi2; // hi square
- double fw; // work wariable
- double fz; // work wariable
- double f; // work wariable
- double fnum; // work wariable
- double fdf; // work wariable
- double fdelta; // work wariable
- double fa; // coefficient a of ax+b
- double fb; // coefficient b of ax+b
- double fda; //error of coefficient a of ax+b
- double fdb; //error of coefficient b of ax+b
- double fda1; // work wariable
- double fdb1; // work wariable
- double fxmin; // xmin
- double fxmax; // xmax
-
- ClassDef(AliLRCFit,0) // macro for rootcint
};
#endif
/**************************************************************************
- * Author: Panos Christakoglou. *
+ * Author: Andrey Ivanov. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
// This class include into LRC library for Long-Range Correlation analysis
// it is the NN class
// calculates NN correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
/* $Id$ */
SetErrors(sourceHist, profname);
}
-AliLRCNN::AliLRCNN(TList * const LHist, char *histname, char *profname):AliLRCAnalysis() {
+AliLRCNN::AliLRCNN(const TList * const LHist, char *histname, char *profname):AliLRCAnalysis() {
//Make NN from 2d histogramm from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
SetErrors(sourceHist, profname);
}
-void AliLRCNN::MakeHistogramm(TList * const LHist, char *histname, char *profname) {
+void AliLRCNN::MakeHistogramm(const TList * const LHist, char *histname, char *profname) {
//Make NN from 2d histogramm from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
// This class include into LRC library for Long-Range Correlation analysis
// it is the NN class
// calculates NN correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
#ifndef ALILRCNN_H
/* $Id$ */
-
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
#include "AliLRCAnalysis.h"
-
class TList;
class TH2D;
class AliLRCAnalysis;
virtual ~AliLRCNN();
AliLRCNN(char *name, TH2D* sourceHist);
AliLRCNN(char *fileHistname, char *histname, char *profname);
- AliLRCNN(TList *LHist, char *histname, char *profname);
+ AliLRCNN(const TList * const LHist, char *histname, char *profname);
void MakeHistogramm(char *name, TH2D* sourceHist);
void MakeHistogramm(char *fileHistname, char *histname, char *profname);
- void MakeHistogramm(TList *LHist, char *histname, char *profname);
+ void MakeHistogramm(const TList * const LHist, char *histname, char *profname);
ClassDef(AliLRCNN,0) // macro for rootcint
};
/**************************************************************************
- * Author: Panos Christakoglou. *
+ * Author: Andrey Ivanov. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
// This class include into LRC library for Long-Range Correlation analysis
// it is the PtN class
// calculates PtN correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
/* $Id$ */
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
#include "AliLRCPtN.h"
#include "TFile.h"
#include "TList.h"
#include "TProfile.h"
-#include "TMath.h"
+#include "math.h"
class TFile;
class TProfile;
}
//const
-AliLRCPtN::AliLRCPtN(TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
+AliLRCPtN::AliLRCPtN(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
//Make PtN form 2d histogram from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
CreateHist(profname, (char*)"PtN_abs", (char*)"PtN_rel", (char*)"n_{F}", (char*)"<Pt_{B}>_{n_{F}}", (char*)"#frac{n_{F}}{<n_{F}>}", (char*)"#frac{<Pt_{B}>_{n_{F}}}{<Pt_{B}>}", sourceHist);
TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
- double dptb=dPtB->GetBinError(1)*TMath::Sqrt(dPtB->GetBinEntries(1));
+ double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
SetErrors(sourceHist, profname, dptb, nbP);
}
SetErrors(sourceHist, profname, ptd, nbP);
}
-void AliLRCPtN::MakeHistogramm(TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
+void AliLRCPtN::MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
//Make PtN form 2d histogram from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
CreateHist(profname, (char*)"PtN_abs", (char*)"PtN_rel", (char*)"n_{F}", (char*)"<Pt_{B}>_{n_{F}}", (char*)"#frac{n_{F}}{<n_{F}>}", (char*)"#frac{<Pt_{B}>_{n_{F}}}{<Pt_{B}>}", sourceHist);
TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
- double dptb=dPtB->GetBinError(1)*TMath::Sqrt(dPtB->GetBinEntries(1));
+ double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
SetErrors(sourceHist, profname, dptb, nbP);
}
// This class include into LRC library for Long-Range Correlation analysis
// it is the PtN class
// calculates PtN correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
#ifndef ALILRCPTN_H
/* $Id$ */
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
#include "AliLRCAnalysis.h"
AliLRCPtN(char *name, TH2D* sourceHist, double ptd, TProfile* nb);
AliLRCPtN(char *name, TH2D* sourceHist, double ptd, TH2D* nb);
AliLRCPtN(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname);
- AliLRCPtN(TList *LHist, char *histname, char *profname, char *ptdname, char *errhistname);
+ AliLRCPtN(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname);
void MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb);
void MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TProfile* nb);
void MakeHistogramm(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname);
- void MakeHistogramm(TList *LHist, char *histname, char *profname, char *ptdname, char *errhistname);
+ void MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname);
ClassDef(AliLRCPtN,0) // macro for rootcint
};
/**************************************************************************
- * Author: Panos Christakoglou. *
+ * Author: Andrey Ivanov. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
// This class include into LRC library for Long-Range Correlation analysis
// it is the PtPt class
// calculates PtPt correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
/* $Id$ */
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
-
#include "AliLRCPtPt.h"
#include "TFile.h"
#include "TList.h"
#include "TProfile.h"
-#include "TMath.h"
+#include "math.h"
class TFile;
class TProfile;
SetErrors(sourceHist, profname, ptd, nbP);
}
-AliLRCPtPt::AliLRCPtPt(TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
+AliLRCPtPt::AliLRCPtPt(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
//Make PtPt form 2d histogram from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
CreateHist(profname, (char*)"PtPt_abs", (char*)"PtPt_rel", (char*)"Pt_{F}", (char*)"<Pt_{B}>_{Pt_{F}}", (char*)"#frac{Pt_{F}}{<Pt_{F}>}", (char*)"#frac{<Pt_{B}>_{Pt_{F}}}{<Pt_{B}>}", sourceHist);
TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
- double dptb=dPtB->GetBinError(1)*TMath::Sqrt(dPtB->GetBinEntries(1));
+ double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
SetErrors(sourceHist, profname, dptb, nbP);
}
SetErrors(sourceHist, profname, ptd, nbP);
}
-void AliLRCPtPt::MakeHistogramm(TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
+void AliLRCPtPt::MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
//Make PtPt form 2d histogram from root file
SetGraphics();
TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
CreateHist(profname, (char*)"PtPt_abs", (char*)"PtPt_rel", (char*)"Pt_{F}", (char*)"<Pt_{B}>_{Pt_{F}}", (char*)"#frac{Pt_{F}}{<Pt_{F}>}", (char*)"#frac{<Pt_{B}>_{Pt_{F}}}{<Pt_{B}>}", sourceHist);
TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
- double dptb=dPtB->GetBinError(1)*TMath::Sqrt(dPtB->GetBinEntries(1));
+ double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
SetErrors(sourceHist, profname, dptb, nbP);
}
// This class include into LRC library for Long-Range Correlation analysis
// it is the PtPt class
// calculates PtPt correlations for abs and rel var
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
+// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
+// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
//-------------------------------------------------------------------------
#ifndef ALILRCPTPT_H
#define ALILRCPTPT_H
/* $Id$ */
-//-------------------------------------------------------------------------
-// LRC library for Long-Range Correlation analysis
-//
-// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch
-//-------------------------------------------------------------------------
#include "AliLRCAnalysis.h"
AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TH2D* nb);
AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TProfile* nb);
AliLRCPtPt(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname);
- AliLRCPtPt(TList *LHist, char *histname, char *profname, char *ptdname, char *errhistname);
+ AliLRCPtPt(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname);
void MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb);
void MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TProfile* nb);
void MakeHistogramm(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname) ;
- void MakeHistogramm(TList *LHist, char *histname, char *profname, char *ptdname, char *errhistname) ;
+ void MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) ;
ClassDef(AliLRCPtPt,0) // macro for rootcint
};