ROOT logo
/**************************************************************************
 * Author: Andrey Ivanov.                                                 *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
//-------------------------------------------------------------------------
//    Description: 
//    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,
//    Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN) 
//-------------------------------------------------------------------------

/* $Id$ */

#include "AliLRCPtPt.h"
#include "TFile.h"
#include "TList.h"
#include "TProfile.h"
#include "math.h"

class TFile;
class TProfile;
class TList;
class TH2D;

ClassImp(AliLRCPtPt)

/******************************************************
 * AliLRCPtPt class
 ******************************************************/
AliLRCPtPt::AliLRCPtPt():AliLRCAnalysis() {
//Empty constructor
}

AliLRCPtPt::~AliLRCPtPt() {
//Destructor
}

AliLRCPtPt::AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TH2D* nb):AliLRCAnalysis() {
//Make PtPt form 2d histogram
    SetGraphics();
    CreateHist(name, (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);
    SetErrors(sourceHist, name, ptd, nb);
}

AliLRCPtPt::AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TProfile* nb):AliLRCAnalysis() {
//Make PtPt form 2d histogram
    SetGraphics();
    CreateHist(name, (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);
    SetErrors(sourceHist, name, ptd, nb);
}

AliLRCPtPt::AliLRCPtPt(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname):AliLRCAnalysis() {
//Make PtPt form 2d histogram from root file
    SetGraphics();
    fileHist = new TFile(fileHistname);
    TH2D* sourceHist = (TH2D*) fileHist->Get(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*) fileHist->Get(errhistname);
	SetErrors(sourceHist, profname, ptd, nbP);
}

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)*sqrt(dPtB->GetBinEntries(1));
	SetErrors(sourceHist, profname, dptb, nbP);
}

void AliLRCPtPt::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb) {
//Make PtPt form 2d histogram
    SetGraphics();
    CreateHist(name, (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);
    SetErrors(sourceHist, name, ptd, nb);
}

void AliLRCPtPt::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TProfile* nb) {
//Make PtPt form 2d histogram
    SetGraphics();
    CreateHist(name, (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);
    SetErrors(sourceHist, name, ptd, nb);
}


void AliLRCPtPt::MakeHistogramm(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname) {
//Make PtPt form 2d histogram from root file
    SetGraphics();
    fileHist = new TFile(fileHistname);
    TH2D* sourceHist = (TH2D*) fileHist->Get(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*) fileHist->Get(errhistname);
	SetErrors(sourceHist, profname, ptd, nbP);
}

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)*sqrt(dPtB->GetBinEntries(1));
	SetErrors(sourceHist, profname, dptb, nbP);
}
 AliLRCPtPt.cxx:1
 AliLRCPtPt.cxx:2
 AliLRCPtPt.cxx:3
 AliLRCPtPt.cxx:4
 AliLRCPtPt.cxx:5
 AliLRCPtPt.cxx:6
 AliLRCPtPt.cxx:7
 AliLRCPtPt.cxx:8
 AliLRCPtPt.cxx:9
 AliLRCPtPt.cxx:10
 AliLRCPtPt.cxx:11
 AliLRCPtPt.cxx:12
 AliLRCPtPt.cxx:13
 AliLRCPtPt.cxx:14
 AliLRCPtPt.cxx:15
 AliLRCPtPt.cxx:16
 AliLRCPtPt.cxx:17
 AliLRCPtPt.cxx:18
 AliLRCPtPt.cxx:19
 AliLRCPtPt.cxx:20
 AliLRCPtPt.cxx:21
 AliLRCPtPt.cxx:22
 AliLRCPtPt.cxx:23
 AliLRCPtPt.cxx:24
 AliLRCPtPt.cxx:25
 AliLRCPtPt.cxx:26
 AliLRCPtPt.cxx:27
 AliLRCPtPt.cxx:28
 AliLRCPtPt.cxx:29
 AliLRCPtPt.cxx:30
 AliLRCPtPt.cxx:31
 AliLRCPtPt.cxx:32
 AliLRCPtPt.cxx:33
 AliLRCPtPt.cxx:34
 AliLRCPtPt.cxx:35
 AliLRCPtPt.cxx:36
 AliLRCPtPt.cxx:37
 AliLRCPtPt.cxx:38
 AliLRCPtPt.cxx:39
 AliLRCPtPt.cxx:40
 AliLRCPtPt.cxx:41
 AliLRCPtPt.cxx:42
 AliLRCPtPt.cxx:43
 AliLRCPtPt.cxx:44
 AliLRCPtPt.cxx:45
 AliLRCPtPt.cxx:46
 AliLRCPtPt.cxx:47
 AliLRCPtPt.cxx:48
 AliLRCPtPt.cxx:49
 AliLRCPtPt.cxx:50
 AliLRCPtPt.cxx:51
 AliLRCPtPt.cxx:52
 AliLRCPtPt.cxx:53
 AliLRCPtPt.cxx:54
 AliLRCPtPt.cxx:55
 AliLRCPtPt.cxx:56
 AliLRCPtPt.cxx:57
 AliLRCPtPt.cxx:58
 AliLRCPtPt.cxx:59
 AliLRCPtPt.cxx:60
 AliLRCPtPt.cxx:61
 AliLRCPtPt.cxx:62
 AliLRCPtPt.cxx:63
 AliLRCPtPt.cxx:64
 AliLRCPtPt.cxx:65
 AliLRCPtPt.cxx:66
 AliLRCPtPt.cxx:67
 AliLRCPtPt.cxx:68
 AliLRCPtPt.cxx:69
 AliLRCPtPt.cxx:70
 AliLRCPtPt.cxx:71
 AliLRCPtPt.cxx:72
 AliLRCPtPt.cxx:73
 AliLRCPtPt.cxx:74
 AliLRCPtPt.cxx:75
 AliLRCPtPt.cxx:76
 AliLRCPtPt.cxx:77
 AliLRCPtPt.cxx:78
 AliLRCPtPt.cxx:79
 AliLRCPtPt.cxx:80
 AliLRCPtPt.cxx:81
 AliLRCPtPt.cxx:82
 AliLRCPtPt.cxx:83
 AliLRCPtPt.cxx:84
 AliLRCPtPt.cxx:85
 AliLRCPtPt.cxx:86
 AliLRCPtPt.cxx:87
 AliLRCPtPt.cxx:88
 AliLRCPtPt.cxx:89
 AliLRCPtPt.cxx:90
 AliLRCPtPt.cxx:91
 AliLRCPtPt.cxx:92
 AliLRCPtPt.cxx:93
 AliLRCPtPt.cxx:94
 AliLRCPtPt.cxx:95
 AliLRCPtPt.cxx:96
 AliLRCPtPt.cxx:97
 AliLRCPtPt.cxx:98
 AliLRCPtPt.cxx:99
 AliLRCPtPt.cxx:100
 AliLRCPtPt.cxx:101
 AliLRCPtPt.cxx:102
 AliLRCPtPt.cxx:103
 AliLRCPtPt.cxx:104
 AliLRCPtPt.cxx:105
 AliLRCPtPt.cxx:106
 AliLRCPtPt.cxx:107
 AliLRCPtPt.cxx:108
 AliLRCPtPt.cxx:109
 AliLRCPtPt.cxx:110
 AliLRCPtPt.cxx:111
 AliLRCPtPt.cxx:112
 AliLRCPtPt.cxx:113
 AliLRCPtPt.cxx:114
 AliLRCPtPt.cxx:115
 AliLRCPtPt.cxx:116
 AliLRCPtPt.cxx:117