AliPhysics  fde8a9f (fde8a9f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskCLQA.cxx
Go to the documentation of this file.
1 // $Id: $
2 //
3 // Constantin's Task
4 //
5 // Author: C.Loizides
6 
7 #include <complex>
8 
9 #include "AliAnalysisTaskCLQA.h"
10 #include <TChain.h>
11 #include <TClonesArray.h>
12 #include <TDirectory.h>
13 #include <TFile.h>
14 #include <TH1F.h>
15 #include <TH2F.h>
16 #include <TH3F.h>
17 #include <TList.h>
18 #include <TLorentzVector.h>
19 #include <TNtuple.h>
20 #include <TNtupleD.h>
21 #include <TProfile.h>
22 #include <TTree.h>
23 #include "AliAODEvent.h"
24 #include "AliAnalysisManager.h"
25 #include "AliAnalysisUtils.h"
26 #include "AliCentrality.h"
27 #include "AliEMCALGeoParams.h"
28 #include "AliEMCALGeometry.h"
29 #include "AliEMCALRecoUtils.h"
30 #include "AliESDEvent.h"
31 #include "AliESDMuonTrack.h"
32 #include "AliEmcalJet.h"
33 #include "AliExternalTrackParam.h"
34 #include "AliInputEventHandler.h"
35 #include "AliLog.h"
36 #include "AliMultSelection.h"
37 #include "AliPicoTrack.h"
38 #include "AliTrackerBase.h"
39 #include "AliVCluster.h"
40 #include "AliVEventHandler.h"
41 #include "AliVParticle.h"
42 #include "AliVTrack.h"
43 
45 
46 //________________________________________________________________________
49  fDo2013VertexCut(1),
50  fDoTracking(0), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
51  fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
52  fDoHet(0), fHetEtmin(6),
53  fCentCL1In(0), fCentV0AIn(0),
54  fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
55  fNtupHet(0), fNtupHetInfo(0)
56 {
57  // Default constructor.
58 
59  for (Int_t i=0;i<1000;++i)
60  fHists[i] = 0;
61 }
62 
63 //________________________________________________________________________
65  AliAnalysisTaskEmcal(name, kTRUE),
66  fDo2013VertexCut(1),
67  fDoTracking(1), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
68  fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
69  fDoHet(0), fHetEtmin(6),
70  fCentCL1In(0), fCentV0AIn(0),
71  fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
72  fNtupHet(0), fNtupHetInfo(0)
73 {
74  // Standard constructor.
75 
76  for (Int_t i=0;i<1000;++i)
77  fHists[i] = 0;
78 }
79 
80 //________________________________________________________________________
82 {
83  // Destructor
84 }
85 
86 //________________________________________________________________________
88  Double_t rangeMin, Double_t rangeMax) const
89 {
90  // Calculate Delta Phi.
91 
92  Double_t dphi = -999;
93  const Double_t tpi = TMath::TwoPi();
94 
95  if (phia < 0) phia += tpi;
96  else if (phia > tpi) phia -= tpi;
97  if (phib < 0) phib += tpi;
98  else if (phib > tpi) phib -= tpi;
99  dphi = phib - phia;
100  if (dphi < rangeMin) dphi += tpi;
101  else if (dphi > rangeMax) dphi -= tpi;
102 
103  return dphi;
104 }
105 
106 //________________________________________________________________________
108 {
109  // Fill histograms.
110 
111  AliVEvent *event = InputEvent();
112  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
113 
114  UInt_t trig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
115  for (Int_t i=0;i<31;++i) {
116  if (trig & (1<<i))
117  fHists[0]->Fill(i);
118  }
119 
120  Double_t vz = event->GetPrimaryVertex()->GetZ();
121  fHists[1]->Fill(vz);
122 
123  Int_t run = event->GetRunNumber();
124  Int_t vzn = event->GetPrimaryVertex()->GetNContributors();
125  if ((vzn<1)&&(run>0))
126  return kTRUE;
127  fHists[2]->Fill(vz);
128 
129  if (TMath::Abs(vz)>10)
130  return kTRUE;
131 
132  if (fDo2013VertexCut) {
133  if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
134  AliAnalysisUtils anau;
135  if (anau.IsFirstEventInChunk(event))
136  return kFALSE;
137  if (!anau.IsVertexSelected2013pA(event))
138  return kFALSE;
139  }
140  }
141 
142  // accepted events
143  fHists[9]->Fill(1,run);
144 
145  AliMultSelection *ms = dynamic_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
146  Double_t v0acent=-1,znacent=-1,v0mcent=-1;
147  if (ms) {
148  v0acent = ms->GetMultiplicityPercentile("V0A");
149  znacent = ms->GetMultiplicityPercentile("ZNA");
150  v0mcent = ms->GetMultiplicityPercentile("V0M");
151  } else {
152  AliCentrality *cent = InputEvent()->GetCentrality();
153  v0acent = cent->GetCentralityPercentile("V0A");
154  znacent = cent->GetCentralityPercentile("ZNA");
155  v0mcent = cent->GetCentralityPercentile("V0M");
156  }
157  fHists[10]->Fill(v0acent);
158  fHists[11]->Fill(znacent);
159  fHists[12]->Fill(v0mcent);
160 
161  if (fDoTracking) {
162  const Int_t ntracks = fTracks->GetEntries();
163  if (fTracks) {
164  for (Int_t i=0; i<ntracks; ++i) {
165  AliVTrack *track = dynamic_cast<AliVTrack*>(fTracks->At(i));
166  if (!track)
167  continue;
168  if (track->Charge()==0)
169  continue;
170 
171  AliPicoTrack *picot = dynamic_cast<AliPicoTrack*>(track);
172  if (picot && picot->GetTrack())
173  track = picot->GetTrack();
174 
175  Double_t phi = track->Phi();
176  Double_t eta = track->Eta();
177  Double_t pt = track->Pt();
178  fHists[20]->Fill(phi,eta);
179  fHists[21]->Fill(phi,pt);
180  fHists[22]->Fill(eta,pt);
181  if (TMath::Abs(eta)<0.8) {
182  fHists[23]->Fill(pt,v0acent);
183  fHists[24]->Fill(pt,znacent);
184  }
185  Int_t ttype = AliPicoTrack::GetTrackType(track);
186  fHists[25+ttype]->Fill(phi,pt);
187  if (track->IsExtrapolatedToEMCAL()) {
188  Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
189  fHists[28]->Fill(dphi,pt);
190  } else {
191  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
192  if (track->IsExtrapolatedToEMCAL()) {
193  Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
194  fHists[29]->Fill(dphi,pt);
195  }
196  }
197  if (track->IsEMCAL() && track->IsExtrapolatedToEMCAL()) {
198  Int_t id = track->GetEMCALcluster();
199  AliVCluster *clus = InputEvent()->GetCaloCluster(id);
200  if (id>=0&&clus) {
201  Float_t pos[3];
202  clus->GetPosition(pos);
203  TVector3 vpos(pos);
204  Double_t dphi = TVector2::Phi_mpi_pi(vpos.Phi()-track->GetTrackPhiOnEMCal());
205  fHists[30]->Fill(dphi,pt);
206  }
207  }
208  if (track->IsExtrapolatedToEMCAL()) {
209  Double_t phi1 = track->GetTrackPhiOnEMCal();
210  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
211  Double_t phi2 = track->GetTrackPhiOnEMCal();
212  Double_t dphi = TVector2::Phi_mpi_pi(phi1-phi2);
213  fHists[31]->Fill(dphi,pt);
214  }
215  }
216  }
217  }
218 
219  if (fDoMuonTracking) {
220  AliAODEvent *aod = dynamic_cast<AliAODEvent*>(InputEvent());
221  if (aod) {
222  for (Int_t iMu = 0; iMu<aod->GetNumberOfTracks(); ++iMu) {
223  AliAODTrack* muonTrack = static_cast<AliAODTrack*>(aod->GetTrack(iMu));
224  if (!muonTrack)
225  continue;
226  if (!muonTrack->IsMuonTrack())
227  continue;
228  Double_t dThetaAbs = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.)* TMath::RadToDeg();
229  if ((dThetaAbs<2.) || (dThetaAbs>10.))
230  continue;
231  Double_t dEta = muonTrack->Eta();
232  if ((dEta<-4.) || (dEta>-2.5))
233  continue;
234  if (0) {
235  if (muonTrack->GetMatchTrigger()<0.5)
236  continue;
237  }
238  Double_t ptMu = muonTrack->Pt();
239  Double_t etaMu = muonTrack->Eta();
240  Double_t phiMu = muonTrack->Phi();
241  fHists[50]->Fill(phiMu,etaMu);
242  fHists[51]->Fill(phiMu,ptMu);
243  fHists[52]->Fill(etaMu,ptMu);
244  fHists[53]->Fill(ptMu,v0acent);
245  fHists[54]->Fill(ptMu,znacent);
246  }
247  } else {
248  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
249  if (esd) {
250  for (Int_t iMu = 0; iMu<esd->GetNumberOfMuonTracks(); ++iMu) {
251  AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iMu);
252  if (!muonTrack)
253  continue;
254  if (!muonTrack->ContainTrackerData())
255  continue;
256  Double_t thetaTrackAbsEnd = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.) * TMath::RadToDeg();
257  if ((thetaTrackAbsEnd < 2.) || (thetaTrackAbsEnd > 10.))
258  continue;
259  Double_t eta = muonTrack->Eta();
260  if ((eta < -4.) || (eta > -2.5))
261  return kFALSE;
262  if (0) {
263  if (!muonTrack->ContainTriggerData())
264  continue;
265  if (muonTrack->GetMatchTrigger() < 0.5)
266  continue;
267  }
268  }
269  }
270  }
271  }
272 
273  return kTRUE;
274 }
275 
276 //________________________________________________________________________
278 {
279  // Retrieve event objects.
280 
282  return kFALSE;
283 
284  return kTRUE;
285 }
286 
287 //________________________________________________________________________
289 {
290  // Run various functions.
291 
293  RunHet(fHetEtmin);
294 
295  return kTRUE;
296 }
297 
298 //________________________________________________________________________
300 {
301  // Run cumulant analysis.
302 
303  if (!fDoCumulants)
304  return;
305 
306  if (!fTracks)
307  return;
308 
309  Bool_t isMC = 0;
310  TString tname(fTracks->GetName());
311  if (tname.Contains("mc"))
312  isMC = 1;
313 
314  const Int_t ntracks = fTracks->GetEntries();
315  Int_t Mall=0,M=0,Mall2=0;
316  Double_t ptmaxall=0,ptsumall=0,pt2sumall=0,ptsumall2=0;
317  Double_t tsa00=0,tsa10=0,tsa11=0;
318  Double_t Q2r=0,Q2i=0;
319  Double_t Q3r=0,Q3i=0;
320  Double_t Q4r=0,Q4i=0;
321  Double_t Q6r=0,Q6i=0;
322  Double_t mpt=0,mpt2=0,ptmaxq=0;
323  Double_t ts00=0,ts10=0,ts11=0;
324  Double_t v0ach=0, v0cch=0;
325  Double_t cl1ch=0;
326 
327  for (Int_t i =0; i<ntracks; ++i) {
328  AliVParticle *track = dynamic_cast<AliVParticle*>(fTracks->At(i));
329  if (!track)
330  continue;
331  if (track->Charge()==0)
332  continue;
333  Double_t eta = track->Eta();
334  if ((eta<5.1)&&(eta>2.8))
335  ++v0ach;
336  else if ((eta>-3.7)&&(eta<-1.7))
337  ++v0cch;
338  if (TMath::Abs(eta)<1.4) {
339  ++cl1ch;
340  }
341  if ((eta<etamin) || (eta>etamax))
342  continue;
343  Double_t pt = track->Pt();
344  if (pt>ptmaxall)
345  ptmaxall = pt;
346  if (pt>1) {
347  ptsumall2 += pt;
348  ++Mall2;
349  }
350  ptsumall +=pt;
351  pt2sumall +=pt*pt;
352  Double_t px = track->Px();
353  Double_t py = track->Py();
354  tsa00 += px*px/pt;
355  tsa10 += px*py/pt;
356  tsa11 += py*py/pt;
357  ++Mall;
358  if ((pt<ptmin) || (pt>ptmax))
359  continue;
360  if (pt>ptmaxq)
361  ptmaxq = pt;
362  Double_t phi = track->Phi();
363  ++M;
364  mpt += pt;
365  mpt2 += pt*pt;
366  ts00 += px*px/pt;
367  ts10 += px*py/pt;
368  ts11 += py*py/pt;
369  Q2r += TMath::Cos(2*phi);
370  Q2i += TMath::Sin(2*phi);
371  Q3r += TMath::Cos(3*phi);
372  Q3i += TMath::Sin(3*phi);
373  Q4r += TMath::Cos(4*phi);
374  Q4i += TMath::Sin(4*phi);
375  Q6r += TMath::Cos(6*phi);
376  Q6i += TMath::Sin(6*phi);
377  }
378 
379  if (M<=1)
380  return;
381 
382  Int_t pmult=0;
383  Double_t v2g=0;
384  Double_t v3g=0;
385  Int_t pmult14=0;
386  Double_t v2g14=0;
387  Double_t v3g14=0;
388  Int_t pmult18=0;
389  Double_t v2g18=0;
390  Double_t v3g18=0;
391  for (Int_t i=0; i<ntracks; ++i) {
392  AliVParticle *track1 = dynamic_cast<AliVParticle*>(fTracks->At(i));
393  if (!track1)
394  continue;
395  if (track1->Charge()==0)
396  continue;
397  Double_t eta1 = track1->Eta();
398  if ((eta1<etamin) || (eta1>etamax))
399  continue;
400  Double_t pt1 = track1->Pt();
401  if ((pt1<ptmin) || (pt1>ptmax))
402  continue;
403  Double_t phi1 = track1->Phi();
404  for (Int_t j = i+1; j<ntracks; ++j) {
405  AliVParticle *track2 = dynamic_cast<AliVParticle*>(fTracks->At(j));
406  if (!track2)
407  continue;
408  if (track2->Charge()==0)
409  continue;
410  Double_t eta2 = track2->Eta();
411  if ((eta2<etamin) || (eta2>etamax))
412  continue;
413  Double_t pt2 = track2->Pt();
414  if ((pt2<ptmin) || (pt2>ptmax))
415  continue;
416  ((TH3*)fHists[128])->Fill(DeltaPhi(phi1,track2->Phi()),eta1-eta2,M);
417  fHists[129]->Fill(M);
418  Double_t deta=TMath::Abs(eta1-eta2);
419  if(deta<1)
420  continue;
421  Double_t dphi=TVector2::Phi_0_2pi(phi1-track2->Phi());
422  pmult++;
423  v2g+=TMath::Cos(2*dphi);
424  v3g+=TMath::Cos(3*dphi);
425  if (deta>1.4) {
426  pmult14++;
427  v2g14+=TMath::Cos(2*dphi);
428  v3g14+=TMath::Cos(3*dphi);
429  }
430  if (deta>1.8) {
431  pmult18++;
432  v2g18+=TMath::Cos(2*dphi);
433  v3g18+=TMath::Cos(3*dphi);
434  }
435  }
436  }
437 
438  if (pmult>0) {
439  v2g/=pmult;
440  v3g/=pmult;
441  }
442  if (pmult14>0) {
443  v2g14/=pmult14;
444  v3g14/=pmult14;
445  }
446  if (pmult18>0) {
447  v2g18/=pmult18;
448  v3g18/=pmult18;
449  }
450 
451  std::complex<double> q2(Q2r,Q2i);
452  std::complex<double> q3(Q3r,Q3i);
453  std::complex<double> q4(Q4r,Q4i);
454  std::complex<double> q6(Q6r,Q6i);
455  Double_t Q22 = std::abs(q2)*std::abs(q2);
456  Double_t Q32 = std::abs(q3)*std::abs(q3);
457  Double_t Q42 = std::abs(q4)*std::abs(q4);
458  Double_t Q62 = std::abs(q6)*std::abs(q6);
459  Double_t Q32re = std::real(q6*std::conj(q3)*std::conj(q3));
460  Double_t Q42re = std::real(q4*std::conj(q2)*std::conj(q2));
461  Double_t Q6are = std::real(q4*q2*std::conj(q2)*std::conj(q2)*std::conj(q2));
462  Double_t Q6bre = std::real(q6*std::conj(q2)*std::conj(q2)*std::conj(q2));
463  Double_t Q6cre = std::real(q6*std::conj(q4)*std::conj(q2));
464 
465  Double_t tsall = -1;
466  Double_t tsax = (tsa00+tsa11)*(tsa00+tsa11)-4*(tsa00*tsa11-tsa10*tsa10);
467  if (tsax>=0) {
468  Double_t l1 = 0.5*(tsa00+tsa11+TMath::Sqrt(tsax))/ptsumall;
469  Double_t l2 = 0.5*(tsa00+tsa11-TMath::Sqrt(tsax))/ptsumall;
470  tsall = 2*l2/(l1+l2);
471  }
472 
473  Double_t ts = -1;
474  Double_t tsx = (ts00+ts11)*(ts00+ts11)-4*(ts00*ts11-ts10*ts10);
475  if (tsx>=0) {
476  Double_t l1 = 0.5*(ts00+ts11+TMath::Sqrt(tsx))/ptsumall;
477  Double_t l2 = 0.5*(ts00+ts11-TMath::Sqrt(tsx))/ptsumall;
478  ts = 2*l2/(l1+l2);
479  }
480 
481  if (isMC) {
482  fHists[106]->Fill(cl1ch);
483  fHists[107]->Fill(v0ach);
484  fHists[108]->Fill(v0cch);
485  AliCentrality *cent = InputEvent()->GetCentrality();
486  if (fCentCL1In) {
487  cent->SetCentralityCL1(100*fCentCL1In->GetBinContent(fCentCL1In->FindBin(cl1ch)));
488  cent->SetQuality(0);
489  }
490  if (fCentV0AIn) {
491  cent->SetCentralityV0A(100*fCentV0AIn->GetBinContent(fCentV0AIn->FindBin(v0ach)));
492  cent->SetQuality(0);
493  }
494  }
495 
496  AliAnalysisUtils anau;
497  AliVEvent *event = InputEvent();
498  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
499 
500  fNtupCumInfo->fTrig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
501  fNtupCumInfo->fRun = event->GetRunNumber();
502  fNtupCumInfo->fVz = event->GetPrimaryVertex()->GetZ();
503  fNtupCumInfo->fIsFEC = anau.IsFirstEventInChunk(event);
504  fNtupCumInfo->fIsVSel = anau.IsVertexSelected2013pA(event);
505  fNtupCumInfo->fIsP = event->IsPileupFromSPD(3/*minContributors*/,
506  0.8/*minZdist*/,
507  3./*nSigmaZdist*/,
508  2./*nSigmaDiamXY*/,
509  5./*nSigmaDiamZ*/);
510 
511  fNtupCumInfo->fMall = Mall;
512  fNtupCumInfo->fMall2 = Mall2;
513  fNtupCumInfo->fPtMaxall = ptmaxall;
514  fNtupCumInfo->fMPtall = ptsumall/Mall;
515  fNtupCumInfo->fMPt2all = pt2sumall/Mall;
516  if (Mall2>0)
517  fNtupCumInfo->fMPtall2 = ptsumall2/Mall2;
518  else
519  fNtupCumInfo->fMPtall2 = -1;
520  fNtupCumInfo->fTSall = tsall;
521  fNtupCumInfo->fM = M;
522  fNtupCumInfo->fQ2abs = Q22;
523  fNtupCumInfo->fQ4abs = Q42;
524  fNtupCumInfo->fQ42re = Q42re;
525  fNtupCumInfo->fCos2phi = Q2r;
526  fNtupCumInfo->fSin2phi = Q2i;
527  fNtupCumInfo->fPtMax = ptmaxq;
528  fNtupCumInfo->fMPt = mpt/M;
529  fNtupCumInfo->fMPt2 = mpt2/M;
530  fNtupCumInfo->fTS = ts;
531 
532  if (isMC) {
533  fNtupCumInfo->fMV0M = v0ach + v0cch;
534  } else {
535  AliVVZERO *vzero = InputEvent()->GetVZEROData();
536  fNtupCumInfo->fMV0M = vzero->GetMTotV0A()+vzero->GetMTotV0C();
537  }
538 
539  AliMultSelection *ms = dynamic_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
540  if (ms) {
541  fNtupCumInfo->fCl1 = ms->GetMultiplicityPercentile("CL1");
542  fNtupCumInfo->fV0M = ms->GetMultiplicityPercentile("V0M");
543  fNtupCumInfo->fV0MEq = ms->GetMultiplicityPercentile("V0MEq");
544  fNtupCumInfo->fV0A = ms->GetMultiplicityPercentile("V0A");
545  fNtupCumInfo->fV0AEq = ms->GetMultiplicityPercentile("V0AEq");
546  fNtupCumInfo->fZNA = ms->GetMultiplicityPercentile("ZNA");
547  } else {
548  AliCentrality *cent = InputEvent()->GetCentrality();
549  fNtupCumInfo->fCl1 = cent->GetCentralityPercentile("CL1");
550  fNtupCumInfo->fV0M = cent->GetCentralityPercentile("V0M");
551  fNtupCumInfo->fV0MEq = cent->GetCentralityPercentile("V0MEq");
552  fNtupCumInfo->fV0A = cent->GetCentralityPercentile("V0A");
553  fNtupCumInfo->fV0AEq = cent->GetCentralityPercentile("V0AEq");
554  fNtupCumInfo->fZNA = cent->GetCentralityPercentile("ZNA");
555  }
556 
557  AliVZDC *vZDC = InputEvent()->GetZDCData();
558  const Double_t *znaTowers = vZDC->GetZNATowerEnergy();
559  fNtupZdcInfo->fZna0 = znaTowers[0];
560  fNtupZdcInfo->fZna1 = znaTowers[1];
561  fNtupZdcInfo->fZna2 = znaTowers[2];
562  fNtupZdcInfo->fZna3 = znaTowers[3];
563  fNtupZdcInfo->fZna4 = znaTowers[4];
564 
565  if (fDoCumNtuple && (M>=Mmin)) {
566  fNtupCum->Fill();
567  }
568 
569  fHists[109]->Fill(fNtupCumInfo->fCl1);
570  fHists[110]->Fill(fNtupCumInfo->fV0A);
571  fHists[111]->Fill(fNtupCumInfo->fZNA);
572 
573  Bool_t fillCumHist = kTRUE;
574  if (fillCumHist) {
575  Int_t run = InputEvent()->GetRunNumber();
576  if (fDo2013VertexCut) {
577  if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
578  if (anau.IsFirstEventInChunk(event))
579  fillCumHist = kFALSE;
580  if (!anau.IsVertexSelected2013pA(event))
581  fillCumHist = kFALSE;
582  }
583  }
584  Double_t vz = InputEvent()->GetPrimaryVertex()->GetZ();
585  if (TMath::Abs(vz)>10)
586  fillCumHist = kFALSE;
587  }
588  if (fillCumHist) {
589  AliVVZERO *vzero = InputEvent()->GetVZEROData();
590  Double_t v0a = vzero->GetMTotV0A();
591  Double_t v0c = vzero->GetMTotV0C();
592  Double_t v0m = vzero->GetMTotV0A()+vzero->GetMTotV0C();
593  fHists[112]->Fill(Mall);
594  fHists[113]->Fill(M);
595  fHists[117]->Fill(v0a,M);
596  fHists[118]->Fill(v0c,M);
597  fHists[119]->Fill(v0m,M);
598  if (M>1) {
599  fHists[114]->Fill(M,(Q22-M)/M/(M-1));
600  fHists[120]->Fill(M,(Q32-M)/M/(M-1));
601  fHists[122]->Fill(M,v2g);
602  fHists[123]->Fill(M,v3g);
603  fHists[124]->Fill(M,v2g14);
604  fHists[125]->Fill(M,v3g14);
605  fHists[126]->Fill(M,v2g18);
606  fHists[127]->Fill(M,v3g18);
607  fHists[130]->Fill(M,Q2r/M);
608  fHists[131]->Fill(M,Q2i/M);
609  fHists[132]->Fill(M,Q3r/M);
610  fHists[133]->Fill(M,Q3i/M);
611  fHists[134]->Fill(M,Q4r/M);
612  fHists[135]->Fill(M,Q4i/M);
613  fHists[136]->Fill(M,Q6r/M);
614  fHists[137]->Fill(M,Q6i/M);
615  }
616  if (M>3) {
617  Double_t qc4tmp = (Q22*Q22+Q42-2*Q42re-4*(M-2)*Q22+2*M*(M-3));
618  fHists[115]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
619  qc4tmp = (Q32*Q32+Q62-2*Q32re-4*(M-2)*Q32+2*M*(M-3));
620  fHists[121]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
621  }
622  if (M>5) {
623  Double_t qc6tmp = Q22*Q22*Q22 + 9*Q42*Q22 - 6*Q6are
624  + 4*Q6bre - 12*Q6cre
625  + 18*(M-4)*Q42re + 4*Q62
626  - 9*(M-4)*Q22*Q22 - 9*(M-4)*Q42
627  + 18*(M-2)*(M-5)*Q22
628  - 6*M*(M-4)*(M-5);
629  fHists[116]->Fill(M,qc6tmp/M/(M-1)/(M-2)/(M-3)/(M-4)/(M-5));
630  }
631  }
632 
633  if ((isMC) ||
634  ((TMath::Abs(fNtupCumInfo->fVz)<10) && !fNtupCumInfo->fIsFEC && fNtupCumInfo->fIsVSel)) {
635  for (Int_t i =0; i<ntracks; ++i) {
636  AliVParticle *track1 = dynamic_cast<AliVParticle*>(fTracks->At(i));
637  if (!track1)
638  continue;
639  Double_t phi1 = track1->Phi();
640  Double_t eta1 = track1->Eta();
641  Double_t pt1 = track1->Pt();
642  ((TH3*)fHists[103])->Fill(pt1,eta1,fNtupCumInfo->fCl1);
643  ((TH3*)fHists[104])->Fill(pt1,eta1,fNtupCumInfo->fV0A);
644  ((TH3*)fHists[105])->Fill(pt1,eta1,fNtupCumInfo->fZNA);
645  if ((eta1<etamin) || (eta1>etamax))
646  continue;
647  if ((pt1<ptmin) || (pt1>ptmax))
648  continue;
649  for (Int_t j =0; j<ntracks; ++j) {
650  AliVParticle *track2 = dynamic_cast<AliVParticle*>(fTracks->At(j));
651  if (!track2)
652  continue;
653  Double_t eta2 = track2->Eta();
654  if ((eta2<etamin) || (eta2>etamax))
655  continue;
656  Double_t pt2 = track2->Pt();
657  if ((pt2<ptmin) || (pt2>ptmax))
658  continue;
659  Double_t phi2 = track2->Phi();
660  Double_t deta = eta1-eta2;
661  Double_t dphi = phi1-phi2;
662  while (dphi<-TMath::Pi())
663  dphi+=TMath::TwoPi();
664  while (dphi>3*TMath::Pi()/2)
665  dphi-=TMath::TwoPi();
666  ((TH3*)fHists[100])->Fill(dphi,deta,fNtupCumInfo->fCl1);
667  ((TH3*)fHists[101])->Fill(dphi,deta,fNtupCumInfo->fV0A);
668  ((TH3*)fHists[102])->Fill(dphi,deta,fNtupCumInfo->fZNA);
669  }
670  }
671  }
672 }
673 
674 //________________________________________________________________________
676 {
677  // Run het analysis.
678 
679  if (!fDoHet)
680  return;
681 }
682 
683 //________________________________________________________________________
685 {
686  // Set parameters for cumulants.
687 
688  fCumMmin = Mmin;
689  fCumPtMin = ptmin;
690  fCumPtMax = ptmax;
691  fCumEtaMin = etamin;
692  fCumEtaMax = etamax;
693 }
694 
695 //________________________________________________________________________
697 {
698  // Set parameters for het.
699 
700  fHetEtmin = etmin;
701 }
702 
703 //________________________________________________________________________
705 {
706  // Create histograms
707 
709 
710  fHists[0] = new TH1D("fTrigBits",";bit",32,-0.5,31.5);
711  fOutput->Add(fHists[0]);
712  fHists[1] = new TH1D("fVertexZ",";vertex z (cm)",51,-25.5,25.5);
713  fOutput->Add(fHists[1]);
714  fHists[2] = new TH1D("fVertexZnc",";vertex z (cm)",51,-25.5,25.5);
715  fOutput->Add(fHists[2]);
716  fHists[9] = new TProfile("fAccepted","",1,0.5,1.5);
717  fOutput->Add(fHists[9]);
718  fHists[10] = new TH1D("fV0ACent",";percentile",20,0,100);
719  fOutput->Add(fHists[10]);
720  fHists[11] = new TH1D("fZNACent",";percentile",20,0,100);
721  fOutput->Add(fHists[11]);
722  fHists[12] = new TH1D("fV0MCent",";percentile",20,0,100);
723  fOutput->Add(fHists[12]);
724 
725  if (fDoTracking) {
726  fHists[20] = new TH2D("fPhiEtaTracks",";#phi;#eta",60,0,TMath::TwoPi(),20,-2,2);
727  fHists[20]->Sumw2();
728  fOutput->Add(fHists[20]);
729  fHists[21] = new TH2D("fPhiPtTracks",";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
730  fHists[21]->Sumw2();
731  fOutput->Add(fHists[21]);
732  fHists[22] = new TH2D("fEtaPtTracks",";#eta;p_{T} (GeV/c)",20,-2,2,40,0,20);
733  fHists[22]->Sumw2();
734  fOutput->Add(fHists[22]);
735  fHists[23] = new TH2D("fPtV0ATracks",";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
736  fHists[23]->Sumw2();
737  fOutput->Add(fHists[23]);
738  fHists[24] = new TH2D("fPtZNATracks",";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
739  fHists[24]->Sumw2();
740  fOutput->Add(fHists[24]);
741  fHists[25] = new TH2D("fPhiPtTracks_type0",";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
742  fHists[25]->Sumw2();
743  fOutput->Add(fHists[25]);
744  fHists[26] = new TH2D("fPhiPtTracks_type1",";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
745  fHists[26]->Sumw2();
746  fOutput->Add(fHists[26]);
747  fHists[27] = new TH2D("fPhiPtTracks_type2",";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
748  fHists[27]->Sumw2();
749  fOutput->Add(fHists[27]);
750  fHists[28] = new TH2D("fDPhiPtTracks",";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
751  fHists[28]->Sumw2();
752  fOutput->Add(fHists[28]);
753  fHists[29] = new TH2D("fDPhiPtTracks2",";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
754  fHists[29]->Sumw2();
755  fOutput->Add(fHists[29]);
756  fHists[30] = new TH2D("fDPhiPtClusTracks",";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
757  fHists[30]->Sumw2();
758  fOutput->Add(fHists[30]);
759  fHists[31] = new TH2D("fDPhiPtReTracks",";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
760  fHists[31]->Sumw2();
761  fOutput->Add(fHists[31]);
762  }
763 
764  if (fDoMuonTracking) {
765  fHists[50] = new TH2D("fPhiEtaMuonTracks",";#phi;#eta",60,0,TMath::TwoPi(),15,-4,-2.5);
766  fHists[50]->Sumw2();
767  fOutput->Add(fHists[50]);
768  fHists[51] = new TH2D("fPhiPtMuonTracks",";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),200,0,20);
769  fHists[51]->Sumw2();
770  fOutput->Add(fHists[51]);
771  fHists[52] = new TH2D("fEtaPtMuonTracks",";#eta;p_{T} (GeV/c)",15,-4,-2.5,200,0,20);
772  fHists[52]->Sumw2();
773  fOutput->Add(fHists[52]);
774  fHists[53] = new TH2D("fPtV0AMuonTracks",";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
775  fHists[53]->Sumw2();
776  fOutput->Add(fHists[53]);
777  fHists[54] = new TH2D("fPtZNAMuonTracks",";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
778  fHists[54]->Sumw2();
779  fOutput->Add(fHists[54]);
780  }
781 
782  if (fDoCumulants) {
783  fHists[100] = new TH3D("fCumPhiEtaCl1",";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
784  fOutput->Add(fHists[100]);
785  fHists[101] = new TH3D("fCumPhiEtaV0A",";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
786  fOutput->Add(fHists[101]);
787  fHists[102] = new TH3D("fCumPhiEtaZNA",";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
788  fOutput->Add(fHists[102]);
789  fHists[103] = new TH3D("fCumPtEtaCl1",";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
790  fOutput->Add(fHists[103]);
791  fHists[104] = new TH3D("fCumPtEtaV0A",";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
792  fOutput->Add(fHists[104]);
793  fHists[105] = new TH3D("fCumPtEtaZNA",";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
794  fOutput->Add(fHists[105]);
795  fHists[106] = new TH1D("fCumCL1MC",";#tracks",fCumMbins,0,fCumMbins);
796  fOutput->Add(fHists[106]);
797  fHists[107] = new TH1D("fCumV0AMC",";#tracks",fCumMbins,0,fCumMbins);
798  fOutput->Add(fHists[107]);
799  fHists[108] = new TH1D("fCumV0CMC",";#tracks",fCumMbins,0,fCumMbins);
800  fOutput->Add(fHists[108]);
801  fHists[109] = new TH1D("fCumCl1Cent",";percentile",10,0,100);
802  fOutput->Add(fHists[109]);
803  fHists[110] = new TH1D("fCumV0ACent",";percentile",10,0,100);
804  fOutput->Add(fHists[110]);
805  fHists[111] = new TH1D("fCumZNACent",";percentile",10,0,100);
806  fOutput->Add(fHists[111]);
807  fHists[112] = new TH1D("fCumMall",";mult",fCumMbins,0,fCumMbins);
808  fOutput->Add(fHists[112]);
809  fHists[113] = new TH1D("fCumM",";mult",fCumMbins,0,fCumMbins);
810  fOutput->Add(fHists[113]);
811  fHists[114] = new TProfile("fCumQC2",";qc2",fCumMbins,0,fCumMbins);
812  fOutput->Add(fHists[114]);
813  fHists[115] = new TProfile("fCumQC4",";qc4",fCumMbins,0,fCumMbins);
814  fOutput->Add(fHists[115]);
815  fHists[116] = new TProfile("fCumQC6",";qc6",fCumMbins,0,fCumMbins);
816  fOutput->Add(fHists[116]);
817  Int_t v0bins=1000;
818  if (fCumMbins>1000)
819  v0bins=25000;
820  fHists[117] = new TH2D("fCumV0ACentVsM",";v0a;M",v0bins,0,v0bins,fCumMbins,0,fCumMbins);
821  fOutput->Add(fHists[117]);
822  fHists[118] = new TH2D("fCumV0CCentVsM",";v0c;M",v0bins,0,v0bins,fCumMbins,0,fCumMbins);
823  fOutput->Add(fHists[118]);
824  fHists[119] = new TH2D("fCumV0MCentVsM",";v0m;M",v0bins,0,v0bins,fCumMbins,0,fCumMbins);
825  fOutput->Add(fHists[119]);
826  fHists[120] = new TProfile("fCum3QC2",";qc2",fCumMbins,0,fCumMbins);
827  fOutput->Add(fHists[120]);
828  fHists[121] = new TProfile("fCum3QC4",";qc4",fCumMbins,0,fCumMbins);
829  fOutput->Add(fHists[121]);
830  fHists[122] = new TProfile("fEtaGapV2",";M",fCumMbins,0,fCumMbins);
831  fOutput->Add(fHists[122]);
832  fHists[123] = new TProfile("fEtaGapV3",";M",fCumMbins,0,fCumMbins);
833  fOutput->Add(fHists[123]);
834  fHists[124] = new TProfile("fEtaGapV214",";M",fCumMbins,0,fCumMbins);
835  fOutput->Add(fHists[124]);
836  fHists[125] = new TProfile("fEtaGapV314",";M",fCumMbins,0,fCumMbins);
837  fOutput->Add(fHists[125]);
838  fHists[126] = new TProfile("fEtaGapV218",";M",fCumMbins,0,fCumMbins);
839  fOutput->Add(fHists[126]);
840  fHists[127] = new TProfile("fEtaGapV318",";M",fCumMbins,0,fCumMbins);
841  fOutput->Add(fHists[127]);
842  fHists[128] = new TH3D("fDPhiDEtaTracks",";#Delta#phi;#Delta#eta;M",64,-0.5*TMath::Pi(),1.5*TMath::Pi(),60,-3,3,fCumMbins/10,0,fCumMbins);
843  fHists[128]->Sumw2();
844  fOutput->Add(fHists[128]);
845  fHists[129] = new TH1D("fDPhiDEtaTrigs",";M",fCumMbins/10,0,fCumMbins);
846  fHists[129]->Sumw2();
847  fOutput->Add(fHists[129]);
848  fHists[130] = new TProfile("fCumQ2r",";q2r",fCumMbins,0,fCumMbins);
849  fOutput->Add(fHists[130]);
850  fHists[131] = new TProfile("fCumQ2i",";q2i",fCumMbins,0,fCumMbins);
851  fOutput->Add(fHists[131]);
852  fHists[132] = new TProfile("fCumQ3r",";q3r",fCumMbins,0,fCumMbins);
853  fOutput->Add(fHists[132]);
854  fHists[133] = new TProfile("fCumQ3i",";q3i",fCumMbins,0,fCumMbins);
855  fOutput->Add(fHists[133]);
856  fHists[134] = new TProfile("fCumQ4r",";q4r",fCumMbins,0,fCumMbins);
857  fOutput->Add(fHists[134]);
858  fHists[135] = new TProfile("fCumQ4i",";q4i",fCumMbins,0,fCumMbins);
859  fOutput->Add(fHists[135]);
860  fHists[136] = new TProfile("fCumQ6r",";q6r",fCumMbins,0,fCumMbins);
861  fOutput->Add(fHists[136]);
862  fHists[137] = new TProfile("fCumQ6i",";q6i",fCumMbins,0,fCumMbins);
863  fOutput->Add(fHists[137]);
864 
865  fNtupCum = new TTree("NtupCum", "Ntuple for cumulant analysis");
866  if (1) {
867  fNtupCum->SetDirectory(0);
868  } else {
869  TFile *f = OpenFile(1);
870  if (f) {
871  f->SetCompressionLevel(2);
872  fNtupCum->SetDirectory(f);
873  fNtupCum->SetAutoFlush(-4*1024*1024);
874  fNtupCum->SetAutoSave(0);
875  }
876  }
878  fNtupCum->Branch("cumulants", &fNtupCumInfo, 32*1024, 99);
880  fNtupCum->Branch("zdc", &fNtupZdcInfo, 32*1024, 99);
881  if (fDoCumNtuple)
882  fOutput->Add(fNtupCum);
883  }
884 
885  if (fDoHet) {
886  fNtupHet = new TTree("NtupHet", "Ntuple for het analysis");
887  if (1) {
888  fNtupHet->SetDirectory(0);
889  } else {
890  TFile *f = OpenFile(1);
891  if (f) {
892  f->SetCompressionLevel(2);
893  fNtupHet->SetDirectory(f);
894  fNtupHet->SetAutoFlush(-4*1024*1024);
895  fNtupHet->SetAutoSave(0);
896  }
897  }
899  fNtupHet->Branch("het", &fNtupHetInfo, 32*1024, 99);
900  fOutput->Add(fNtupHet);
901  }
902 
903  PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
904 }
void RunHet(Double_t Etmin)
double Double_t
Definition: External.C:58
Definition: External.C:244
void SetHetParams(Double_t Etmin)
Base task in the EMCAL framework.
ClassImp(AliAnalysisTaskCLQA) AliAnalysisTaskCLQA
Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rangeMin=-TMath::Pi()/2, Double_t rangeMax=3 *TMath::Pi()/2) const
pointers to histograms
AliNtupZdcInfo * fNtupZdcInfo
object holding cumulant results
const Double_t etamin
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void SetCumParams(Double_t Mmin, Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax)
const Double_t ptmax
Definition: External.C:252
Definition: External.C:228
Definition: External.C:212
const Double_t ptmin
Byte_t GetTrackType() const
Definition: AliPicoTrack.h:42
virtual Bool_t RetrieveEventObjects()
AliNtupHetInfo * fNtupHetInfo
ntuple for het analysis
AliVTrack * GetTrack() const
Definition: AliPicoTrack.h:59
Bool_t isMC
AliEmcalList * fOutput
!output list
TClonesArray * fTracks
!tracks
TH1 * fHists[1000]
object holding het info
const Double_t etamax
bool Bool_t
Definition: External.C:53
AliNtupCumInfo * fNtupCumInfo
ntuple for cumulant analysis
void RunCumulants(Double_t Mmin, Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
TTree * fNtupHet
object holding zdc info