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