]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/EBYE/LRC/AliLRCPtPt.cxx
Updated LRC code and fixes for the warnings (Andrey Ivanov)
[u/mrichter/AliRoot.git] / PWG2 / EBYE / LRC / AliLRCPtPt.cxx
1 /**************************************************************************
2  * Author: Andrey Ivanov.                                                 *
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
18 //    Origin: Petr Naumenko, SPbSU-CERN, Petr.Naoumenko@cern.ch,
19 //    Andrey Ivanov (SPbSU-CERN), Igor Altsebeev (SPbSU-CERN) 
20 //-------------------------------------------------------------------------
21
22 /* $Id$ */
23
24 #include "AliLRCPtPt.h"
25 #include "TFile.h"
26 #include "TList.h"
27 #include "TProfile.h"
28 #include "math.h"
29
30 class TFile;
31 class TProfile;
32 class TList;
33 class TH2D;
34
35 ClassImp(AliLRCPtPt)
36
37 /******************************************************
38  * AliLRCPtPt class
39  ******************************************************/
40 AliLRCPtPt::AliLRCPtPt():AliLRCAnalysis() {
41 //Empty constructor
42 }
43
44 AliLRCPtPt::~AliLRCPtPt() {
45 //Destructor
46 }
47
48 AliLRCPtPt::AliLRCPtPt(char *name, TH2D* sourceHist, double ptd, TH2D* nb):AliLRCAnalysis() {
49 //Make PtPt form 2d histogram
50     SetGraphics();
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
55 AliLRCPtPt::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);
59     SetErrors(sourceHist, name, ptd, nb);
60 }
61
62 AliLRCPtPt::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);
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
72 AliLRCPtPt::AliLRCPtPt(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
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);
79         double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
80         SetErrors(sourceHist, profname, dptb, nbP);
81 }
82
83 void AliLRCPtPt::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb) {
84 //Make PtPt form 2d histogram
85     SetGraphics();
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);
87     SetErrors(sourceHist, name, ptd, nb);
88 }
89
90 void 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
98 void 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);
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
108 void AliLRCPtPt::MakeHistogramm(const TList *  const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
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);
115         double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
116         SetErrors(sourceHist, profname, dptb, nbP);
117 }