]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/LRC/AliLRCPtPt.cxx
fix for fake tracks
[u/mrichter/AliRoot.git] / PWGCF / EBYE / LRC / AliLRCPtPt.cxx
CommitLineData
d03e5de4 1/**************************************************************************
ec6ab54b 2 * Author: Andrey Ivanov. *
d03e5de4 3 * Contributors are mentioned in the code where appropriate. *
4 * *
5 * Permission to use, copy, modify and distribute this software and its *
6 * documentation strictly for non-commercial purposes is hereby granted *
7 * without fee, provided that the above copyright notice appears in all *
8 * copies and that both the copyright notice and this permission notice *
9 * appear in the supporting documentation. The authors make no claims *
10 * about the suitability of this software for any purpose. It is *
11 * provided "as is" without express or implied warranty. *
12 **************************************************************************/
13//-------------------------------------------------------------------------
14// Description:
15// This class include into LRC library for Long-Range Correlation analysis
16// it is the PtPt class
17// calculates PtPt correlations for abs and rel var
ec6ab54b 18// Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
19// Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN)
d03e5de4 20//-------------------------------------------------------------------------
21
22/* $Id$ */
23
d03e5de4 24#include "AliLRCPtPt.h"
adf00ba6 25#include "TFile.h"
26#include "TList.h"
27#include "TProfile.h"
ec6ab54b 28#include "math.h"
adf00ba6 29
30class TFile;
31class TProfile;
32class TList;
33class TH2D;
d03e5de4 34
35ClassImp(AliLRCPtPt)
36
37/******************************************************
38 * AliLRCPtPt class
39 ******************************************************/
40AliLRCPtPt::AliLRCPtPt():AliLRCAnalysis() {
41//Empty constructor
42}
43
44AliLRCPtPt::~AliLRCPtPt() {
45//Destructor
46}
47
48AliLRCPtPt::AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TH2D* nb):AliLRCAnalysis() {
49//Make PtPt form 2d histogram
50 SetGraphics();
d96e5666 51 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);
52 SetErrors(sourceHist, name, ptd, nb);
53}
54
55AliLRCPtPt::AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TProfile* nb):AliLRCAnalysis() {
56//Make PtPt form 2d histogram
57 SetGraphics();
58 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);
d03e5de4 59 SetErrors(sourceHist, name, ptd, nb);
60}
61
62AliLRCPtPt::AliLRCPtPt(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname):AliLRCAnalysis() {
63//Make PtPt form 2d histogram from root file
64 SetGraphics();
65 fileHist = new TFile(fileHistname);
66 TH2D* sourceHist = (TH2D*) fileHist->Get(histname);
d96e5666 67 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);
68 TProfile* nbP = (TProfile*) fileHist->Get(errhistname);
69 SetErrors(sourceHist, profname, ptd, nbP);
70}
71
ec6ab54b 72AliLRCPtPt::AliLRCPtPt(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
d96e5666 73//Make PtPt form 2d histogram from root file
74 SetGraphics();
75 TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
76 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);
77 TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
78 TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
ec6ab54b 79 double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
d96e5666 80 SetErrors(sourceHist, profname, dptb, nbP);
d03e5de4 81}
82
83void AliLRCPtPt::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb) {
84//Make PtPt form 2d histogram
85 SetGraphics();
d96e5666 86 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);
d03e5de4 87 SetErrors(sourceHist, name, ptd, nb);
88}
89
d96e5666 90void AliLRCPtPt::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TProfile* nb) {
91//Make PtPt form 2d histogram
92 SetGraphics();
93 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);
94 SetErrors(sourceHist, name, ptd, nb);
95}
96
97
d03e5de4 98void AliLRCPtPt::MakeHistogramm(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname) {
99//Make PtPt form 2d histogram from root file
100 SetGraphics();
101 fileHist = new TFile(fileHistname);
102 TH2D* sourceHist = (TH2D*) fileHist->Get(histname);
d96e5666 103 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);
104 TProfile* nbP = (TProfile*) fileHist->Get(errhistname);
105 SetErrors(sourceHist, profname, ptd, nbP);
106}
107
ec6ab54b 108void AliLRCPtPt::MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
d96e5666 109//Make PtPt form 2d histogram from root file
110 SetGraphics();
111 TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
112 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);
113 TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
114 TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
ec6ab54b 115 double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
d96e5666 116 SetErrors(sourceHist, profname, dptb, nbP);
d03e5de4 117}