]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/XtAnalysis/AliJXtHistos.cxx
Removed some classed (Same code in JCORRAN packet under PWG-CF) + polished remaining...
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / XtAnalysis / AliJXtHistos.cxx
CommitLineData
072855d8 1/**************************************************************************
2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/**************************************************************************
17 * AliJXtHistos.h
18 * This class encapsulated all histograms that the analysis provides
19 *
20 *
21 * contact: Sami Räsänen
22 * University of Jyväskylä, Finland
23 * sami.s.rasanen@jyu.fi
24 **************************************************************************/
25
26#include "AliJXtHistos.h"
27#include "AliJCard.h"
28
29//______________________________________________________________________________
a5f56dc7 30AliJXtHistos::AliJXtHistos(AliJCard* cardP)
31 : fUseDirectory(true),
32 fTopDirectory(0x0),
33 fCard(0x0),
34 fmaxEtaRange(0.8),
35 fhistoList(0x0),
36 fhConeActivity(0x0),
37 fhConeActivityIsolated(0x0),
38 fhZVertRaw(0x0),
39 fhCentr(0x0),
40 fhiCentr(0x0),
41 fhEventPerRun(0x0),
42 fhVertexZTriggVtx(0x0)
43{
44 // constructor
45 fCard=cardP;
46 fmaxEtaRange = fCard->Get("EtaRange");
072855d8 47
48 fhistoList = new TList();
49 fTopDirectory = gDirectory;
50}
51
52//______________________________________________________________________________
a5f56dc7 53AliJXtHistos::AliJXtHistos(const AliJXtHistos& obj)
54 : fUseDirectory(obj.fUseDirectory),
55 fTopDirectory(obj.fTopDirectory),
56 fCard(obj.fCard),
57 fmaxEtaRange(obj.fmaxEtaRange),
58 fhistoList(obj.fhistoList),
59 fhConeActivity(obj.fhConeActivity),
60 fhConeActivityIsolated(obj.fhConeActivityIsolated),
61 fhZVertRaw(obj.fhZVertRaw),
62 fhCentr(obj.fhCentr),
63 fhiCentr(obj.fhiCentr),
64 fhEventPerRun(obj.fhEventPerRun),
65 fhVertexZTriggVtx(obj.fhVertexZTriggVtx)
66{
072855d8 67 // copy constructor
68}
69
70//______________________________________________________________________________
71AliJXtHistos& AliJXtHistos::operator=(const AliJXtHistos& obj){
72 // copy constructor
a5f56dc7 73 this->~AliJXtHistos();
74 new(this) AliJXtHistos(obj);
072855d8 75 return *this;
76}
77//______________________________________________________________________________
78TDirectory * AliJXtHistos::MakeDirectory(TString name){
79 // Make directory with given name and move into it
80 JumpToDefaultDirectory();
81 TDirectory * dir = gDirectory->GetDirectory(name);
82 if( !dir ) dir = gDirectory->mkdir(name);
83 dir->cd();
84 return dir;
85}
86//______________________________________________________________________________
87TDirectory * AliJXtHistos::JumpToDefaultDirectory(){
88 // Move to default directory
89 fTopDirectory->cd();
90 return gDirectory;
91}
92//______________________________________________________________________________
93void AliJXtHistos::FillInclusiveHistograms(double pT, double xT, double eta, double phi, double effCorr, int centBin){
94 // Fill all inclusive histograms
95 fhChargedEta[centBin]->Fill(eta, effCorr);
96 fhChargedPhi[centBin]->Fill(phi, effCorr);
97 fhChargedPt[centBin]->Fill(pT, effCorr);
98 fhChargedXt[centBin]->Fill(xT, effCorr);
99 fhInvariantChargedPt[centBin]->Fill(pT, pT > 0. ? effCorr/pT : 0.); // Can you do 1/pT here???
100 fhInvariantChargedXt[centBin]->Fill(xT, xT > 0. ? effCorr/xT : 0.); // Can you do 1/xT here???
101 // For checks, fill also without efficiency correction
102 fhChargedEtaNoCorr[centBin]->Fill(eta);
103 fhChargedPhiNoCorr[centBin]->Fill(phi);
104 fhChargedPtNoCorr[centBin]->Fill(pT);
105 fhChargedXtNoCorr[centBin]->Fill(xT);
106}
107//______________________________________________________________________________
108void AliJXtHistos::FillIsolatedHistograms(double pT, double xT, double eta, double phi, double effCorr, int centBin){
109 // Fill all inclusive histograms
110 fhIsolatedChargedEta[centBin]->Fill(eta, effCorr);
111 fhIsolatedChargedPhi[centBin]->Fill(phi, effCorr);
112 fhIsolatedChargedPt[centBin]->Fill(pT, effCorr);
113 fhIsolatedChargedXt[centBin]->Fill(xT, effCorr);
114 fhInvariantIsolatedChargedPt[centBin]->Fill(pT, pT > 0. ? effCorr/pT : 0.); // Can you do 1/pT here???
115 fhInvariantIsolatedChargedXt[centBin]->Fill(xT, xT > 0. ? effCorr/xT : 0.); // Can you do 1/xT here???
116}
117//______________________________________________________________________________
118void AliJXtHistos::CreateXtHistos(){
119 // all the histograms of xT analysis
120
121 MakeDirectory("xT");
122 TH1::SetDefaultSumw2(kTRUE);
123 cout << "GetDefaultSumw2() = " << TH1::GetDefaultSumw2() << endl;
124
125 // === pT binning
126 int nBins=150;
127 double logBinsPt[nBins+1], limL=0.1, limH=100;
128 double logBW = (log(limH)-log(limL))/nBins;
129 for(int ij=0;ij<=nBins;ij++) logBinsPt[ij]=limL*exp(ij*logBW);
130
131 // === xT binning
132 int nBinsXt=200;
133 double logBinsXt[nBinsXt+1];
134 double xTlimL = 1e-5, xTlimH = 1.0, xTlogBW = (log(xTlimH)-log(xTlimL))/nBinsXt;
135 for(int ij=0;ij<=nBinsXt;ij++) logBinsXt[ij]=xTlimL*exp(ij*xTlogBW);
136
137 // === create histos
a5f56dc7 138 for (int hic = 0;hic < fCard->GetNoOfBins(kCentrType);hic++) {
139 float b1 = fCard->GetBinBorder(kCentrType, hic);
140 float b2 = fCard->GetBinBorder(kCentrType, hic + 1);
072855d8 141
142 fhChargedPt[hic] = new TH1D(Form("hChargedPt%d",hic), Form("C: %2.0f-%2.0f%%",b1,b2), nBins, logBinsPt );
143 fhChargedPt[hic]->Sumw2();
144 fhistoList->Add(fhChargedPt[hic]);
145
146 fhInvariantChargedPt[hic] = new TH1D(Form("hInvariantChargedPt%d",hic), Form("C: %2.0f-%2.0f%%",b1,b2), nBins, logBinsPt );
147 fhInvariantChargedPt[hic]->Sumw2();
148 fhistoList->Add(fhInvariantChargedPt[hic]);
149
150 fhChargedPtNoCorr[hic] = new TH1D(Form("hChargedPtNoCorr%d",hic), Form("C: %2.0f-%2.0f%%",b1,b2), nBins, logBinsPt );
151 fhChargedPtNoCorr[hic]->Sumw2();
152 fhistoList->Add(fhChargedPtNoCorr[hic]);
153
154 fhIsolatedChargedPt[hic] = new TH1D(Form("hIsolatedChargedPt%d",hic), Form("C: %2.0f-%2.0f%%",b1,b2), nBins, logBinsPt );
155 fhIsolatedChargedPt[hic]->Sumw2();
156 fhistoList->Add(fhIsolatedChargedPt[hic]);
157
158 fhInvariantIsolatedChargedPt[hic] = new TH1D(Form("hInvariantIsolatedChargedPt%d",hic), Form("C: %2.0f-%2.0f%%",b1,b2), nBins, logBinsPt );
159 fhInvariantIsolatedChargedPt[hic]->Sumw2();
160 fhistoList->Add(fhInvariantIsolatedChargedPt[hic]);
161
162 fhChargedXt[hic] = new TH1D(Form("hChargedXt%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), nBinsXt, logBinsXt );
163 fhChargedXt[hic]->Sumw2();
164 fhistoList->Add( fhChargedXt[hic] );
165
166 fhInvariantChargedXt[hic] = new TH1D(Form("hInvariantChargedXt%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), nBinsXt, logBinsXt );
167 fhInvariantChargedXt[hic]->Sumw2();
168 fhistoList->Add( fhInvariantChargedXt[hic] );
169
170 fhChargedXtNoCorr[hic] = new TH1D(Form("hChargedXtNoCorr%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), nBinsXt, logBinsXt );
171 fhChargedXtNoCorr[hic]->Sumw2();
172 fhistoList->Add( fhChargedXtNoCorr[hic] );
173
174 fhIsolatedChargedXt[hic] = new TH1D(Form("hIsolatedChargedXt%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), nBinsXt, logBinsXt );
175 fhIsolatedChargedXt[hic]->Sumw2();
176 fhistoList->Add( fhIsolatedChargedXt[hic] );
177
178 fhInvariantIsolatedChargedXt[hic] = new TH1D(Form("hInvariantIsolatedChargedXt%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), nBinsXt, logBinsXt );
179 fhInvariantIsolatedChargedXt[hic]->Sumw2();
180 fhistoList->Add( fhInvariantIsolatedChargedXt[hic] );
181
182 fhChargedEta[hic] = new TH1D(Form("hChargedEta%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),100,-1.0,1.0);
183 fhChargedEta[hic]->Sumw2();
184 fhistoList->Add(fhChargedEta[hic]);
185
186 fhChargedEtaNoCorr[hic] = new TH1D(Form("hChargedEtaNoCorr%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),100,-1.0,1.0);
187 fhChargedEtaNoCorr[hic]->Sumw2();
188 fhistoList->Add(fhChargedEtaNoCorr[hic]);
189
190 fhIsolatedChargedEta[hic] = new TH1D(Form("hIsolatedChargedEta%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),100,-1.0,1.0);
191 fhIsolatedChargedEta[hic]->Sumw2();
192 fhistoList->Add(fhIsolatedChargedEta[hic]);
193
194 fhChargedPhi[hic] = new TH1D(Form("hChargedPhi%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),128,-0.2,6.4);
195 fhChargedPhi[hic]->Sumw2();
196 fhistoList->Add(fhChargedPhi[hic]);
197
198 fhChargedPhiNoCorr[hic] = new TH1D(Form("hChargedPhiNoCorr%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),128,-0.2,6.4);
199 fhChargedPhiNoCorr[hic]->Sumw2();
200 fhistoList->Add(fhChargedPhiNoCorr[hic]);
201
202 fhIsolatedChargedPhi[hic] = new TH1D(Form("hIsolatedChargedPhi%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2),128,-0.2,6.4);
203 fhIsolatedChargedPhi[hic]->Sumw2();
204 fhistoList->Add(fhIsolatedChargedPhi[hic]);
205
206 fhZVert[hic] = new TH1D(Form("hZVert%d",hic),Form("C: %2.0f-%2.0f%%",b1,b2), 120, -30., 30.);
207 fhistoList->Add(fhZVert[hic]);
208 }
209
210 fhZVertRaw = new TH1D("hZVertRaw","vertex 0", 120, -30., 30.);
211 fhistoList->Add(fhZVertRaw);
212 fhCentr = new TH1D("hCentr","centrality", 101, -0.5, 100.5);
213 fhistoList->Add(fhCentr);
214 fhiCentr = new TH1D("hiCentr","centrality",10, -0.5, 9.5);
215 fhistoList->Add(fhiCentr);
216 fhEventPerRun = new TH1D("hEventPerRun","log(eve)/run",200, 0, 30.0);
217 fhistoList->Add(fhEventPerRun);
218
219 //------------------ for Abs Norm FK --------------------------------
220 double binsVertexMult[] = {0,1,2,3,4,5,10000};
221 int nBinsVertexMult = sizeof(binsVertexMult)/sizeof(double)-1;
222 double binsVertexZ[] = {-10,-6,-3,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,3,6,10};
223 int nBinsVertexZ = sizeof(binsVertexZ)/sizeof(double)-1;
224 fhVertexZTriggVtx = new TH2D("hVertexZTriggVtx","Vertex counts", nBinsVertexMult, binsVertexMult, nBinsVertexZ, binsVertexZ);
225 fhistoList->Add(fhVertexZTriggVtx);
226
227 sprintf(fhtit, "Mean activity inside cone");
228 sprintf(fhname, "hActivity");
229 fhConeActivity = new TProfile(fhname, fhtit, nBins, logBinsPt );
230 fhistoList->Add(fhConeActivity);
231
232 sprintf(fhtit, "Mean pion activity inside cone isolated");
233 sprintf(fhname, "hActivityIsolated");
234 fhConeActivityIsolated = new TProfile(fhname, fhtit, nBins, logBinsPt );
235 fhistoList->Add(fhConeActivityIsolated);
236
237 JumpToDefaultDirectory();
238}