]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/JetTasks/AliUEHistograms.cxx
updated dphi correlation analysis
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / 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"
32#include "TH2F.h"
33#include "TH1F.h"
34#include "TH3F.h"
35#include "TMath.h"
36
37ClassImp(AliUEHistograms)
38
bf58cbde 39const Int_t AliUEHistograms::fgkUEHists = 3;
40
e0331fd9 41AliUEHistograms::AliUEHistograms(const char* name, const char* histograms) :
42 TNamed(name, name),
a75aacd6 43 fNumberDensitypT(0),
44 fSumpT(0),
45 fNumberDensityPhi(0),
46 fCorrelationpT(0),
47 fCorrelationEta(0),
48 fCorrelationPhi(0),
49 fCorrelationR(0),
50 fCorrelationLeading2Phi(0),
51 fCorrelationMultiplicity(0),
52 fEventCount(0),
53 fEventCountDifferential(0),
bf58cbde 54 fVertexContributors(0),
c7245604 55 fCentralityDistribution(0),
2a910c25 56 fITSClusterMap(0),
85bfac17 57 fSelectCharge(0),
58 fRunNumber(0)
a75aacd6 59{
60 // Constructor
bf58cbde 61 //
62 // the string histograms defines which histograms are created:
63 // 1 = NumberDensitypT
64 // 2 = SumpT
65 // 3 = NumberDensityPhi
66 // 4 = NumberDensityPhiCentrality (other multiplicity for Pb)
67
68 TString histogramsStr(histograms);
69
70 if (histogramsStr.Contains("1"))
71 fNumberDensitypT = new AliUEHist("NumberDensitypT");
72 if (histogramsStr.Contains("2"))
73 fSumpT = new AliUEHist("SumpT");
a75aacd6 74
bf58cbde 75 if (histogramsStr.Contains("3"))
76 fNumberDensityPhi = new AliUEHist("NumberDensityPhi");
77 else if (histogramsStr.Contains("4"))
78 fNumberDensityPhi = new AliUEHist("NumberDensityPhiCentrality");
a75aacd6 79
80 // do not add this hists to the directory
81 Bool_t oldStatus = TH1::AddDirectoryStatus();
82 TH1::AddDirectory(kFALSE);
83
c7245604 84 if (!histogramsStr.Contains("4"))
85 {
86 fCorrelationpT = new TH2F("fCorrelationpT", ";p_{T,lead} (MC);p_{T,lead} (RECO)", 200, 0, 50, 200, 0, 50);
2a910c25 87 fCorrelationEta = new TH2F("fCorrelationEta", ";#eta_{lead} (MC);#eta_{T,lead} (RECO)", 200, -1, 1, 200, -1, 1);
88 fCorrelationPhi = new TH2F("fCorrelationPhi", ";#phi_{lead} (MC);#phi_{T,lead} (RECO)", 200, 0, TMath::TwoPi(), 200, 0, TMath::TwoPi());
c7245604 89 }
90 else
91 {
2a910c25 92 fCorrelationpT = new TH2F("fCorrelationpT", ";Centrality;p_{T} (RECO)", 100, 0, 100.001, 200, 0, 50);
93 fCorrelationEta = new TH2F("fCorrelationEta", ";Centrality;#eta (RECO)", 100, 0, 100.001, 200, -1, 1);
94 fCorrelationPhi = new TH2F("fCorrelationPhi", ";Centrality;#phi (RECO)", 100, 0, 100.001, 200, 0, TMath::TwoPi());
c7245604 95 }
96
a75aacd6 97 fCorrelationR = new TH2F("fCorrelationR", ";R;p_{T,lead} (MC)", 200, 0, 2, 200, 0, 50);
98 fCorrelationLeading2Phi = new TH2F("fCorrelationLeading2Phi", ";#Delta #phi;p_{T,lead} (MC)", 200, -TMath::Pi(), TMath::Pi(), 200, 0, 50);
99 fCorrelationMultiplicity = new TH2F("fCorrelationMultiplicity", ";MC tracks;Reco tracks", 100, -0.5, 99.5, 100, -0.5, 99.5);
100
2a910c25 101 if (!histogramsStr.Contains("4"))
102 {
103 fEventCount = new TH2F("fEventCount", ";step;event type;count", AliUEHist::fgkCFSteps+2, -2.5, -0.5 + AliUEHist::fgkCFSteps, 3, -0.5, 2.5);
104 fEventCount->GetYaxis()->SetBinLabel(1, "ND");
105 fEventCount->GetYaxis()->SetBinLabel(2, "SD");
106 fEventCount->GetYaxis()->SetBinLabel(3, "DD");
107 }
108 else
109 {
110 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());
111 }
a75aacd6 112
113 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);
114 fEventCountDifferential->GetZaxis()->SetBinLabel(1, "ND");
115 fEventCountDifferential->GetZaxis()->SetBinLabel(2, "SD");
116 fEventCountDifferential->GetZaxis()->SetBinLabel(3, "DD");
117
118 fVertexContributors = new TH1F("fVertexContributors", ";contributors;count", 100, -0.5, 99.5);
119
664d6288 120 if (fNumberDensityPhi)
121 fCentralityDistribution = new TH1F("fCentralityDistribution", ";;count", fNumberDensityPhi->GetEventHist()->GetNBins(1), fNumberDensityPhi->GetEventHist()->GetAxis(1, 0)->GetXbins()->GetArray());
bf58cbde 122
2a910c25 123 fITSClusterMap = new TH3F("fITSClusterMap", "; its cluster map; centrality; pT", 256, -0.5, 255.5, 20, 0, 100.001, 100, 0, 20);
124
a75aacd6 125 TH1::AddDirectory(oldStatus);
126}
127
d1c75d06 128//_____________________________________________________________________________
129AliUEHistograms::AliUEHistograms(const AliUEHistograms &c) :
e0331fd9 130 TNamed(fName, fTitle),
d1c75d06 131 fNumberDensitypT(0),
132 fSumpT(0),
133 fNumberDensityPhi(0),
134 fCorrelationpT(0),
135 fCorrelationEta(0),
136 fCorrelationPhi(0),
137 fCorrelationR(0),
138 fCorrelationLeading2Phi(0),
139 fCorrelationMultiplicity(0),
140 fEventCount(0),
141 fEventCountDifferential(0),
bf58cbde 142 fVertexContributors(0),
c7245604 143 fCentralityDistribution(0),
2a910c25 144 fITSClusterMap(0),
85bfac17 145 fSelectCharge(0),
146 fRunNumber(0)
d1c75d06 147{
148 //
149 // AliUEHistograms copy constructor
150 //
151
152 ((AliUEHistograms &) c).Copy(*this);
153}
154
a75aacd6 155//____________________________________________________________________
156AliUEHistograms::~AliUEHistograms()
157{
158 // Destructor
159
160 if (fNumberDensitypT)
161 {
162 delete fNumberDensitypT;
163 fNumberDensitypT = 0;
164 }
165
166 if (fSumpT)
167 {
168 delete fSumpT;
169 fSumpT = 0;
170 }
171
172 if (fNumberDensityPhi)
173 {
174 delete fNumberDensityPhi;
175 fNumberDensityPhi = 0;
176 }
177
178 if (fCorrelationpT)
179 {
180 delete fCorrelationpT;
181 fCorrelationpT = 0;
182 }
183
184 if (fCorrelationEta)
185 {
186 delete fCorrelationEta;
187 fCorrelationEta = 0;
188 }
189
190 if (fCorrelationPhi)
191 {
192 delete fCorrelationPhi;
193 fCorrelationPhi = 0;
194 }
195
196 if (fCorrelationR)
197 {
198 delete fCorrelationR;
199 fCorrelationR = 0;
200 }
201
202 if (fCorrelationLeading2Phi)
203 {
204 delete fCorrelationLeading2Phi;
205 fCorrelationLeading2Phi = 0;
206 }
207
208 if (fCorrelationMultiplicity)
209 {
210 delete fCorrelationMultiplicity;
211 fCorrelationMultiplicity = 0;
212 }
213
214 if (fEventCount)
215 {
216 delete fEventCount;
217 fEventCount = 0;
218 }
219
220 if (fEventCountDifferential)
221 {
222 delete fEventCountDifferential;
223 fEventCountDifferential = 0;
224 }
225
226 if (fVertexContributors)
227 {
228 delete fVertexContributors;
229 fVertexContributors = 0;
230 }
bf58cbde 231
232 if (fCentralityDistribution)
233 {
234 delete fCentralityDistribution;
235 fCentralityDistribution = 0;
236 }
2a910c25 237
238 if (fITSClusterMap)
239 {
240 delete fITSClusterMap;
241 fITSClusterMap = 0;
242 }
a75aacd6 243}
244
ada1a03f 245AliUEHist* AliUEHistograms::GetUEHist(Int_t id)
246{
247 // returns AliUEHist object, useful for loops
248
249 switch (id)
250 {
251 case 0: return fNumberDensitypT; break;
252 case 1: return fSumpT; break;
253 case 2: return fNumberDensityPhi; break;
254 }
255
256 return 0;
257}
258
a75aacd6 259//____________________________________________________________________
260Int_t AliUEHistograms::CountParticles(TList* list, Float_t ptMin)
261{
262 // counts the number of particles in the list with a pT above ptMin
263 // TODO eta cut needed here?
264
265 Int_t count = 0;
266 for (Int_t j=0; j<list->GetEntries(); j++)
267 if (((AliVParticle*) list->At(j))->Pt() > ptMin)
268 count++;
269
270 return count;
271}
272
273//____________________________________________________________________
85bfac17 274void AliUEHistograms::Fill(Int_t eventType, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* toward, TList* away, TList* min, TList* max)
a75aacd6 275{
276 // fills the UE event histograms
277 //
278 // 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
279
280 // if leading is not set, just fill event statistics
281 if (leading)
282 {
283 Int_t multiplicity = 0;
284
285 // TODO configurable?
286 Float_t ptMin = 0.15;
287 if (leading->Pt() > ptMin)
288 multiplicity++;
289
290 multiplicity += CountParticles(toward, ptMin);
291 multiplicity += CountParticles(away, ptMin);
292 multiplicity += CountParticles(min, ptMin);
293 multiplicity += CountParticles(max, ptMin);
294
85bfac17 295 FillRegion(AliUEHist::kToward, zVtx, step, leading, toward, multiplicity);
296 FillRegion(AliUEHist::kAway, zVtx, step, leading, away, multiplicity);
297 FillRegion(AliUEHist::kMin, zVtx, step, leading, min, multiplicity);
298 FillRegion(AliUEHist::kMax, zVtx, step, leading, max, multiplicity);
b1831bcb 299
85bfac17 300 Double_t vars[3];
a75aacd6 301 vars[0] = leading->Pt();
302 vars[1] = multiplicity;
85bfac17 303 vars[2] = zVtx;
bf58cbde 304 for (Int_t i=0; i<fgkUEHists; i++)
305 if (GetUEHist(i))
306 GetUEHist(i)->GetEventHist()->Fill(vars, step);
a75aacd6 307
308 fEventCountDifferential->Fill(leading->Pt(), step, eventType);
309 }
310
311 FillEvent(eventType, step);
312}
313
314//____________________________________________________________________
85bfac17 315void AliUEHistograms::FillRegion(AliUEHist::Region region, Float_t zVtx, AliUEHist::CFStep step, AliVParticle* leading, TList* list, Int_t multiplicity)
a75aacd6 316{
317 // loops over AliVParticles in list and fills the given region at the given step
318 //
319 // See also Fill(...)
320
321 for (Int_t i=0; i<list->GetEntries(); i++)
322 {
323 AliVParticle* particle = (AliVParticle*) list->At(i);
324
85bfac17 325 Double_t vars[6];
a75aacd6 326 vars[0] = particle->Eta();
327 vars[1] = particle->Pt();
328 vars[2] = leading->Pt();
329 vars[3] = multiplicity;
330 vars[4] = leading->Phi() - particle->Phi();
2ac8dc5c 331 if (vars[4] > 1.5 * TMath::Pi())
332 vars[4] -= TMath::TwoPi();
333 if (vars[4] < -0.5 * TMath::Pi())
334 vars[4] += TMath::TwoPi();
85bfac17 335 vars[5] = zVtx;
336
bf58cbde 337 if (fNumberDensitypT)
338 fNumberDensitypT->GetTrackHist(region)->Fill(vars, step);
339
340 if (fSumpT)
341 fSumpT->GetTrackHist(region)->Fill(vars, step, particle->Pt());
a75aacd6 342
343 // fill all in toward region (is anyway as function of delta phi!)
bf58cbde 344 if (fNumberDensityPhi)
345 fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->Fill(vars, step);
a75aacd6 346 }
347}
348
349//____________________________________________________________________
350void AliUEHistograms::Fill(AliVParticle* leadingMC, AliVParticle* leadingReco)
351{
352 // fills the correlation histograms
353
354 if (leadingMC)
355 {
356 fCorrelationpT->Fill(leadingMC->Pt(), leadingReco->Pt());
357 if (leadingMC->Pt() > 0.5)
358 {
359 fCorrelationEta->Fill(leadingMC->Eta(), leadingReco->Eta());
360 fCorrelationPhi->Fill(leadingMC->Phi(), leadingReco->Phi());
361 }
362
363 Float_t phiDiff = leadingMC->Phi() - leadingReco->Phi();
364 if (phiDiff > TMath::Pi())
365 phiDiff -= TMath::TwoPi();
366 if (phiDiff < -TMath::Pi())
367 phiDiff += TMath::TwoPi();
368
369 Float_t etaDiff = leadingMC->Eta() - leadingReco->Eta();
370
371 fCorrelationR->Fill(TMath::Sqrt(phiDiff * phiDiff + etaDiff * etaDiff), leadingMC->Pt());
372 fCorrelationLeading2Phi->Fill(phiDiff, leadingMC->Pt());
373 }
374 else
375 {
376 fCorrelationpT->Fill(1.0, leadingReco->Pt());
377 if (leadingReco->Pt() > 0.5)
378 {
379 fCorrelationEta->Fill(0.0, leadingReco->Eta());
380 fCorrelationPhi->Fill(0.0, leadingReco->Phi());
381 }
382 }
383}
bf58cbde 384
385//____________________________________________________________________
85bfac17 386void AliUEHistograms::FillCorrelations(Double_t centrality, Float_t zVtx, AliUEHist::CFStep step, TSeqCollection* particles, TSeqCollection* mixed, Float_t weight, Bool_t firstTime)
bf58cbde 387{
388 // fills the fNumberDensityPhi histogram
389 //
390 // this function need a list of AliVParticles which contain the particles/tracks to be filled
e0331fd9 391 //
392 // if mixed is non-0, mixed events are filled, the trigger particle is from particles, the associated from mixed
bf58cbde 393
394 // if particles is not set, just fill event statistics
395 if (particles)
396 {
397 for (Int_t i=0; i<particles->GetEntries(); i++)
398 {
399 AliVParticle* triggerParticle = (AliVParticle*) particles->At(i);
e0331fd9 400 Int_t jMax = particles->GetEntries();
401 if (mixed)
402 jMax = mixed->GetEntries();
403
c7245604 404 if (!mixed)
405 {
406 // QA
407 fCorrelationpT->Fill(centrality, triggerParticle->Pt());
408 fCorrelationEta->Fill(centrality, triggerParticle->Eta());
409 fCorrelationPhi->Fill(centrality, triggerParticle->Phi());
85bfac17 410/* if (dynamic_cast<AliAODTrack*>(triggerParticle))
411 fITSClusterMap->Fill(((AliAODTrack*) triggerParticle)->GetITSClusterMap(), centrality, triggerParticle->Pt());*/
c7245604 412 }
413
e0331fd9 414 for (Int_t j=0; j<jMax; j++)
bf58cbde 415 {
e0331fd9 416 if (!mixed && i == j)
bf58cbde 417 continue;
418
e0331fd9 419 AliVParticle* particle = 0;
420 if (!mixed)
421 particle = (AliVParticle*) particles->At(j);
422 else
423 particle = (AliVParticle*) mixed->At(j);
bf58cbde 424
2a910c25 425 // 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)
426 if (mixed && triggerParticle == particle)
427 continue;
428
c7245604 429 if (particle->Pt() > triggerParticle->Pt())
430 continue;
431
432 if (fSelectCharge > 0)
433 {
434 // skip like sign
435 if (fSelectCharge == 1 && particle->Charge() * triggerParticle->Charge() > 0)
436 continue;
437
438 // skip unlike sign
439 if (fSelectCharge == 2 && particle->Charge() * triggerParticle->Charge() < 0)
440 continue;
441 }
442
85bfac17 443 Double_t vars[6];
e0331fd9 444 vars[0] = triggerParticle->Eta() - particle->Eta();
bf58cbde 445 vars[1] = particle->Pt();
446 vars[2] = triggerParticle->Pt();
447 vars[3] = centrality;
448 vars[4] = triggerParticle->Phi() - particle->Phi();
449 if (vars[4] > 1.5 * TMath::Pi())
450 vars[4] -= TMath::TwoPi();
451 if (vars[4] < -0.5 * TMath::Pi())
452 vars[4] += TMath::TwoPi();
85bfac17 453 vars[5] = zVtx;
bf58cbde 454
c7245604 455 // fill all in toward region and do not use the other regions
456 fNumberDensityPhi->GetTrackHist(AliUEHist::kToward)->Fill(vars, step, weight);
457 }
bf58cbde 458
c7245604 459 if (firstTime)
460 {
461 // once per trigger particle
85bfac17 462 Double_t vars[3];
c7245604 463 vars[0] = triggerParticle->Pt();
464 vars[1] = centrality;
85bfac17 465 vars[2] = zVtx;
c7245604 466 fNumberDensityPhi->GetEventHist()->Fill(vars, step);
c7245604 467 }
bf58cbde 468 }
469 }
470
471 fCentralityDistribution->Fill(centrality);
2a910c25 472 FillEvent(centrality, step);
bf58cbde 473}
a75aacd6 474
b1831bcb 475//____________________________________________________________________
c7245604 476void AliUEHistograms::FillTrackingEfficiency(TObjArray* mc, TObjArray* recoPrim, TObjArray* recoAll, Int_t particleType, Double_t centrality)
b1831bcb 477{
478 // fills the tracking efficiency objects
479 //
480 // mc: all primary MC particles
481 // recoPrim: reconstructed primaries (again MC particles)
482 // recoAll: reconstructed (again MC particles)
483 // particleType is: 0 for pion, 1 for kaon, 2 for proton, 3 for others
484
485 for (Int_t step=0; step<3; step++)
486 {
487 TObjArray* list = mc;
488 if (step == 1)
489 list = recoPrim;
490 else if (step == 2)
491 list = recoAll;
492
493 for (Int_t i=0; i<list->GetEntries(); i++)
494 {
495 AliVParticle* particle = (AliVParticle*) list->At(i);
c7245604 496 Double_t vars[4];
b1831bcb 497 vars[0] = particle->Eta();
498 vars[1] = particle->Pt();
499 vars[2] = particleType;
c7245604 500 vars[3] = centrality;
b1831bcb 501
bf58cbde 502 for (Int_t j=0; j<fgkUEHists; j++)
503 if (GetUEHist(j))
504 GetUEHist(j)->GetTrackHistEfficiency()->Fill(vars, step);
b1831bcb 505 }
506 }
507}
508
a75aacd6 509//____________________________________________________________________
510void AliUEHistograms::FillEvent(Int_t eventType, Int_t step)
511{
512 // fills the number of events at the given step and the given enty type
513 //
514 // WARNING: This function is called from Fill, so only call it for steps where Fill is not called
515
516 fEventCount->Fill(step, eventType);
517}
518
2a910c25 519//____________________________________________________________________
520void AliUEHistograms::FillEvent(Double_t centrality, Int_t step)
521{
522 // fills the number of events at the given step and the given centrality
523 //
524 // WARNING: This function is called from Fill, so only call it for steps where Fill is not called
525
526 fEventCount->Fill(step, centrality);
527}
528
a75aacd6 529//____________________________________________________________________
530void AliUEHistograms::SetEtaRange(Float_t etaMin, Float_t etaMax)
531{
532 // sets eta min and max for all contained AliUEHist classes
533
bf58cbde 534 for (Int_t i=0; i<fgkUEHists; i++)
535 if (GetUEHist(i))
536 GetUEHist(i)->SetEtaRange(etaMin, etaMax);
a75aacd6 537}
538
539//____________________________________________________________________
540void AliUEHistograms::SetPtRange(Float_t ptMin, Float_t ptMax)
541{
542 // sets pT min and max for all contained AliUEHist classes
543
bf58cbde 544 for (Int_t i=0; i<fgkUEHists; i++)
545 if (GetUEHist(i))
546 GetUEHist(i)->SetPtRange(ptMin, ptMax);
a75aacd6 547}
548
85bfac17 549//____________________________________________________________________
550void AliUEHistograms::SetZVtxRange(Float_t min, Float_t max)
551{
552 // sets pT min and max for all contained AliUEHist classes
553
554 for (Int_t i=0; i<fgkUEHists; i++)
555 if (GetUEHist(i))
556 GetUEHist(i)->SetZVtxRange(min, max);
557}
558
144bd037 559//____________________________________________________________________
560void AliUEHistograms::SetContaminationEnhancement(TH1F* hist)
561{
562 // sets the contamination enhancement histogram in all contained AliUEHist classes
563
bf58cbde 564 for (Int_t i=0; i<fgkUEHists; i++)
565 if (GetUEHist(i))
566 GetUEHist(i)->SetContaminationEnhancement(hist);
144bd037 567}
568
a75aacd6 569//____________________________________________________________________
570void AliUEHistograms::SetCombineMinMax(Bool_t flag)
571{
572 // sets pT min and max for all contained AliUEHist classes
573
bf58cbde 574 for (Int_t i=0; i<fgkUEHists; i++)
575 if (GetUEHist(i))
576 GetUEHist(i)->SetCombineMinMax(flag);
a75aacd6 577}
578
579//____________________________________________________________________
580void AliUEHistograms::Correct(AliUEHistograms* corrections)
581{
582 // corrects the contained histograms by calling AliUEHist::Correct
583
bf58cbde 584 for (Int_t i=0; i<fgkUEHists; i++)
585 if (GetUEHist(i))
586 GetUEHist(i)->Correct(corrections->GetUEHist(i));
a75aacd6 587}
588
589//____________________________________________________________________
590AliUEHistograms &AliUEHistograms::operator=(const AliUEHistograms &c)
591{
592 // assigment operator
593
594 if (this != &c)
595 ((AliUEHistograms &) c).Copy(*this);
596
597 return *this;
598}
599
600//____________________________________________________________________
601void AliUEHistograms::Copy(TObject& c) const
602{
603 // copy function
604
605 AliUEHistograms& target = (AliUEHistograms &) c;
606
607 if (fNumberDensitypT)
608 target.fNumberDensitypT = dynamic_cast<AliUEHist*> (fNumberDensitypT->Clone());
609
610 if (fSumpT)
611 target.fSumpT = dynamic_cast<AliUEHist*> (fSumpT->Clone());
612
613 if (fNumberDensityPhi)
614 target.fNumberDensityPhi = dynamic_cast<AliUEHist*> (fNumberDensityPhi->Clone());
615
616 if (fCorrelationpT)
617 target.fCorrelationpT = dynamic_cast<TH2F*> (fCorrelationpT->Clone());
618
619 if (fCorrelationEta)
620 target.fCorrelationEta = dynamic_cast<TH2F*> (fCorrelationEta->Clone());
621
622 if (fCorrelationPhi)
623 target.fCorrelationPhi = dynamic_cast<TH2F*> (fCorrelationPhi->Clone());
624
625 if (fCorrelationR)
626 target.fCorrelationR = dynamic_cast<TH2F*> (fCorrelationR->Clone());
627
628 if (fCorrelationLeading2Phi)
629 target.fCorrelationLeading2Phi = dynamic_cast<TH2F*> (fCorrelationLeading2Phi->Clone());
630
631 if (fCorrelationMultiplicity)
632 target.fCorrelationMultiplicity = dynamic_cast<TH2F*> (fCorrelationMultiplicity->Clone());
633
634 if (fEventCount)
635 target.fEventCount = dynamic_cast<TH2F*> (fEventCount->Clone());
636
637 if (fEventCountDifferential)
638 target.fEventCountDifferential = dynamic_cast<TH3F*> (fEventCountDifferential->Clone());
639
640 if (fVertexContributors)
641 target.fVertexContributors = dynamic_cast<TH1F*> (fVertexContributors->Clone());
bf58cbde 642
643 if (fCentralityDistribution)
644 target.fCentralityDistribution = dynamic_cast<TH1F*> (fCentralityDistribution->Clone());
c7245604 645
2a910c25 646 if (fITSClusterMap)
647 target.fITSClusterMap = dynamic_cast<TH3F*> (fITSClusterMap->Clone());
648
c7245604 649 target.fSelectCharge = fSelectCharge;
85bfac17 650 target.fRunNumber = fRunNumber;
a75aacd6 651}
652
653//____________________________________________________________________
654Long64_t AliUEHistograms::Merge(TCollection* list)
655{
656 // Merge a list of AliUEHistograms objects with this (needed for
657 // PROOF).
658 // Returns the number of merged objects (including this).
659
660 if (!list)
661 return 0;
662
663 if (list->IsEmpty())
664 return 1;
665
666 TIterator* iter = list->MakeIterator();
667 TObject* obj;
668
669 // collections of objects
2a910c25 670 const Int_t kMaxLists = 14;
a75aacd6 671 TList* lists[kMaxLists];
672
673 for (Int_t i=0; i<kMaxLists; i++)
674 lists[i] = new TList;
675
676 Int_t count = 0;
677 while ((obj = iter->Next())) {
678
679 AliUEHistograms* entry = dynamic_cast<AliUEHistograms*> (obj);
680 if (entry == 0)
681 continue;
682
bf58cbde 683 if (entry->fNumberDensitypT)
684 lists[0]->Add(entry->fNumberDensitypT);
685 if (entry->fSumpT)
686 lists[1]->Add(entry->fSumpT);
687 if (entry->fNumberDensityPhi)
688 lists[2]->Add(entry->fNumberDensityPhi);
a75aacd6 689 lists[3]->Add(entry->fCorrelationpT);
690 lists[4]->Add(entry->fCorrelationEta);
691 lists[5]->Add(entry->fCorrelationPhi);
692 lists[6]->Add(entry->fCorrelationR);
693 lists[7]->Add(entry->fCorrelationLeading2Phi);
694 lists[8]->Add(entry->fCorrelationMultiplicity);
695 lists[9]->Add(entry->fEventCount);
696 lists[10]->Add(entry->fEventCountDifferential);
697 lists[11]->Add(entry->fVertexContributors);
bf58cbde 698 lists[12]->Add(entry->fCentralityDistribution);
2a910c25 699 lists[13]->Add(entry->fITSClusterMap);
a75aacd6 700
701 count++;
702 }
703
bf58cbde 704 if (fNumberDensitypT)
705 fNumberDensitypT->Merge(lists[0]);
706 if (fSumpT)
707 fSumpT->Merge(lists[1]);
708 if (fNumberDensityPhi)
709 fNumberDensityPhi->Merge(lists[2]);
a75aacd6 710 fCorrelationpT->Merge(lists[3]);
711 fCorrelationEta->Merge(lists[4]);
712 fCorrelationPhi->Merge(lists[5]);
713 fCorrelationR->Merge(lists[6]);
714 fCorrelationLeading2Phi->Merge(lists[7]);
715 fCorrelationMultiplicity->Merge(lists[8]);
716 fEventCount->Merge(lists[9]);
717 fEventCountDifferential->Merge(lists[10]);
718 fVertexContributors->Merge(lists[11]);
bf58cbde 719 fCentralityDistribution->Merge(lists[12]);
2a910c25 720 fITSClusterMap->Merge(lists[13]);
a75aacd6 721
722 for (Int_t i=0; i<kMaxLists; i++)
723 delete lists[i];
724
725 return count+1;
726}
b1831bcb 727
728void AliUEHistograms::CopyReconstructedData(AliUEHistograms* from)
729{
730 // copies those histograms extracted from ESD to this object
731
bf58cbde 732 for (Int_t i=0; i<fgkUEHists; i++)
733 if (GetUEHist(i))
734 GetUEHist(i)->CopyReconstructedData(from->GetUEHist(i));
b1831bcb 735}
6f803f6c 736
2a910c25 737void AliUEHistograms::ExtendTrackingEfficiency(Bool_t verbose)
6f803f6c 738{
739 // delegates to AliUEHists
740
bf58cbde 741 for (Int_t i=0; i<fgkUEHists; i++)
742 if (GetUEHist(i))
2a910c25 743 GetUEHist(i)->ExtendTrackingEfficiency(verbose);
6f803f6c 744}
745
c7245604 746void AliUEHistograms::Scale(Double_t factor)
747{
748 // scales all contained histograms by the given factor
749
750 for (Int_t i=0; i<fgkUEHists; i++)
751 if (GetUEHist(i))
752 GetUEHist(i)->Scale(factor);
753
754 TList list;
755 list.Add(fCorrelationpT);
756 list.Add(fCorrelationEta);
757 list.Add(fCorrelationPhi);
758 list.Add(fCorrelationR);
759 list.Add(fCorrelationLeading2Phi);
760 list.Add(fCorrelationMultiplicity);
761 list.Add(fEventCount);
762 list.Add(fEventCountDifferential);
763 list.Add(fVertexContributors);
764 list.Add(fCentralityDistribution);
2a910c25 765 list.Add(fITSClusterMap);
c7245604 766
767 for (Int_t i=0; i<list.GetEntries(); i++)
768 ((TH1*) list.At(i))->Scale(factor);
769}
770
771void AliUEHistograms::Reset()
772{
773 // delegates to AliUEHists
774
775 for (Int_t i=0; i<fgkUEHists; i++)
776 if (GetUEHist(i))
777 GetUEHist(i)->Reset();
778}