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 PtN class
//    calculates PtN 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 "AliLRCPtN.h"
#include "TFile.h"
#include "TList.h"
#include "TProfile.h"
#include "math.h"

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

ClassImp(AliLRCPtN) 

/******************************************************
 * AliLRCPtN class
 ******************************************************/



AliLRCPtN::AliLRCPtN():AliLRCAnalysis() {
//Empty constructor
}

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

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

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

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

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

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

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

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