]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/LRC/AliLRCPtN.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / EBYE / LRC / AliLRCPtN.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 PtN class
17 //    calculates PtN 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
25 #include "AliLRCPtN.h"
26 #include "TFile.h"
27 #include "TList.h"
28 #include "TProfile.h"
29 #include "math.h"
30
31 class TFile;
32 class TProfile;
33 class TList;
34 class TH2D;
35
36 ClassImp(AliLRCPtN) 
37
38 /******************************************************
39  * AliLRCPtN class
40  ******************************************************/
41
42
43
44 AliLRCPtN::AliLRCPtN():AliLRCAnalysis() {
45 //Empty constructor
46 }
47
48 AliLRCPtN::~AliLRCPtN() {
49 //Destructor
50 }
51
52 AliLRCPtN::AliLRCPtN(char *name, TH2D* sourceHist, double ptd, TH2D* nb):AliLRCAnalysis() {
53 //Make PtN form 2d histogram
54     SetGraphics();
55     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);
56     SetErrors(sourceHist, name, ptd, nb);
57 }
58
59 AliLRCPtN::AliLRCPtN(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname):AliLRCAnalysis() {
60 //Make PtN form 2d histogram from root file
61     SetGraphics();
62     fileHist = new TFile(fileHistname);
63     TH2D* sourceHist = (TH2D*) fileHist->Get(histname);
64     
65     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);
66         TProfile* nbP = (TProfile*) fileHist->Get(errhistname);
67         SetErrors(sourceHist, profname, ptd, nbP);
68         
69 }
70 //const
71 AliLRCPtN::AliLRCPtN(const TList *  const LHist, char *histname, char *profname, char *ptdname, char *errhistname):AliLRCAnalysis() {
72 //Make PtN form 2d histogram from root file
73     SetGraphics();
74     TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
75     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);
76         TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
77         TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
78         double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
79         SetErrors(sourceHist, profname, dptb, nbP);
80 }
81
82 AliLRCPtN::AliLRCPtN(char *name, TH2D* sourceHist, double ptd, TProfile* nb):AliLRCAnalysis() {
83 //Make PtN form 2d histogram
84     SetGraphics();
85     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);
86     SetErrors(sourceHist, name, ptd, nb);
87 }
88
89 void AliLRCPtN::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TH2D* nb) {
90 //Make PtN form 2d histogram
91     SetGraphics();
92     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);
93     SetErrors(sourceHist, name, ptd, nb);
94 }
95
96 void AliLRCPtN::MakeHistogramm(char *name, TH2D* sourceHist, double ptd, TProfile* nb) {
97 //Make PtN form 2d histogram
98     SetGraphics();
99     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);
100     SetErrors(sourceHist, name, ptd, nb);
101 }
102
103 void AliLRCPtN::MakeHistogramm(char *fileHistname, char *histname, char *profname, double ptd, char *errhistname) {
104 //Make PtN form 2d histogram from root file
105     SetGraphics();
106     fileHist = new TFile(fileHistname);
107     TH2D* sourceHist = (TH2D*) fileHist->Get(histname);
108     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);
109         TProfile* nbP = (TProfile*) fileHist->Get(errhistname);
110         SetErrors(sourceHist, profname, ptd, nbP);
111 }
112
113 void AliLRCPtN::MakeHistogramm(const TList * const LHist, char *histname, char *profname, char *ptdname, char *errhistname) {
114 //Make PtN form 2d histogram from root file
115     SetGraphics();
116     TH2D* sourceHist = (TH2D*) LHist->FindObject(histname);
117     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);
118         TProfile* nbP = (TProfile*) LHist->FindObject(errhistname);
119         TProfile *dPtB = (TProfile*) LHist->FindObject(ptdname);
120         double dptb=dPtB->GetBinError(1)*sqrt(dPtB->GetBinEntries(1));
121         SetErrors(sourceHist, profname, dptb, nbP);
122 }