]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/Base/AliUEHistograms.cxx
Code cleanup and improvement, adding setter for pA or (pp||PbPb) vertex selection...
[u/mrichter/AliRoot.git] / PWGCF / Correlations / Base / AliUEHistograms.cxx
CommitLineData
a75aacd6 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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/* $Id: AliUEHistograms.cxx 20164 2007-08-14 15:31:50Z morsch $ */
17
18//
19//
20// encapsulates several AliUEHist objects for a full UE analysis plus additional control histograms
21//
22//
23// Author: Jan Fiete Grosse-Oetringhaus, Sara Vallero
24
25#include "AliUEHistograms.h"
26
27#include "AliCFContainer.h"
28#include "AliVParticle.h"
2a910c25 29#include "AliAODTrack.h"
a75aacd6 30
31#include "TList.h"
8a368fc2 32#include "TCanvas.h"
a75aacd6 33#include "TH2F.h"
34#include "TH1F.h"
35#include "TH3F.h"
36#include "TMath.h"
b0d56b29 37#include "TLorentzVector.h"
a75aacd6 38
39ClassImp(AliUEHistograms)
40
bf58cbde 41const Int_t AliUEHistograms::fgkUEHists = 3;
42
3f3f12d9 43AliUEHistograms::AliUEHistograms(const char* name, const char* histograms, const char* binning) :
e0331fd9 44 TNamed(name, name),
a75aacd6 45 fNumberDensitypT(0),
46 fSumpT(0),
47 fNumberDensityPhi(0),
48 fCorrelationpT(0),
49 fCorrelationEta(0),
50 fCorrelationPhi(0),
51 fCorrelationR(0),
52 fCorrelationLeading2Phi(0),
53 fCorrelationMultiplicity(0),
5e053cad 54 fYields(0),
a75aacd6 55 fEventCount(0),
56 fEventCountDifferential(0),
bf58cbde 57 fVertexContributors(0),
c7245604 58 fCentralityDistribution(0),
447d47d8 59 fCentralityCorrelation(0),
2a910c25 60 fITSClusterMap(0),
f613255f 61 fControlConvResoncances(0),
13a404ed 62 fEfficiencyCorrection(0),
d787bf34 63 fCorrectTriggers(kFALSE),
85bfac17 64 fSelectCharge(0),
7a77d480 65 fTriggerSelectCharge(0),
d38fa455 66 fTriggerRestrictEta(-1),
00b6f3c6 67 fEtaOrdering(kFALSE),
b0d56b29 68 fCutConversions(kFALSE),
69 fCutResonances(kFALSE),
9da2f080 70 fOnlyOneEtaSide(0),
8a368fc2 71 fWeightPerEvent(kFALSE),
e5df0f3a 72 fRunNumber(0),
73 fMergeCount(1)
a75aacd6 74{
75 // Constructor
bf58cbde 76 //
77 // the string histograms defines which histograms are created:
78 // 1 = NumberDensitypT
79 // 2 = SumpT
80 // 3 = NumberDensityPhi
81 // 4 = NumberDensityPhiCentrality (other multiplicity for Pb)
82
0ffdaf17 83 AliLog::SetClassDebugLevel("AliCFContainer", -1);
84 AliLog::SetClassDebugLevel("AliCFGridSparse", -3);
85
670e1d49 86 fTwoTrackDistancePt[0] = 0;
87 fTwoTrackDistancePt[1] = 0;
1bba939a 88
bf58cbde 89 TString histogramsStr(histograms);
90
3f3f12d9 91 TString defaultBinningStr;
92 defaultBinningStr = "eta: -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0\n"
93 "p_t_assoc: 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 8.0\n"
94 "p_t_leading: 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, 20.5, 21.0, 21.5, 22.0, 22.5, 23.0, 23.5, 24.0, 24.5, 25.0, 25.5, 26.0, 26.5, 27.0, 27.5, 28.0, 28.5, 29.0, 29.5, 30.0, 30.5, 31.0, 31.5, 32.0, 32.5, 33.0, 33.5, 34.0, 34.5, 35.0, 35.5, 36.0, 36.5, 37.0, 37.5, 38.0, 38.5, 39.0, 39.5, 40.0, 40.5, 41.0, 41.5, 42.0, 42.5, 43.0, 43.5, 44.0, 44.5, 45.0, 45.5, 46.0, 46.5, 47.0, 47.5, 48.0, 48.5, 49.0, 49.5, 50.0\n"
95 "p_t_leading_course: 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0\n"
96 "p_t_eff: 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0\n"
97 "vertex_eff: -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10\n"
98 ;
99
100 if (histogramsStr.Contains("4") || histogramsStr.Contains("5") || histogramsStr.Contains("6")) // Dphi Corr
101 {
102 if (histogramsStr.Contains("C"))
103 defaultBinningStr += "multiplicity: 0, 20, 40, 60, 80, 100.1\n"; // course
104 else
105 defaultBinningStr += "multiplicity: 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1\n";
106
107 if (histogramsStr.Contains("5"))
108 defaultBinningStr += "vertex: -7, -5, -3, -1, 1, 3, 5, 7\n";
109 else
110 defaultBinningStr += "vertex: -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10\n";
111
112 if (histogramsStr.Contains("R"))
113 defaultBinningStr += "delta_phi: -1.570796, -1.483530, -1.396263, -1.308997, -1.221730, -1.134464, -1.047198, -0.959931, -0.872665, -0.785398, -0.698132, -0.610865, -0.523599, -0.436332, -0.349066, -0.261799, -0.174533, -0.087266, 0.0, 0.087266, 0.174533, 0.261799, 0.349066, 0.436332, 0.523599, 0.610865, 0.698132, 0.785398, 0.872665, 0.959931, 1.047198, 1.134464, 1.221730, 1.308997, 1.396263, 1.483530, 1.570796, 1.658063, 1.745329, 1.832596, 1.919862, 2.007129, 2.094395, 2.181662, 2.268928, 2.356194, 2.443461, 2.530727, 2.617994, 2.705260, 2.792527, 2.879793, 2.967060, 3.054326, 3.141593, 3.228859, 3.316126, 3.403392, 3.490659, 3.577925, 3.665191, 3.752458, 3.839724, 3.926991, 4.014257, 4.101524, 4.188790, 4.276057, 4.363323, 4.450590, 4.537856, 4.625123, 4.712389\n" // this binning starts at -pi/2 and is modulo 3
114 "delta_eta: -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0,2.1, 2.2, 2.3, 2.4\n"
115 ;
116 else // for TTR studies
117 defaultBinningStr += "delta_phi: -1.570796, -1.483530, -1.396263, -1.308997, -1.221730, -1.134464, -1.047198, -0.959931, -0.872665, -0.785398, -0.698132, -0.610865, -0.523599, -0.436332, -0.349066, -0.261799, -0.174533, -0.087266, -0.043633, -0.021817, 0.0, 0.021817, 0.043633, 0.087266, 0.174533, 0.261799, 0.349066, 0.436332, 0.523599, 0.610865, 0.698132, 0.785398, 0.872665, 0.959931, 1.047198, 1.134464, 1.221730, 1.308997, 1.396263, 1.483530, 1.570796, 1.658063, 1.745329, 1.832596, 1.919862, 2.007129, 2.094395, 2.181662, 2.268928, 2.356194, 2.443461, 2.530727, 2.617994, 2.705260, 2.792527, 2.879793, 2.967060, 3.054326, 3.141593, 3.228859, 3.316126, 3.403392, 3.490659, 3.577925, 3.665191, 3.752458, 3.839724, 3.926991, 4.014257, 4.101524, 4.188790, 4.276057, 4.363323, 4.450590, 4.537856, 4.625123, 4.712389\n"
118 "delta_eta: -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, -0.05, -0.025, 0, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0\n"
119 ;
120 }
121 else // UE
122 defaultBinningStr += "multiplicity: -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 200.0\n"
123 "delta_phi: -1.570796, -1.483530, -1.396263, -1.308997, -1.221730, -1.134464, -1.047198, -0.959931, -0.872665, -0.785398, -0.698132, -0.610865, -0.523599, -0.436332, -0.349066, -0.261799, -0.174533, -0.087266, 0.0, 0.087266, 0.174533, 0.261799, 0.349066, 0.436332, 0.523599, 0.610865, 0.698132, 0.785398, 0.872665, 0.959931, 1.047198, 1.134464, 1.221730, 1.308997, 1.396263, 1.483530, 1.570796, 1.658063, 1.745329, 1.832596, 1.919862, 2.007129, 2.094395, 2.181662, 2.268928, 2.356194, 2.443461, 2.530727, 2.617994, 2.705260, 2.792527, 2.879793, 2.967060, 3.054326, 3.141593, 3.228859, 3.316126, 3.403392, 3.490659, 3.577925, 3.665191, 3.752458, 3.839724, 3.926991, 4.014257, 4.101524, 4.188790, 4.276057, 4.363323, 4.450590, 4.537856, 4.625123, 4.712389\n"
124 "vertex: -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10\n"
125 ;
126
127 // combine customBinning with defaultBinningStr -> use customBinning where available and otherwise defaultBinningStr
128 TString customBinning(binning);
129 TString binningStr;
130
131 TObjArray* lines = defaultBinningStr.Tokenize("\n");
132 for (Int_t i=0; i<lines->GetEntriesFast(); i++)
133 {
134 TString line(lines->At(i)->GetName());
135 TString tag = line(0, line.Index(":")+1);
136 if (!customBinning.Contains(tag))
137 binningStr += line + "\n";
138 else
139 Printf("Using custom binning for %s", tag.Data());
140 }
141 delete lines;
142 binningStr += customBinning;
143
bf58cbde 144 if (histogramsStr.Contains("1"))
3f3f12d9 145 fNumberDensitypT = new AliUEHist("NumberDensitypT", binningStr);
bf58cbde 146 if (histogramsStr.Contains("2"))
3f3f12d9 147 fSumpT = new AliUEHist("SumpT", binningStr);
a75aacd6 148
bf58cbde 149 if (histogramsStr.Contains("3"))
3f3f12d9 150 fNumberDensityPhi = new AliUEHist("NumberDensityPhi", binningStr);
0ffdaf17 151 else if (histogramsStr.Contains("4"))
3f3f12d9 152 fNumberDensityPhi = new AliUEHist("NumberDensityPhiCentrality", binningStr);
153 else if (histogramsStr.Contains("5") || histogramsStr.Contains("6"))
154 fNumberDensityPhi = new AliUEHist("NumberDensityPhiCentralityVtx", binningStr);
a75aacd6 155
156 // do not add this hists to the directory
157 Bool_t oldStatus = TH1::AddDirectoryStatus();
158 TH1::AddDirectory(kFALSE);
159
f0a25b1d 160 if (!histogramsStr.Contains("4") && !histogramsStr.Contains("5") && !histogramsStr.Contains("6"))
c7245604 161 {
162 fCorrelationpT = new TH2F("fCorrelationpT", ";p_{T,lead} (MC);p_{T,lead} (RECO)", 200, 0, 50, 200, 0, 50);
2a910c25 163 fCorrelationEta = new TH2F("fCorrelationEta", ";#eta_{lead} (MC);#eta_{T,lead} (RECO)", 200, -1, 1, 200, -1, 1);
a4a4d54e 164 fCorrelationPhi = new TH2F("fCorrelationPhi", ";#varphi_{lead} (MC);#varphi_{T,lead} (RECO)", 200, 0, TMath::TwoPi(), 200, 0, TMath::TwoPi());
c7245604 165 }
166 else
167 {
2a910c25 168 fCorrelationpT = new TH2F("fCorrelationpT", ";Centrality;p_{T} (RECO)", 100, 0, 100.001, 200, 0, 50);
9da2f080 169 fCorrelationEta = new TH2F("fCorrelationEta", ";Centrality;#eta (RECO)", 100, 0, 100.001, 200, -5, 5);
a4a4d54e 170 fCorrelationPhi = new TH2F("fCorrelationPhi", ";Centrality;#varphi (RECO)", 100, 0, 100.001, 200, 0, TMath::TwoPi());
c7245604 171 }
172
a75aacd6 173 fCorrelationR = new TH2F("fCorrelationR", ";R;p_{T,lead} (MC)", 200, 0, 2, 200, 0, 50);
a4a4d54e 174 fCorrelationLeading2Phi = new TH2F("fCorrelationLeading2Phi", ";#Delta #varphi;p_{T,lead} (MC)", 200, -TMath::Pi(), TMath::Pi(), 200, 0, 50);
a75aacd6 175 fCorrelationMultiplicity = new TH2F("fCorrelationMultiplicity", ";MC tracks;Reco tracks", 100, -0.5, 99.5, 100, -0.5, 99.5);
a5d12d24 176 fYields = new TH3F("fYields", ";centrality;pT;eta", 100, 0, 100, 40, 0, 20, 100, -1, 1);
5e053cad 177
f0a25b1d 178 if (!histogramsStr.Contains("4") && !histogramsStr.Contains("5") && !histogramsStr.Contains("6"))
2a910c25 179 {
180 fEventCount = new TH2F("fEventCount", ";step;event type;count", AliUEHist::fgkCFSteps+2, -2.5, -0.5 + AliUEHist::fgkCFSteps, 3, -0.5, 2.5);
181 fEventCount->GetYaxis()->SetBinLabel(1, "ND");
182 fEventCount->GetYaxis()->SetBinLabel(2, "SD");
183 fEventCount->GetYaxis()->SetBinLabel(3, "DD");
184 }
185 else
186 {
187 fEventCount = new TH2F("fEventCount", ";step;centrality;count", AliUEHist::fgkCFSteps+2, -2.5, -0.5 + AliUEHist::fgkCFSteps, fNumberDensityPhi->GetEventHist()->GetNBins(1), fNumberDensityPhi->GetEventHist()->GetAxis(1, 0)->GetXbins()->GetArray());
188 }
a75aacd6 189
190 fEventCountDifferential = new TH3F("fEventCountDifferential", ";p_{T,lead};step;event type", 100, 0, 50, AliUEHist::fgkCFSteps, -0.5, -0.5 + AliUEHist::fgkCFSteps, 3, -0.5, 2.5);
191 fEventCountDifferential->GetZaxis()->SetBinLabel(1, "ND");
192 fEventCountDifferential->GetZaxis()->SetBinLabel(2, "SD");
193 fEventCountDifferential->GetZaxis()->SetBinLabel(3, "DD");
194
195 fVertexContributors = new TH1F("fVertexContributors", ";contributors;count", 100, -0.5, 99.5);
196
664d6288 197 if (fNumberDensityPhi)
447d47d8 198 {
199 fCentralityDistribution = new TH1F("fCentralityDistribution", ";centrality;count", fNumberDensityPhi->GetEventHist()->GetNBins(1), fNumberDensityPhi->GetEventHist()->GetAxis(1, 0)->GetXbins()->GetArray());
5e053cad 200 fCentralityCorrelation = new TH2F("fCentralityCorrelation", ";centrality;multiplicity", 101, 0, 101, 200, 0, 4000);
447d47d8 201 }
bf58cbde 202
2a910c25 203 fITSClusterMap = new TH3F("fITSClusterMap", "; its cluster map; centrality; pT", 256, -0.5, 255.5, 20, 0, 100.001, 100, 0, 20);
204
f613255f 205 fControlConvResoncances = new TH2F("fControlConvResoncances", ";id;delta mass", 3, -0.5, 2.5, 100, -0.1, 0.1);
206
a75aacd6 207 TH1::AddDirectory(oldStatus);
208}
209
d1c75d06 210//_____________________________________________________________________________
211AliUEHistograms::AliUEHistograms(const AliUEHistograms &c) :
e0331fd9 212 TNamed(fName, fTitle),
d1c75d06 213 fNumberDensitypT(0),
214 fSumpT(0),
215 fNumberDensityPhi(0),
216 fCorrelationpT(0),
217 fCorrelationEta(0),
218 fCorrelationPhi(0),
219 fCorrelationR(0),
220 fCorrelationLeading2Phi(0),
221 fCorrelationMultiplicity(0),
5e053cad 222 fYields(0),
d1c75d06 223 fEventCount(0),
224 fEventCountDifferential(0),
bf58cbde 225 fVertexContributors(0),
c7245604 226 fCentralityDistribution(0),
447d47d8 227 fCentralityCorrelation(0),
2a910c25 228 fITSClusterMap(0),
f613255f 229 fControlConvResoncances(0),
13a404ed 230 fEfficiencyCorrection(0),
d787bf34 231 fCorrectTriggers(kFALSE),
85bfac17 232 fSelectCharge(0),
7a77d480 233 fTriggerSelectCharge(0),
d38fa455 234 fTriggerRestrictEta(-1),
00b6f3c6 235 fEtaOrdering(kFALSE),
b0d56b29 236 fCutConversions(kFALSE),
237 fCutResonances(kFALSE),
9da2f080 238 fOnlyOneEtaSide(0),
8a368fc2 239 fWeightPerEvent(kFALSE),
e5df0f3a 240 fRunNumber(0),
241 fMergeCount(1)
d1c75d06 242{
243 //
244 // AliUEHistograms copy constructor
245 //
246
670e1d49 247 fTwoTrackDistancePt[0] = 0;
248 fTwoTrackDistancePt[1] = 0;
1bba939a 249
d1c75d06 250 ((AliUEHistograms &) c).Copy(*this);
251}
252
a75aacd6 253//____________________________________________________________________
254AliUEHistograms::~AliUEHistograms()
255{
256 // Destructor
257
b0d56b29 258 DeleteContainers();
259}
260
261void AliUEHistograms::DeleteContainers()
262{
a75aacd6 263 if (fNumberDensitypT)
264 {
265 delete fNumberDensitypT;
266 fNumberDensitypT = 0;
267 }
268
269 if (fSumpT)
270 {
271 delete fSumpT;
272 fSumpT = 0;
273 }
274
275 if (fNumberDensityPhi)
276 {
277 delete fNumberDensityPhi;
278 fNumberDensityPhi = 0;
279 }
280
281 if (fCorrelationpT)
282 {
283 delete fCorrelationpT;
284 fCorrelationpT = 0;
285 }
286
287 if (fCorrelationEta)
288 {
289 delete fCorrelationEta;
290 fCorrelationEta = 0;
291 }
292
293 if (fCorrelationPhi)
294 {
295 delete fCorrelationPhi;
296 fCorrelationPhi = 0;
297 }
298
299 if (fCorrelationR)
300 {
301 delete fCorrelationR;
302 fCorrelationR = 0;
303 }
304
305 if (fCorrelationLeading2Phi)
306 {
307 delete fCorrelationLeading2Phi;
308 fCorrelationLeading2Phi = 0;
309 }
310
311 if (fCorrelationMultiplicity)
312 {
313 delete fCorrelationMultiplicity;
314 fCorrelationMultiplicity = 0;
315 }
316
5e053cad 317 if (fYields)
318 {
319 delete fYields;
320 fYields = 0;
321 }
322
a75aacd6 323 if (fEventCount)
324 {
325 delete fEventCount;
326 fEventCount = 0;
327 }
328
329 if (fEventCountDifferential)
330 {
331 delete fEventCountDifferential;
332 fEventCountDifferential = 0;
333 }
334
335 if (fVertexContributors)
336 {
337 delete fVertexContributors;
338 fVertexContributors = 0;
339 }
bf58cbde 340
341 if (fCentralityDistribution)
342 {
343 delete fCentralityDistribution;
344 fCentralityDistribution = 0;
345 }
2a910c25 346
447d47d8 347 if (fCentralityCorrelation)
348 {
349 delete fCentralityCorrelation;
350 fCentralityCorrelation = 0;
351 }
352
2a910c25 353 if (fITSClusterMap)
354 {
355 delete fITSClusterMap;
356 fITSClusterMap = 0;
357 }
13a404ed 358
1bba939a 359 for (Int_t i=0; i<2; i++)
670e1d49 360 if (fTwoTrackDistancePt[i])
1bba939a 361 {
670e1d49 362 delete fTwoTrackDistancePt[i];
363 fTwoTrackDistancePt[i] = 0;
1bba939a 364 }
13a404ed 365
f613255f 366 if (fControlConvResoncances)
367 {
368 delete fControlConvResoncances;
369 fControlConvResoncances = 0;
370 }
371
13a404ed 372 if (fEfficiencyCorrection)
373 {
374 delete fEfficiencyCorrection;
375 fEfficiencyCorrection = 0;
376 }
a75aacd6 377}
378
ada1a03f 379AliUEHist* AliUEHistograms::GetUEHist(Int_t id)
380{
381 // returns AliUEHist object, useful for loops
382
383 switch (id)
384 {
385 case 0: return fNumberDensitypT; break;
386 case 1: return fSumpT; break;
387 case 2: return fNumberDensityPhi; break;
388 }
389
390 return 0;
391}
392
a75aacd6 393//____________________________________________________________________
394Int_t AliUEHistograms::CountParticles(TList* list, Float_t ptMin)
395{
396 // counts the number of particles in the list with a pT above ptMin
397 // TODO eta cut needed here?
398
399 Int_t count = 0;
400 for (Int_t j=0; j<list->GetEntries(); j++)
401 if (((AliVParticle*) list->At(j))->Pt() > ptMin)
402 count++;
403
404 return count;
405}
406
407//____________________________________________________________________
85bfac17 408void AliUEHistograms::Fill(Int_t eventType, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* toward, TList* away, TList* min, TList* max)
a75aacd6 409{
410 // fills the UE event histograms
411 //
412 // this function needs the leading (track or jet or ...) and four lists of AliVParticles which contain the particles/tracks to be filled in the four regions
413
414 // if leading is not set, just fill event statistics
415 if (leading)
416 {
417 Int_t multiplicity = 0;
418
419 // TODO configurable?
420 Float_t ptMin = 0.15;
421 if (leading->Pt() > ptMin)
422 multiplicity++;
423
424 multiplicity += CountParticles(toward, ptMin);
425 multiplicity += CountParticles(away, ptMin);
426 multiplicity += CountParticles(min, ptMin);
427 multiplicity += CountParticles(max, ptMin);
428
85bfac17 429 FillRegion(AliUEHist::kToward, zVtx, step, leading, toward, multiplicity);
430 FillRegion(AliUEHist::kAway, zVtx, step, leading, away, multiplicity);
431 FillRegion(AliUEHist::kMin, zVtx, step, leading, min, multiplicity);
432 FillRegion(AliUEHist::kMax, zVtx, step, leading, max, multiplicity);
b1831bcb 433
85bfac17 434 Double_t vars[3];
a75aacd6 435 vars[0] = leading->Pt();
436 vars[1] = multiplicity;
85bfac17 437 vars[2] = zVtx;
bf58cbde 438 for (Int_t i=0; i<fgkUEHists; i++)
439 if (GetUEHist(i))
440 GetUEHist(i)->GetEventHist()->Fill(vars, step);
a75aacd6 441
442 fEventCountDifferential->Fill(leading->Pt(), step, eventType);
443 }
444
445 FillEvent(eventType, step);
446}
447
448//____________________________________________________________________
85bfac17 449void AliUEHistograms::FillRegion(AliUEHist::Region region, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* list, Int_t multiplicity)
a75aacd6 450{
451 // loops over AliVParticles in list and fills the given region at the given step
452 //
453 // See also Fill(...)
454
455 for (Int_t i=0; i<list->GetEntries(); i++)
456 {
457 AliVParticle* particle = (AliVParticle*) list->At(i);
458
85bfac17 459 Double_t vars[6];
a75aacd6 460 vars[0] = particle->Eta();
461 vars[1] = particle->Pt();
462 vars[2] = leading->Pt();
463 vars[3] = multiplicity;
464 vars[4] = leading->Phi() - particle->Phi();
2ac8dc5c 465 if (vars[4] > 1.5 * TMath::Pi())
466 vars[4] -= TMath::TwoPi();
467 if (vars[4] < -0.5 * TMath::Pi())
468 vars[4] += TMath::TwoPi();
85bfac17 469 vars[5] = zVtx;
470
bf58cbde 471 if (fNumberDensitypT)
472 fNumberDensitypT->GetTrackHist(region)->Fill(vars, step);
473
474 if (fSumpT)
475 fSumpT->GetTrackHist(region)->Fill(vars, step, particle->Pt());
a75aacd6 476
477 // fill all in toward region (is anyway as function of delta phi!)
bf58cbde 478 if (fNumberDensityPhi)
479 fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->Fill(vars, step);
a75aacd6 480 }
481}
482
483//____________________________________________________________________
484void AliUEHistograms::Fill(AliVParticle* leadingMC, AliVParticle* leadingReco)
485{
486 // fills the correlation histograms
487
488 if (leadingMC)
489 {
490 fCorrelationpT->Fill(leadingMC->Pt(), leadingReco->Pt());
491 if (leadingMC->Pt() > 0.5)
492 {
493 fCorrelationEta->Fill(leadingMC->Eta(), leadingReco->Eta());
494 fCorrelationPhi->Fill(leadingMC->Phi(), leadingReco->Phi());
495 }
496
497 Float_t phiDiff = leadingMC->Phi() - leadingReco->Phi();
498 if (phiDiff > TMath::Pi())
499 phiDiff -= TMath::TwoPi();
500 if (phiDiff < -TMath::Pi())
501 phiDiff += TMath::TwoPi();
502
503 Float_t etaDiff = leadingMC->Eta() - leadingReco->Eta();
504
505 fCorrelationR->Fill(TMath::Sqrt(phiDiff * phiDiff + etaDiff * etaDiff), leadingMC->Pt());
506 fCorrelationLeading2Phi->Fill(phiDiff, leadingMC->Pt());
507 }
508 else
509 {
510 fCorrelationpT->Fill(1.0, leadingReco->Pt());
511 if (leadingReco->Pt() > 0.5)
512 {
513 fCorrelationEta->Fill(0.0, leadingReco->Eta());
514 fCorrelationPhi->Fill(0.0, leadingReco->Phi());
515 }
516 }
517}
bf58cbde 518
519//____________________________________________________________________
408d1ac9 520void AliUEHistograms::FillCorrelations(Double_t centrality, Float_t zVtx, AliUEHist::CFStep step, TObjArray* particles, TObjArray* mixed, Float_t weight, Bool_t firstTime, Bool_t twoTrackEfficiencyCut, Float_t bSign, Float_t twoTrackEfficiencyCutValue, Bool_t applyEfficiency)
bf58cbde 521{
522 // fills the fNumberDensityPhi histogram
523 //
524 // this function need a list of AliVParticles which contain the particles/tracks to be filled
e0331fd9 525 //
526 // if mixed is non-0, mixed events are filled, the trigger particle is from particles, the associated from mixed
c05ff6be 527 // if weight < 0, then the pt of the associated particle is filled as weight
528
529 Bool_t fillpT = kFALSE;
530 if (weight < 0)
531 fillpT = kTRUE;
bf58cbde 532
7fd35fdd 533 if (twoTrackEfficiencyCut && !fTwoTrackDistancePt[0])
534 {
5e053cad 535 // do not add this hists to the directory
536 Bool_t oldStatus = TH1::AddDirectoryStatus();
537 TH1::AddDirectory(kFALSE);
538
edd964a8 539 fTwoTrackDistancePt[0] = new TH3F("fTwoTrackDistancePt[0]", ";#Delta#eta;#Delta#varphi^{*}_{min};#Delta p_{T}", 100, -0.15, 0.15, 100, -0.05, 0.05, 20, 0, 10);
7fd35fdd 540 fTwoTrackDistancePt[1] = (TH3F*) fTwoTrackDistancePt[0]->Clone("fTwoTrackDistancePt[1]");
5e053cad 541
542 TH1::AddDirectory(oldStatus);
7fd35fdd 543 }
544
eed401dc 545 // Eta() is extremely time consuming, therefore cache it for the inner loop here:
546 TObjArray* input = (mixed) ? mixed : particles;
547 TArrayF eta(input->GetEntriesFast());
548 for (Int_t i=0; i<input->GetEntriesFast(); i++)
549 eta[i] = ((AliVParticle*) input->At(i))->Eta();
550
bf58cbde 551 // if particles is not set, just fill event statistics
552 if (particles)
553 {
eed401dc 554 Int_t jMax = particles->GetEntriesFast();
555 if (mixed)
556 jMax = mixed->GetEntriesFast();
557
8a368fc2 558 TH1* triggerWeighting = 0;
559 if (fWeightPerEvent)
560 {
561 TAxis* axis = fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->GetGrid(0)->GetGrid()->GetAxis(2);
562 triggerWeighting = new TH1F("triggerWeighting", "", axis->GetNbins(), axis->GetXbins()->GetArray());
563
564 for (Int_t i=0; i<particles->GetEntriesFast(); i++)
565 {
566 AliVParticle* triggerParticle = (AliVParticle*) particles->At(i);
567
568 // some optimization
569 Float_t triggerEta = triggerParticle->Eta();
570
571 if (fTriggerRestrictEta > 0 && TMath::Abs(triggerEta) > fTriggerRestrictEta)
572 continue;
573
574 if (fOnlyOneEtaSide != 0)
575 {
576 if (fOnlyOneEtaSide * triggerEta < 0)
577 continue;
578 }
579
580 if (fTriggerSelectCharge != 0)
581 if (triggerParticle->Charge() * fTriggerSelectCharge < 0)
582 continue;
583
584 triggerWeighting->Fill(triggerParticle->Pt());
585 }
586// new TCanvas; triggerWeighting->Draw();
587 }
588
eed401dc 589 for (Int_t i=0; i<particles->GetEntriesFast(); i++)
bf58cbde 590 {
591 AliVParticle* triggerParticle = (AliVParticle*) particles->At(i);
eed401dc 592
593 // some optimization
594 Float_t triggerEta = triggerParticle->Eta();
9da2f080 595
596 if (fTriggerRestrictEta > 0 && TMath::Abs(triggerEta) > fTriggerRestrictEta)
597 continue;
598
599 if (fOnlyOneEtaSide != 0)
600 {
601 if (fOnlyOneEtaSide * triggerEta < 0)
602 continue;
603 }
7a77d480 604
605 if (fTriggerSelectCharge != 0)
606 if (triggerParticle->Charge() * fTriggerSelectCharge < 0)
607 continue;
9da2f080 608
e0331fd9 609 for (Int_t j=0; j<jMax; j++)
bf58cbde 610 {
e0331fd9 611 if (!mixed && i == j)
bf58cbde 612 continue;
613
e0331fd9 614 AliVParticle* particle = 0;
615 if (!mixed)
616 particle = (AliVParticle*) particles->At(j);
617 else
618 particle = (AliVParticle*) mixed->At(j);
bf58cbde 619
2a910c25 620 // check if both particles point to the same element (does not occur for mixed events, but if subsets are mixed within the same event for cross-checks)
621 if (mixed && triggerParticle == particle)
622 continue;
623
c7245604 624 if (particle->Pt() > triggerParticle->Pt())
625 continue;
626
627 if (fSelectCharge > 0)
628 {
629 // skip like sign
630 if (fSelectCharge == 1 && particle->Charge() * triggerParticle->Charge() > 0)
631 continue;
632
633 // skip unlike sign
634 if (fSelectCharge == 2 && particle->Charge() * triggerParticle->Charge() < 0)
635 continue;
636 }
637
00b6f3c6 638 if (fEtaOrdering)
639 {
640 if (triggerEta < 0 && eta[j] < triggerEta)
641 continue;
642 if (triggerEta > 0 && eta[j] > triggerEta)
643 continue;
644 }
645
b0d56b29 646 // conversions
647 if (fCutConversions && particle->Charge() * triggerParticle->Charge() < 0)
648 {
f613255f 649 Float_t mass = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.510e-3, 0.510e-3);
650
651 fControlConvResoncances->Fill(0.0, mass);
b0d56b29 652
653 if (mass < 0.04*0.04)
654 continue;
655 }
656
f613255f 657 // K0s
b0d56b29 658 if (fCutResonances && particle->Charge() * triggerParticle->Charge() < 0)
659 {
f613255f 660 Float_t mass = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.1396, 0.1396);
661
662 const Float_t kK0smass = 0.4976;
b0d56b29 663
f613255f 664 fControlConvResoncances->Fill(1, mass - kK0smass*kK0smass);
665
666 if (mass > (kK0smass-0.02)*(kK0smass-0.02) && mass < (kK0smass+0.02)*(kK0smass+0.02))
b0d56b29 667 continue;
668 }
04af8d15 669
f613255f 670 // Lambda
671 if (fCutResonances && particle->Charge() * triggerParticle->Charge() < 0)
672 {
673 Float_t mass1 = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.1396, 0.9383);
674 Float_t mass2 = GetInvMassSquared(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), particle->Pt(), eta[j], particle->Phi(), 0.9383, 0.1396);
675
676 const Float_t kLambdaMass = 1.115;
677
678 fControlConvResoncances->Fill(2, mass1 - kLambdaMass*kLambdaMass);
679 fControlConvResoncances->Fill(2, mass2 - kLambdaMass*kLambdaMass);
680
681 if ((mass1 > (kLambdaMass-0.02)*(kLambdaMass-0.02) && mass1 < (kLambdaMass+0.02)*(kLambdaMass+0.02)) ||
682 (mass2 > (kLambdaMass-0.02)*(kLambdaMass-0.02) && mass2 < (kLambdaMass+0.02)*(kLambdaMass+0.02)))
683 continue;
684 }
685
04af8d15 686 if (twoTrackEfficiencyCut)
687 {
7fd35fdd 688 // the variables & cuthave been developed by the HBT group
689 // see e.g. https://indico.cern.ch/materialDisplay.py?contribId=36&sessionId=6&materialId=slides&confId=142700
690
04af8d15 691 Float_t phi1 = triggerParticle->Phi();
692 Float_t pt1 = triggerParticle->Pt();
693 Float_t charge1 = triggerParticle->Charge();
694
695 Float_t phi2 = particle->Phi();
696 Float_t pt2 = particle->Pt();
697 Float_t charge2 = particle->Charge();
698
699 Float_t deta = triggerEta - eta[j];
700
701 // optimization
edd964a8 702 if (TMath::Abs(deta) < twoTrackEfficiencyCutValue * 2.5 * 3)
04af8d15 703 {
7fd35fdd 704 // check first boundaries to see if is worth to loop and find the minimum
705 Float_t dphistar1 = GetDPhiStar(phi1, pt1, charge1, phi2, pt2, charge2, 0.8, bSign);
706 Float_t dphistar2 = GetDPhiStar(phi1, pt1, charge1, phi2, pt2, charge2, 2.5, bSign);
707
d4b3dbfc 708 const Float_t kLimit = twoTrackEfficiencyCutValue * 3;
04af8d15 709
7fd35fdd 710 Float_t dphistarminabs = 1e5;
711 Float_t dphistarmin = 1e5;
712 if (TMath::Abs(dphistar1) < kLimit || TMath::Abs(dphistar2) < kLimit || dphistar1 * dphistar2 < 0)
04af8d15 713 {
7fd35fdd 714 for (Double_t rad=0.8; rad<2.51; rad+=0.01)
715 {
716 Float_t dphistar = GetDPhiStar(phi1, pt1, charge1, phi2, pt2, charge2, rad, bSign);
717
718 Float_t dphistarabs = TMath::Abs(dphistar);
719
720 if (dphistarabs < dphistarminabs)
721 {
722 dphistarmin = dphistar;
723 dphistarminabs = dphistarabs;
724 }
725 }
726
727 fTwoTrackDistancePt[0]->Fill(deta, dphistarmin, TMath::Abs(pt1 - pt2));
04af8d15 728
d4b3dbfc 729 if (dphistarminabs < twoTrackEfficiencyCutValue && TMath::Abs(deta) < twoTrackEfficiencyCutValue)
04af8d15 730 {
7fd35fdd 731// Printf("Removed track pair %d %d with %f %f %f %f %f %f %f %f %f", i, j, deta, dphistarminabs, phi1, pt1, charge1, phi2, pt2, charge2, bSign);
732 continue;
04af8d15 733 }
7fd35fdd 734
735 fTwoTrackDistancePt[1]->Fill(deta, dphistarmin, TMath::Abs(pt1 - pt2));
04af8d15 736 }
04af8d15 737 }
738 }
b0d56b29 739
85bfac17 740 Double_t vars[6];
eed401dc 741 vars[0] = triggerEta - eta[j];
bf58cbde 742 vars[1] = particle->Pt();
743 vars[2] = triggerParticle->Pt();
744 vars[3] = centrality;
745 vars[4] = triggerParticle->Phi() - particle->Phi();
746 if (vars[4] > 1.5 * TMath::Pi())
747 vars[4] -= TMath::TwoPi();
748 if (vars[4] < -0.5 * TMath::Pi())
749 vars[4] += TMath::TwoPi();
85bfac17 750 vars[5] = zVtx;
c05ff6be 751
752 if (fillpT)
753 weight = particle->Pt();
13a404ed 754
755 Double_t useWeight = weight;
408d1ac9 756 if (fEfficiencyCorrection && applyEfficiency)
757 {
758 Int_t effVars[4];
defad170 759
760 // associated particle
408d1ac9 761 effVars[0] = fEfficiencyCorrection->GetAxis(0)->FindBin(eta[j]);
defad170 762 effVars[1] = fEfficiencyCorrection->GetAxis(1)->FindBin(vars[1]); //pt
763 effVars[2] = fEfficiencyCorrection->GetAxis(2)->FindBin(vars[3]); //centrality
764 effVars[3] = fEfficiencyCorrection->GetAxis(3)->FindBin(vars[5]); //zVtx
408d1ac9 765
766// Printf("%d %d %d %d %f", effVars[0], effVars[1], effVars[2], effVars[3], fEfficiencyCorrection->GetBinContent(effVars));
767
768 useWeight *= fEfficiencyCorrection->GetBinContent(effVars);
defad170 769
770 // trigger particle
d787bf34 771 if (fCorrectTriggers)
772 {
773 effVars[0] = fEfficiencyCorrection->GetAxis(0)->FindBin(triggerEta);
774 effVars[1] = fEfficiencyCorrection->GetAxis(1)->FindBin(vars[2]); //pt
775 useWeight *= fEfficiencyCorrection->GetBinContent(effVars);
776 }
408d1ac9 777 }
8a368fc2 778
779 if (fWeightPerEvent)
780 {
781 Int_t weightBin = triggerWeighting->GetXaxis()->FindBin(vars[2]);
782// Printf("Using weight %f", triggerWeighting->GetBinContent(weightBin));
783 useWeight /= triggerWeighting->GetBinContent(weightBin);
784 }
bf58cbde 785
c7245604 786 // fill all in toward region and do not use the other regions
13a404ed 787 fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->Fill(vars, step, useWeight);
d38fa455 788
789// Printf("%.2f %.2f --> %.2f", triggerEta, eta[j], vars[0]);
c7245604 790 }
bf58cbde 791
c7245604 792 if (firstTime)
793 {
794 // once per trigger particle
85bfac17 795 Double_t vars[3];
c7245604 796 vars[0] = triggerParticle->Pt();
797 vars[1] = centrality;
85bfac17 798 vars[2] = zVtx;
defad170 799
800 Double_t useWeight = 1;
d787bf34 801 if (fEfficiencyCorrection && applyEfficiency && fCorrectTriggers)
defad170 802 {
803 Int_t effVars[4];
804
805 // trigger particle
806 effVars[0] = fEfficiencyCorrection->GetAxis(0)->FindBin(triggerEta);
807 effVars[1] = fEfficiencyCorrection->GetAxis(1)->FindBin(vars[0]); //pt
808 effVars[2] = fEfficiencyCorrection->GetAxis(2)->FindBin(vars[1]); //centrality
809 effVars[3] = fEfficiencyCorrection->GetAxis(3)->FindBin(vars[2]); //zVtx
810 useWeight *= fEfficiencyCorrection->GetBinContent(effVars);
811 }
20b7a005 812 if (fWeightPerEvent)
813 {
814 // leads effectively to a filling of one entry per filled trigger particle pT bin
815 Int_t weightBin = triggerWeighting->GetXaxis()->FindBin(vars[0]);
816// Printf("Using weight %f", triggerWeighting->GetBinContent(weightBin));
817 useWeight /= triggerWeighting->GetBinContent(weightBin);
818 }
defad170 819
820 fNumberDensityPhi->GetEventHist()->Fill(vars, step, useWeight);
3f3f12d9 821
822 // QA
823 fCorrelationpT->Fill(centrality, triggerParticle->Pt());
824 fCorrelationEta->Fill(centrality, triggerEta);
825 fCorrelationPhi->Fill(centrality, triggerParticle->Phi());
826 fYields->Fill(centrality, triggerParticle->Pt(), triggerEta);
827
828/* if (dynamic_cast<AliAODTrack*>(triggerParticle))
829 fITSClusterMap->Fill(((AliAODTrack*) triggerParticle)->GetITSClusterMap(), centrality, triggerParticle->Pt());*/
c7245604 830 }
bf58cbde 831 }
8a368fc2 832
833 if (triggerWeighting)
834 {
835 delete triggerWeighting;
836 triggerWeighting = 0;
837 }
bf58cbde 838 }
839
840 fCentralityDistribution->Fill(centrality);
447d47d8 841 fCentralityCorrelation->Fill(centrality, particles->GetEntriesFast());
2a910c25 842 FillEvent(centrality, step);
bf58cbde 843}
a75aacd6 844
b1831bcb 845//____________________________________________________________________
408d1ac9 846void AliUEHistograms::FillTrackingEfficiency(TObjArray* mc, TObjArray* recoPrim, TObjArray* recoAll, TObjArray* fake, Int_t particleType, Double_t centrality, Double_t zVtx)
b1831bcb 847{
848 // fills the tracking efficiency objects
849 //
850 // mc: all primary MC particles
851 // recoPrim: reconstructed primaries (again MC particles)
852 // recoAll: reconstructed (again MC particles)
853 // particleType is: 0 for pion, 1 for kaon, 2 for proton, 3 for others
b591fb9c 854
855 for (Int_t step=0; step<4; step++)
b1831bcb 856 {
857 TObjArray* list = mc;
858 if (step == 1)
859 list = recoPrim;
860 else if (step == 2)
861 list = recoAll;
b591fb9c 862 else if (step == 3)
863 list = fake;
864
865 if (!list)
866 continue;
867
eed401dc 868 for (Int_t i=0; i<list->GetEntriesFast(); i++)
b1831bcb 869 {
870 AliVParticle* particle = (AliVParticle*) list->At(i);
408d1ac9 871 Double_t vars[5];
b1831bcb 872 vars[0] = particle->Eta();
873 vars[1] = particle->Pt();
874 vars[2] = particleType;
c7245604 875 vars[3] = centrality;
408d1ac9 876 vars[4] = zVtx;
b1831bcb 877
bf58cbde 878 for (Int_t j=0; j<fgkUEHists; j++)
879 if (GetUEHist(j))
880 GetUEHist(j)->GetTrackHistEfficiency()->Fill(vars, step);
b1831bcb 881 }
882 }
883}
884
b591fb9c 885//____________________________________________________________________
886void AliUEHistograms::FillFakePt(TObjArray* fake, Double_t centrality)
887{
888 TObjArray* tracksReco = (TObjArray*) fake->At(0);
889 TObjArray* tracksMC = (TObjArray*) fake->At(1);
890
b752706a 891 if (tracksReco->GetEntriesFast() != tracksMC->GetEntriesFast())
892 AliFatal(Form("Inconsistent arrays: %d vs %d", tracksReco->GetEntriesFast(), tracksMC->GetEntriesFast()));
893
b591fb9c 894 for (Int_t i=0; i<tracksReco->GetEntriesFast(); i++)
895 {
896 AliVParticle* particle1 = (AliVParticle*) tracksReco->At(i);
897 AliVParticle* particle2 = (AliVParticle*) tracksMC->At(i);
898 Double_t vars[3];
899 vars[0] = particle1->Pt();
900 vars[1] = particle2->Pt();
901 vars[2] = centrality;
902 for (Int_t j=0; j<fgkUEHists; j++)
903 if (GetUEHist(j))
904 GetUEHist(j)->GetMCRecoPtCorrelation()->Fill(vars[0],vars[1],vars[2]);
905 }
906}
907
a75aacd6 908//____________________________________________________________________
909void AliUEHistograms::FillEvent(Int_t eventType, Int_t step)
910{
911 // fills the number of events at the given step and the given enty type
912 //
913 // WARNING: This function is called from Fill, so only call it for steps where Fill is not called
914
915 fEventCount->Fill(step, eventType);
916}
917
2a910c25 918//____________________________________________________________________
919void AliUEHistograms::FillEvent(Double_t centrality, Int_t step)
920{
921 // fills the number of events at the given step and the given centrality
922 //
923 // WARNING: This function is called from Fill, so only call it for steps where Fill is not called
924
925 fEventCount->Fill(step, centrality);
926}
927
a75aacd6 928//____________________________________________________________________
929void AliUEHistograms::SetEtaRange(Float_t etaMin, Float_t etaMax)
930{
931 // sets eta min and max for all contained AliUEHist classes
932
bf58cbde 933 for (Int_t i=0; i<fgkUEHists; i++)
934 if (GetUEHist(i))
935 GetUEHist(i)->SetEtaRange(etaMin, etaMax);
a75aacd6 936}
937
938//____________________________________________________________________
939void AliUEHistograms::SetPtRange(Float_t ptMin, Float_t ptMax)
940{
941 // sets pT min and max for all contained AliUEHist classes
942
bf58cbde 943 for (Int_t i=0; i<fgkUEHists; i++)
944 if (GetUEHist(i))
945 GetUEHist(i)->SetPtRange(ptMin, ptMax);
a75aacd6 946}
947
85bfac17 948//____________________________________________________________________
949void AliUEHistograms::SetZVtxRange(Float_t min, Float_t max)
950{
951 // sets pT min and max for all contained AliUEHist classes
952
953 for (Int_t i=0; i<fgkUEHists; i++)
954 if (GetUEHist(i))
955 GetUEHist(i)->SetZVtxRange(min, max);
956}
957
144bd037 958//____________________________________________________________________
959void AliUEHistograms::SetContaminationEnhancement(TH1F* hist)
960{
961 // sets the contamination enhancement histogram in all contained AliUEHist classes
962
bf58cbde 963 for (Int_t i=0; i<fgkUEHists; i++)
964 if (GetUEHist(i))
965 GetUEHist(i)->SetContaminationEnhancement(hist);
144bd037 966}
967
a75aacd6 968//____________________________________________________________________
969void AliUEHistograms::SetCombineMinMax(Bool_t flag)
970{
971 // sets pT min and max for all contained AliUEHist classes
972
bf58cbde 973 for (Int_t i=0; i<fgkUEHists; i++)
974 if (GetUEHist(i))
975 GetUEHist(i)->SetCombineMinMax(flag);
a75aacd6 976}
977
defad170 978//____________________________________________________________________
979void AliUEHistograms::SetTrackEtaCut(Float_t value)
980{
981 // sets track eta cut for all contained AliUEHist classes
982
983 for (Int_t i=0; i<fgkUEHists; i++)
984 if (GetUEHist(i))
985 GetUEHist(i)->SetTrackEtaCut(value);
986}
987
20b7a005 988//____________________________________________________________________
989void AliUEHistograms::SetWeightPerEvent(Bool_t flag)
990{
991 // sets fWeightPerEvent for all contained AliUEHist classes
992
993 fWeightPerEvent = flag;
994
995 for (Int_t i=0; i<fgkUEHists; i++)
996 if (GetUEHist(i))
997 GetUEHist(i)->SetWeightPerEvent(fWeightPerEvent);
998}
999
a75aacd6 1000//____________________________________________________________________
1001void AliUEHistograms::Correct(AliUEHistograms* corrections)
1002{
1003 // corrects the contained histograms by calling AliUEHist::Correct
1004
bf58cbde 1005 for (Int_t i=0; i<fgkUEHists; i++)
1006 if (GetUEHist(i))
1007 GetUEHist(i)->Correct(corrections->GetUEHist(i));
a75aacd6 1008}
1009
1010//____________________________________________________________________
1011AliUEHistograms &AliUEHistograms::operator=(const AliUEHistograms &c)
1012{
1013 // assigment operator
1014
b0d56b29 1015 DeleteContainers();
1016
a75aacd6 1017 if (this != &c)
1018 ((AliUEHistograms &) c).Copy(*this);
1019
1020 return *this;
1021}
1022
1023//____________________________________________________________________
1024void AliUEHistograms::Copy(TObject& c) const
1025{
1026 // copy function
1027
1028 AliUEHistograms& target = (AliUEHistograms &) c;
1029
1030 if (fNumberDensitypT)
1031 target.fNumberDensitypT = dynamic_cast<AliUEHist*> (fNumberDensitypT->Clone());
1032
1033 if (fSumpT)
1034 target.fSumpT = dynamic_cast<AliUEHist*> (fSumpT->Clone());
1035
1036 if (fNumberDensityPhi)
1037 target.fNumberDensityPhi = dynamic_cast<AliUEHist*> (fNumberDensityPhi->Clone());
1038
1039 if (fCorrelationpT)
1040 target.fCorrelationpT = dynamic_cast<TH2F*> (fCorrelationpT->Clone());
1041
1042 if (fCorrelationEta)
1043 target.fCorrelationEta = dynamic_cast<TH2F*> (fCorrelationEta->Clone());
1044
1045 if (fCorrelationPhi)
1046 target.fCorrelationPhi = dynamic_cast<TH2F*> (fCorrelationPhi->Clone());
1047
1048 if (fCorrelationR)
1049 target.fCorrelationR = dynamic_cast<TH2F*> (fCorrelationR->Clone());
1050
1051 if (fCorrelationLeading2Phi)
1052 target.fCorrelationLeading2Phi = dynamic_cast<TH2F*> (fCorrelationLeading2Phi->Clone());
1053
1054 if (fCorrelationMultiplicity)
1055 target.fCorrelationMultiplicity = dynamic_cast<TH2F*> (fCorrelationMultiplicity->Clone());
1056
5e053cad 1057 if (fYields)
1058 target.fYields = dynamic_cast<TH3F*> (fYields->Clone());
1059
a75aacd6 1060 if (fEventCount)
1061 target.fEventCount = dynamic_cast<TH2F*> (fEventCount->Clone());
1062
1063 if (fEventCountDifferential)
1064 target.fEventCountDifferential = dynamic_cast<TH3F*> (fEventCountDifferential->Clone());
1065
1066 if (fVertexContributors)
1067 target.fVertexContributors = dynamic_cast<TH1F*> (fVertexContributors->Clone());
bf58cbde 1068
1069 if (fCentralityDistribution)
1070 target.fCentralityDistribution = dynamic_cast<TH1F*> (fCentralityDistribution->Clone());
c7245604 1071
447d47d8 1072 if (fCentralityCorrelation)
1073 target.fCentralityCorrelation = dynamic_cast<TH2F*> (fCentralityCorrelation->Clone());
1074
2a910c25 1075 if (fITSClusterMap)
1076 target.fITSClusterMap = dynamic_cast<TH3F*> (fITSClusterMap->Clone());
13a404ed 1077
f613255f 1078 if (fControlConvResoncances)
1079 target.fControlConvResoncances = dynamic_cast<TH2F*> (fControlConvResoncances->Clone());
1080
1bba939a 1081 for (Int_t i=0; i<2; i++)
670e1d49 1082 if (fTwoTrackDistancePt[i])
1083 target.fTwoTrackDistancePt[i] = dynamic_cast<TH3F*> (fTwoTrackDistancePt[i]->Clone());
1bba939a 1084
13a404ed 1085 if (fEfficiencyCorrection)
408d1ac9 1086 target.fEfficiencyCorrection = dynamic_cast<THnF*> (fEfficiencyCorrection->Clone());
13a404ed 1087
c7245604 1088 target.fSelectCharge = fSelectCharge;
7a77d480 1089 target.fTriggerSelectCharge = fTriggerSelectCharge;
d38fa455 1090 target.fTriggerRestrictEta = fTriggerRestrictEta;
00b6f3c6 1091 target.fEtaOrdering = fEtaOrdering;
b0d56b29 1092 target.fCutConversions = fCutConversions;
1093 target.fCutResonances = fCutResonances;
9da2f080 1094 target.fOnlyOneEtaSide = fOnlyOneEtaSide;
8a368fc2 1095 target.fWeightPerEvent = fWeightPerEvent;
85bfac17 1096 target.fRunNumber = fRunNumber;
e5df0f3a 1097 target.fMergeCount = fMergeCount;
d787bf34 1098 target.fCorrectTriggers = fCorrectTriggers;
a75aacd6 1099}
1100
1101//____________________________________________________________________
1102Long64_t AliUEHistograms::Merge(TCollection* list)
1103{
1104 // Merge a list of AliUEHistograms objects with this (needed for
1105 // PROOF).
1106 // Returns the number of merged objects (including this).
1107
1108 if (!list)
1109 return 0;
1110
1111 if (list->IsEmpty())
1112 return 1;
1113
1114 TIterator* iter = list->MakeIterator();
1115 TObject* obj;
1116
1117 // collections of objects
f613255f 1118 const Int_t kMaxLists = 19;
a75aacd6 1119 TList* lists[kMaxLists];
1120
1121 for (Int_t i=0; i<kMaxLists; i++)
1122 lists[i] = new TList;
1123
1124 Int_t count = 0;
1125 while ((obj = iter->Next())) {
1126
1127 AliUEHistograms* entry = dynamic_cast<AliUEHistograms*> (obj);
1128 if (entry == 0)
1129 continue;
1130
bf58cbde 1131 if (entry->fNumberDensitypT)
1132 lists[0]->Add(entry->fNumberDensitypT);
1133 if (entry->fSumpT)
1134 lists[1]->Add(entry->fSumpT);
1135 if (entry->fNumberDensityPhi)
1136 lists[2]->Add(entry->fNumberDensityPhi);
a75aacd6 1137 lists[3]->Add(entry->fCorrelationpT);
1138 lists[4]->Add(entry->fCorrelationEta);
1139 lists[5]->Add(entry->fCorrelationPhi);
1140 lists[6]->Add(entry->fCorrelationR);
1141 lists[7]->Add(entry->fCorrelationLeading2Phi);
1142 lists[8]->Add(entry->fCorrelationMultiplicity);
1143 lists[9]->Add(entry->fEventCount);
1144 lists[10]->Add(entry->fEventCountDifferential);
1145 lists[11]->Add(entry->fVertexContributors);
bf58cbde 1146 lists[12]->Add(entry->fCentralityDistribution);
2a910c25 1147 lists[13]->Add(entry->fITSClusterMap);
78d64459 1148 if (entry->fTwoTrackDistancePt[0])
670e1d49 1149 lists[14]->Add(entry->fTwoTrackDistancePt[0]);
78d64459 1150 if (entry->fTwoTrackDistancePt[1])
670e1d49 1151 lists[15]->Add(entry->fTwoTrackDistancePt[1]);
78d64459 1152 if (entry->fCentralityCorrelation)
447d47d8 1153 lists[16]->Add(entry->fCentralityCorrelation);
5e053cad 1154 if (entry->fYields)
1155 lists[17]->Add(entry->fYields);
f613255f 1156 if (entry->fControlConvResoncances)
1157 lists[18]->Add(entry->fControlConvResoncances);
e5df0f3a 1158
1159 fMergeCount += entry->fMergeCount;
1160
a75aacd6 1161 count++;
1162 }
1163
bf58cbde 1164 if (fNumberDensitypT)
1165 fNumberDensitypT->Merge(lists[0]);
1166 if (fSumpT)
1167 fSumpT->Merge(lists[1]);
1168 if (fNumberDensityPhi)
1169 fNumberDensityPhi->Merge(lists[2]);
a75aacd6 1170 fCorrelationpT->Merge(lists[3]);
1171 fCorrelationEta->Merge(lists[4]);
1172 fCorrelationPhi->Merge(lists[5]);
1173 fCorrelationR->Merge(lists[6]);
1174 fCorrelationLeading2Phi->Merge(lists[7]);
1175 fCorrelationMultiplicity->Merge(lists[8]);
1176 fEventCount->Merge(lists[9]);
1177 fEventCountDifferential->Merge(lists[10]);
1178 fVertexContributors->Merge(lists[11]);
bf58cbde 1179 fCentralityDistribution->Merge(lists[12]);
2a910c25 1180 fITSClusterMap->Merge(lists[13]);
0ffdaf17 1181 if (fTwoTrackDistancePt[0] && lists[14]->GetEntries() > 0)
670e1d49 1182 fTwoTrackDistancePt[0]->Merge(lists[14]);
0ffdaf17 1183 if (fTwoTrackDistancePt[1] && lists[15]->GetEntries() > 0)
670e1d49 1184 fTwoTrackDistancePt[1]->Merge(lists[15]);
447d47d8 1185 if (fCentralityCorrelation)
1186 fCentralityCorrelation->Merge(lists[16]);
5e053cad 1187 if (fYields && lists[17]->GetEntries() > 0)
1188 fYields->Merge(lists[17]);
f613255f 1189 if (fControlConvResoncances && lists[18]->GetEntries() > 0)
1190 fControlConvResoncances->Merge(lists[18]);
a75aacd6 1191
1192 for (Int_t i=0; i<kMaxLists; i++)
1193 delete lists[i];
e5df0f3a 1194
a75aacd6 1195 return count+1;
1196}
b1831bcb 1197
1198void AliUEHistograms::CopyReconstructedData(AliUEHistograms* from)
1199{
1200 // copies those histograms extracted from ESD to this object
1201
bf58cbde 1202 for (Int_t i=0; i<fgkUEHists; i++)
1203 if (GetUEHist(i))
1204 GetUEHist(i)->CopyReconstructedData(from->GetUEHist(i));
b1831bcb 1205}
6f803f6c 1206
0ffdaf17 1207void AliUEHistograms::DeepCopy(AliUEHistograms* from)
1208{
1209 // copies the entries of this object's members from the object <from> to this object
1210
1211 for (Int_t i=0; i<fgkUEHists; i++)
1212 if (GetUEHist(i) && from->GetUEHist(i))
1213 GetUEHist(i)->DeepCopy(from->GetUEHist(i));
1214}
1215
2a910c25 1216void AliUEHistograms::ExtendTrackingEfficiency(Bool_t verbose)
6f803f6c 1217{
1218 // delegates to AliUEHists
1219
bf58cbde 1220 for (Int_t i=0; i<fgkUEHists; i++)
1221 if (GetUEHist(i))
2a910c25 1222 GetUEHist(i)->ExtendTrackingEfficiency(verbose);
6f803f6c 1223}
1224
c7245604 1225void AliUEHistograms::Scale(Double_t factor)
1226{
1227 // scales all contained histograms by the given factor
1228
1229 for (Int_t i=0; i<fgkUEHists; i++)
1230 if (GetUEHist(i))
1231 GetUEHist(i)->Scale(factor);
1232
1233 TList list;
1234 list.Add(fCorrelationpT);
1235 list.Add(fCorrelationEta);
1236 list.Add(fCorrelationPhi);
1237 list.Add(fCorrelationR);
1238 list.Add(fCorrelationLeading2Phi);
1239 list.Add(fCorrelationMultiplicity);
5e053cad 1240 list.Add(fYields);
c7245604 1241 list.Add(fEventCount);
1242 list.Add(fEventCountDifferential);
1243 list.Add(fVertexContributors);
1244 list.Add(fCentralityDistribution);
447d47d8 1245 list.Add(fCentralityCorrelation);
2a910c25 1246 list.Add(fITSClusterMap);
670e1d49 1247 list.Add(fTwoTrackDistancePt[0]);
1248 list.Add(fTwoTrackDistancePt[1]);
f613255f 1249 list.Add(fControlConvResoncances);
c7245604 1250
1251 for (Int_t i=0; i<list.GetEntries(); i++)
1252 ((TH1*) list.At(i))->Scale(factor);
1253}
1254
1255void AliUEHistograms::Reset()
1256{
1257 // delegates to AliUEHists
1258
1259 for (Int_t i=0; i<fgkUEHists; i++)
1260 if (GetUEHist(i))
1261 GetUEHist(i)->Reset();
1262}
1bba939a 1263
f613255f 1264Float_t AliUEHistograms::GetInvMassSquared(Float_t pt1, Float_t eta1, Float_t phi1, Float_t pt2, Float_t eta2, Float_t phi2, Float_t m0_1, Float_t m0_2)
b0d56b29 1265{
1266 // calculate inv mass squared
1267 // same can be achieved, but with more computing time with
1268 /*TLorentzVector photon, p1, p2;
1269 p1.SetPtEtaPhiM(triggerParticle->Pt(), triggerEta, triggerParticle->Phi(), 0.510e-3);
1270 p2.SetPtEtaPhiM(particle->Pt(), eta[j], particle->Phi(), 0.510e-3);
1271 photon = p1+p2;
1272 photon.M()*/
1273
1274 Float_t tantheta1 = 1e10;
1275
1276 if (eta1 < -1e-10 || eta1 > 1e-10)
1277 tantheta1 = 2 * TMath::Exp(-eta1) / ( 1 - TMath::Exp(-2*eta1));
1278
1279 Float_t tantheta2 = 1e10;
1280 if (eta2 < -1e-10 || eta2 > 1e-10)
1281 tantheta2 = 2 * TMath::Exp(-eta2) / ( 1 - TMath::Exp(-2*eta2));
1282
f613255f 1283 Float_t e1squ = m0_1 * m0_1 + pt1 * pt1 * (1.0 + 1.0 / tantheta1 / tantheta1);
1284 Float_t e2squ = m0_2 * m0_2 + pt2 * pt2 * (1.0 + 1.0 / tantheta2 / tantheta2);
b0d56b29 1285
f613255f 1286 Float_t mass2 = m0_1 * m0_1 + m0_2 * m0_2 + 2 * ( TMath::Sqrt(e1squ * e2squ) - ( pt1 * pt2 * ( TMath::Cos(phi1 - phi2) + 1.0 / tantheta1 / tantheta2 ) ) );
b0d56b29 1287
1288 return mass2;
1289}