AliPhysics  vAN-20150507 (0645659)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnaParticleHadronCorrelation.cxx
Go to the documentation of this file.
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 // --- ROOT system ---
17 #include <TClass.h>
18 #include <TMath.h>
19 #include <TH2F.h>
20 #include <TDatabasePDG.h>
21 #include "TParticle.h"
22 #include <TClonesArray.h>
23 #include <TList.h>
24 #include <TObjString.h>
25 
26 //---- ANALYSIS system ----
29 #include "AliCaloTrackReader.h"
30 #include "AliAODPWG4ParticleCorrelation.h"
31 #include "AliFiducialCut.h"
32 #include "AliVTrack.h"
33 #include "AliVCluster.h"
34 #include "AliMCAnalysisUtils.h"
35 #include "TParticle.h"
36 #include "AliStack.h"
37 #include "AliAODMCParticle.h"
38 #include "AliMixedEvent.h"
39 #include "AliAnalysisManager.h"
40 #include "AliInputEventHandler.h"
41 #include "AliEventplane.h"
42 #include "AliIsolationCut.h"
43 #include "AliESDEvent.h"
44 #include "AliAODEvent.h"
45 
46 // --- Detectors ---
47 #include "AliEMCALGeometry.h"
48 #include "AliPHOSGeoUtils.h"
49 
53 
54 
55 //___________________________________________________________________
57 //___________________________________________________________________
60 fFillAODWithReferences(0), fCheckLeadingWithNeutralClusters(0),
61 fMaxAssocPt(1000.), fMinAssocPt(0.),
62 fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
63 fSelectIsolated(0), fMakeSeveralUE(0),
64 fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.),
65 fPi0AODBranchName(""), fNeutralCorr(0),
66 fPi0Trigger(0), fDecayTrigger(0),
67 fNDecayBits(0), fDecayBits(),
68 fMakeAbsoluteLeading(0), fMakeNearSideLeading(0),
69 fLeadingTriggerIndex(-1), fHMPIDCorrelation(0), fFillBradHisto(0),
70 fNAssocPtBins(0), fAssocPtBinLimit(),
71 fCorrelVzBin(0),
72 fListMixTrackEvents(), fListMixCaloEvents(),
73 fUseMixStoredInReader(0), fFillNeutralEventMixPool(0),
74 fM02MaxCut(0), fM02MinCut(0),
75 fSelectLeadingHadronAngle(0), fFillLeadHadOppositeHisto(0),
76 fMinLeadHadPhi(0), fMaxLeadHadPhi(0),
77 fMinLeadHadPt(0), fMaxLeadHadPt(0),
78 fFillEtaGapsHisto(1), fFillMomImbalancePtAssocBinsHisto(0),
79 fFillInvMassHisto(0), fFillBkgBinsHisto(0),
80 fMCGenTypeMin(0), fMCGenTypeMax(0),
81 fTrackVector(), fMomentum(), fMomentumIM(),
82 fDecayMom1(), fDecayMom2(),
83 //Histograms
84 fhPtTriggerInput(0), fhPtTriggerSSCut(0),
85 fhPtTriggerIsoCut(0), fhPtTriggerFidCut(0),
86 fhPtTrigger(0), fhPtTriggerVtxBC0(0),
87 fhPtTriggerVzBin(0), fhPtTriggerBin(0),
88 fhPhiTrigger(0), fhEtaTrigger(0),
89 fhPtTriggerMC(),
90 fhPtDecayTrigger(), fhPtDecayTriggerMC(),
91 fhPtTriggerCentrality(0), fhPtTriggerEventPlane(0),
92 fhTriggerEventPlaneCentrality(0),
93 fhPtTriggerMixed(0), fhPtTriggerMixedVzBin(0), fhPtTriggerMixedBin(0),
94 fhPhiTriggerMixed(0), fhEtaTriggerMixed(0),
95 fhPtLeadingOppositeHadron(0), fhPtDiffPhiLeadingOppositeHadron(0), fhPtDiffEtaLeadingOppositeHadron(0),
96 fhPtNoLeadingOppositeHadron(0), fhEtaPhiNoLeadingOppositeHadron(0),
97 fhDeltaPhiDeltaEtaCharged(0),
98 fhPhiCharged(0), fhEtaCharged(0),
99 fhDeltaPhiCharged(0), fhDeltaEtaCharged(0),
100 fhDeltaPhiChargedPt(0), fhDeltaPhiUeChargedPt(0),
101 fhUePart(0),
102 fhXECharged(0), fhXECharged_Cone2(0), fhXEUeCharged(0),
103 fhXEPosCharged(0), fhXENegCharged(0),
104 fhPtHbpXECharged(0), fhPtHbpXECharged_Cone2(0), fhPtHbpXEUeCharged(0),
105 fhZTCharged(0), fhZTUeCharged(0),
106 fhZTPosCharged(0), fhZTNegCharged(0),
107 fhPtHbpZTCharged(0), fhPtHbpZTUeCharged(0),
108 fhXEChargedMC(), fhDeltaPhiChargedMC(),
109 fhXEUeChargedLeftMC(), fhXEUeChargedRightMC(),
110 fhDeltaPhiDeltaEtaChargedPtA3GeV(0),
111 fhDeltaPhiChargedPtA3GeV(0), fhDeltaEtaChargedPtA3GeV(0),
112 // Pile-Up
113 fhDeltaPhiChargedPileUp(), fhDeltaEtaChargedPileUp(),
114 fhDeltaPhiChargedPtA3GeVPileUp(), fhDeltaEtaChargedPtA3GeVPileUp(),
115 fhXEChargedPileUp(), fhXEUeChargedPileUp(),
116 fhZTChargedPileUp(), fhZTUeChargedPileUp(),
117 fhPtTrigChargedPileUp(),
118 fhDeltaPhiChargedOtherBC(), fhDeltaPhiChargedPtA3GeVOtherBC(),
119 fhXEChargedOtherBC(), fhXEUeChargedOtherBC(),
120 fhZTChargedOtherBC(), fhZTUeChargedOtherBC(),
121 fhPtTrigChargedOtherBC(),
122 fhDeltaPhiChargedBC0(), fhDeltaPhiChargedPtA3GeVBC0(),
123 fhXEChargedBC0(), fhXEUeChargedBC0(),
124 fhZTChargedBC0(), fhZTUeChargedBC0(),
125 fhPtTrigChargedBC0(),
126 fhDeltaPhiChargedVtxBC0(), fhDeltaPhiChargedPtA3GeVVtxBC0(),
127 fhXEChargedVtxBC0(), fhXEUeChargedVtxBC0(),
128 fhZTChargedVtxBC0(), fhZTUeChargedVtxBC0(),
129 fhPtTrigChargedVtxBC0(),
130 fhDeltaPhiUeLeftCharged(0),
131 fhDeltaPhiUeLeftUpCharged(0), fhDeltaPhiUeRightUpCharged(0),
132 fhDeltaPhiUeLeftDownCharged(0), fhDeltaPhiUeRightDownCharged(0),
133 fhXEUeLeftCharged(0),
134 fhXEUeLeftUpCharged(0), fhXEUeRightUpCharged(0),
135 fhXEUeLeftDownCharged(0), fhXEUeRightDownCharged(0),
136 fhPtHbpXEUeLeftCharged(0), fhZTUeLeftCharged(0),
137 fhPtHbpZTUeLeftCharged(0),
138 fhPtTrigPout(0), fhPtTrigCharged(0),
139 fhDeltaPhiChargedMult(0x0), fhDeltaEtaChargedMult(0x0),
140 fhXEMult(0x0), fhXEUeMult(0x0),
141 fhZTMult(0x0), fhZTUeMult(0x0),
142 fhAssocPtBkg(0), fhDeltaPhiDeltaEtaAssocPtBin(0),
143 fhDeltaPhiAssocPtBin(0),
144 fhDeltaPhiAssocPtBinDEta08(0), fhDeltaPhiAssocPtBinDEta0(0),
145 fhDeltaPhiAssocPtBinHMPID(0), fhDeltaPhiAssocPtBinHMPIDAcc(0),
146 fhDeltaPhiBradAssocPtBin(0), fhDeltaPhiBrad(0),
147 fhXEAssocPtBin(0), fhZTAssocPtBin(0),
148 fhXEVZ(0), fhZTVZ(0),
149 fhDeltaPhiDeltaEtaNeutral(0),
150 fhPhiNeutral(0), fhEtaNeutral(0),
151 fhDeltaPhiNeutral(0), fhDeltaEtaNeutral(0),
152 fhDeltaPhiNeutralPt(0), fhDeltaPhiUeNeutralPt(0),
153 fhXENeutral(0), fhXEUeNeutral(0),
154 fhPtHbpXENeutral(0), fhPtHbpXEUeNeutral(0),
155 fhZTNeutral(0), fhZTUeNeutral(0),
156 fhPtHbpZTNeutral(0), fhPtHbpZTUeNeutral(0),
157 fhDeltaPhiUeLeftNeutral(0), fhXEUeLeftNeutral(0),
158 fhPtHbpXEUeLeftNeutral(0), fhZTUeLeftNeutral(0),
159 fhPtHbpZTUeLeftNeutral(0), fhPtPi0DecayRatio(0),
160 fhDeltaPhiPi0DecayCharged(0), fhXEPi0DecayCharged(0), fhZTPi0DecayCharged(0),
161 fhDeltaPhiPi0DecayNeutral(0), fhXEPi0DecayNeutral(0), fhZTPi0DecayNeutral(0),
162 fhDeltaPhiDecayCharged(), fhXEDecayCharged(), fhZTDecayCharged(),
163 fhDeltaPhiDecayChargedAssocPtBin(),
164 fhMCPtTrigger(), fhMCPhiTrigger(), fhMCEtaTrigger(),
165 fhMCPtTriggerNotLeading(), fhMCPhiTriggerNotLeading(), fhMCEtaTriggerNotLeading(),
166 fhMCEtaCharged(), fhMCPhiCharged(),
167 fhMCDeltaEtaCharged(), fhMCDeltaPhiCharged(),
168 fhMCDeltaPhiDeltaEtaCharged(), fhMCDeltaPhiChargedPt(),
169 fhMCPtXECharged(), fhMCPtXEUeCharged(),
170 fhMCPtXEUeLeftCharged(),
171 fhMCPtHbpXECharged(), fhMCPtHbpXEUeCharged(),
172 fhMCPtHbpXEUeLeftCharged(),
173 fhMCUePart(),
174 fhMCPtZTCharged(), fhMCPtZTUeCharged(),
175 fhMCPtZTUeLeftCharged(),
176 fhMCPtHbpZTCharged(), fhMCPtHbpZTUeCharged(),
177 fhMCPtHbpZTUeLeftCharged(),
178 fhMCPtTrigPout(), fhMCPtAssocDeltaPhi(),
179 // Mixing
180 fhNEventsTrigger(0), fhNtracksMB(0), fhNclustersMB(0),
181 fhMixDeltaPhiCharged(0), fhMixDeltaPhiDeltaEtaCharged(0),
182 fhMixXECharged(0), fhMixXEUeCharged(0), fhMixHbpXECharged(0),
183 fhMixDeltaPhiChargedAssocPtBin(),
184 fhMixDeltaPhiChargedAssocPtBinDEta08(),
185 fhMixDeltaPhiChargedAssocPtBinDEta0(),
186 fhMixDeltaPhiDeltaEtaChargedAssocPtBin(),
187 fhEventBin(0), fhEventMixBin(0), fhEventMBBin(0),
188 fhMassPtTrigger(0), fhMCMassPtTrigger(),
189 fhPtLeadInConeBin(), fhPtSumInConeBin(),
190 fAODNamepTInConeHisto("")
191 
192 {
193  InitParameters();
194 
195  for(Int_t i = 0; i < fgkNmcTypes; i++)
196  {
197  fhPtTriggerMC[i] = 0;
198  fhXEChargedMC[i] = 0;
199  fhDeltaPhiChargedMC[i] = 0;
200  fhMCMassPtTrigger [i] = 0 ;
201  fhXEUeChargedRightMC[i] = 0;
202  fhXEUeChargedLeftMC[i] = 0;
203 
204  for(Int_t ib = 0; ib < AliNeutralMesonSelection::fgkMaxNDecayBits; ib++) fhPtDecayTriggerMC[ib][i] = 0;
205  }
206 
207  for(Int_t ib = 0; ib < AliNeutralMesonSelection::fgkMaxNDecayBits; ib++) fhPtDecayTrigger[ib] = 0;
208 
209  for(Int_t i = 0; i < 7; i++)
210  {
211  fhPtTriggerPileUp [i] = 0 ;
213  fhXEChargedPileUp [i] = 0 ; fhXEUeChargedPileUp [i] = 0 ;
214  fhZTChargedPileUp [i] = 0 ; fhZTUeChargedPileUp [i] = 0 ;
215  fhPtTrigChargedPileUp [i] = 0 ;
217  }
218 }
219 
220 //_________________________________________________________________
222 //_________________________________________________________________
224 {
225  if(DoOwnMix())
226  {
228  {
229  for(Int_t iz=0; iz < GetNZvertBin(); iz++)
230  {
231  for(Int_t ic=0; ic < GetNCentrBin(); ic++)
232  {
233  for(Int_t irp=0; irp<GetNRPBin(); irp++)
234  {
235  Int_t bin = GetEventMixBin(ic, iz, irp);
236  fListMixTrackEvents[bin]->Delete() ;
237  delete fListMixTrackEvents[bin] ;
238  }
239  }
240  }
241  }
242 
243  delete[] fListMixTrackEvents;
244 
246  {
247  for(Int_t iz=0; iz < GetNZvertBin(); iz++)
248  {
249  for(Int_t ic=0; ic < GetNCentrBin(); ic++)
250  {
251  for(Int_t irp=0; irp<GetNRPBin(); irp++)
252  {
253  Int_t bin = GetEventMixBin(ic, iz, irp);
254  fListMixCaloEvents[bin]->Delete() ;
255  delete fListMixCaloEvents[bin] ;
256  }
257  }
258  }
259  }
260 
261  delete[] fListMixCaloEvents;
262  }
263 }
264 
265 //____________________________________________________________________________________________________________________________________
267 //____________________________________________________________________________________________________________________________________
268 void AliAnaParticleHadronCorrelation::FillChargedAngularCorrelationHistograms(Float_t ptAssoc, Float_t ptTrig, Int_t bin,
269  Float_t phiAssoc, Float_t phiTrig, Float_t deltaPhi,
270  Float_t etaAssoc, Float_t etaTrig,
271  Int_t decayTag, Float_t hmpidSignal, Int_t outTOF,
272  Int_t cen, Int_t mcTag)
273 {
274  Float_t deltaEta = etaTrig-etaAssoc;
275  Float_t deltaPhiOrg = phiTrig-phiAssoc;
276 
277  fhEtaCharged ->Fill(ptAssoc, etaAssoc, GetEventWeight());
278  fhPhiCharged ->Fill(ptAssoc, phiAssoc, GetEventWeight());
279  fhDeltaEtaCharged ->Fill(ptTrig , deltaEta, GetEventWeight());
280  fhDeltaPhiCharged ->Fill(ptTrig , deltaPhi, GetEventWeight());
281  fhDeltaPhiChargedPt->Fill(ptAssoc, deltaPhi, GetEventWeight());
282  fhDeltaPhiDeltaEtaCharged->Fill(deltaPhi, deltaEta, GetEventWeight());
283 
284  if(ptAssoc > 3 )
285  {
286  fhDeltaEtaChargedPtA3GeV ->Fill(ptTrig , deltaEta, GetEventWeight());
287  fhDeltaPhiChargedPtA3GeV ->Fill(ptTrig , deltaPhi, GetEventWeight());
288  fhDeltaPhiDeltaEtaChargedPtA3GeV->Fill(deltaPhi, deltaEta, GetEventWeight());
289  }
290 
291  // Pile up studies
292 
293  if(IsPileUpAnalysisOn())
294  {
295  if (outTOF==1)
296  {
297  fhDeltaPhiChargedOtherBC->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
298  if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVOtherBC->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
299  }
300  else if(outTOF==0)
301  {
302  fhDeltaPhiChargedBC0->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
303  if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVBC0->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
304  }
305 
306  Int_t vtxBC = GetReader()->GetVertexBC();
307  if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA)
308  {
309  fhDeltaPhiChargedVtxBC0->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
310  if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVVtxBC0->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
311  }
312 
313  if(GetReader()->IsPileUpFromSPD())
314  {
315  fhDeltaEtaChargedPileUp[0]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
316  fhDeltaPhiChargedPileUp[0]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
317  }
318  if(GetReader()->IsPileUpFromEMCal())
319  {
320  fhDeltaEtaChargedPileUp[1]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
321  fhDeltaPhiChargedPileUp[1]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
322  }
323  if(GetReader()->IsPileUpFromSPDOrEMCal())
324  {
325  fhDeltaEtaChargedPileUp[2]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
326  fhDeltaPhiChargedPileUp[2]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
327  }
328  if(GetReader()->IsPileUpFromSPDAndEMCal())
329  {
330  fhDeltaEtaChargedPileUp[3]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
331  fhDeltaPhiChargedPileUp[3]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
332  }
333  if(GetReader()->IsPileUpFromSPDAndNotEMCal())
334  {
335  fhDeltaEtaChargedPileUp[4]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
336  fhDeltaPhiChargedPileUp[4]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
337  }
338  if(GetReader()->IsPileUpFromEMCalAndNotSPD())
339  {
340  fhDeltaEtaChargedPileUp[5]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
341  fhDeltaPhiChargedPileUp[5]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
342  }
343  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
344  {
345  fhDeltaEtaChargedPileUp[6]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
346  fhDeltaPhiChargedPileUp[6]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
347  }
348 
349  if(ptAssoc > 3 )
350  {
351  if(GetReader()->IsPileUpFromSPD())
352  {
353  fhDeltaEtaChargedPtA3GeVPileUp[0]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
354  fhDeltaPhiChargedPtA3GeVPileUp[0]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
355  }
356  if(GetReader()->IsPileUpFromEMCal())
357  {
358  fhDeltaEtaChargedPtA3GeVPileUp[1]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
359  fhDeltaPhiChargedPtA3GeVPileUp[1]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
360  }
361  if(GetReader()->IsPileUpFromSPDOrEMCal())
362  {
363  fhDeltaEtaChargedPtA3GeVPileUp[2]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
364  fhDeltaPhiChargedPtA3GeVPileUp[2]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
365  }
366  if(GetReader()->IsPileUpFromSPDAndEMCal())
367  {
368  fhDeltaEtaChargedPtA3GeVPileUp[3]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
369  fhDeltaPhiChargedPtA3GeVPileUp[3]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
370  }
371  if(GetReader()->IsPileUpFromSPDAndNotEMCal())
372  {
373  fhDeltaEtaChargedPtA3GeVPileUp[4]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
374  fhDeltaPhiChargedPtA3GeVPileUp[4]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
375  }
376  if(GetReader()->IsPileUpFromEMCalAndNotSPD())
377  {
378  fhDeltaEtaChargedPtA3GeVPileUp[5]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
379  fhDeltaPhiChargedPtA3GeVPileUp[5]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
380  }
381  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
382  {
383  fhDeltaEtaChargedPtA3GeVPileUp[6]->Fill(ptTrig, deltaEta, GetEventWeight()) ;
384  fhDeltaPhiChargedPtA3GeVPileUp[6]->Fill(ptTrig, deltaPhi, GetEventWeight()) ;
385  }
386  }
387  }
388 
389  if(IsDataMC())
390  {
391  Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
392  fhDeltaPhiChargedMC[mcIndex]->Fill(ptTrig , deltaPhi, GetEventWeight());
393 
395  {
396  // check index in GetMCTagIndexHistogram
397  if ( mcIndex == 2 ) fhDeltaPhiChargedMC[8]->Fill(ptTrig, deltaPhi, GetEventWeight()); // pi0 decay
398  else if( mcIndex == 4 ) fhDeltaPhiChargedMC[9]->Fill(ptTrig, deltaPhi, GetEventWeight()); // eta decay
399  }
400  }
401 
402  if(fDecayTrigger && decayTag > 0)
403  {
404  for(Int_t ibit = 0; ibit<fNDecayBits; ibit++)
405  {
406  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
407  fhDeltaPhiDecayCharged[ibit]->Fill(ptTrig, deltaPhi, GetEventWeight());
408  }
409  }
410 
411  Double_t dphiBrad = -100;
412  if(fFillBradHisto)
413  {
414  dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
415  if( TMath::Abs(dphiBrad) > 0.325 && TMath::Abs(dphiBrad) < 0.475 ) // Hardcoded values, BAD, FIXME
416  {
417  fhAssocPtBkg->Fill(ptTrig, ptAssoc, GetEventWeight());
418  }
419 
420  if( dphiBrad < -1./3 ) dphiBrad += 2;
421  fhDeltaPhiBrad->Fill(ptTrig, dphiBrad, GetEventWeight());
422  }
423 
424  // Fill histograms in bins of associated particle pT
425  if ( bin >= 0 )
426  {
427  fhDeltaPhiDeltaEtaAssocPtBin[bin]->Fill(deltaPhi,deltaEta, GetEventWeight());
428 
429  fhDeltaPhiAssocPtBin [bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
430 
432  {
433  if(TMath::Abs(deltaEta)> 0.8)
434  fhDeltaPhiAssocPtBinDEta08[bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
435 
436  if(TMath::Abs(deltaEta)< 0.01)
437  fhDeltaPhiAssocPtBinDEta0 [bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
438  }
439 
440  if (fFillBradHisto)
441  fhDeltaPhiBradAssocPtBin [bin]->Fill(ptTrig, dphiBrad, GetEventWeight());
442 
443  if(fDecayTrigger && decayTag > 0 && fNDecayBits > 0 &&
444  GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[0]))
445  {
446  fhDeltaPhiDecayChargedAssocPtBin[bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
447  }
448 
450  {
451  if( hmpidSignal > 0 )
452  {
453  //printf("Track pt %f with HMPID signal %f \n",pt,hmpidSignal);
454  fhDeltaPhiAssocPtBinHMPID[bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
455  }
456 
457  if(phiAssoc > 5*TMath::DegToRad() && phiAssoc < 20*TMath::DegToRad())
458  {
459  //printf("Track pt %f in HMPID acceptance phi %f \n ",pt,phi*TMath::RadToDeg() );
460  fhDeltaPhiAssocPtBinHMPIDAcc[bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
461  }
462  }
463  }
464 
465  // Fill different multiplicity/centrality histogram
466  if(IsHighMultiplicityAnalysisOn() && cen >= 0 && cen < GetNCentrBin())
467  {
468  fhDeltaPhiChargedMult[cen]->Fill(ptTrig, deltaPhi, GetEventWeight());
469  fhDeltaEtaChargedMult[cen]->Fill(ptTrig, deltaEta, GetEventWeight());
470  }
471 }
472 
473 //___________________________________________________________________________________________________________________________________
475 //___________________________________________________________________________________________________________________________________
476 Bool_t AliAnaParticleHadronCorrelation::FillChargedMCCorrelationHistograms(Float_t mcAssocPt, Float_t mcAssocPhi, Float_t mcAssocEta,
477  Float_t mcTrigPt, Float_t mcTrigPhi, Float_t mcTrigEta,
478  Int_t histoIndex, Bool_t lostDecayPair)
479 {
480  Bool_t lead = kTRUE;
481 
482  // In case we requested the trigger to be a leading particle,
483  // check if this is true at the MC level.
484  // Not sure if it is correct to skip or not skip this.
485  // Absolute leading?
486  if( fMakeAbsoluteLeading && mcAssocPt > mcTrigPt ) lead = kFALSE; // skip event
487 
488  // Skip this event if near side associated particle pt larger than trigger
489  if( mcAssocPhi < 0 ) mcAssocPhi+=TMath::TwoPi();
490 
491  Float_t mcdeltaPhi= mcTrigPhi-mcAssocPhi;
492  if(mcdeltaPhi <= -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
493  if(mcdeltaPhi > 3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
494 
496  {
497  if( mcAssocPt > mcTrigPt && mcdeltaPhi < TMath::PiOver2() ) lead = kFALSE; // skip event
498  }
499 
500  //
501  // Select only hadrons in pt range
502  if ( mcAssocPt < fMinAssocPt || mcAssocPt > fMaxAssocPt ) return lead ; // exclude but continue
503  if ( mcAssocPt < GetReader()->GetCTSPtMin()) return lead ;
504 
505 
506  //
507  // Remove trigger itself for correlation when use charged triggers
508  if(TMath::Abs(mcAssocPt -mcTrigPt ) < 1e-6 &&
509  mcdeltaPhi < 1e-6 &&
510  TMath::Abs(mcAssocEta-mcTrigEta) < 1e-6) return lead ; // exclude but continue
511 
512  Float_t mcxE =-mcAssocPt/mcTrigPt*TMath::Cos(mcdeltaPhi);// -(mcAssocPx*pxprim+mcAssocPy*pyprim)/(mcTrigPt*mcTrigPt);
513  Float_t mchbpXE =-100 ;
514  if(mcxE > 0 ) mchbpXE = TMath::Log(1./mcxE);
515 
516  Float_t mczT = mcAssocPt/mcTrigPt ;
517  Float_t mchbpZT =-100 ;
518  if(mczT > 0 ) mchbpZT = TMath::Log(1./mczT);
519 
520  Double_t mcpout = mcAssocPt*TMath::Sin(mcdeltaPhi) ;
521 
522  AliDebug(1,Form("Charged hadron: track Pt %f, track Phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f",
523  mcAssocPt,mcAssocPhi, mcTrigPhi,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut));
524 
525  // Fill Histograms
526  fhMCEtaCharged [histoIndex]->Fill(mcAssocPt, mcAssocEta, GetEventWeight());
527  fhMCPhiCharged [histoIndex]->Fill(mcAssocPt, mcAssocPhi, GetEventWeight());
528  fhMCDeltaPhiCharged[histoIndex]->Fill(mcTrigPt , mcdeltaPhi, GetEventWeight());
529  fhMCPtAssocDeltaPhi[histoIndex]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
530 
531  fhMCDeltaEtaCharged [histoIndex]->Fill(mcTrigPt , mcTrigEta-mcAssocEta, GetEventWeight());
532  fhMCDeltaPhiDeltaEtaCharged[histoIndex]->Fill(mcdeltaPhi, mcTrigEta-mcAssocEta, GetEventWeight());
533 
534  // Delta phi cut for correlation
535  if( (mcdeltaPhi > fDeltaPhiMinCut) && (mcdeltaPhi < fDeltaPhiMaxCut) )
536  {
537  fhMCDeltaPhiChargedPt[histoIndex]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
538  fhMCPtXECharged [histoIndex]->Fill(mcTrigPt , mcxE , GetEventWeight());
539  fhMCPtHbpXECharged [histoIndex]->Fill(mcTrigPt , mchbpXE , GetEventWeight());
540  fhMCPtZTCharged [histoIndex]->Fill(mcTrigPt , mczT , GetEventWeight());
541  fhMCPtHbpZTCharged [histoIndex]->Fill(mcTrigPt , mchbpZT , GetEventWeight());
542  fhMCPtTrigPout [histoIndex]->Fill(mcTrigPt , mcpout , GetEventWeight());
543  }
544 
545  if(lostDecayPair)
546  {
547  // check index in GetMCTagIndexHistogram
548  if(histoIndex == 2 && 8 >= fMCGenTypeMin && 8 <= fMCGenTypeMax )
549  {
550  // pi0 decay
551  fhMCEtaCharged [8]->Fill(mcAssocPt, mcAssocEta, GetEventWeight());
552  fhMCPhiCharged [8]->Fill(mcAssocPt, mcAssocPhi, GetEventWeight());
553  fhMCDeltaPhiCharged[8]->Fill(mcTrigPt , mcdeltaPhi, GetEventWeight());
554  fhMCPtAssocDeltaPhi[8]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
555 
556  fhMCDeltaEtaCharged [8]->Fill(mcTrigPt , mcTrigEta-mcAssocEta, GetEventWeight());
557  fhMCDeltaPhiDeltaEtaCharged[8]->Fill(mcdeltaPhi, mcTrigEta-mcAssocEta, GetEventWeight());
558 
559  //delta phi cut for correlation
560  if( (mcdeltaPhi > fDeltaPhiMinCut) && (mcdeltaPhi < fDeltaPhiMaxCut) )
561  {
562  fhMCDeltaPhiChargedPt[8]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
563  fhMCPtXECharged [8]->Fill(mcTrigPt , mcxE , GetEventWeight());
564  fhMCPtHbpXECharged [8]->Fill(mcTrigPt , mchbpXE , GetEventWeight());
565  fhMCPtZTCharged [8]->Fill(mcTrigPt , mczT , GetEventWeight());
566  fhMCPtHbpZTCharged [8]->Fill(mcTrigPt , mchbpZT , GetEventWeight());
567  fhMCPtTrigPout [8]->Fill(mcTrigPt , mcpout , GetEventWeight());
568  }
569  } // pi0 decay lost pair
570 
571  if(histoIndex == 4 && 9 >= fMCGenTypeMin && 9 <= fMCGenTypeMax )
572  {
573  // eta decay
574  fhMCEtaCharged [9]->Fill(mcAssocPt, mcAssocEta, GetEventWeight());
575  fhMCPhiCharged [9]->Fill(mcAssocPt, mcAssocPhi, GetEventWeight());
576  fhMCDeltaPhiCharged[9]->Fill(mcTrigPt , mcdeltaPhi, GetEventWeight());
577  fhMCPtAssocDeltaPhi[9]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
578 
579  fhMCDeltaEtaCharged [9]->Fill(mcTrigPt , mcTrigEta-mcAssocEta, GetEventWeight());
580  fhMCDeltaPhiDeltaEtaCharged[9]->Fill(mcdeltaPhi, mcTrigEta-mcAssocEta, GetEventWeight());
581 
582  // Delta phi cut for correlation
583  if( (mcdeltaPhi > fDeltaPhiMinCut) && (mcdeltaPhi < fDeltaPhiMaxCut) )
584  {
585  fhMCDeltaPhiChargedPt[9]->Fill(mcAssocPt, mcdeltaPhi, GetEventWeight());
586  fhMCPtXECharged [9]->Fill(mcTrigPt , mcxE , GetEventWeight());
587  fhMCPtHbpXECharged [9]->Fill(mcTrigPt , mchbpXE , GetEventWeight());
588  fhMCPtZTCharged [9]->Fill(mcTrigPt , mczT , GetEventWeight());
589  fhMCPtHbpZTCharged [9]->Fill(mcTrigPt , mchbpZT , GetEventWeight());
590  fhMCPtTrigPout [9]->Fill(mcTrigPt , mcpout , GetEventWeight()) ;
591  }
592  } // eta decay lost pair
593  }
594  // Underlying event
595 
596  // Right
597  if ( (mcdeltaPhi > fUeDeltaPhiMinCut) && (mcdeltaPhi < fUeDeltaPhiMaxCut) )
598  {
599  //Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
600  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
601  Double_t mcUexE = -(mcAssocPt/mcTrigPt)*TMath::Cos(randomphi);
602  Double_t mcUezT = mcAssocPt/mcTrigPt;
603 
604  if(mcUexE < 0.)
605  AliWarning(Form("Careful!!, negative xE %2.2f for right UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
606  mcUexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
607 
608  fhMCPtXEUeCharged[histoIndex]->Fill(mcTrigPt, mcUexE, GetEventWeight());
609  if(mcUexE > 0) fhMCPtHbpXEUeCharged[histoIndex]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
610 
611  fhMCPtZTUeCharged[histoIndex]->Fill(mcTrigPt, mcUezT, GetEventWeight());
612  if(mcUezT > 0) fhMCPtHbpZTUeCharged[histoIndex]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
613 
614  fhMCUePart[histoIndex]->Fill(mcTrigPt, GetEventWeight());
615 
616  if(lostDecayPair)
617  {
618  // check index in GetMCTagIndexHistogram
619  if(histoIndex == 2 && 8 >= fMCGenTypeMin && 8 <= fMCGenTypeMax )
620  {
621  // pi0 decay
622  fhMCPtXEUeCharged[8]->Fill(mcTrigPt, mcUexE, GetEventWeight());
623  if(mcUexE > 0) fhMCPtHbpXEUeCharged[8]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
624 
625  fhMCPtZTUeCharged[8]->Fill(mcTrigPt, mcUezT, GetEventWeight());
626  if(mcUezT > 0) fhMCPtHbpZTUeCharged[8]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
627 
628  fhMCUePart[8]->Fill(mcTrigPt, GetEventWeight());
629  }
630  else if(histoIndex == 4 && 9 >= fMCGenTypeMin && 9 <= fMCGenTypeMax )
631  {
632  // eta decay
633  fhMCPtXEUeCharged[9]->Fill(mcTrigPt, mcUexE, GetEventWeight());
634  if(mcUexE > 0) fhMCPtHbpXEUeCharged[9]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
635 
636  fhMCPtZTUeCharged[9]->Fill(mcTrigPt, mcUezT, GetEventWeight());
637  if(mcUezT > 0) fhMCPtHbpZTUeCharged[9]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
638 
639  fhMCUePart[9]->Fill(mcTrigPt, GetEventWeight());
640  }
641  }
642  }
643 
644  if(fMakeSeveralUE)
645  {
646  // Left
647  if((mcdeltaPhi<-fUeDeltaPhiMinCut) || (mcdeltaPhi >2*fUeDeltaPhiMaxCut))
648  {
649  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
650  Double_t mcUexE = -(mcAssocPt/mcTrigPt)*TMath::Cos(randomphi);
651  Double_t mcUezT = mcAssocPt/mcTrigPt;
652 
653  if(mcUexE < 0.)
654  AliWarning(Form("Careful!!, negative xE %2.2f for left UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
655  mcUexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
656 
657  fhMCPtXEUeLeftCharged[histoIndex]->Fill(mcTrigPt, mcUexE, GetEventWeight());
658  if(mcUexE > 0) fhMCPtHbpXEUeLeftCharged[histoIndex]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
659 
660  fhMCPtZTUeLeftCharged[histoIndex]->Fill(mcTrigPt, mcUezT, GetEventWeight());
661  if(mcUezT > 0) fhMCPtHbpZTUeLeftCharged[histoIndex]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
662 
663  if(lostDecayPair)
664  {
665  // Check index in GetMCTagIndexHistogram
666  if(histoIndex == 2 && 8 >= fMCGenTypeMin && 8 <= fMCGenTypeMax )
667  {
668  // pi0 decay
669  fhMCPtXEUeLeftCharged[8]->Fill(mcTrigPt,mcUexE, GetEventWeight());
670  if(mcUexE > 0) fhMCPtHbpXEUeLeftCharged[8]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
671 
672  fhMCPtZTUeLeftCharged[8]->Fill(mcTrigPt,mcUezT, GetEventWeight());
673  if(mcUezT > 0) fhMCPtHbpZTUeLeftCharged[8]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
674  }
675  else if(histoIndex == 4 && 9 >= fMCGenTypeMin && 9 <= fMCGenTypeMax )
676  {
677  // eta decay
678  fhMCPtXEUeLeftCharged[9]->Fill(mcTrigPt, mcUexE, GetEventWeight());
679  if(mcUexE > 0) fhMCPtHbpXEUeLeftCharged[9]->Fill(mcTrigPt, TMath::Log(1/mcUexE), GetEventWeight());
680 
681  fhMCPtZTUeLeftCharged[9]->Fill(mcTrigPt, mcUezT, GetEventWeight());
682  if(mcUezT > 0) fhMCPtHbpZTUeLeftCharged[9]->Fill(mcTrigPt, TMath::Log(1/mcUezT), GetEventWeight());
683  }
684  }
685  }
686  }
687 
688  return lead;
689 }
690 
691 //______________________________________________________________________________________________________________
693 //______________________________________________________________________________________________________________
695  Float_t deltaPhi,
696  Int_t cen, Int_t charge,
697  Int_t bin, Int_t decayTag,
698  Int_t outTOF, Int_t mcTag)
699 
700 {
701  Float_t zT = ptAssoc/ptTrig ;
702  Float_t xE =-ptAssoc/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
703  Float_t pout = ptAssoc*TMath::Sin(deltaPhi) ;
704 
705  if(xE < 0.)
706  AliWarning(Form("Careful!!, negative xE %2.2f for right UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
707  xE,deltaPhi*TMath::RadToDeg(),TMath::Cos(deltaPhi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
708 
709  Float_t hbpXE = -100;
710  Float_t hbpZT = -100;
711 
712  if(xE > 0 ) hbpXE = TMath::Log(1./xE);
713  if(zT > 0 ) hbpZT = TMath::Log(1./zT);
714 
715  fhXECharged ->Fill(ptTrig, xE , GetEventWeight());
716  fhPtHbpXECharged ->Fill(ptTrig, hbpXE , GetEventWeight());
717  fhZTCharged ->Fill(ptTrig, zT , GetEventWeight());
718  fhPtHbpZTCharged ->Fill(ptTrig, hbpZT , GetEventWeight());
719  fhPtTrigPout ->Fill(ptTrig, pout , GetEventWeight());
720  fhPtTrigCharged ->Fill(ptTrig, ptAssoc, GetEventWeight());
721 
722  if((deltaPhi > 5*TMath::Pi()/6.) && (deltaPhi < 7*TMath::Pi()/6.))
723  {
724  fhXECharged_Cone2 ->Fill(ptTrig, xE , GetEventWeight());
725  fhPtHbpXECharged_Cone2 ->Fill(ptTrig, hbpXE, GetEventWeight());
726  }
727 
728  // MC
729  if(IsDataMC())
730  {
731  Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
732  fhXEChargedMC[mcIndex]->Fill(ptTrig, xE, GetEventWeight());
733 
734  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
735  {
736  // check index in GetMCTagIndexHistogram
737  if ( mcIndex == 2 ) fhXEChargedMC[8]->Fill(ptTrig, xE, GetEventWeight()); // pi0 decay
738  else if ( mcIndex == 4 ) fhXEChargedMC[9]->Fill(ptTrig, xE, GetEventWeight()); // eta decay
739  }
740  }
741 
742  // Pile-up studies
743  if(IsPileUpAnalysisOn())
744  {
745  if (outTOF==1)
746  {
747  fhXEChargedOtherBC ->Fill(ptTrig, xE , GetEventWeight());
748  fhZTChargedOtherBC ->Fill(ptTrig, zT , GetEventWeight());
749  fhPtTrigChargedOtherBC->Fill(ptTrig, ptAssoc, GetEventWeight());
750  }
751  else if(outTOF==0)
752  {
753  fhXEChargedBC0 ->Fill(ptTrig, xE , GetEventWeight());
754  fhZTChargedBC0 ->Fill(ptTrig, zT , GetEventWeight());
755  fhPtTrigChargedBC0->Fill(ptTrig, ptAssoc, GetEventWeight());
756  }
757 
758  Int_t vtxBC = GetReader()->GetVertexBC();
759  if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA)
760  {
761  fhXEChargedVtxBC0 ->Fill(ptTrig, xE , GetEventWeight());
762  fhZTChargedVtxBC0 ->Fill(ptTrig, zT , GetEventWeight());
763  fhPtTrigChargedVtxBC0->Fill(ptTrig, ptAssoc, GetEventWeight());
764  }
765 
766  if(GetReader()->IsPileUpFromSPD())
767  {
768  fhXEChargedPileUp [0]->Fill(ptTrig, xE , GetEventWeight());
769  fhZTChargedPileUp [0]->Fill(ptTrig, zT , GetEventWeight());
770  fhPtTrigChargedPileUp[0]->Fill(ptTrig, ptAssoc, GetEventWeight());
771  }
772  if(GetReader()->IsPileUpFromEMCal())
773  {
774  fhXEChargedPileUp [1]->Fill(ptTrig, xE , GetEventWeight());
775  fhZTChargedPileUp [1]->Fill(ptTrig, zT , GetEventWeight());
776  fhPtTrigChargedPileUp[1]->Fill(ptTrig, ptAssoc, GetEventWeight());
777  }
778  if(GetReader()->IsPileUpFromSPDOrEMCal())
779  {
780  fhXEChargedPileUp [2]->Fill(ptTrig, xE , GetEventWeight());
781  fhZTChargedPileUp [2]->Fill(ptTrig, zT , GetEventWeight());
782  fhPtTrigChargedPileUp[2]->Fill(ptTrig, ptAssoc, GetEventWeight());
783  }
784  if(GetReader()->IsPileUpFromSPDAndEMCal())
785  {
786  fhXEChargedPileUp [3]->Fill(ptTrig, xE , GetEventWeight());
787  fhZTChargedPileUp [3]->Fill(ptTrig, zT , GetEventWeight());
788  fhPtTrigChargedPileUp[3]->Fill(ptTrig, ptAssoc, GetEventWeight());
789  }
790  if(GetReader()->IsPileUpFromSPDAndNotEMCal())
791  {
792  fhXEChargedPileUp [4]->Fill(ptTrig, xE , GetEventWeight());
793  fhZTChargedPileUp [4]->Fill(ptTrig, zT , GetEventWeight());
794  fhPtTrigChargedPileUp[4]->Fill(ptTrig, ptAssoc, GetEventWeight());
795  }
796  if(GetReader()->IsPileUpFromEMCalAndNotSPD())
797  {
798  fhXEChargedPileUp [5]->Fill(ptTrig, xE , GetEventWeight());
799  fhZTChargedPileUp [5]->Fill(ptTrig, zT , GetEventWeight());
800  fhPtTrigChargedPileUp[5]->Fill(ptTrig, ptAssoc, GetEventWeight());
801  }
802  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
803  {
804  fhXEChargedPileUp [6]->Fill(ptTrig, xE , GetEventWeight());
805  fhZTChargedPileUp [6]->Fill(ptTrig, zT , GetEventWeight());
806  fhPtTrigChargedPileUp[6]->Fill(ptTrig, ptAssoc, GetEventWeight());
807  }
808  }
809 
810  if(fDecayTrigger && decayTag > 0)
811  {
812  for(Int_t ibit = 0; ibit<fNDecayBits; ibit++)
813  {
814  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
815  {
816  fhXEDecayCharged[ibit]->Fill(ptTrig, xE, GetEventWeight());
817  fhZTDecayCharged[ibit]->Fill(ptTrig, zT, GetEventWeight());
818  }
819  }
820  } // photon decay pi0/eta trigger
821 
822  if(bin >= 0 && fFillMomImbalancePtAssocBinsHisto)//away side
823  {
824  fhXEAssocPtBin[bin]->Fill(ptTrig, xE, GetEventWeight()) ;
825  fhZTAssocPtBin[bin]->Fill(ptTrig, zT, GetEventWeight()) ;
826  }
827 
828  if(fCorrelVzBin)
829  {
830  Int_t vz = GetEventVzBin();
831  fhXEVZ[vz]->Fill(ptTrig, xE, GetEventWeight()) ;
832  fhZTVZ[vz]->Fill(ptTrig, zT, GetEventWeight()) ;
833  }
834 
835  if(charge > 0)
836  {
837  fhXEPosCharged->Fill(ptTrig, xE, GetEventWeight()) ;
838  fhZTPosCharged->Fill(ptTrig, zT, GetEventWeight()) ;
839  }
840  else
841  {
842  fhXENegCharged->Fill(ptTrig, xE, GetEventWeight()) ;
843  fhZTNegCharged->Fill(ptTrig, zT, GetEventWeight()) ;
844  }
845 
846  // Fill different multiplicity/centrality histogram
847  if(IsHighMultiplicityAnalysisOn() && cen >= 0 && cen < GetNCentrBin())
848  {
849  fhXEMult[cen]->Fill(ptTrig, xE, GetEventWeight());
850  fhZTMult[cen]->Fill(ptTrig, zT, GetEventWeight());
851  } // multiplicity/centrality events selection
852 }
853 
854 //___________________________________________________________________________________________________________________
856 //___________________________________________________________________________________________________________________
858  Float_t deltaPhi, Int_t cen, Int_t outTOF, Int_t mcTag)
859 {
860  fhUePart->Fill(ptTrig, GetEventWeight());
861 
862  fhDeltaPhiUeChargedPt->Fill(ptAssoc, deltaPhi, GetEventWeight());
863 
864  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
865  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
866  Double_t uezT = ptAssoc/ptTrig;
867 
868  if(uexE < 0.)
869  AliWarning(Form("Careful!!, negative xE %2.2f for right UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
870  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
871 
872  fhXEUeCharged->Fill(ptTrig, uexE, GetEventWeight());
873  if(uexE > 0) fhPtHbpXEUeCharged->Fill(ptTrig, TMath::Log(1/uexE), GetEventWeight());
874 
875  fhZTUeCharged->Fill(ptTrig, uezT, GetEventWeight());
876  if(uezT > 0) fhPtHbpZTUeCharged->Fill(ptTrig, TMath::Log(1/uezT), GetEventWeight());
877 
878  if(IsDataMC())
879  {
880  Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
881  fhXEUeChargedRightMC[mcIndex]->Fill(ptTrig, uexE, GetEventWeight());
882 
883  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
884  {
885  // check index in GetMCTagIndexHistogram
886  if ( mcIndex == 2 ) fhXEUeChargedRightMC[8]->Fill(ptTrig, uexE, GetEventWeight()); // pi0 decay
887  else if ( mcIndex == 4 ) fhXEUeChargedRightMC[9]->Fill(ptTrig, uexE, GetEventWeight()); // eta decay
888  }
889  }
890 
891  // Pile-up studies
892 
893  if(IsPileUpAnalysisOn())
894  {
895  if (outTOF==1)
896  {
897  fhXEUeChargedOtherBC->Fill(ptTrig, uexE, GetEventWeight());
898  fhZTUeChargedOtherBC->Fill(ptTrig, uezT, GetEventWeight());
899  }
900  else if(outTOF==0)
901  {
902  fhXEUeChargedBC0->Fill(ptTrig, uexE, GetEventWeight());
903  fhZTUeChargedBC0->Fill(ptTrig, uezT, GetEventWeight());
904  }
905 
906  Int_t vtxBC = GetReader()->GetVertexBC();
907  if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA)
908  {
909  fhXEUeChargedVtxBC0->Fill(ptTrig, uexE, GetEventWeight());
910  fhZTUeChargedVtxBC0->Fill(ptTrig, uezT, GetEventWeight());
911  }
912 
913  if(GetReader()->IsPileUpFromSPD())
914  {
915  fhXEUeChargedPileUp[0]->Fill(ptTrig, uexE, GetEventWeight());
916  fhZTUeChargedPileUp[0]->Fill(ptTrig, uezT, GetEventWeight());
917  }
918  if(GetReader()->IsPileUpFromEMCal())
919  {
920  fhXEUeChargedPileUp[1]->Fill(ptTrig, uexE, GetEventWeight());
921  fhZTUeChargedPileUp[1]->Fill(ptTrig, uezT, GetEventWeight());
922  }
923  if(GetReader()->IsPileUpFromSPDOrEMCal())
924  {
925  fhXEUeChargedPileUp[2]->Fill(ptTrig, uexE, GetEventWeight());
926  fhZTUeChargedPileUp[2]->Fill(ptTrig, uezT, GetEventWeight());
927  }
928  if(GetReader()->IsPileUpFromSPDAndEMCal())
929  {
930  fhXEUeChargedPileUp[3]->Fill(ptTrig, uexE, GetEventWeight());
931  fhZTUeChargedPileUp[3]->Fill(ptTrig, uezT, GetEventWeight());
932  }
933  if(GetReader()->IsPileUpFromSPDAndNotEMCal())
934  {
935  fhXEUeChargedPileUp[4]->Fill(ptTrig, uexE, GetEventWeight());
936  fhZTUeChargedPileUp[4]->Fill(ptTrig, uezT, GetEventWeight());
937  }
938  if(GetReader()->IsPileUpFromEMCalAndNotSPD())
939  {
940  fhXEUeChargedPileUp[5]->Fill(ptTrig, uexE, GetEventWeight());
941  fhZTUeChargedPileUp[5]->Fill(ptTrig, uezT, GetEventWeight());
942  }
943  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
944  {
945  fhXEUeChargedPileUp[6]->Fill(ptTrig, uexE, GetEventWeight());
946  fhZTUeChargedPileUp[6]->Fill(ptTrig, uezT, GetEventWeight());
947  }
948  }
949 
950  // Fill different multiplicity/centrality histogram
951  if(IsHighMultiplicityAnalysisOn() && cen >= 0 && cen < GetNCentrBin())
952  {
953  fhXEUeMult[cen]->Fill(ptTrig, uexE, GetEventWeight());
954  fhZTUeMult[cen]->Fill(ptTrig, uezT, GetEventWeight());
955  }
956 }
957 
958 //_______________________________________________________________________________________________
961 //_______________________________________________________________________________________________
963  Float_t ptAssoc,
964  Float_t deltaPhi,
965  Int_t mcTag)
966 {
967  if((deltaPhi<-fUeDeltaPhiMinCut) || (deltaPhi >2*fUeDeltaPhiMaxCut))
968  {
969  fhDeltaPhiUeLeftCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
970 
971  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
972  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
973  Double_t uezT = ptAssoc/ptTrig;
974 
975  if(uexE < 0.)
976  AliWarning(Form("Careful!!, negative xE %2.2f for left UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
977  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
978 
979  fhXEUeLeftCharged->Fill(ptTrig, uexE, GetEventWeight());
980  if(uexE > 0) fhPtHbpXEUeLeftCharged->Fill(ptTrig, TMath::Log(1/uexE), GetEventWeight());
981 
982  fhZTUeLeftCharged->Fill(ptTrig, uezT, GetEventWeight());
983  if(uezT > 0) fhPtHbpZTUeLeftCharged->Fill(ptTrig, TMath::Log(1/uezT), GetEventWeight());
984 
985  fhDeltaPhiUeLeftCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
986 
987  if(IsDataMC())
988  {
989  Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
990  fhXEUeChargedLeftMC[mcIndex]->Fill(ptTrig, uexE, GetEventWeight());
991 
992  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
993  {
994  // check index in GetMCTagIndexHistogram
995  if ( mcIndex == 2 ) fhXEUeChargedLeftMC[8]->Fill(ptTrig, uexE, GetEventWeight()); // pi0 decay
996  else if ( mcIndex == 4 ) fhXEUeChargedLeftMC[9]->Fill(ptTrig, uexE, GetEventWeight()); // eta decay
997  }
998  }
999  }
1000 
1001  if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-TMath::Pi()/2))
1002  {
1003  fhDeltaPhiUeLeftDownCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
1004 
1005  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
1006  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
1007 
1008  if(uexE < 0.)
1009  AliWarning(Form("Careful!!, negative xE %2.2f for left-down UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
1010  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
1011 
1012  fhXEUeLeftDownCharged->Fill(ptTrig, uexE, GetEventWeight());
1013  }
1014 
1015  if((deltaPhi>2*fUeDeltaPhiMaxCut) && (deltaPhi <3*TMath::Pi()/2))
1016  {
1017  fhDeltaPhiUeLeftUpCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
1018 
1019  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
1020  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
1021 
1022  if(uexE < 0.)
1023  AliWarning(Form("Careful!!, negative xE %2.2f for left-up UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
1024  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
1025 
1026  fhXEUeLeftUpCharged->Fill(ptTrig, uexE, GetEventWeight());
1027  }
1028 
1029  if((deltaPhi > TMath::Pi()/2) && (deltaPhi < fUeDeltaPhiMaxCut))
1030  {
1031  fhDeltaPhiUeRightUpCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
1032 
1033  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
1034  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
1035 
1036  if(uexE < 0.)
1037  AliWarning(Form("Careful!!, negative xE %2.2f for right-up UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
1038  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
1039 
1040  fhXEUeRightUpCharged->Fill(ptTrig, uexE, GetEventWeight());
1041  }
1042 
1043  if((deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < TMath::Pi()/2))
1044  {
1045  fhDeltaPhiUeRightDownCharged->Fill(ptAssoc, deltaPhi, GetEventWeight());
1046 
1047  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
1048  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
1049 
1050  if(uexE < 0.)
1051  AliWarning(Form("Careful!!, negative xE %2.2f for right-down UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
1052  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
1053 
1054  fhXEUeRightDownCharged->Fill(ptTrig, uexE, GetEventWeight());
1055  }
1056 }
1057 
1058 //_____________________________________________________________________________________________________________________________________
1060 //_____________________________________________________________________________________________________________________________________
1061 void AliAnaParticleHadronCorrelation::FillDecayPhotonCorrelationHistograms(Float_t ptAssoc, Float_t phiAssoc, Bool_t bChargedOrNeutral)
1062 {
1063  // Calculate the correlation parameters
1064  Float_t ptDecay1 = fDecayMom1.Pt();
1065  Float_t ptDecay2 = fDecayMom2.Pt();
1066 
1067  Float_t zTDecay1 = -100, zTDecay2 = -100;
1068  if(ptDecay1 > 0) zTDecay1 = ptAssoc/ptDecay1 ;
1069  if(ptDecay2 > 0) zTDecay2 = ptAssoc/ptDecay2 ;
1070 
1071  Float_t deltaPhiDecay1 = fDecayMom1.Phi()-phiAssoc;
1072  if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1073  if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1074 
1075  Float_t deltaPhiDecay2 = fDecayMom2.Phi()-phiAssoc;
1076  if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1077  if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
1078 
1079  Float_t xEDecay1 =-zTDecay1*TMath::Cos(deltaPhiDecay1); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1080  Float_t xEDecay2 =-zTDecay2*TMath::Cos(deltaPhiDecay2); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1081 
1082  if(bChargedOrNeutral) // correlate with charges
1083  {
1084  fhDeltaPhiPi0DecayCharged->Fill(ptDecay1, deltaPhiDecay1, GetEventWeight());
1085  fhDeltaPhiPi0DecayCharged->Fill(ptDecay2, deltaPhiDecay2, GetEventWeight());
1086 
1087  AliDebug(2,Form("deltaPhoton1 = %f, deltaPhoton2 = %f", deltaPhiDecay1, deltaPhiDecay2));
1088 
1089  if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
1090  {
1091  fhZTPi0DecayCharged->Fill(ptDecay1, zTDecay1, GetEventWeight());
1092  fhXEPi0DecayCharged->Fill(ptDecay1, xEDecay1, GetEventWeight());
1093  }
1094  if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
1095  {
1096  fhZTPi0DecayCharged->Fill(ptDecay2, zTDecay2, GetEventWeight());
1097  fhXEPi0DecayCharged->Fill(ptDecay2, xEDecay2, GetEventWeight());
1098  }
1099  }
1100  else // correlate with neutrals
1101  {
1102  fhDeltaPhiPi0DecayNeutral->Fill(ptDecay1, deltaPhiDecay1, GetEventWeight());
1103  fhDeltaPhiPi0DecayNeutral->Fill(ptDecay2, deltaPhiDecay2, GetEventWeight());
1104 
1105  AliDebug(2,Form("deltaPhoton1 = %f, deltaPhoton2 = %f", deltaPhiDecay1, deltaPhiDecay2));
1106 
1107  if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
1108  {
1109  fhZTPi0DecayNeutral->Fill(ptDecay1, zTDecay1, GetEventWeight());
1110  fhXEPi0DecayNeutral->Fill(ptDecay1, xEDecay1, GetEventWeight());
1111  }
1112  if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
1113  {
1114  fhZTPi0DecayNeutral->Fill(ptDecay2, zTDecay2, GetEventWeight());
1115  fhXEPi0DecayNeutral->Fill(ptDecay2, xEDecay2, GetEventWeight());
1116  }
1117  }
1118 }
1119 
1120 //_____________________________________________________________________________________________________________________________
1123 //_____________________________________________________________________________________________________________________________
1125  Float_t zT, Float_t hbpZT,
1126  Float_t deltaPhi)
1127 {
1128  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
1129 
1130  Float_t xE =-ptAssoc/ptTrig*TMath::Cos(randomphi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1131  Float_t hbpXE = -100;
1132  if(xE > 0 ) hbpXE = TMath::Log(1./xE);
1133 
1134  if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
1135  {
1136  fhDeltaPhiUeLeftNeutral->Fill(ptAssoc, deltaPhi, GetEventWeight());
1137  fhXEUeLeftNeutral ->Fill(ptTrig , xE , GetEventWeight());
1138  fhPtHbpXEUeLeftNeutral ->Fill(ptTrig , hbpXE , GetEventWeight());
1139  fhZTUeLeftNeutral ->Fill(ptTrig , zT , GetEventWeight());
1140  fhPtHbpZTUeLeftNeutral ->Fill(ptTrig , hbpZT , GetEventWeight());
1141  }
1142 }
1143 
1144 //______________________________________________________
1146 //______________________________________________________
1148 {
1149  if ( !DoOwnMix() ) return;
1150 
1152 
1153  // Do the cluster pool filling only if requested
1154  // or in case of isolation cut using clusters in the cone.
1156 
1157  if( !fFillNeutralEventMixPool && !isoCase) return;
1158 
1160 }
1161 
1162 //_____________________________________________________________
1164 //_____________________________________________________________
1166 {
1167  if(fUseMixStoredInReader && GetReader()->GetLastTracksMixedEvent() == GetEventNumber())
1168  {
1169  //printf("%s : Pool already filled for this event !!!\n",GetInputAODName().Data());
1170  return ; // pool filled previously for another trigger
1171  }
1172 
1173  AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
1174  AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
1175 
1176  if(!inputHandler) return ;
1177 
1178  // Do mixing only with MB event (or the chosen mask), if not skip
1179  if( !(inputHandler->IsEventSelected( ) & GetReader()->GetMixEventTriggerMask()) ) return ;
1180 
1181  Int_t eventBin = GetEventMixBin();
1182 
1183  //Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
1184  if(eventBin < 0) return;
1185 
1186  fhEventMBBin->Fill(eventBin, GetEventWeight());
1187 
1188  TObjArray * mixEventTracks = new TObjArray;
1189 
1191  {
1193  }
1194 
1195  if(!fListMixTrackEvents[eventBin]) fListMixTrackEvents[eventBin] = new TList();
1196 
1197  //printf("%s ***** Pool Event bin : %d - nTracks %d\n",GetInputAODName().Data(),eventBin, GetCTSTracks()->GetEntriesFast());
1198 
1199  TList * pool = fListMixTrackEvents[eventBin];
1200 
1201  for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
1202  {
1203  AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
1204 
1205  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
1206  Float_t pt = fTrackVector.Pt();
1207 
1208  // Select only hadrons in pt range
1209  if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
1210 
1211  AliAODPWG4Particle * mixedTrack = new AliAODPWG4Particle(track->Px(),track->Py(),track->Pz(),0);
1212  mixedTrack->SetDetectorTag(kCTS);
1213  mixedTrack->SetChargedBit(track->Charge()>0);
1214  mixEventTracks->Add(mixedTrack);
1215  }
1216 
1217  fhNtracksMB->Fill(mixEventTracks->GetEntriesFast(), eventBin, GetEventWeight());
1218 
1219  // Set the event number where the last event was added, to avoid double pool filling
1221 
1222  //printf("Add event to pool with %d tracks \n ",mixEventTracks->GetEntries());
1223  pool->AddFirst(mixEventTracks);
1224  mixEventTracks = 0;
1225 
1226  //printf("Pool size %d, max %d\n",pool->GetSize(), GetNMaxEvMix());
1227 
1228  if(pool->GetSize() > GetNMaxEvMix())
1229  {
1230  // Remove last event
1231  TClonesArray * tmp = static_cast<TClonesArray*>(pool->Last()) ;
1232  pool->RemoveLast() ;
1233  delete tmp ;
1234  }
1235 }
1236 
1237 //_____________________________________________________________
1240 //_____________________________________________________________
1242 {
1243  //printf("FillNeutralEventMixPool for %s\n",GetInputAODName().Data());
1244 
1245  if(fUseMixStoredInReader && GetReader()->GetLastCaloMixedEvent() == GetEventNumber())
1246  {
1247  //printf("%s : Pool already filled for this event !!!\n",GetInputAODName().Data());
1248  return ; // pool filled previously for another trigger
1249  }
1250 
1251  TObjArray * pl = GetEMCALClusters();
1252  //if (GetAODObjArrayName.Contains("PHOS") )pl = GetPHOSClusters();
1253  //else pl = GetEMCALClusters();
1254 
1255  AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
1256  AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
1257 
1258  if(!inputHandler) return ;
1259 
1260  // Do mixing only with MB event (or the chosen mask), if not skip
1261  if( !(inputHandler->IsEventSelected( ) & GetReader()->GetMixEventTriggerMask()) ) return ;
1262 
1263  Int_t eventBin = GetEventMixBin();
1264 
1265  // Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
1266  if(eventBin < 0) return;
1267 
1268  TObjArray * mixEventCalo = new TObjArray;
1269 
1271  {
1273  }
1274 
1275  if(!fListMixCaloEvents[eventBin]) fListMixCaloEvents[eventBin] = new TList();
1276 
1277  TList * poolCalo = fListMixCaloEvents[eventBin];
1278 
1279  for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ )
1280  {
1281  AliVCluster * calo = (AliVCluster *) (pl->At(ipr)) ;
1282 
1283  // Remove matched clusters
1284  if( IsTrackMatched( calo, GetReader()->GetInputEvent() ) ) continue ;
1285 
1286  // Cluster momentum calculation
1288  {
1289  calo->GetMomentum(fMomentum,GetVertex(0)) ;
1290  }// Assume that come from vertex in straight line
1291  else
1292  {
1293  Double_t vertex[]={0,0,0};
1294  calo->GetMomentum(fMomentum,vertex) ;
1295  }
1296 
1297  Float_t pt = fMomentum.Pt();
1298 
1299  // Select only clusters in pt range
1300  if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
1301 
1302  AliAODPWG4Particle * mixedCalo = new AliAODPWG4Particle(fMomentum);
1303  mixedCalo->SetDetectorTag(kEMCAL);
1304  mixEventCalo->Add(mixedCalo);
1305  }
1306 
1307  fhNclustersMB->Fill(mixEventCalo->GetEntriesFast(), eventBin, GetEventWeight());
1308 
1309  // Set the event number where the last event was added, to avoid double pool filling
1311 
1312  //printf("Add event to pool with %d clusters \n ",mixEventCalo->GetEntries());
1313  poolCalo->AddFirst(mixEventCalo);
1314  mixEventCalo = 0;
1315 
1316  //printf("Pool size %d, max %d\n",poolCalo->GetSize(), GetNMaxEvMix());
1317 
1318  if(poolCalo->GetSize() > GetNMaxEvMix())
1319  {
1320  // Remove last event
1321  TClonesArray * tmp = static_cast<TClonesArray*>(poolCalo->Last()) ;
1322  poolCalo->RemoveLast() ;
1323  delete tmp ;
1324  }
1325 }
1326 
1327 //_________________________________________________________________________________________________________________
1330 //_________________________________________________________________________________________________________________
1331 Bool_t AliAnaParticleHadronCorrelation::FindLeadingOppositeHadronInWindow(AliAODPWG4ParticleCorrelation * particle)
1332 {
1333  Float_t etaTrig = particle->Eta();
1334  Float_t ptTrig = particle->Pt();
1335  Float_t phiTrig = particle->Phi();
1336  if(phiTrig < 0 ) phiTrig+= TMath::TwoPi();
1337 
1338  Float_t ptLeadHad = 0 ;
1339  Float_t dphiLeadHad= -100 ;
1340  Float_t phiLeadHad = -100 ;
1341  Float_t etaLeadHad = -100 ;
1342  Int_t nTrack = 0;
1343 
1344  for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
1345  {
1346  AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
1347 
1348  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
1349 
1350  Float_t pt = fTrackVector.Pt();
1351  Float_t phi = fTrackVector.Phi() ;
1352  if(phi < 0 ) phi+= TMath::TwoPi();
1353 
1354  Float_t deltaPhi = phiTrig-phi;
1355  //
1356  // Calculate deltaPhi shift so that for the particles on the opposite side
1357  // it is defined between 90 and 270 degrees
1358  // Shift [-360,-90] to [0, 270]
1359  // and [270,360] to [-90,0]
1360  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1361  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
1362 
1363  if(pt > ptLeadHad && deltaPhi > TMath::PiOver2()) // in opposite hemisphere
1364  {
1365  ptLeadHad = pt ;
1366  phiLeadHad = phi;
1367  dphiLeadHad= deltaPhi;
1368  etaLeadHad = fTrackVector.Eta();
1369  nTrack++;
1370  }
1371  }// track loop
1372 
1374  {
1375  if(nTrack == 0)
1376  {
1377  fhPtNoLeadingOppositeHadron ->Fill(ptTrig , GetEventWeight());
1378  fhEtaPhiNoLeadingOppositeHadron->Fill(etaTrig, phiTrig, GetEventWeight());
1379  }
1380  else
1381  {
1382  fhPtLeadingOppositeHadron ->Fill(ptTrig, ptLeadHad, GetEventWeight());
1383  fhPtDiffPhiLeadingOppositeHadron->Fill(ptTrig, dphiLeadHad, GetEventWeight());
1384  fhPtDiffEtaLeadingOppositeHadron->Fill(ptTrig, etaLeadHad-etaTrig, GetEventWeight());
1385  }
1386  }
1387 
1388 
1389  AliDebug(1,Form("pT %2.2f, phi %2.2f, eta %2.2f, nTracks away %d, total tracks %d",
1390  ptLeadHad,phiLeadHad*TMath::RadToDeg(),etaLeadHad,nTrack, GetTrackMultiplicity()));
1391  AliDebug(1,Form("\t pT trig %2.2f, Dphi (trigger-hadron) %2.2f, Deta (trigger-hadron) %2.2f",
1392  ptTrig, dphiLeadHad*TMath::RadToDeg(), etaLeadHad-etaTrig));
1393  AliDebug(1,Form("\t cuts pT: min %2.2f, max %2.2f; DPhi: min %2.2f, max %2.2f",
1394  fMinLeadHadPt,fMaxLeadHadPt,fMinLeadHadPhi*TMath::RadToDeg(),fMaxLeadHadPhi*TMath::RadToDeg()));
1395 
1396 
1397  // reject the trigger if the leading hadron is not in the requested pt or phi window and
1398 
1399  if( nTrack == 0 ) return kFALSE; // No track found in opposite hemisphere
1400 
1401  if( ptLeadHad < fMinLeadHadPt || ptLeadHad > fMaxLeadHadPt ) return kFALSE;
1402 
1403  //printf("Accept leading hadron pT \n");
1404 
1405  if( dphiLeadHad < fMinLeadHadPhi || dphiLeadHad > fMaxLeadHadPhi ) return kFALSE;
1406 
1407  //printf("Accept leading hadron phi \n");
1408 
1409  return kTRUE ;
1410 }
1411 
1412 //____________________________________________________________
1414 //____________________________________________________________
1416 {
1417  TString parList ; //this will be list of parameters used for this analysis.
1418  const Int_t buffersize = 560;
1419  char onePar[buffersize] ;
1420 
1421  snprintf(onePar,buffersize,"--- AliAnaPaticleHadronCorrelation ---:") ;
1422  parList+=onePar ;
1423  snprintf(onePar,buffersize," %3.2f < Pt associated < %3.2f; ", fMinAssocPt, fMaxAssocPt) ;
1424  parList+=onePar ;
1425  snprintf(onePar,buffersize," %3.2f < Phi trigger particle-Hadron < %3.2f; ", fDeltaPhiMinCut, fDeltaPhiMaxCut) ;
1426  parList+=onePar ;
1427  snprintf(onePar,buffersize," %3.2f < Phi trigger particle-UeHadron < %3.2f; ", fUeDeltaPhiMinCut, fUeDeltaPhiMaxCut) ;
1428  parList+=onePar ;
1429  snprintf(onePar,buffersize,"Isolated Trigger? %d;", fSelectIsolated) ;
1430  parList+=onePar ;
1431  snprintf(onePar,buffersize,"Several UE? %d;", fMakeSeveralUE) ;
1432  parList+=onePar ;
1433  snprintf(onePar,buffersize,"Name of AOD Pi0 Branch %s;", fPi0AODBranchName.Data());
1434  parList+=onePar ;
1435  snprintf(onePar,buffersize,"Do Decay-hadron correlation ? pi0 %d, decay %d;", fPi0Trigger, fDecayTrigger) ;
1436  parList+=onePar ;
1437  snprintf(onePar,buffersize,"Select absolute leading for cluster triggers ? %d or Near Side Leading %d;",
1439  parList+=onePar ;
1440  snprintf(onePar,buffersize,"Associated particle pt bins %d: ", fNAssocPtBins) ;
1441  parList+=onePar ;
1442  for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
1443  snprintf(onePar,buffersize,"bin %d = [%2.1f,%2.1f];", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
1444  }
1445  parList+=onePar ;
1446 
1447  //Get parameters set in base class.
1448  parList += GetBaseParametersList() ;
1449 
1450  //Get parameters set in FiducialCut class (not available yet)
1451  //parlist += GetFidCut()->GetFidCutParametersList()
1452 
1453  return new TObjString(parList) ;
1454 }
1455 
1456 //________________________________________________________________
1459 //________________________________________________________________
1461 {
1462  TList * outputContainer = new TList() ;
1463  outputContainer->SetName("CorrelationHistos") ;
1464 
1465  Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Int_t netabins = GetHistogramRanges()->GetHistoEtaBins();
1466  Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax();
1467  Float_t ptmin = GetHistogramRanges()->GetHistoPtMin(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1468 
1469  Int_t ndeltaphibins = GetHistogramRanges()->GetHistoDeltaPhiBins(); Int_t ndeltaetabins = GetHistogramRanges()->GetHistoDeltaEtaBins();
1470  Float_t deltaphimax = GetHistogramRanges()->GetHistoDeltaPhiMax(); Float_t deltaetamax = GetHistogramRanges()->GetHistoDeltaEtaMax();
1471  Float_t deltaphimin = GetHistogramRanges()->GetHistoDeltaPhiMin(); Float_t deltaetamin = GetHistogramRanges()->GetHistoDeltaEtaMin();
1472 
1476 
1477  Int_t nxeztbins = GetHistogramRanges()->GetHistoRatioBins(); Int_t nhbpbins = GetHistogramRanges()->GetHistoHBPBins();
1478  Float_t xeztmax = GetHistogramRanges()->GetHistoRatioMax(); Float_t hbpmax = GetHistogramRanges()->GetHistoHBPMax();
1479  Float_t xeztmin = GetHistogramRanges()->GetHistoRatioMin(); Float_t hbpmin = GetHistogramRanges()->GetHistoHBPMin();
1480 
1481  Int_t nMixBins = GetNCentrBin()*GetNZvertBin()*GetNRPBin();
1482 
1483  Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
1484  Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
1485  Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
1486 
1487  TString nameMC[] = {"Photon","Pi0","Pi0Decay","Eta","EtaDecay","OtherDecay","Electron","Hadron","Pi0DecayLostPair","EtaDecayLostPair"};
1488  TString mcPartType[] = { "#gamma", "#pi^{0} (merged #gamma)", "#gamma_{#pi decay}","#eta (merged #gamma)" , "#gamma_{#eta decay}", "#gamma_{other decay}" , "e^{#pm}" , "hadrons?" , "#gamma_{#pi decay} lost companion", "#gamma_{#eta decay} lost companion"} ;
1489  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1490 
1491  TString parTitle = Form("#it{R} = %2.2f",GetIsolationCut()->GetConeSize());
1492 
1493  // For vz dependent histograms, if option ON
1494  Int_t nz = 1 ;
1495  if(fCorrelVzBin) nz = GetNZvertBin();
1496  TString sz = "" ;
1497  TString tz = "" ;
1498 
1499  // Fill histograms for neutral clusters in mixing?
1501  Bool_t neutralMix = fFillNeutralEventMixPool || isoCase ;
1502 
1503  fhPtTriggerInput = new TH1F("hPtTriggerInput","Input trigger #it{p}_{T}", nptbins,ptmin,ptmax);
1504  fhPtTriggerInput->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1505  outputContainer->Add(fhPtTriggerInput);
1506 
1507  if( fM02MaxCut > 0 && fM02MinCut > 0 )
1508  {
1509  fhPtTriggerSSCut = new TH1F("hPtTriggerSSCut","Trigger #it{p}_{T} after #lambda^{2}_{0} cut", nptbins,ptmin,ptmax);
1510  fhPtTriggerSSCut->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1511  outputContainer->Add(fhPtTriggerSSCut);
1512  }
1513 
1514  if( OnlyIsolated() )
1515  {
1516  fhPtTriggerIsoCut = new TH1F("hPtTriggerIsoCut","Trigger #it{p}_{T} after isolation (and #lambda^{2}_{0} cut)", nptbins,ptmin,ptmax);
1517  fhPtTriggerIsoCut->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1518  outputContainer->Add(fhPtTriggerIsoCut);
1519  }
1520 
1521  fhPtTriggerFidCut = new TH1F("hPtTriggerFidCut","Trigger #it{p}_{T} after fiducial (isolation and #lambda^{2}_{0}) cut", nptbins,ptmin,ptmax);
1522  fhPtTriggerFidCut->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1523  outputContainer->Add(fhPtTriggerFidCut);
1524 
1525  fhPtTrigger = new TH1F("hPtTrigger","#it{p}_{T} distribution of trigger particles (after opposite hadron leading cut and rest)", nptbins,ptmin,ptmax);
1526  fhPtTrigger->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1527  outputContainer->Add(fhPtTrigger);
1528 
1529  if(fFillInvMassHisto)
1530  {
1531  fhMassPtTrigger = new TH2F("hMassPtTrigger","2 photons invariant mass vs p_{T}^{trig}",
1532  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1533  fhMassPtTrigger->SetYTitle("M_{#gamma#gamma} (GeV/#it{c}^{2})");
1534  fhMassPtTrigger->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1535  outputContainer->Add(fhMassPtTrigger);
1536  }
1537 
1538  if(fFillBkgBinsHisto)
1539  {
1540 
1541  fhPtLeadInConeBin = new TH1F*[fNBkgBin] ;
1542 
1543  fhPtSumInConeBin = new TH1F*[fNBkgBin] ;
1544 
1546 
1548 
1549  fhPtLeadConeBinMC = new TH1F*[fNBkgBin*fgkNmcTypes] ;
1550 
1551  fhSumPtConeBinMC = new TH1F*[fNBkgBin*fgkNmcTypes] ;
1552 
1553  for(Int_t ibin = 0; ibin < fNBkgBin; ibin++)
1554  {
1555  fhPtLeadInConeBin[ibin] = new TH1F
1556  (Form("hPtLeadCone_Bin%d",ibin),
1557  Form("cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, %s",
1558  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
1559  fhPtLeadInConeBin[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
1560  fhPtLeadInConeBin[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1561  outputContainer->Add(fhPtLeadInConeBin[ibin]) ;
1562 
1563  fhPtSumInConeBin[ibin] = new TH1F
1564  (Form("hSumPtCone_Bin%d",ibin),
1565  Form("in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, %s",
1566  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
1567  fhPtSumInConeBin[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
1568  fhPtSumInConeBin[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1569  outputContainer->Add(fhPtSumInConeBin[ibin]) ;
1570 
1572  {
1573  for(Int_t idecay = 0; idecay < fNDecayBits; idecay++)
1574  {
1575  Int_t bindecay = ibin+idecay*fNBkgBin;
1576 
1577  fhPtLeadConeBinDecay[bindecay] = new TH1F
1578  (Form("hPtLeadCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
1579  Form("Decay bit %d, cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, %s",
1580  fDecayBits[idecay],fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
1581  fhPtLeadConeBinDecay[bindecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
1582  fhPtLeadConeBinDecay[bindecay]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1583  outputContainer->Add(fhPtLeadConeBinDecay[bindecay]) ;
1584 
1585  fhSumPtConeBinDecay[bindecay] = new TH1F
1586  (Form("hSumPtCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
1587  Form("Decay bit %d, in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, %s",
1588  fDecayBits[idecay],fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
1589  fhSumPtConeBinDecay[bindecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
1590  fhSumPtConeBinDecay[bindecay]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1591  outputContainer->Add(fhSumPtConeBinDecay[bindecay]) ;
1592  }
1593  }
1594 
1595  if(IsDataMC())
1596  {
1597  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
1598  {
1599  Int_t binmc = ibin+imc*fNBkgBin;
1600  fhPtLeadConeBinMC[binmc] = new TH1F
1601  (Form("hPtLeadCone_Bin%d_MC%s",ibin, nameMC[imc].Data()),
1602  Form("in cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, MC %s, %s",
1603  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax);
1604  fhPtLeadConeBinMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
1605  fhPtLeadConeBinMC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1606  outputContainer->Add(fhPtLeadConeBinMC[binmc]) ;
1607 
1608  fhSumPtConeBinMC[binmc] = new TH1F
1609  (Form("hSumPtCone_Bin%d_MC%s",ibin,nameMC[imc].Data()),
1610  Form("in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, MC %s, %s",
1611  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax);
1612  fhSumPtConeBinMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
1613  fhSumPtConeBinMC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1614  outputContainer->Add(fhSumPtConeBinMC[binmc]) ;
1615  } // MC particle loop
1616  }
1617  }
1618  }
1619 
1620  if(IsDataMC())
1621  {
1622  for(Int_t i=0; i < fgkNmcTypes; i++)
1623  {
1624  fhPtTriggerMC[i] = new TH1F(Form("hPtTrigger_MC%s",nameMC[i].Data()),
1625  Form("#it{p}_{T} distribution of trigger particles, trigger origin is %s",nameMC[i].Data()),
1626  nptbins,ptmin,ptmax);
1627  fhPtTriggerMC[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1628  outputContainer->Add(fhPtTriggerMC[i]);
1629 
1630  if(fFillInvMassHisto)
1631  {
1632  fhMCMassPtTrigger[i] = new TH2F(Form("hMassPtTrigger_MC%s",nameMC[i].Data()),
1633  Form("2 photons invariant mass, trigger origin is %s",nameMC[i].Data()),
1634  nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1635  fhMCMassPtTrigger[i]->SetYTitle("m_{#gamma#gamma}");
1636  fhMCMassPtTrigger[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1637  outputContainer->Add(fhMCMassPtTrigger[i]) ;
1638  }
1639  }
1640  }
1641 
1642  if(fDecayTrigger)
1643  {
1644  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
1645  {
1646  fhPtDecayTrigger[ibit] = new TH1F(Form("hPtDecayTrigger_bit%d",fDecayBits[ibit]),
1647  Form("#it{p}_{T} distribution of trigger particles, decay Bit %d",fDecayBits[ibit]),
1648  nptbins,ptmin,ptmax);
1649  fhPtDecayTrigger[ibit]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1650  outputContainer->Add(fhPtDecayTrigger[ibit]);
1651 
1652  if(IsDataMC())
1653  {
1654  for(Int_t i=0; i < fgkNmcTypes; i++)
1655  {
1656  fhPtDecayTriggerMC[ibit][i] = new TH1F(Form("hPtDecayTrigger_bit%d_MC%s",fDecayBits[ibit], nameMC[i].Data()),
1657  Form("#it{p}_{T} distribution of trigger particles, decay Bit %d, trigger origin is %s",fDecayBits[ibit], nameMC[i].Data()),
1658  nptbins,ptmin,ptmax);
1659  fhPtDecayTriggerMC[ibit][i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1660  outputContainer->Add(fhPtDecayTriggerMC[ibit][i]);
1661  }
1662  }
1663  }
1664  }
1665 
1666  if(fCorrelVzBin)
1667  {
1668  fhPtTriggerVzBin = new TH2F("hPtTriggerVzBin","#it{p}_{T} distribution of trigger particles vs vz bin", nptbins,ptmin,ptmax,GetNZvertBin(),0,GetNZvertBin());
1669  fhPtTriggerVzBin->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1670  fhPtTriggerVzBin->SetYTitle("#it{v}_{#it{z}} bin");
1671  outputContainer->Add(fhPtTriggerVzBin);
1672  }
1673 
1674  fhPtTriggerBin = new TH2F ("hPtTriggerBin","#it{p}_{T} distribution of trigger particles", nptbins,ptmin,ptmax,nMixBins,0,nMixBins);
1675  fhPtTriggerBin->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1676  fhPtTriggerBin->SetYTitle("Bin");
1677  outputContainer->Add(fhPtTriggerBin);
1678 
1679  fhPhiTrigger = new TH2F ("hPhiTrigger","#phi distribution of trigger Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
1680  fhPhiTrigger->SetYTitle("#phi (rad)");
1681  outputContainer->Add(fhPhiTrigger);
1682 
1683  fhEtaTrigger = new TH2F ("hEtaTrigger","#eta distribution of trigger",nptbins,ptmin,ptmax, netabins,etamin,etamax);
1684  fhEtaTrigger->SetYTitle("#eta ");
1685  outputContainer->Add(fhEtaTrigger);
1686 
1688  {
1689  fhPtTriggerCentrality = new TH2F("hPtTriggerCentrality","Trigger particle #it{p}_{T} vs centrality",nptbins,ptmin,ptmax,100,0.,100) ;
1690  fhPtTriggerCentrality->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1691  fhPtTriggerCentrality->SetYTitle("Centrality (%)");
1692  outputContainer->Add(fhPtTriggerCentrality) ;
1693 
1694  fhPtTriggerEventPlane = new TH2F("hPtTriggerEventPlane","Trigger particle #it{p}_{T} vs event plane angle",nptbins,ptmin,ptmax, 100,0.,TMath::Pi()) ;
1695  fhPtTriggerEventPlane->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1696  fhPtTriggerEventPlane->SetXTitle("EP angle (rad)");
1697  outputContainer->Add(fhPtTriggerEventPlane) ;
1698 
1699  fhTriggerEventPlaneCentrality = new TH2F("hTriggerEventPlaneCentrality","Trigger particle centrality vs event plane angle",100,0.,100,100,0.,TMath::Pi()) ;
1700  fhTriggerEventPlaneCentrality->SetXTitle("Centrality (%)");
1701  fhTriggerEventPlaneCentrality->SetYTitle("EP angle (rad)");
1702  outputContainer->Add(fhTriggerEventPlaneCentrality) ;
1703  }
1704 
1705  // Leading hadron in oposite side
1707  {
1708  fhPtLeadingOppositeHadron = new TH2F("hPtTriggerPtLeadingOppositeHadron","Leading hadron opposite to trigger vs trigger #it{p}_{T}",
1709  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1710  fhPtLeadingOppositeHadron->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1711  fhPtLeadingOppositeHadron->SetYTitle("#it{p}_{T}^{lead hadron} (GeV/#it{c})");
1712  outputContainer->Add(fhPtLeadingOppositeHadron);
1713 
1714  fhPtNoLeadingOppositeHadron = new TH1F("hPtTriggerNoLeadingOppositeHadron","No Leading hadron opposite to trigger #it{p}_{T}",
1715  nptbins,ptmin,ptmax);
1716  fhPtNoLeadingOppositeHadron->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1717  outputContainer->Add(fhPtNoLeadingOppositeHadron);
1718 
1719  fhEtaPhiNoLeadingOppositeHadron = new TH2F("hEtaPhiTriggerNoLeadingOppositeHadron","No Leading hadron opposite to trigger #eta:#phi",
1720  netabins,etamin,etamax,nphibins,phimin,phimax);
1721  fhEtaPhiNoLeadingOppositeHadron->SetXTitle("#eta");
1722  fhEtaPhiNoLeadingOppositeHadron->SetYTitle("#phi");
1723  outputContainer->Add(fhEtaPhiNoLeadingOppositeHadron);
1724 
1725 
1726  fhPtDiffPhiLeadingOppositeHadron = new TH2F("hPtTriggerDiffPhiTriggerLeadingOppositeHadron","#phi_{trigger}-#phi_{leading opposite hadron} vs #it{p}_{T}^{trig}",
1727  nptbins,ptmin,ptmax,ndeltaphibins,deltaphimin,deltaphimax);
1728  fhPtDiffPhiLeadingOppositeHadron->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1729  fhPtDiffPhiLeadingOppositeHadron->SetYTitle("#phi_{trigger}-#phi_{leading opposite hadron} (rad)");
1730  outputContainer->Add(fhPtDiffPhiLeadingOppositeHadron);
1731 
1732  fhPtDiffEtaLeadingOppositeHadron = new TH2F("hPtTriggerDiffEtaTriggerPhiLeadingOppositeHadron","#eta_{trigger}-#eta_{leading opposite hadron} vs #it{p}_{T}^{trig}",
1733  nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1734  fhPtDiffEtaLeadingOppositeHadron->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1735  fhPtDiffEtaLeadingOppositeHadron->SetYTitle("#eta_{trigger}-#eta_{leading opposite hadron}");
1736  outputContainer->Add(fhPtDiffEtaLeadingOppositeHadron);
1737  }
1738 
1739  // Correlation with charged hadrons
1740 
1741  fhDeltaPhiDeltaEtaCharged = new TH2F
1742  ("hDeltaPhiDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs #phi_{trigger} - #phi_{h^{#pm}}",
1743  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
1744  fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi (rad)");
1745  fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
1746 
1748  ("hDeltaPhiDeltaEtaChargedPtA3GeV","#eta_{trigger} - #eta_{h^{#pm}} vs #phi_{trigger} - #phi_{h^{#pm}, #it{p}_{TA}>3 GeV/#it{c}}",
1749  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
1750  fhDeltaPhiDeltaEtaChargedPtA3GeV->SetXTitle("#Delta #phi (rad)");
1751  fhDeltaPhiDeltaEtaChargedPtA3GeV->SetYTitle("#Delta #eta");
1752 
1753  fhPhiCharged = new TH2F
1754  ("hPhiCharged","#phi_{h^{#pm}} vs #it{p}_{T #pm}",
1755  nptbins,ptmin,ptmax,180,0,TMath::TwoPi());
1756  fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
1757  fhPhiCharged->SetXTitle("#it{p}_{T #pm} (GeV/#it{c})");
1758 
1759  fhEtaCharged = new TH2F
1760  ("hEtaCharged","#eta_{h^{#pm}} vs #it{p}_{T #pm}",
1761  nptbins,ptmin,ptmax,100,-1.,1.);
1762  fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
1763  fhEtaCharged->SetXTitle("#it{p}_{T #pm} (GeV/#it{c})");
1764 
1765  fhDeltaPhiCharged = new TH2F
1766  ("hDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}",
1767  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1768  fhDeltaPhiCharged->SetYTitle("#Delta #phi (rad)");
1769  fhDeltaPhiCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1770 
1771  fhDeltaPhiChargedPtA3GeV = new TH2F
1772  ("hDeltaPhiChargedPtA3GeV","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}",
1773  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1774  fhDeltaPhiChargedPtA3GeV->SetYTitle("#Delta #phi (rad)");
1775  fhDeltaPhiChargedPtA3GeV->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1776 
1777 
1778  fhDeltaPhiChargedPt = new TH2F
1779  ("hDeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs #it{p}_{T h^{#pm}}",
1780  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1781  fhDeltaPhiChargedPt->SetYTitle("#Delta #phi (rad)");
1782  fhDeltaPhiChargedPt->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1783 
1784  fhDeltaEtaCharged = new TH2F
1785  ("hDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs #it{p}_{T trigger}",
1786  nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1787  fhDeltaEtaCharged->SetYTitle("#Delta #eta");
1788  fhDeltaEtaCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1789 
1790  fhDeltaEtaChargedPtA3GeV = new TH2F
1791  ("hDeltaEtaChargedPtA3GeV","#eta_{trigger} - #eta_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}",
1792  nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1793  fhDeltaEtaChargedPtA3GeV->SetYTitle("#Delta #eta");
1794  fhDeltaEtaChargedPtA3GeV->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1795 
1796  fhXECharged =
1797  new TH2F("hXECharged","#it{x}_{#it{E}} for charged tracks",
1798  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1799  fhXECharged->SetYTitle("#it{x}_{#it{E}}");
1800  fhXECharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1801 
1803  new TH2F("hXECharged_Cone2","#it{x}_{#it{E}} for charged tracks in cone 2 (5#pi/6-7#pi/6)",
1804  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1805  fhXECharged_Cone2->SetYTitle("#it{x}_{#it{E}}");
1806  fhXECharged_Cone2->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1807 
1808  fhXEPosCharged =
1809  new TH2F("hXEPositiveCharged","#it{x}_{#it{E}} for positive charged tracks",
1810  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1811  fhXEPosCharged->SetYTitle("#it{x}_{#it{E}}");
1812  fhXEPosCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1813 
1814  fhXENegCharged =
1815  new TH2F("hXENegativeCharged","#it{x}_{#it{E}} for negative charged tracks",
1816  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1817  fhXENegCharged->SetYTitle("#it{x}_{#it{E}}");
1818  fhXENegCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1819 
1821  new TH2F("hHbpXECharged","#xi = ln(1/#it{x}_{#it{E}}) with charged hadrons",
1822  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
1823  fhPtHbpXECharged->SetYTitle("ln(1/#it{x}_{#it{E}})");
1824  fhPtHbpXECharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1825 
1827  new TH2F("hHbpXECharged_Cone2","#xi = ln(1/#it{x}_{#it{E}}) with charged hadrons in cone 2 (5#pi/6-7#pi/6)",
1828  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
1829  fhPtHbpXECharged_Cone2->SetYTitle("ln(1/#it{x}_{#it{E}})");
1830  fhPtHbpXECharged_Cone2->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1831 
1832  fhZTCharged =
1833  new TH2F("hZTCharged","#it{z}_{T} for charged tracks",
1834  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1835  fhZTCharged->SetYTitle("#it{z}_{T}");
1836  fhZTCharged->SetXTitle("#it{p}_{T trigger}");
1837 
1838  fhZTPosCharged =
1839  new TH2F("hZTPositiveCharged","#it{z}_{T} for positive charged tracks",
1840  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1841  fhZTPosCharged->SetYTitle("#it{z}_{T}");
1842  fhZTPosCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1843 
1844  fhZTNegCharged =
1845  new TH2F("hZTNegativeCharged","#it{z}_{T} for negative charged tracks",
1846  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1847  fhZTNegCharged->SetYTitle("#it{z}_{T}");
1848  fhZTNegCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1849 
1851  new TH2F("hHbpZTCharged","#xi = ln(1/#it{z}_{T}) with charged hadrons",
1852  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
1853  fhPtHbpZTCharged->SetYTitle("ln(1/#it{z}_{T})");
1854  fhPtHbpZTCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1855 
1856  fhPtTrigPout =
1857  new TH2F("hPtTrigPout","Pout with triggers",
1858  nptbins,ptmin,ptmax,nptbins,-1.*ptmax/2.,ptmax/2.);
1859  fhPtTrigPout->SetYTitle("#it{p}_{out} (GeV/#it{c})");
1860  fhPtTrigPout->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1861 
1862  fhPtTrigCharged =
1863  new TH2F("hPtTrigCharged","trigger and charged tracks pt distribution",
1864  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1865  fhPtTrigCharged->SetYTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1866  fhPtTrigCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1867 
1868  outputContainer->Add(fhDeltaPhiDeltaEtaCharged);
1869  outputContainer->Add(fhDeltaPhiDeltaEtaChargedPtA3GeV);
1870  outputContainer->Add(fhPhiCharged) ;
1871  outputContainer->Add(fhEtaCharged) ;
1872  outputContainer->Add(fhDeltaPhiCharged) ;
1873  outputContainer->Add(fhDeltaPhiChargedPtA3GeV) ;
1874  outputContainer->Add(fhDeltaEtaCharged) ;
1875  outputContainer->Add(fhDeltaEtaChargedPtA3GeV) ;
1876  outputContainer->Add(fhDeltaPhiChargedPt) ;
1877 
1878  outputContainer->Add(fhXECharged) ;
1879  outputContainer->Add(fhXECharged_Cone2) ;
1880 
1881  if(IsDataMC())
1882  {
1883  for(Int_t i=0; i < fgkNmcTypes; i++)
1884  {
1885 
1886  fhDeltaPhiChargedMC[i] = new TH2F(Form("hDeltaPhiCharged_MC%s",nameMC[i].Data()),
1887  Form("#Delta #phi for charged tracks, trigger origin is %s",nameMC[i].Data()),
1888  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
1889  fhDeltaPhiChargedMC[i]->SetYTitle("#it{x}_{#it{E}}");
1890  fhDeltaPhiChargedMC[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1891  outputContainer->Add(fhDeltaPhiChargedMC[i]) ;
1892 
1893  fhXEChargedMC[i] = new TH2F(Form("hXECharged_MC%s",nameMC[i].Data()),
1894  Form("#it{x}_{#it{E}} for charged tracks, trigger origin is %s",nameMC[i].Data()),
1895  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1896  fhXEChargedMC[i]->SetYTitle("#it{x}_{#it{E}}");
1897  fhXEChargedMC[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1898  outputContainer->Add(fhXEChargedMC[i]) ;
1899 
1900  fhXEUeChargedRightMC[i] = new TH2F(Form("hXEUeChargedRight_MC%s",nameMC[i].Data()),
1901  Form("#it{x}_{#it{E}} for charged tracks in right UE cone, trigger origin is %s",nameMC[i].Data()),
1902  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1903  fhXEUeChargedRightMC[i]->SetYTitle("#it{x}_{#it{E}}");
1904  fhXEUeChargedRightMC[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1905  outputContainer->Add(fhXEUeChargedRightMC[i]) ;
1906 
1907  fhXEUeChargedLeftMC[i] = new TH2F(Form("hXEUeChargedLeft_MC%s",nameMC[i].Data()),
1908  Form("#it{x}_{#it{E}} for charged tracks in left UE cone, trigger origin is %s",nameMC[i].Data()),
1909  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1910  fhXEUeChargedLeftMC[i]->SetYTitle("#it{x}_{#it{E}}");
1911  fhXEUeChargedLeftMC[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1912  outputContainer->Add(fhXEUeChargedLeftMC[i]) ;
1913  }
1914  }
1915 
1916  outputContainer->Add(fhXEPosCharged) ;
1917  outputContainer->Add(fhXENegCharged) ;
1918  outputContainer->Add(fhPtHbpXECharged) ;
1919  outputContainer->Add(fhPtHbpXECharged_Cone2) ;
1920 
1921  outputContainer->Add(fhZTCharged) ;
1922  outputContainer->Add(fhZTPosCharged) ;
1923  outputContainer->Add(fhZTNegCharged) ;
1924  outputContainer->Add(fhPtHbpZTCharged) ;
1925 
1926  outputContainer->Add(fhPtTrigPout) ;
1927  outputContainer->Add(fhPtTrigCharged) ;
1928 
1929  TString right = "";
1930  if(fMakeSeveralUE) right = "Right";
1931 
1932  fhUePart = new TH1F("hUePart","UE particles distribution vs pt trig",
1933  nptbins,ptmin,ptmax);
1934  fhUePart->SetYTitle("dNch");
1935  fhUePart->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1936 
1937  fhDeltaPhiUeChargedPt = new TH2F
1938  (Form("hDeltaPhiUe%sChargedPt",right.Data()),"#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}}",
1939  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1940  fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi (rad)");
1941  fhDeltaPhiUeChargedPt->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1942 
1943  fhXEUeCharged =
1944  new TH2F(Form("hXEUeCharged%s",right.Data()),"#it{x}_{#it{E}} for Underlying Event",
1945  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1946  fhXEUeCharged->SetYTitle("#it{x}_{#it{E}}");
1947  fhXEUeCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1948 
1950  new TH2F(Form("hHbpXEUeCharged%s",right.Data()),"#xi = ln(1/#it{x}_{#it{E}}) for Underlying Event",
1951  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
1952  fhPtHbpXEUeCharged->SetYTitle("ln(1/#it{x}_{#it{E}})");
1953  fhPtHbpXEUeCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1954 
1955  fhZTUeCharged =
1956  new TH2F(Form("hZTUeCharged%s",right.Data()),"#it{z}_{T} for Underlying Event",
1957  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
1958  fhZTUeCharged->SetYTitle("#it{z}_{T}");
1959  fhZTUeCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1960 
1962  new TH2F(Form("hHbpZTUeCharged%s",right.Data()),"#xi = ln(1/#it{z}_{T}) for Underlying Event",
1963  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
1964  fhPtHbpZTUeCharged->SetYTitle("ln(1/#it{x}_{#it{E}})");
1965  fhPtHbpZTUeCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
1966 
1967  outputContainer->Add(fhUePart);
1968  outputContainer->Add(fhDeltaPhiUeChargedPt) ;
1969  outputContainer->Add(fhXEUeCharged) ;
1970  outputContainer->Add(fhPtHbpXEUeCharged) ;
1971  outputContainer->Add(fhZTUeCharged) ;
1972  outputContainer->Add(fhPtHbpZTUeCharged) ;
1973 
1974  if(fMakeSeveralUE)
1975  {
1976  fhDeltaPhiUeLeftCharged = new TH2F
1977  ("hDeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}} with UE left side range of trigger particles",
1978  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1979  fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi (rad)");
1980  fhDeltaPhiUeLeftCharged->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1981  outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
1982 
1983  fhDeltaPhiUeLeftUpCharged = new TH2F
1984  ("hDeltaPhiUeLeftUpChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}} with UE left Up side range of trigger particles",
1985  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1986  fhDeltaPhiUeLeftUpCharged->SetYTitle("#Delta #phi (rad)");
1987  fhDeltaPhiUeLeftUpCharged->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1988  outputContainer->Add(fhDeltaPhiUeLeftUpCharged) ;
1989 
1990  fhDeltaPhiUeRightUpCharged = new TH2F
1991  ("hDeltaPhiUeRightUpChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}} with UE right Up side range of trigger particles",
1992  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1993  fhDeltaPhiUeRightUpCharged->SetYTitle("#Delta #phi (rad)");
1994  fhDeltaPhiUeRightUpCharged->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
1995  outputContainer->Add(fhDeltaPhiUeRightUpCharged) ;
1996 
1997  fhDeltaPhiUeLeftDownCharged = new TH2F
1998  ("hDeltaPhiUeLeftDownChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}} with UE left Down side range of trigger particles",
1999  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2000  fhDeltaPhiUeLeftDownCharged->SetYTitle("#Delta #phi (rad)");
2001  fhDeltaPhiUeLeftDownCharged->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2002  outputContainer->Add(fhDeltaPhiUeLeftDownCharged) ;
2003 
2004  fhDeltaPhiUeRightDownCharged = new TH2F
2005  ("hDeltaPhiUeRightDownChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs #it{p}_{T Ueh^{#pm}} with UE right Down side range of trigger particles",
2006  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2007  fhDeltaPhiUeRightDownCharged->SetYTitle("#Delta #phi (rad)");
2008  fhDeltaPhiUeRightDownCharged->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2009  outputContainer->Add(fhDeltaPhiUeRightDownCharged) ;
2010 
2012  new TH2F("hXEUeChargedLeft","#it{x}_{#it{E}} with UE left side of trigger",
2013  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2014  fhXEUeLeftCharged->SetYTitle("#it{x}_{#it{E} Ueh^{#pm}}");
2015  fhXEUeLeftCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2016  outputContainer->Add(fhXEUeLeftCharged) ;
2017 
2019  new TH2F("hXEUeChargedLeftUp","#it{x}_{#it{E}} with UE left Up side of trigger",
2020  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2021  fhXEUeLeftUpCharged->SetYTitle("#it{x}_{#it{E} Ueh^{#pm}}");
2022  fhXEUeLeftUpCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2023  outputContainer->Add(fhXEUeLeftUpCharged) ;
2024 
2026  new TH2F("hXEUeChargedRightUp","#it{x}_{#it{E} h^{#pm}} with UE right Up side of trigger",
2027  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2028  fhXEUeRightUpCharged->SetYTitle("#it{z}_{trigger Ueh^{#pm}}");
2029  fhXEUeRightUpCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2030  outputContainer->Add(fhXEUeRightUpCharged) ;
2031 
2033  new TH2F("hXEUeChargedLeftDown","#it{x}_{#it{E}} with UE left Down side of trigger",
2034  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2035  fhXEUeLeftDownCharged->SetYTitle("#it{x}_{#it{E} Ueh^{#pm}}");
2036  fhXEUeLeftDownCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2037  outputContainer->Add(fhXEUeLeftDownCharged) ;
2038 
2040  new TH2F("hXEUeChargedRightDown","#it{x}_{#it{E} h^{#pm}} with UE right Down side of trigger",
2041  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2042  fhXEUeRightDownCharged->SetYTitle("#it{z}_{trigger Ueh^{#pm}}");
2043  fhXEUeRightDownCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2044  outputContainer->Add(fhXEUeRightDownCharged) ;
2045 
2047  new TH2F("hHbpXEUeChargedLeft","#xi = ln(1/#it{x}_{#it{E}}) with charged UE left side of trigger",
2048  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2049  fhPtHbpXEUeLeftCharged->SetYTitle("ln(1/#it{x}_{#it{E}})");
2050  fhPtHbpXEUeLeftCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2051  outputContainer->Add(fhPtHbpXEUeLeftCharged) ;
2052 
2054  new TH2F("hZTUeChargedLeft","#it{z}_{trigger h^{#pm}} = #it{p}_{T Ueh^{#pm}} / #it{p}_{T trigger} with UE left side of trigger",
2055  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2056  fhZTUeLeftCharged->SetYTitle("#it{z}_{trigger Ueh^{#pm}}");
2057  fhZTUeLeftCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2058  outputContainer->Add(fhZTUeLeftCharged) ;
2059 
2061  new TH2F("hHbpZTUeChargedLeft","#xi = ln(1/#it{z}_{T}) with charged UE left side of trigger",
2062  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2063  fhPtHbpZTUeLeftCharged->SetYTitle("ln(1/#it{z}_{T})");
2064  fhPtHbpZTUeLeftCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2065  outputContainer->Add(fhPtHbpZTUeLeftCharged) ;
2066  }
2067 
2068  if(IsPileUpAnalysisOn())
2069  {
2070  fhDeltaPhiChargedOtherBC = new TH2F
2071  ("hDeltaPhiChargedOtherBC","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, track BC!=0",
2072  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2073  fhDeltaPhiChargedOtherBC->SetYTitle("#Delta #phi (rad)");
2074  fhDeltaPhiChargedOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2075 
2077  ("hDeltaPhiChargedPtA3GeVOtherBC","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}, track BC!=0",
2078  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2079  fhDeltaPhiChargedPtA3GeVOtherBC->SetYTitle("#Delta #phi (rad)");
2080  fhDeltaPhiChargedPtA3GeVOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2081 
2083  new TH2F("hPtTrigChargedOtherBC","trigger and charged tracks pt distribution, track BC!=0",
2084  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2085  fhPtTrigChargedOtherBC->SetYTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2086  fhPtTrigChargedOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2087 
2089  new TH2F("hXEChargedOtherBC","#it{x}_{#it{E}} for charged tracks, track BC!=0",
2090  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2091  fhXEChargedOtherBC->SetYTitle("#it{x}_{#it{E}}");
2092  fhXEChargedOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2093 
2095  new TH2F("hXEUeChargedOtherBC","#it{x}_{#it{E}} for Underlying Event, track BC!=0",
2096  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2097  fhXEUeChargedOtherBC->SetYTitle("#it{x}_{#it{E}}");
2098  fhXEUeChargedOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2099 
2101  new TH2F("hZTChargedOtherBC","#it{z}_{T} for charged tracks, track BC!=0",
2102  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2103  fhZTChargedOtherBC->SetYTitle("#it{z}_{T}");
2104  fhZTChargedOtherBC->SetXTitle("#it{p}_{T trigger}");
2105 
2107  new TH2F("hZTUeChargedOtherBC","#it{z}_{T} for Underlying Event, track BC!=0",
2108  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2109  fhZTUeChargedOtherBC->SetYTitle("#it{z}_{T}");
2110  fhZTUeChargedOtherBC->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2111 
2112  outputContainer->Add(fhDeltaPhiChargedOtherBC) ;
2113  outputContainer->Add(fhDeltaPhiChargedPtA3GeVOtherBC) ;
2114  outputContainer->Add(fhXEChargedOtherBC) ;
2115  outputContainer->Add(fhXEUeChargedOtherBC) ;
2116  outputContainer->Add(fhZTChargedOtherBC) ;
2117  outputContainer->Add(fhZTUeChargedOtherBC) ;
2118  outputContainer->Add(fhPtTrigChargedOtherBC) ;
2119 
2120  fhDeltaPhiChargedBC0 = new TH2F
2121  ("hDeltaPhiChargedBC0","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, track BC==0",
2122  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2123  fhDeltaPhiChargedBC0->SetYTitle("#Delta #phi (rad)");
2124  fhDeltaPhiChargedBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2125 
2126  fhDeltaPhiChargedPtA3GeVBC0 = new TH2F
2127  ("hDeltaPhiChargedPtA3GeVBC0","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}, track BC==0",
2128  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2129  fhDeltaPhiChargedPtA3GeVBC0->SetYTitle("#Delta #phi (rad)");
2130  fhDeltaPhiChargedPtA3GeVBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2131 
2133  new TH2F("hPtTrigChargedBC0","trigger and charged tracks pt distribution, track BC==0",
2134  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2135  fhPtTrigChargedBC0->SetYTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2136  fhPtTrigChargedBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2137 
2138  fhXEChargedBC0 =
2139  new TH2F("hXEChargedBC0","#it{x}_{#it{E}} for charged tracks, track BC==0",
2140  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2141  fhXEChargedBC0->SetYTitle("#it{x}_{#it{E}}");
2142  fhXEChargedBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2143 
2145  new TH2F("hXEUeChargedBC0","#it{x}_{#it{E}} for Underlying Event, track BC==0",
2146  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2147  fhXEUeChargedBC0->SetYTitle("#it{x}_{#it{E}}");
2148  fhXEUeChargedBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2149 
2150  fhZTChargedBC0 =
2151  new TH2F("hZTChargedBC0","#it{z}_{T} for charged tracks, track BC==0",
2152  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2153  fhZTChargedBC0->SetYTitle("#it{z}_{T}");
2154  fhZTChargedBC0->SetXTitle("#it{p}_{T trigger}");
2155 
2157  new TH2F("hZTUeChargedBC0","#it{z}_{T} for Underlying Event, track BC==0",
2158  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2159  fhZTUeChargedBC0->SetYTitle("#it{z}_{T}");
2160  fhZTUeChargedBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2161 
2162  outputContainer->Add(fhDeltaPhiChargedBC0) ;
2163  outputContainer->Add(fhDeltaPhiChargedPtA3GeVBC0) ;
2164  outputContainer->Add(fhXEChargedBC0) ;
2165  outputContainer->Add(fhXEUeChargedBC0) ;
2166  outputContainer->Add(fhZTChargedBC0) ;
2167  outputContainer->Add(fhZTUeChargedBC0) ;
2168  outputContainer->Add(fhPtTrigChargedBC0) ;
2169 
2170  fhPtTriggerVtxBC0 = new TH1F("hPtTriggerVtxBC0","#it{p}_{T} distribution of trigger particles", nptbins,ptmin,ptmax);
2171  fhPtTriggerVtxBC0->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2172 
2173  fhDeltaPhiChargedVtxBC0 = new TH2F
2174  ("hDeltaPhiChargedVtxBC0","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, track BC==0",
2175  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2176  fhDeltaPhiChargedVtxBC0->SetYTitle("#Delta #phi (rad)");
2177  fhDeltaPhiChargedVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2178 
2180  ("hDeltaPhiChargedPtA3GeVVtxBC0","#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}, track BC==0",
2181  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2182  fhDeltaPhiChargedPtA3GeVVtxBC0->SetYTitle("#Delta #phi (rad)");
2183  fhDeltaPhiChargedPtA3GeVVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2184 
2186  new TH2F("hPtTrigChargedVtxBC0","trigger and charged tracks pt distribution, track BC==0",
2187  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2188  fhPtTrigChargedVtxBC0->SetYTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2189  fhPtTrigChargedVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2190 
2192  new TH2F("hXEChargedVtxBC0","#it{x}_{#it{E}} for charged tracks, track BC==0",
2193  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2194  fhXEChargedVtxBC0->SetYTitle("#it{x}_{#it{E}}");
2195  fhXEChargedVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2196 
2198  new TH2F("hXEUeChargedVtxBC0","#it{x}_{#it{E}} for Underlying Event, track BC==0",
2199  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2200  fhXEUeChargedVtxBC0->SetYTitle("#it{x}_{#it{E}}");
2201  fhXEUeChargedVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2202 
2204  new TH2F("hZTChargedVtxBC0","#it{z}_{T} for charged tracks, track BC==0",
2205  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2206  fhZTChargedVtxBC0->SetYTitle("#it{z}_{T}");
2207  fhZTChargedVtxBC0->SetXTitle("#it{p}_{T trigger}");
2208 
2210  new TH2F("hZTUeChargedVtxBC0","#it{z}_{T} for Underlying Event, track BC==0",
2211  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2212  fhZTUeChargedVtxBC0->SetYTitle("#it{z}_{T}");
2213  fhZTUeChargedVtxBC0->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2214 
2215  outputContainer->Add(fhPtTriggerVtxBC0);
2216  outputContainer->Add(fhDeltaPhiChargedVtxBC0) ;
2217  outputContainer->Add(fhDeltaPhiChargedPtA3GeVVtxBC0) ;
2218  outputContainer->Add(fhXEChargedVtxBC0) ;
2219  outputContainer->Add(fhXEUeChargedVtxBC0) ;
2220  outputContainer->Add(fhZTChargedVtxBC0) ;
2221  outputContainer->Add(fhZTUeChargedVtxBC0) ;
2222  outputContainer->Add(fhPtTrigChargedVtxBC0) ;
2223 
2224  for(Int_t i = 0 ; i < 7 ; i++)
2225  {
2226  fhPtTriggerPileUp[i] = new TH1F(Form("hPtTriggerPileUp%s",pileUpName[i].Data()),
2227  Form("#it{p}_{T} distribution of trigger particles, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2228  fhPtTriggerPileUp[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2229  outputContainer->Add(fhPtTriggerPileUp[i]);
2230 
2231  fhDeltaPhiChargedPileUp[i] = new TH2F(Form("hDeltaPhiChargedPileUp%s",pileUpName[i].Data()),
2232  Form("#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, %s Pile-Up event",pileUpName[i].Data()),
2233  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2234  fhDeltaPhiChargedPileUp[i]->SetYTitle("#Delta #phi (rad)");
2235  fhDeltaPhiChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2236  outputContainer->Add(fhDeltaPhiChargedPileUp[i]) ;
2237 
2238  fhDeltaPhiChargedPtA3GeVPileUp[i] = new TH2F(Form("hDeltaPhiChargedPtA3GeVPileUp%s",pileUpName[i].Data()),
2239  Form("#phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}, %s Pile-Up event",pileUpName[i].Data()),
2240  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2241  fhDeltaPhiChargedPtA3GeVPileUp[i]->SetYTitle("#Delta #phi (rad)");
2242  fhDeltaPhiChargedPtA3GeVPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2243  outputContainer->Add(fhDeltaPhiChargedPtA3GeVPileUp[i]) ;
2244 
2245  fhDeltaEtaChargedPileUp[i] = new TH2F(Form("hDeltaEtaChargedPileUp%s",pileUpName[i].Data()),
2246  Form("#eta_{trigger} - #eta_{h^{#pm}} vs #it{p}_{T trigger}, %s Pile-Up event",pileUpName[i].Data()),
2247  nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
2248  fhDeltaEtaChargedPileUp[i]->SetYTitle("#Delta #eta");
2249  fhDeltaEtaChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2250  outputContainer->Add(fhDeltaEtaChargedPileUp[i]) ;
2251 
2252  fhDeltaEtaChargedPtA3GeVPileUp[i] = new TH2F(Form("hDeltaEtaChargedPtA3GeVPileUp%s",pileUpName[i].Data()),
2253  Form("#eta_{trigger} - #eta_{h^{#pm}} vs #it{p}_{T trigger}, #it{p}_{TA}>3 GeV/#it{c}, %s Pile-Up event",pileUpName[i].Data()),
2254  nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
2255  fhDeltaEtaChargedPtA3GeVPileUp[i]->SetYTitle("#Delta #eta");
2256  fhDeltaEtaChargedPtA3GeVPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2257  outputContainer->Add(fhDeltaEtaChargedPtA3GeVPileUp[i]) ;
2258 
2259  fhXEChargedPileUp[i] = new TH2F(Form("hXEChargedPileUp%s",pileUpName[i].Data()),
2260  Form("#it{x}_{#it{E}} for charged tracks, %s Pile-Up event",pileUpName[i].Data()),
2261  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2262  fhXEChargedPileUp[i]->SetYTitle("#it{x}_{#it{E}}");
2263  fhXEChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2264  outputContainer->Add(fhXEChargedPileUp[i]) ;
2265 
2266  fhXEUeChargedPileUp[i] = new TH2F(Form("hXEUeChargedPileUp%s",pileUpName[i].Data()),
2267  Form("#it{x}_{#it{E}} for Underlying Event, %s Pile-Up event",pileUpName[i].Data()),
2268  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2269  fhXEUeChargedPileUp[i]->SetYTitle("#it{x}_{#it{E}}");
2270  fhXEUeChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2271  outputContainer->Add(fhXEUeChargedPileUp[i]) ;
2272 
2273  fhZTChargedPileUp[i] = new TH2F(Form("hZTChargedPileUp%s",pileUpName[i].Data()),
2274  Form("#it{z}_{T} for charged tracks, %s Pile-Up event",pileUpName[i].Data()),
2275  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2276  fhZTChargedPileUp[i]->SetYTitle("#it{z}_{T}");
2277  fhZTChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2278  outputContainer->Add(fhZTChargedPileUp[i]) ;
2279 
2280  fhZTUeChargedPileUp[i] = new TH2F(Form("hZTUeChargedPileUp%s",pileUpName[i].Data()),
2281  Form("#it{z}_{T} for Underlying Event, %s Pile-Up event",pileUpName[i].Data()),
2282  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2283  fhZTUeChargedPileUp[i]->SetYTitle("#it{z}_{T}");
2284  fhZTUeChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2285  outputContainer->Add(fhZTUeChargedPileUp[i]) ;
2286 
2287  fhPtTrigChargedPileUp[i] = new TH2F(Form("hPtTrigChargedPileUp%s",pileUpName[i].Data()),
2288  Form("trigger and charged tracks pt distribution, %s Pile-Up event",pileUpName[i].Data()),
2289  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2290  fhPtTrigChargedPileUp[i]->SetYTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2291  fhPtTrigChargedPileUp[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2292  outputContainer->Add(fhPtTrigChargedPileUp[i]) ;
2293  }
2294  }
2295 
2297  {
2298  Int_t nMultiBins = GetNCentrBin();
2299  fhDeltaPhiChargedMult = new TH2F*[nMultiBins] ;
2300  fhDeltaEtaChargedMult = new TH2F*[nMultiBins] ;
2301  fhXEMult = new TH2F*[nMultiBins] ;
2302  fhXEUeMult = new TH2F*[nMultiBins] ;
2303  fhZTMult = new TH2F*[nMultiBins] ;
2304  fhZTUeMult = new TH2F*[nMultiBins] ;
2305 
2306  for(Int_t im=0; im<nMultiBins; im++)
2307  {
2308  fhDeltaPhiChargedMult[im] = new TH2F
2309  (Form("hDeltaPhiCharged_Mult%d",im),Form("#Delta #phi charged Mult bin %d",im), nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2310  fhDeltaPhiChargedMult[im]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2311  fhDeltaPhiChargedMult[im]->SetYTitle("#Delta #phi (rad)");
2312 
2313  fhDeltaEtaChargedMult[im] = new TH2F
2314  (Form("hDeltaEtaCharged_Mult%d",im),Form("#Delta #eta charged Mult bin %d",im), nptbins,ptmin,ptmax, ndeltaetabins ,deltaetamin,deltaetamax);
2315  fhDeltaEtaChargedMult[im]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2316  fhDeltaEtaChargedMult[im]->SetYTitle("#Delta #eta");
2317 
2318  fhXEMult[im] = new TH2F
2319  (Form("hXECharged_Mult%d",im),Form("#it{x}_{E} charged Mult bin %d",im), nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2320  fhXEMult[im]->SetYTitle("#it{x}_{E}");
2321  fhXEMult[im]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2322 
2323  fhXEUeMult[im] = new TH2F
2324  (Form("hXEUeCharged_Mult%d",im),Form("#it{x}_{E} UE charged Mult bin %d",im), nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2325  fhXEUeMult[im]->SetYTitle("#it{x}_{E}");
2326  fhXEUeMult[im]->SetXTitle("#it{p}_{T trigger}(GeV/#it{c})");
2327 
2328  fhZTMult[im] = new TH2F
2329  (Form("hZTCharged_Mult%d",im),Form("#it{z}_{T} charged Mult bin %d",im), nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2330  fhZTMult[im]->SetYTitle("#it{z}_{T}");
2331  fhZTMult[im]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2332 
2333  fhZTUeMult[im] = new TH2F
2334  (Form("hZTUeCharged_Mult%d",im),Form("#it{z}_{T} UE charged Mult bin %d",im), nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2335  fhZTUeMult[im]->SetYTitle("#it{z}_{T}");
2336  fhZTUeMult[im]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2337 
2338  outputContainer->Add(fhDeltaPhiChargedMult[im]) ;
2339  outputContainer->Add(fhDeltaEtaChargedMult[im]) ;
2340  outputContainer->Add(fhXEMult [im]);
2341  outputContainer->Add(fhXEUeMult[im]);
2342  outputContainer->Add(fhZTMult [im]);
2343  outputContainer->Add(fhZTUeMult[im]);
2344  }
2345  }
2346 
2347  if(fFillBradHisto)
2348  {
2349  fhAssocPtBkg = new TH2F("hAssocPtBkg", " Trigger #it{p}_{T} vs associated hadron #it{p}_{T} from background",
2350  nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
2351  fhAssocPtBkg->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2352  fhAssocPtBkg->SetYTitle("#it{p}_{T associated} (GeV/#it{c})");
2353  outputContainer->Add(fhAssocPtBkg) ;
2354 
2355  fhDeltaPhiBrad = new TH2F("hDeltaPhiBrad","atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs #it{p}_{T trigger} ",
2356  nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
2357  fhDeltaPhiBrad->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2358  fhDeltaPhiBrad->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
2359  outputContainer->Add(fhDeltaPhiBrad) ;
2360  }
2361 
2363  fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2364  fhDeltaPhiAssocPtBinDEta08 = new TH2F*[fNAssocPtBins*nz];
2365  fhDeltaPhiAssocPtBinDEta0 = new TH2F*[fNAssocPtBins*nz];
2367  {
2368  fhXEAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2369  fhZTAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2370  }
2371 
2372  if(fCorrelVzBin)
2373  {
2374  fhXEVZ = new TH2F*[nz];
2375  fhZTVZ = new TH2F*[nz];
2376  }
2377 
2378  if(fFillBradHisto)
2379  fhDeltaPhiBradAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2380 
2381 
2382  fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2385 
2386 
2387  if(fHMPIDCorrelation)
2388  {
2389  fhDeltaPhiAssocPtBinHMPID = new TH2F*[fNAssocPtBins*nz];
2391  }
2392 
2393  for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
2394  {
2395  for(Int_t z = 0 ; z < nz ; z++)
2396  {
2397  Int_t bin = i*nz+z;
2398 
2399  if(fCorrelVzBin)
2400  {
2401  sz = Form("_vz%d",z);
2402  tz = Form(", #it{v}_{#it{z}} bin %d",z);
2403  }
2404 
2405  //printf("iAssoc %d, Vz %d, bin %d - sz %s, tz %s \n",i,z,bin,sz.Data(),tz.Data());
2406 
2407  fhDeltaPhiDeltaEtaAssocPtBin[bin] = new TH2F(Form("hDeltaPhiDeltaEtaPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2408  Form("#Delta #phi vs #Delta #eta for associated #it{p}_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2409  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
2410  fhDeltaPhiDeltaEtaAssocPtBin[bin]->SetXTitle("#Delta #phi (rad)");
2411  fhDeltaPhiDeltaEtaAssocPtBin[bin]->SetYTitle("#Delta #eta");
2412 
2413  fhDeltaPhiAssocPtBin[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2414  Form("#Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2415  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2416  fhDeltaPhiAssocPtBin[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2417  fhDeltaPhiAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
2418 
2419  outputContainer->Add(fhDeltaPhiDeltaEtaAssocPtBin[bin]) ;
2420  outputContainer->Add(fhDeltaPhiAssocPtBin[bin]) ;
2421 
2422  if(fFillEtaGapsHisto)
2423  {
2424  fhDeltaPhiAssocPtBinDEta08[bin] = new TH2F(Form("hDeltaPhiDeltaEta0.8PtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2425  Form("#Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta > 0.8", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2426  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2427  fhDeltaPhiAssocPtBinDEta08[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2428  fhDeltaPhiAssocPtBinDEta08[bin]->SetYTitle("#Delta #phi (rad)");
2429 
2430  fhDeltaPhiAssocPtBinDEta0[bin] = new TH2F(Form("hDeltaPhiDeltaEta0PtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2431  Form("#Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta = 0.", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2432  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2433  fhDeltaPhiAssocPtBinDEta0[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2434  fhDeltaPhiAssocPtBinDEta0[bin]->SetYTitle("#Delta #phi (rad)");
2435 
2436  outputContainer->Add(fhDeltaPhiAssocPtBinDEta08[bin]) ;
2437  outputContainer->Add(fhDeltaPhiAssocPtBinDEta0[bin]) ;
2438  }
2439 
2440  if(fDecayTrigger)
2441  {
2442  fhDeltaPhiDecayChargedAssocPtBin[bin] = new TH2F(Form("hDeltaPhiPtDecayChargedAssocPt%2.1f_%2.1f%s_bit%d", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data(),fDecayBits[0]),
2443  Form("#Delta #phi vs #it{p}_{T trigger} tagged as decay for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, Bit %d", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data(),fDecayBits[0]),
2444  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2445  fhDeltaPhiDecayChargedAssocPtBin[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2446  fhDeltaPhiDecayChargedAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
2447 
2448  outputContainer->Add(fhDeltaPhiDecayChargedAssocPtBin[bin]) ;
2449  }
2450 
2451  if(fFillBradHisto)
2452  {
2453  fhDeltaPhiBradAssocPtBin[bin] = new TH2F(Form("hDeltaPhiBradPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2454  Form("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2455  nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
2456  fhDeltaPhiBradAssocPtBin[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2457  fhDeltaPhiBradAssocPtBin[bin]->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
2458  outputContainer->Add(fhDeltaPhiBradAssocPtBin[bin]) ;
2459  }
2460 
2461  if(fHMPIDCorrelation)
2462  {
2463  fhDeltaPhiAssocPtBinHMPID[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%sHMPID", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2464  Form("#Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, with track having HMPID signal", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2465  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2466  fhDeltaPhiAssocPtBinHMPID[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})" );
2467  fhDeltaPhiAssocPtBinHMPID[bin]->SetYTitle("#Delta #phi (rad)");
2468 
2469  fhDeltaPhiAssocPtBinHMPIDAcc[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%sHMPIDAcc", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2470  Form("#Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, with track within 5<phi<20 deg", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2471  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2472  fhDeltaPhiAssocPtBinHMPIDAcc[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2473  fhDeltaPhiAssocPtBinHMPIDAcc[bin]->SetYTitle("#Delta #phi (rad)");
2474 
2475  outputContainer->Add(fhDeltaPhiAssocPtBinHMPID [bin]) ;
2476  outputContainer->Add(fhDeltaPhiAssocPtBinHMPIDAcc[bin]) ;
2477  }
2478  }
2479  }
2480 
2482  {
2483  for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
2484  {
2485  fhXEAssocPtBin[i] = new TH2F(Form("hXEAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
2486  Form("#it{x}_{#it{E}} vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
2487  nptbins, ptmin, ptmax,nxeztbins,xeztmin,xeztmax);
2488  fhXEAssocPtBin[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2489  fhXEAssocPtBin[i]->SetYTitle("#it{x}_{#it{E}}");
2490 
2491  fhZTAssocPtBin[i] = new TH2F(Form("hZTAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
2492  Form("#it{z}_{T} vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
2493  nptbins, ptmin, ptmax,nxeztbins,xeztmin,xeztmax);
2494  fhZTAssocPtBin[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2495  fhZTAssocPtBin[i]->SetYTitle("#it{z}_{T}");
2496 
2497 
2498  outputContainer->Add(fhXEAssocPtBin[i]);
2499  outputContainer->Add(fhZTAssocPtBin[i]);
2500  }
2501  }
2502 
2503  if(fCorrelVzBin)
2504  {
2505  for(Int_t z = 0 ; z < nz ; z++)
2506  {
2507  sz = Form("_vz%d",z);
2508  tz = Form(", #it{v}_{#it{z}} bin %d",z);
2509 
2510  fhXEVZ[z] = new TH2F(Form("hXE%s", sz.Data()),
2511  Form("#it{x}_{#it{E}} vs #it{p}_{T trigger}%s", tz.Data()),
2512  nptbins, ptmin, ptmax,nxeztbins,xeztmin,xeztmax);
2513  fhXEVZ[z]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2514  fhXEVZ[z]->SetYTitle("#it{x}_{#it{E}}");
2515 
2516  fhZTVZ[z] = new TH2F(Form("hZT%s",sz.Data()),
2517  Form("#it{z}_{T} vs #it{p}_{T trigger}%s", tz.Data()),
2518  nptbins, ptmin, ptmax,nxeztbins,xeztmin,xeztmax);
2519  fhZTVZ[z]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2520  fhZTVZ[z]->SetYTitle("#it{z}_{T}");
2521 
2522  outputContainer->Add(fhXEVZ[z]);
2523  outputContainer->Add(fhZTVZ[z]);
2524  }
2525  }
2526 
2527 
2528  if(fPi0Trigger)
2529  {
2530  fhPtPi0DecayRatio = new TH2F
2531  ("hPtPi0DecayRatio","#it{p}_{T} of #pi^{0} and the ratio of pt for two decay",
2532  nptbins,ptmin,ptmax, 100,0.,2.);
2533  fhPtPi0DecayRatio->SetXTitle("#it{p}_{T}^{#pi^{0}} (GeV/#it{c})");
2534  fhPtPi0DecayRatio->SetYTitle("#it{p}_{T}^{Decay}/#it{p}_{T}^{#pi^{0}}");
2535  outputContainer->Add(fhPtPi0DecayRatio) ;
2536 
2537  fhDeltaPhiPi0DecayCharged = new TH2F
2538  ("hDeltaPhiPi0DecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs #it{p}_{T Decay}",
2539  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2540  fhDeltaPhiPi0DecayCharged->SetYTitle("#Delta #phi (rad)");
2541  fhDeltaPhiPi0DecayCharged->SetXTitle("#it{p}_{T Decay} (GeV/#it{c})");
2542 
2544  new TH2F("hXEPi0DecayCharged","#it{x}_{#it{E}} Decay",
2545  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2546  fhXEPi0DecayCharged->SetYTitle("#it{x}_{#it{E}}");
2547  fhXEPi0DecayCharged->SetXTitle("#it{p}_{T decay} (GeV/#it{c})");
2548 
2550  new TH2F("hZTPi0DecayCharged","#it{z}_{trigger h^{#pm}} = #it{p}_{T h^{#pm}} / #it{p}_{T Decay}",
2551  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2552  fhZTPi0DecayCharged->SetYTitle("#it{z}_{decay h^{#pm}}");
2553  fhZTPi0DecayCharged->SetXTitle("#it{p}_{T decay} (GeV/#it{c})");
2554 
2555  outputContainer->Add(fhDeltaPhiPi0DecayCharged) ;
2556  outputContainer->Add(fhXEPi0DecayCharged) ;
2557  outputContainer->Add(fhZTPi0DecayCharged) ;
2558  }
2559 
2560  if(fDecayTrigger)
2561  {
2562  for(Int_t ibit = 0; ibit< fNDecayBits; ibit++)
2563  {
2564  fhDeltaPhiDecayCharged[ibit] = new TH2F
2565  (Form("hDeltaPhiDecayCharged_bit%d",fDecayBits[ibit]),
2566  Form("#phi_{Decay} - #phi_{h^{#pm}} vs #it{p}_{T Decay}, Bit %d",fDecayBits[ibit]),
2567  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2568  fhDeltaPhiDecayCharged[ibit]->SetYTitle("#Delta #phi (rad)");
2569  fhDeltaPhiDecayCharged[ibit]->SetXTitle("#it{p}_{T Decay} (GeV/#it{c})");
2570 
2571  fhXEDecayCharged[ibit] =
2572  new TH2F(Form("hXEDecayCharged_bit%d",fDecayBits[ibit]),
2573  Form("#it{x}_{#it{E}} Decay, Bit %d",fDecayBits[ibit]),
2574  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2575  fhXEDecayCharged[ibit]->SetYTitle("#it{x}_{#it{E}}");
2576  fhXEDecayCharged[ibit]->SetXTitle("#it{p}_{T decay} (GeV/#it{c})");
2577 
2578  fhZTDecayCharged[ibit] =
2579  new TH2F(Form("hZTDecayCharged_bit%d",fDecayBits[ibit]),
2580  Form("#it{z}_{trigger h^{#pm}} = #it{p}_{T h^{#pm}} / #it{p}_{T Decay}, Bit %d",fDecayBits[ibit]),
2581  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2582  fhZTDecayCharged[ibit]->SetYTitle("#it{z}_{decay h^{#pm}}");
2583  fhZTDecayCharged[ibit]->SetXTitle("#it{p}_{T decay} (GeV/#it{c})");
2584 
2585  outputContainer->Add(fhDeltaPhiDecayCharged[ibit]) ;
2586  outputContainer->Add(fhXEDecayCharged[ibit]) ;
2587  outputContainer->Add(fhZTDecayCharged[ibit]) ;
2588  }
2589  }
2590 
2591  //Correlation with neutral hadrons
2592  if(fNeutralCorr)
2593  {
2594  fhDeltaPhiDeltaEtaNeutral = new TH2F
2595  ("hDeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
2596  ndeltaphibins ,deltaphimin,deltaphimax, ndeltaetabins ,deltaetamin,deltaetamax);
2597  fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi (rad)");
2598  fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta");
2599 
2600  fhPhiNeutral = new TH2F
2601  ("hPhiNeutral","#phi_{#pi^{0}} vs #it{p}_{T #pi^{0}}",
2602  nptbins,ptmin,ptmax,180,0,TMath::TwoPi());
2603  fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
2604  fhPhiNeutral->SetXTitle("#it{p}_{T #pi^{0}} (GeV/#it{c})");
2605 
2606  fhEtaNeutral = new TH2F
2607  ("hEtaNeutral","#eta_{#pi^{0}} vs #it{p}_{T #pi^{0}}",
2608  nptbins,ptmin,ptmax,200,-1.,1.);
2609  fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
2610  fhEtaNeutral->SetXTitle("#it{p}_{T #pi^{0}} (GeV/#it{c})");
2611 
2612  fhDeltaPhiNeutral = new TH2F
2613  ("hDeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs #it{p}_{T trigger}",
2614  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2615  fhDeltaPhiNeutral->SetYTitle("#Delta #phi (rad)");
2616  fhDeltaPhiNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2617 
2618  fhDeltaPhiNeutralPt = new TH2F
2619  ("hDeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs #it{p}_{T #pi^{0}}}",
2620  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2621  fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi (rad)");
2622  fhDeltaPhiNeutralPt->SetXTitle("#it{p}_{T h^{0}} (GeV/#it{c})");
2623 
2624  fhDeltaEtaNeutral = new TH2F
2625  ("hDeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs #it{p}_{T trigger}",
2626  nptbins,ptmin,ptmax, ndeltaetabins ,deltaetamin,deltaetamax);
2627  fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
2628  fhDeltaEtaNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2629 
2630  fhXENeutral =
2631  new TH2F("hXENeutral","#it{x}_{#it{E}} for #pi^{0} associated",
2632  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2633  fhXENeutral->SetYTitle("#it{x}_{#it{E}}");
2634  fhXENeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2635 
2637  new TH2F("hHbpXENeutral","#xi = ln(1/#it{x}_{#it{E}})for #pi^{0} associated",
2638  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2639  fhPtHbpXENeutral->SetYTitle("ln(1/#it{x}_{#it{E}})");
2640  fhPtHbpXENeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2641 
2642  fhZTNeutral =
2643  new TH2F("hZTNeutral","#it{z}_{trigger #pi} = #it{p}_{T #pi^{0}} / #it{p}_{T trigger} for #pi^{0} associated",
2644  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2645  fhZTNeutral->SetYTitle("#it{z}_{trigger #pi^{0}}");
2646  fhZTNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2647 
2649  new TH2F("hHbpZTNeutral","#xi = ln(1/#it{x}_{#it{E}}) for #pi^{0} associated",
2650  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2651  fhPtHbpZTNeutral->SetYTitle("ln(1/#it{z}_{T})");
2652  fhPtHbpZTNeutral->SetXTitle("#it{p}_{T trigger}");
2653 
2654  outputContainer->Add(fhDeltaPhiDeltaEtaNeutral);
2655  outputContainer->Add(fhPhiNeutral) ;
2656  outputContainer->Add(fhEtaNeutral) ;
2657  outputContainer->Add(fhDeltaPhiNeutral) ;
2658  outputContainer->Add(fhDeltaPhiNeutralPt) ;
2659  outputContainer->Add(fhDeltaEtaNeutral) ;
2660  outputContainer->Add(fhXENeutral) ;
2661  outputContainer->Add(fhPtHbpXENeutral) ;
2662  outputContainer->Add(fhZTNeutral) ;
2663  outputContainer->Add(fhPtHbpZTNeutral) ;
2664 
2665  fhDeltaPhiUeNeutralPt = new TH2F
2666  (Form("hDeltaPhiUe%sNeutralPt",right.Data()),"#phi_{trigger} - #phi_{#pi^{0}} vs #it{p}_{T #pi^{0}}}",
2667  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2668  fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi (rad)");
2669  fhDeltaPhiUeNeutralPt->SetXTitle("#it{p}_{T h^{0}} (GeV/#it{c})");
2670 
2671  fhXEUeNeutral =
2672  new TH2F(Form("hXEUeNeutral%s",right.Data()),"#it{x}_{#it{E}} for #pi^{0} associated",
2673  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2674  fhXEUeNeutral->SetYTitle("#it{x}_{#it{E}}");
2675  fhXEUeNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2676 
2678  new TH2F(Form("hHbpXEUeNeutral%s",right.Data()),"#xi = ln(1/#it{x}_{#it{E}}) for #pi^{0} associated",
2679  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2680  fhPtHbpXEUeNeutral->SetYTitle("ln(1/#it{x}_{#it{E}})");
2681  fhPtHbpXEUeNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2682 
2683  fhZTUeNeutral =
2684  new TH2F(Form("hZTUeNeutral%s",right.Data()),"#it{z}_{trigger #pi} = #it{p}_{T #pi^{0}} / #it{p}_{T trigger} for #pi^{0} associated",
2685  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2686  fhZTUeNeutral->SetYTitle("#it{z}_{trigger #pi^{0}}");
2687  fhZTUeNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2688 
2690  new TH2F(Form("hHbpZTUeNeutral%s",right.Data()),"#xi = ln(1/#it{x}_{#it{E}}) for #pi^{0} associated",
2691  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2692  fhPtHbpXEUeNeutral->SetYTitle("ln(1/#it{z}_{T})");
2693  fhPtHbpXEUeNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2694 
2695  outputContainer->Add(fhDeltaPhiUeNeutralPt) ;
2696  outputContainer->Add(fhXEUeNeutral) ;
2697  outputContainer->Add(fhPtHbpXEUeNeutral) ;
2698  outputContainer->Add(fhZTUeNeutral) ;
2699  outputContainer->Add(fhPtHbpZTUeNeutral) ;
2700 
2701  if(fMakeSeveralUE)
2702  {
2703  fhDeltaPhiUeLeftNeutral = new TH2F
2704  ("hDeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs #it{p}_{T h^{0}} with neutral UE left side range of trigger particles",
2705  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2706  fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi (rad)");
2707  fhDeltaPhiUeLeftNeutral->SetXTitle("#it{p}_{T h^{0}} (GeV/#it{c})");
2708  outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
2709 
2711  new TH2F("hXEUeNeutralLeft","#it{x}_{#it{E}} = #it{p}_{T Ueh^{0}} / #it{p}_{T trigger} with neutral UE left side of trigger",
2712  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2713  fhXEUeLeftNeutral->SetYTitle("#it{z}_{trigger Ueh^{0}}");
2714  fhXEUeLeftNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2715  outputContainer->Add(fhXEUeLeftNeutral) ;
2716 
2718  new TH2F("hHbpXEUeNeutralLeft","#xi = ln(1/#it{x}_{#it{E}}) with neutral UE left side of trigger",
2719  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2720  fhPtHbpXEUeLeftNeutral->SetYTitle("ln(1/#it{x}_{#it{E}})");
2721  fhPtHbpXEUeLeftNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2722  outputContainer->Add(fhPtHbpXEUeLeftNeutral) ;
2723 
2725  new TH2F("hZTUeNeutralLeft","#it{z}_{trigger h^{0}} = #it{p}_{T Ueh^{0}} / #it{p}_{T trigger} with neutral UE left side of trigger",
2726  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2727  fhZTUeLeftNeutral->SetYTitle("#it{z}_{trigger Ueh^{0}}");
2728  fhZTUeLeftNeutral->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2729  outputContainer->Add(fhZTUeLeftNeutral) ;
2730 
2732  new TH2F("hHbpZTUeNeutralLeft","#xi = ln(1/#it{z}_{T}) with neutral UE left side of trigger",
2733  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2734  fhPtHbpZTUeLeftNeutral->SetYTitle("ln(1/#it{z}_{T})");
2735  fhPtHbpZTUeLeftNeutral->SetXTitle("#it{p}_{T trigger}");
2736  outputContainer->Add(fhPtHbpZTUeLeftNeutral) ;
2737  }
2738 
2739  if(fPi0Trigger)
2740  {
2741  fhDeltaPhiPi0DecayNeutral = new TH2F
2742  ("hDeltaPhiPi0DecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs #it{p}_{T Decay}",
2743  nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2744  fhDeltaPhiPi0DecayNeutral->SetYTitle("#Delta #phi (rad)");
2745  fhDeltaPhiPi0DecayNeutral->SetXTitle("#it{p}_{T Decay} (GeV/#it{c})");
2746 
2748  new TH2F("hXEPi0DecayNeutral","#it{x}_{#it{E}} for decay trigger",
2749  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2750  fhXEPi0DecayNeutral->SetYTitle("#it{x}_{#it{E}}");
2751  fhXEPi0DecayNeutral->SetXTitle("#it{p}_{T decay}");
2752 
2754  new TH2F("hZTPi0DecayNeutral","#it{z}_{trigger h^{0}} = #it{p}_{T h^{0}} / #it{p}_{T Decay}",
2755  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2756  fhZTPi0DecayNeutral->SetYTitle("#it{z}_{h^{0}}");
2757  fhZTPi0DecayNeutral->SetXTitle("#it{p}_{T decay}");
2758 
2759  outputContainer->Add(fhDeltaPhiPi0DecayNeutral) ;
2760  outputContainer->Add(fhXEPi0DecayNeutral) ;
2761  outputContainer->Add(fhZTPi0DecayNeutral) ;
2762  }
2763  }//Correlation with neutral hadrons
2764 
2765  // If data is MC, fill more histograms, depending on origin
2766  if(IsDataMC())
2767  {
2768  for(Int_t i= fMCGenTypeMin; i <= fMCGenTypeMax; i++)
2769  {
2770  fhMCPtTrigger[i] = new TH1F (Form("hMCPtTrigger_%s",nameMC[i].Data()),
2771  Form("MC %s: generated trigger #it{p}_{T}",nameMC[i].Data()),
2772  nptbins,ptmin,ptmax);
2773  fhMCPtTrigger[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2774 
2775  fhMCPhiTrigger[i] = new TH2F (Form("hMCPhiTrigger_%s",nameMC[i].Data()),
2776  Form("MC %s: generated trigger #phi",nameMC[i].Data()),
2777  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
2778  fhMCPhiTrigger[i]->SetYTitle("#phi (rad)");
2779  fhMCPhiTrigger[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2780 
2781  fhMCEtaTrigger[i] = new TH2F (Form("hMCEtaTrigger_%s",nameMC[i].Data()),
2782  Form("MC %s: generated trigger #eta",nameMC[i].Data()),
2783  nptbins,ptmin,ptmax, netabins,etamin,etamax);
2784  fhMCEtaTrigger[i]->SetYTitle("#eta");
2785  fhMCEtaTrigger[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2786 
2788  {
2789  fhMCPtTriggerNotLeading[i] = new TH1F (Form("hMCPtTriggerNotLeading_%s",nameMC[i].Data()),
2790  Form("MC %s: generated trigger #it{p}_{T}, when not leading of primaries",nameMC[i].Data()),
2791  nptbins,ptmin,ptmax);
2792  fhMCPtTriggerNotLeading[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2793 
2794  fhMCPhiTriggerNotLeading[i] = new TH2F (Form("hMCPhiTriggerNotLeading_%s",nameMC[i].Data()),
2795  Form("MC %s: generated trigger #phi, when not leading of primaries",nameMC[i].Data()),
2796  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
2797  fhMCPhiTriggerNotLeading[i]->SetYTitle("#phi (rad)");
2798  fhMCPhiTriggerNotLeading[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2799 
2800 
2801  fhMCEtaTriggerNotLeading[i] = new TH2F (Form("hMCEtaTriggerNotLeading_%s",nameMC[i].Data()),
2802  Form("MC %s: generated triogger #eta, when not leading of primaries",nameMC[i].Data()),
2803  nptbins,ptmin,ptmax, netabins,etamin,etamax);
2804  fhMCEtaTriggerNotLeading[i]->SetYTitle("#eta ");
2805  fhMCEtaTriggerNotLeading[i]->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
2806  }
2807 
2808  fhMCEtaCharged[i] = new TH2F (Form("hMCEtaCharged_%s",nameMC[i].Data()),
2809  Form("MC %s: #eta_{h^{#pm}} vs #it{p}_{T #pm}",nameMC[i].Data()),
2810  nptbins,ptmin,ptmax,100,-1.,1.);
2811  fhMCEtaCharged[i]->SetYTitle("#eta_{h^{#pm}} (rad)");
2812  fhMCEtaCharged[i]->SetXTitle("#it{p}_{T #pm} (GeV/#it{c})");
2813 
2814  fhMCPhiCharged[i] = new TH2F(Form("hMCPhiCharged_%s",nameMC[i].Data()),
2815  Form("MC %s: phi_{h^{#pm}} vs #it{p}_{T #pm}",nameMC[i].Data()),
2816  nptbins,ptmin,ptmax,180,0,TMath::TwoPi());
2817  fhMCPhiCharged[i]->SetYTitle("MC #phi_{h^{#pm}} (rad)");
2818  fhMCPhiCharged[i]->SetXTitle("#it{p}_{T #pm} (GeV/#it{c})");
2819 
2820  fhMCDeltaPhiDeltaEtaCharged[i] = new TH2F (Form("hMCDeltaPhiDeltaEtaCharged_%s",nameMC[i].Data()),
2821  Form("MC %s: phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",nameMC[i].Data()),
2822  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins ,deltaetamin,deltaetamax);
2823  fhMCDeltaPhiDeltaEtaCharged[i]->SetXTitle("#Delta #phi (rad)");
2824  fhMCDeltaPhiDeltaEtaCharged[i]->SetYTitle("#Delta #eta");
2825 
2826  fhMCDeltaEtaCharged[i] = new TH2F (Form("hMCDeltaEtaCharged_%s",nameMC[i].Data()),
2827  Form("MC %s: #eta_{trigger} - #eta_{h^{#pm}} vs #it{p}_{T trigger} and #it{p}_{T assoc}",nameMC[i].Data()),
2828  nptbins,ptmin,ptmax,ndeltaetabins ,deltaetamin,deltaetamax);
2829  fhMCDeltaEtaCharged[i]->SetYTitle("#Delta #eta");
2830  fhMCDeltaEtaCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2831 
2832  fhMCDeltaPhiCharged[i] = new TH2F (Form("hMCDeltaPhiCharged_%s",nameMC[i].Data()),
2833  Form("MC %s: #phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}",nameMC[i].Data()),
2834  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2835  fhMCDeltaPhiCharged[i]->SetYTitle("#Delta #phi (rad)");
2836  fhMCDeltaPhiCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2837 
2838  fhMCDeltaPhiChargedPt[i] = new TH2F (Form("hMCDeltaPhiChargedPt_%s",nameMC[i].Data()),
2839  Form("MC %s: #phi_{trigger} - #phi_{#h^{#pm}} vs #it{p}_{T h^{#pm}}",nameMC[i].Data()),
2840  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2841  fhMCDeltaPhiChargedPt[i]->SetYTitle("#Delta #phi (rad)");
2842  fhMCDeltaPhiChargedPt[i]->SetXTitle("#it{p}_{T h^{#pm}} (GeV/#it{c})");
2843 
2844  fhMCPtXECharged[i] = new TH2F (Form("hMCPtXECharged_%s",nameMC[i].Data()),
2845  Form("MC %s: #it{x}_{#it{E}} with charged hadrons",nameMC[i].Data()),
2846  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2847  fhMCPtXECharged[i]->SetYTitle("#it{x}_{#it{E}}");
2848  fhMCPtXECharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2849 
2850  fhMCPtHbpXECharged[i] = new TH2F(Form("hMCHbpXECharged_%s",nameMC[i].Data()),
2851  Form("MC %s: #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons",nameMC[i].Data()),
2852  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2853  fhMCPtHbpXECharged[i]->SetYTitle("ln(1/#it{x}_{#it{E}})");
2854  fhMCPtHbpXECharged[i]->SetXTitle("#it{p}_{T trigger}");
2855 
2856  fhMCPtZTCharged[i] = new TH2F(Form("hMCPtZTCharged_%s",nameMC[i].Data()),
2857  Form("MC %s: #it{z}_{T} with charged hadrons",nameMC[i].Data()),
2858  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2859  fhMCPtZTCharged[i]->SetYTitle("#it{z}_{T}");
2860  fhMCPtZTCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2861 
2862  fhMCPtHbpZTCharged[i] = new TH2F(Form("hMCHbpZTCharged_%s",nameMC[i].Data()),
2863  Form("MC %s: #xi = ln(1/#it{z}_{T}) with charged hadrons",nameMC[i].Data()),
2864  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2865  fhMCPtHbpZTCharged[i]->SetYTitle("ln(1/#it{z}_{T})");
2866  fhMCPtHbpZTCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2867 
2868  fhMCPtTrigPout[i] = new TH2F(Form("hMCPtTrigPout_%s",nameMC[i].Data()),
2869  Form("MC %s: #it{p}_{out} with triggers",nameMC[i].Data()),
2870  nptbins,ptmin,ptmax,nptbins,-1.*ptmax/2.,ptmax/2.);
2871  fhMCPtTrigPout[i]->SetYTitle("#it{p}_{out} (GeV/#it{c})");
2872  fhMCPtTrigPout[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2873 
2874  fhMCPtAssocDeltaPhi[i] = new TH2F(Form("hMCPtAssocDeltaPhi_%s",nameMC[i].Data()),
2875  Form("MC %s: #Delta #phi with associated charged hadrons",nameMC[i].Data()),
2876  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2877  fhMCPtAssocDeltaPhi[i]->SetYTitle("#Delta #phi (rad)");
2878  fhMCPtAssocDeltaPhi[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2879 
2880  outputContainer->Add(fhMCPtTrigger[i]);
2881  outputContainer->Add(fhMCPhiTrigger[i]);
2882  outputContainer->Add(fhMCEtaTrigger[i]);
2883 
2885  {
2886  outputContainer->Add(fhMCPtTriggerNotLeading[i]);
2887  outputContainer->Add(fhMCPhiTriggerNotLeading[i]);
2888  outputContainer->Add(fhMCEtaTriggerNotLeading[i]);
2889  }
2890 
2891  outputContainer->Add(fhMCDeltaPhiDeltaEtaCharged[i]);
2892  outputContainer->Add(fhMCPhiCharged[i]) ;
2893  outputContainer->Add(fhMCEtaCharged[i]) ;
2894  outputContainer->Add(fhMCDeltaEtaCharged[i]) ;
2895  outputContainer->Add(fhMCDeltaPhiCharged[i]) ;
2896 
2897  outputContainer->Add(fhMCDeltaPhiChargedPt[i]) ;
2898  outputContainer->Add(fhMCPtXECharged[i]) ;
2899  outputContainer->Add(fhMCPtZTCharged[i]) ;
2900  outputContainer->Add(fhMCPtHbpXECharged[i]) ;
2901  outputContainer->Add(fhMCPtHbpZTCharged[i]) ;
2902  outputContainer->Add(fhMCPtTrigPout[i]) ;
2903  outputContainer->Add(fhMCPtAssocDeltaPhi[i]) ;
2904 
2905  // Underlying event
2906 
2907  fhMCUePart[i] =
2908  new TH1F(Form("hMCUePart_%s",nameMC[i].Data()),
2909  Form("MC %s: UE particles distribution vs #it{p}_{T trigger}",nameMC[i].Data()),
2910  nptbins,ptmin,ptmax);
2911  fhMCUePart[i]->SetYTitle("#it{dN}^{ch}");
2912  fhMCUePart[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2913 
2914  fhMCPtXEUeCharged[i] =
2915  new TH2F(Form("hMCPtXEUeCharged%s_%s",right.Data(),nameMC[i].Data()),
2916  Form("MC %s: #it{x}_{#it{E}} with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
2917  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2918  fhMCPtXEUeCharged[i]->SetYTitle("#it{x}_{#it{E}}");
2919  fhMCPtXEUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2920 
2922  new TH2F(Form("hMCPtHbpXEUeCharged%s_%s",right.Data(),nameMC[i].Data()),
2923  Form("MC %s: #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
2924  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2925  fhMCPtHbpXEUeCharged[i]->SetYTitle("ln(1/#it{x}_{#it{E}})");
2926  fhMCPtHbpXEUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2927 
2928  fhMCPtZTUeCharged[i] =
2929  new TH2F(Form("hMCPtZTUeCharged%s_%s",right.Data(),nameMC[i].Data()),
2930  Form("MC %s: #it{z}_{T} with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
2931  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2932  fhMCPtZTUeCharged[i]->SetYTitle("#it{z}_{T}");
2933  fhMCPtZTUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2934 
2936  new TH2F(Form("hMCPtHbpZTUeCharged%s_%s",right.Data(),nameMC[i].Data()),
2937  Form("MC %s: #xi = ln(1/#it{z}_{T}) with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
2938  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2939  fhMCPtHbpZTUeCharged[i]->SetYTitle("ln(1/#it{z}_{T})");
2940  fhMCPtHbpZTUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2941 
2942  outputContainer->Add(fhMCUePart[i]);
2943  outputContainer->Add(fhMCPtXEUeCharged[i]) ;
2944  outputContainer->Add(fhMCPtZTUeCharged[i]) ;
2945  outputContainer->Add(fhMCPtHbpZTUeCharged[i]);
2946  outputContainer->Add(fhMCPtHbpXEUeCharged[i]);
2947 
2948  if(fMakeSeveralUE)
2949  {
2950  fhMCPtXEUeLeftCharged[i] = new TH2F(Form("hMCPtXEUeChargedLeft_%s",nameMC[i].Data()),
2951  Form("MC %s: #it{x}_{#it{E}} with charged hadrons, with UE left side range of trigger particles",nameMC[i].Data()),
2952  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2953  fhMCPtXEUeLeftCharged[i]->SetYTitle("#it{x}_{#it{E}}");
2954  fhMCPtXEUeLeftCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2955 
2956  fhMCPtHbpXEUeLeftCharged[i] = new TH2F(Form("hMCPtHbpXEUeChargedLeft_%s",nameMC[i].Data()),
2957  Form("MC %s: #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons, with UE left side range of trigger particles",nameMC[i].Data()),
2958  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2959  fhMCPtHbpXEUeLeftCharged[i]->SetYTitle("ln(1/#it{x}_{#it{E}})");
2960  fhMCPtHbpXEUeLeftCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2961 
2962  fhMCPtZTUeLeftCharged[i] = new TH2F(Form("hMCPtZTUeChargedLeft_%s",nameMC[i].Data()),
2963  Form("MC %s: #it{z}_{T} with charged hadrons, with UE left side range of trigger particles",nameMC[i].Data()),
2964  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
2965  fhMCPtZTUeLeftCharged[i]->SetYTitle("#it{z}_{T}");
2966  fhMCPtZTUeLeftCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2967 
2968  fhMCPtHbpZTUeLeftCharged[i] = new TH2F(Form("hMCPtHbpZTUeChargedLeft_%s",nameMC[i].Data()),
2969  Form("MC %s: #xi = ln(1/#it{z}_{T}) with charged hadrons, with UE left side range of trigger particles",nameMC[i].Data()),
2970  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
2971  fhMCPtHbpZTUeLeftCharged[i]->SetYTitle("ln(1/#it{z}_{T})");
2972  fhMCPtHbpZTUeLeftCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
2973 
2974  outputContainer->Add(fhMCPtXEUeLeftCharged[i]) ;
2975  outputContainer->Add(fhMCPtZTUeLeftCharged[i]) ;
2976  outputContainer->Add(fhMCPtHbpXEUeLeftCharged[i]);
2977  outputContainer->Add(fhMCPtHbpZTUeLeftCharged[i]) ;
2978 
2979  }
2980  }
2981  } // For MC histogram
2982 
2983  if(DoOwnMix())
2984  {
2985  // Create event containers
2986 
2987  if(!fUseMixStoredInReader || (fUseMixStoredInReader && !GetReader()->ListWithMixedEventsForTracksExists()))
2988  {
2989  Int_t nvz = GetNZvertBin();
2990  Int_t nrp = GetNRPBin();
2991  Int_t nce = GetNCentrBin();
2992 
2993  fListMixTrackEvents= new TList*[nvz*nrp*nce] ;
2994 
2995  for( Int_t ice = 0 ; ice < nce ; ice++ )
2996  {
2997  for( Int_t ivz = 0 ; ivz < nvz ; ivz++ )
2998  {
2999  for( Int_t irp = 0 ; irp < nrp ; irp++ )
3000  {
3001  Int_t bin = GetEventMixBin(ice,ivz,irp); //ic*nvz*nrp+iz*nrp+irp;
3002 
3003  //printf("GetCreateOutputObjects - Bins : cent %d, vz %d, RP %d, event %d/%d\n",
3004  // ic,iz, irp, bin);
3005 
3006  fListMixTrackEvents[bin] = new TList() ;
3007  fListMixTrackEvents[bin]->SetOwner(kFALSE);
3008  }
3009  }
3010  }
3011  }
3012 
3013  fhPtTriggerMixed = new TH1F ("hPtTriggerMixed","#it{p}_{T} distribution of trigger particles, used for mixing", nptbins,ptmin,ptmax);
3014  fhPtTriggerMixed->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
3015 
3016  if(fCorrelVzBin)
3017  {
3018  fhPtTriggerMixedVzBin = new TH2F ("hPtTriggerMixedVzBin","#it{p}_{T} distribution of trigger particles, used for mixing", nptbins,ptmin,ptmax,GetNZvertBin(),0,GetNZvertBin());
3019  fhPtTriggerMixedVzBin->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
3020  fhPtTriggerMixedVzBin->SetYTitle("#it{v}_{#it{z}} bin");
3021  outputContainer->Add(fhPtTriggerMixedVzBin);
3022  }
3023 
3024  fhPtTriggerMixedBin = new TH2F ("hPtTriggerMixedBin","#it{p}_{T} distribution of trigger particles vs mixing bin", nptbins,ptmin,ptmax,nMixBins,0,nMixBins);
3025  fhPtTriggerMixedBin->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
3026  fhPtTriggerMixedBin->SetYTitle("Bin");
3027 
3028  fhPhiTriggerMixed = new TH2F ("hPhiTriggerMixed","#phi distribution of trigger Particles, used for mixing",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
3029  fhPhiTriggerMixed->SetYTitle("#phi (rad)");
3030 
3031  fhEtaTriggerMixed = new TH2F ("hEtaTriggerMixed","#eta distribution of trigger, used for mixing",nptbins,ptmin,ptmax, netabins,etamin,etamax);
3032  fhEtaTriggerMixed->SetYTitle("#eta ");
3033 
3034  outputContainer->Add(fhPtTriggerMixed);
3035  outputContainer->Add(fhPtTriggerMixedBin);
3036  outputContainer->Add(fhPhiTriggerMixed);
3037  outputContainer->Add(fhEtaTriggerMixed);
3038 
3039  // Fill the cluster pool only in isolation analysis or if requested
3040  if( neutralMix && (!fUseMixStoredInReader || (fUseMixStoredInReader && !GetReader()->ListWithMixedEventsForCaloExists())))
3041  {
3042  Int_t nvz = GetNZvertBin();
3043  Int_t nrp = GetNRPBin();
3044  Int_t nce = GetNCentrBin();
3045 
3046  fListMixCaloEvents= new TList*[nvz*nrp*nce] ;
3047 
3048  for( Int_t ice = 0 ; ice < nce ; ice++ )
3049  {
3050  for( Int_t ivz = 0 ; ivz < nvz ; ivz++ )
3051  {
3052  for( Int_t irp = 0 ; irp < nrp ; irp++ )
3053  {
3054  Int_t bin = GetEventMixBin(ice,ivz,irp); //ic*nvz*nrp+iz*nrp+irp;
3055 
3056  //printf("GetCreateOutputObjects - Bins : cent %d, vz %d, RP %d, event %d/%d\n",
3057  // ic,iz, irp, bin);
3058 
3059  fListMixCaloEvents[bin] = new TList() ;
3060  fListMixCaloEvents[bin]->SetOwner(kFALSE);
3061  }
3062  }
3063  }
3064  }
3065 
3066  // Init the list in the reader if not done previously
3068  {
3069  if( !GetReader()->ListWithMixedEventsForTracksExists() )
3071 
3072  if( !GetReader()->ListWithMixedEventsForCaloExists() )
3074  }
3075 
3076  fhEventBin=new TH1I("hEventBin","Number of triggers per bin(cen,vz,rp)",
3079  fhEventBin->SetXTitle("event bin");
3080  outputContainer->Add(fhEventBin) ;
3081 
3082  fhEventMixBin=new TH1I("hEventMixBin","Number of triggers mixed per event bin(cen,vz,rp)",
3085  fhEventMixBin->SetXTitle("event bin");
3086  outputContainer->Add(fhEventMixBin) ;
3087 
3088  fhEventMBBin=new TH1I("hEventMBBin","Number of min bias events per bin(cen,vz,rp)",
3091  fhEventMBBin->SetXTitle("event bin");
3092  outputContainer->Add(fhEventMBBin) ;
3093 
3094  fhNtracksMB=new TH2F("hNtracksMBEvent","Number of filtered tracks in MB event per event bin",ntrbins,trmin,trmax,
3097  fhNtracksMB->SetYTitle("event bin");
3098  fhNtracksMB->SetXTitle("#it{N}_{track}");
3099  outputContainer->Add(fhNtracksMB);
3100 
3101  if( neutralMix )
3102  {
3103  fhNclustersMB=new TH2F("hNclustersMBEvent","Number of filtered clusters in MB events per event bin",nclbins,clmin,clmax,
3106  fhNclustersMB->SetYTitle("event bin");
3107  fhNclustersMB->SetXTitle("#it{N}_{cluster}");
3108  outputContainer->Add(fhNclustersMB);
3109  }
3110 
3111  fhMixDeltaPhiCharged = new TH2F
3112  ("hMixDeltaPhiCharged","Mixed event : #phi_{trigger} - #phi_{h^{#pm}} vs #it{p}_{T trigger}",
3113  nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
3114  fhMixDeltaPhiCharged->SetYTitle("#Delta #phi (rad)");
3115  fhMixDeltaPhiCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3116  outputContainer->Add(fhMixDeltaPhiCharged);
3117 
3118  fhMixDeltaPhiDeltaEtaCharged = new TH2F
3119  ("hMixDeltaPhiDeltaEtaCharged","Mixed event : #phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
3120  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins ,deltaetamin,deltaetamax);
3121  fhMixDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi (rad)");
3122  fhMixDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
3123  outputContainer->Add(fhMixDeltaPhiDeltaEtaCharged);
3124 
3125  fhMixXECharged =
3126  new TH2F("hMixXECharged","Mixed event : #it{x}_{#it{E}} for charged tracks",
3127  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
3128  fhMixXECharged->SetYTitle("#it{x}_{#it{E}}");
3129  fhMixXECharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3130  outputContainer->Add(fhMixXECharged);
3131 
3133  new TH2F("hMixXEUeCharged","Mixed event : #it{x}_{#it{E}} for charged tracks in Ue region",
3134  nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
3135  fhMixXEUeCharged->SetYTitle("#it{x}_{#it{E}}");
3136  fhMixXEUeCharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3137  outputContainer->Add(fhMixXEUeCharged);
3138 
3140  new TH2F("hMixHbpXECharged","mixed event : #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons",
3141  nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
3142  fhMixHbpXECharged->SetYTitle("ln(1/#it{x}_{#it{E}})");
3143  fhMixHbpXECharged->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3144  outputContainer->Add(fhMixHbpXECharged);
3145 
3146  fhMixDeltaPhiChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
3147  fhMixDeltaPhiChargedAssocPtBinDEta08 = new TH2F*[fNAssocPtBins*nz];
3148  fhMixDeltaPhiChargedAssocPtBinDEta0 = new TH2F*[fNAssocPtBins*nz];
3149  fhMixDeltaPhiDeltaEtaChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
3150 
3151  for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
3152  {
3153  for(Int_t z = 0 ; z < nz ; z++)
3154  {
3155  Int_t bin = i*nz+z;
3156 
3157  if(fCorrelVzBin)
3158  {
3159  sz = Form("_vz%d",z);
3160  tz = Form(", #it{v}_{#it{z}} bin %d",z);
3161  }
3162 
3163  //printf("MIX : iAssoc %d, Vz %d, bin %d - sz %s, tz %s \n",i,z,bin,sz.Data(),tz.Data());
3164 
3165  fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin] = new TH2F(Form("hMixDeltaPhiDeltaEtaChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
3166  Form("Mixed event #Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
3167  ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins ,deltaetamin,deltaetamax);
3168  fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->SetXTitle("#Delta #phi (rad)");
3169  fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->SetYTitle("#Delta #eta");
3170 
3171  outputContainer->Add(fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]);
3172 
3173  fhMixDeltaPhiChargedAssocPtBin[bin] = new TH2F(Form("hMixDeltaPhiChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
3174  Form("Mixed event #Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
3175  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
3176  fhMixDeltaPhiChargedAssocPtBin[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3177  fhMixDeltaPhiChargedAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
3178 
3179  outputContainer->Add(fhMixDeltaPhiChargedAssocPtBin[bin]);
3180 
3181  if(fFillEtaGapsHisto)
3182  {
3183  fhMixDeltaPhiChargedAssocPtBinDEta08[bin] = new TH2F(Form("hMixDeltaPhiDeltaEta0.8ChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
3184  Form("Mixed event #Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta > 0.8", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
3185  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
3186  fhMixDeltaPhiChargedAssocPtBinDEta08[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3187  fhMixDeltaPhiChargedAssocPtBinDEta08[bin]->SetYTitle("#Delta #phi (rad)");
3188 
3189  fhMixDeltaPhiChargedAssocPtBinDEta0[bin] = new TH2F(Form("hMixDeltaPhiDeltaEta0ChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
3190  Form("Mixed event #Delta #phi vs #it{p}_{T trigger} for associated #it{p}_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta = 0", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
3191  nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
3192  fhMixDeltaPhiChargedAssocPtBinDEta0[bin]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
3193  fhMixDeltaPhiChargedAssocPtBinDEta0[bin]->SetYTitle("#Delta #phi (rad)");
3194 
3195  outputContainer->Add(fhMixDeltaPhiChargedAssocPtBinDEta08[bin]);
3196  outputContainer->Add(fhMixDeltaPhiChargedAssocPtBinDEta0[bin]);
3197  }
3198  }
3199  }
3200  }
3201 
3202  return outputContainer;
3203 }
3204 
3205 //_____________________________________________________________________________________________________________________
3213 //_____________________________________________________________________________________________________________________
3214 Bool_t AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum(Int_t indexPhoton1, Int_t indexPhoton2, Int_t idetector)
3215 {
3216  if(indexPhoton1!=-1 || indexPhoton2!=-1) return kFALSE;
3217 
3218  AliDebug(1,Form("indexPhoton1 = %d, indexPhoton2 = %d", indexPhoton1, indexPhoton2));
3219 
3220  TObjArray * clusters = 0x0 ;
3221  if(idetector==kEMCAL) clusters = GetEMCALClusters() ;
3222  else clusters = GetPHOSClusters() ;
3223 
3224  for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
3225  {
3226  AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
3227 
3228  if(photon->GetID()==indexPhoton1) photon->GetMomentum(fDecayMom1,GetVertex(0)) ;
3229  if(photon->GetID()==indexPhoton2) photon->GetMomentum(fDecayMom2,GetVertex(0)) ;
3230 
3231  AliDebug(1,Form("Photon1 = %f, Photon2 = %f", fDecayMom1.Pt(), fDecayMom2.Pt()));
3232  } //cluster loop
3233 
3234  return kTRUE;
3235 }
3236 
3237 //________________________________________________________________________
3240 //________________________________________________________________________
3242 {
3243  if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPrompt) ||
3245  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCISR) ) return 0;
3246  else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) ) return 1;
3247  else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0Decay) ) return 2;
3248  else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) ) return 3;
3249  else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEtaDecay) ) return 4;
3250  else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) ) return 5; // other decays
3251  else if(!GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron) ) return 6;
3252  else return 7;
3253 }
3254 
3255 //_________________________________________
3257 //_________________________________________
3259 {
3260  if(!GetReader()->IsCTSSwitchedOn())
3261  AliFatal("STOP!: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!");
3262 }
3263 
3264 //____________________________________________________
3266 //____________________________________________________
3268 {
3269  SetInputAODName("Particle");
3270  SetAODObjArrayName("Hadrons");
3271  AddToHistogramsName("AnaHadronCorr_");
3272 
3273  SetPtCutRange(0.,300);
3274  fDeltaPhiMinCut = TMath::DegToRad()*120.;
3275  fDeltaPhiMaxCut = TMath::DegToRad()*240. ;
3276  fSelectIsolated = kFALSE;
3277  fMakeSeveralUE = kFALSE;
3278  fUeDeltaPhiMinCut = TMath::DegToRad()*60.;
3279  fUeDeltaPhiMaxCut = TMath::DegToRad()*120 ;
3280 
3281  fNeutralCorr = kFALSE ;
3282  fPi0Trigger = kFALSE ;
3283  fDecayTrigger = kFALSE ;
3284  fHMPIDCorrelation = kFALSE ;
3285 
3286  fMakeAbsoluteLeading = kTRUE;
3287  fMakeNearSideLeading = kFALSE;
3288 
3289  fNAssocPtBins = 9 ;
3290  fAssocPtBinLimit[0] = 0.2 ;
3291  fAssocPtBinLimit[1] = 0.5 ;
3292  fAssocPtBinLimit[2] = 1.0 ;
3293  fAssocPtBinLimit[3] = 2.0 ;
3294  fAssocPtBinLimit[4] = 3.0 ;
3295  fAssocPtBinLimit[5] = 4.0 ;
3296  fAssocPtBinLimit[6] = 5.0 ;
3297  fAssocPtBinLimit[7] = 6.0 ;
3298  fAssocPtBinLimit[8] = 7.0 ;
3299  fAssocPtBinLimit[9] = 8.0 ;
3300  fAssocPtBinLimit[10] = 9.0 ;
3301  fAssocPtBinLimit[11] = 10.0 ;
3302  fAssocPtBinLimit[12] = 12.0 ;
3303  fAssocPtBinLimit[13] = 14.0 ;
3304  fAssocPtBinLimit[14] = 16.0 ;
3305  fAssocPtBinLimit[15] = 20.0 ;
3306  fAssocPtBinLimit[16] = 30.0 ;
3307  fAssocPtBinLimit[17] = 40.0 ;
3308  fAssocPtBinLimit[18] = 50.0 ;
3309  fAssocPtBinLimit[19] = 200.0 ;
3310 
3311  fUseMixStoredInReader = kTRUE;
3312 
3313  fM02MinCut = -1 ;
3314  fM02MaxCut = -1 ;
3315 
3316  fDecayTagsM02Cut = 0.27;
3317 
3318  fSelectLeadingHadronAngle = kFALSE;
3319  fFillLeadHadOppositeHisto = kFALSE;
3320  fMinLeadHadPhi = 150*TMath::DegToRad();
3321  fMaxLeadHadPhi = 210*TMath::DegToRad();
3322 
3323  fMinLeadHadPt = 1;
3324  fMaxLeadHadPt = 100;
3325 
3326  fMCGenTypeMin = 0;
3327  fMCGenTypeMax = 10;
3328 
3329  fNDecayBits = 1;
3336  fDecayBits[6] = AliNeutralMesonSelection::kPi0LeftSide ; // Leave it last since likely not used
3337  fDecayBits[7] = AliNeutralMesonSelection::kPi0BothSides; // Leave it last since likely not used
3338 
3339  fNBkgBin = 11;
3340  fBkgBinLimit[ 0] = 00.0; fBkgBinLimit[ 1] = 00.2; fBkgBinLimit[ 2] = 00.3; fBkgBinLimit[ 3] = 00.4; fBkgBinLimit[ 4] = 00.5;
3341  fBkgBinLimit[ 5] = 01.0; fBkgBinLimit[ 6] = 01.5; fBkgBinLimit[ 7] = 02.0; fBkgBinLimit[ 8] = 03.0; fBkgBinLimit[ 9] = 05.0;
3342  fBkgBinLimit[10] = 10.0; fBkgBinLimit[11] = 100.;
3343  for(Int_t ibin = fNBkgBin+1; ibin < 20; ibin++)
3344  {
3345  fBkgBinLimit[ibin] = 00.0;
3346  }
3347 
3348 }
3349 
3350 //________________________________________________________________________________________________________
3355 //________________________________________________________________________________________________________
3356 void AliAnaParticleHadronCorrelation::InvMassHisto(AliAODPWG4ParticleCorrelation * trigger, Int_t mcIndex)
3357 {
3358  Int_t idTrig = trigger->GetCaloLabel(0);
3359  Float_t ptTrig = trigger->Pt();
3360  Float_t tofTrig = trigger->GetTime();
3361 
3362  fMomentum = *(trigger->Momentum());
3363 
3364  // Loop on second cluster to be associated to trigger particle to have the invariant mass
3365  Int_t nphoton = GetInputAODBranch()->GetEntriesFast();
3366 
3367  for(Int_t iphoton = 0; iphoton < nphoton; iphoton++)
3368  {
3369  AliAODPWG4ParticleCorrelation * photon1 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iphoton));
3370 
3371  if(idTrig == photon1->GetCaloLabel(0)) continue; //Do not the invariant mass for the same particle
3372 
3373  fMomentumIM = *(photon1->Momentum());
3374 
3375  // Select secondary photon with proper invariant mass
3376  if(fM02MaxCut > 0 && fM02MinCut > 0) //clID1 > 0 && clID2 < 0 &&
3377  {
3378  Float_t m02 = photon1->GetM02();
3379 
3380  if(m02 > fM02MaxCut || m02 < fM02MinCut) continue ;
3381  }
3382 
3383  // Select clusters with good time window difference
3384  Double_t tdiff = tofTrig - photon1->GetTime();
3385  if(TMath::Abs(tdiff) > GetPairTimeCut()) continue;
3386 
3387  // Add momenta of trigger and possible secondary decay
3389 
3390  Double_t mass = fMomentumIM.M();
3391  Double_t epair = fMomentumIM.E();
3392  Float_t ptpair = fMomentumIM.Pt();
3393 
3394  // Mass of all pairs
3395  fhMassPtTrigger->Fill(ptTrig, mass, GetEventWeight());
3396  if ( IsDataMC() ) fhMCMassPtTrigger[mcIndex]->Fill(ptTrig, mass, GetEventWeight());
3397  }
3398 }
3399 
3400 //_________________________________________________________________________
3403 //_________________________________________________________________________
3405 {
3406  Double_t ptTrig = GetMinPt();
3407  Double_t phiTrig = 0 ;
3408  fLeadingTriggerIndex =-1 ;
3409  Int_t index =-1 ;
3410  AliAODPWG4ParticleCorrelation* pLeading = 0;
3411 
3412  // Loop on stored AOD particles, find leading trigger on the selected list, with at least min pT.
3413 
3414  for(Int_t iaod = 0; iaod < GetInputAODBranch()->GetEntriesFast() ; iaod++)
3415  {
3416  AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
3417  particle->SetLeadingParticle(kFALSE); // set it later
3418 
3419  // Vertex cut in case of mixing
3420  Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
3421  if(check == 0) continue;
3422  if(check == -1) return kFALSE; // not sure if it is correct.
3423 
3424  // Find the leading particles with highest momentum
3425  if (particle->Pt() > ptTrig)
3426  {
3427  ptTrig = particle->Pt() ;
3428  phiTrig = particle->Phi();
3429  index = iaod ;
3430  pLeading = particle ;
3431  }
3432  }// Finish search of leading trigger particle on the AOD branch.
3433 
3434  if(index < 0) return kFALSE;
3435 
3436  //printf("AOD leading pT %2.2f, ID %d\n", pLeading->Pt(),pLeading->GetCaloLabel(0));
3437 
3438  if(phiTrig < 0 ) phiTrig += TMath::TwoPi();
3439 
3440  // Compare if it is the leading of all tracks
3441 
3442  for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
3443  {
3444  AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
3445 
3446  if(track->GetID() == pLeading->GetTrackLabel(0) || track->GetID() == pLeading->GetTrackLabel(1) ||
3447  track->GetID() == pLeading->GetTrackLabel(2) || track->GetID() == pLeading->GetTrackLabel(3) ) continue ;
3448 
3449  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
3450  Float_t pt = fTrackVector.Pt();
3451  Float_t phi = fTrackVector.Phi() ;
3452  if(phi < 0) phi+=TMath::TwoPi();
3453 
3454  //jump out this event if near side associated particle pt larger than trigger
3456  {
3457  Float_t deltaPhi = phiTrig-phi;
3458  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
3459  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
3460 
3461  if(pt > ptTrig && deltaPhi < TMath::PiOver2()) return kFALSE;
3462  }
3463  //jump out this event if there is any other particle with pt larger than trigger
3464  else
3465  {
3466  if(pt > ptTrig) return kFALSE ;
3467  }
3468  }// track loop
3469 
3470  // Compare if it is leading of all calorimeter clusters
3471 
3473  {
3474  // Select the calorimeter cluster list
3475  TObjArray * nePl = 0x0;
3476  if (pLeading->GetDetectorTag() == kPHOS )
3477  nePl = GetPHOSClusters();
3478  else
3479  nePl = GetEMCALClusters();
3480 
3481  if(!nePl) return kTRUE; // Do the selection just with the tracks if no calorimeter is available.
3482 
3483  for(Int_t ipr = 0;ipr < nePl->GetEntriesFast() ; ipr ++ )
3484  {
3485  AliVCluster * cluster = (AliVCluster *) (nePl->At(ipr)) ;
3486 
3487  if(cluster->GetID() == pLeading->GetCaloLabel(0) || cluster->GetID() == pLeading->GetCaloLabel(1) ) continue ;
3488 
3489  cluster->GetMomentum(fMomentum,GetVertex(0));
3490 
3491  Float_t pt = fMomentum.Pt();
3492  Float_t phi = fMomentum.Phi() ;
3493  if(phi < 0) phi+=TMath::TwoPi();
3494 
3495  if(IsTrackMatched(cluster,GetReader()->GetInputEvent())) continue ; // avoid charged clusters, already covered by tracks, or cluster merging with track.
3496 
3497  //jump out this event if near side associated particle pt larger than trigger
3498  // not really needed for calorimeter, unless DCal is included
3500  {
3501  Float_t deltaPhi = phiTrig-phi;
3502  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
3503  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
3504 
3505  if(pt > ptTrig && deltaPhi < TMath::PiOver2()) return kFALSE ;
3506  }
3507  //jump out this event if there is any other particle with pt larger than trigger
3508  else
3509  {
3510  if(pt > ptTrig) return kFALSE ;
3511  }
3512  }// cluster loop
3513  } // check neutral clusters
3514 
3515  fLeadingTriggerIndex = index ;
3516  pLeading->SetLeadingParticle(kTRUE);
3517 
3518  AliDebug(1,Form("\t particle AOD with index %d is leading with pT %2.2f", fLeadingTriggerIndex, pLeading->Pt()));
3519 
3520  return kTRUE;
3521 }
3522 
3523 //_________________________________________________________________
3537 //_________________________________________________________________
3539 {
3540  if(!GetInputAODBranch())
3541  {
3542  AliFatal(Form("No input particles in AOD with name branch < %s >, STOP",GetInputAODName().Data()));
3543  return ; // coverity
3544  }
3545 
3546  Int_t naod = GetInputAODBranch()->GetEntriesFast();
3547  if( naod == 0 )
3548  {
3549  AliDebug(1,"No particle AOD found!");
3550  return ; // no trigger particles found.
3551  }
3552 
3553  AliDebug(1,Form("Begin hadron correlation analysis, fill histograms"));
3554  AliDebug(1,Form("n particle branch aod entries %d", naod));
3555  AliDebug(1,Form("In CTS aod entries %d",GetCTSTracks()->GetEntriesFast()));
3556 
3557  //------------------------------------------------------
3558  // Find leading trigger if analysis request only leading,
3559  // if there is no leading trigger, then skip the event
3560 
3561  Int_t iaod = 0 ;
3563  {
3564  Bool_t leading = IsTriggerTheEventLeadingParticle();
3565 
3566  AliDebug(1,Form("AOD Leading trigger? %d, with index %d",leading,fLeadingTriggerIndex));
3567 
3568  if(!leading)
3569  {
3570  AliDebug(1,"Leading was requested and not found");
3571  return ;
3572  }
3573  else
3574  {
3575  // Select only the leading in the trigger AOD loop
3576  naod = fLeadingTriggerIndex+1 ;
3577  iaod = fLeadingTriggerIndex ;
3578  }
3579  }
3580 
3581  //------------------------------------------------------
3582  // Get event multiplicity and bins
3583 
3584  Float_t cen = GetEventCentrality();
3585  Float_t ep = GetEventPlaneAngle();
3587 
3588  Int_t mixEventBin = GetEventMixBin();
3589  Int_t vzbin = GetEventVzBin();
3590 
3591  //------------------------------------------------------
3592  // Loop on trigger AOD
3593 
3594  for( iaod = 0; iaod < naod; iaod++ )
3595  {
3596  AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
3597 
3598  //
3599  // Trigger particle selection criteria:
3600  //
3601  Float_t pt = particle->Pt();
3602 
3603  if(pt < GetMinPt() || pt > GetMaxPt() ) continue ;
3604 
3605  fhPtTriggerInput->Fill(pt, GetEventWeight());
3606 
3607  //
3608  // check if it was a calorimeter cluster
3609  // and if the shower shape cut was requested apply it.
3610  // Not needed if already done at the particle identification level,
3611  // but for isolation studies, it is preferred not to remove so we do it here
3612  //
3613 
3614  AliDebug(1,Form("%s Trigger : min %f, max %f, det %d",
3615  GetInputAODName().Data(),fM02MinCut,fM02MaxCut,particle->GetDetectorTag()));
3616 
3617  if(fM02MaxCut > 0 && fM02MinCut > 0) //clID1 > 0 && clID2 < 0 &&
3618  {
3619  // Int_t iclus = -1;
3620  // TObjArray* clusters = 0x0;
3621  // if (particle->GetDetectorTag() == kEMCAL) clusters = GetEMCALClusters();
3622  // else if(particle->GetDetectorTag() == kPHOS ) clusters = GetPHOSClusters();
3623  //
3624  // if(clusters)
3625  // {
3626  // AliVCluster *cluster = FindCluster(clusters,clID1,iclus);
3627  // Float_t m02 = cluster->GetM02();
3628  // if(m02 > fM02MaxCut || m02 < fM02MinCut) continue ;
3629  // }
3630 
3631  Float_t m02 = particle->GetM02();
3632 
3633  if(m02 > fM02MaxCut || m02 < fM02MinCut) continue ;
3634 
3635  fhPtTriggerSSCut->Fill(pt, GetEventWeight());
3636 
3637  AliDebug(1,"Pass the shower shape cut");
3638  }
3639 
3640  //
3641  // Check if the particle is isolated or if we want to take the isolation into account
3642  // This bool is set in AliAnaParticleIsolation
3643  //
3644  if(OnlyIsolated())
3645  {
3646  if( !particle->IsIsolated() ) continue;
3647 
3648  fhPtTriggerIsoCut->Fill(pt, GetEventWeight());
3649 
3650  AliDebug(1,"Pass the isolation cut");
3651  }
3652 
3653  //
3654  // Check if trigger is in fiducial region
3655  //
3656  if(IsFiducialCutOn())
3657  {
3658  Bool_t in = GetFiducialCut()->IsInFiducialCut(particle->Eta(),particle->Phi(),particle->GetDetectorTag()) ;
3659 
3660  if(! in ) continue ;
3661 
3662  AliDebug(1,"Pass the fiducial cut");
3663  }
3664 
3665  fhPtTriggerFidCut->Fill(pt, GetEventWeight());
3666 
3667  //---------------------------------------
3668  // Make correlation
3669 
3670  // Find the leading hadron in the opposite hemisphere to the trigger
3671  // and accept the trigger if leading is in defined window.
3672  Bool_t okLeadHad = kTRUE;
3674  {
3675  okLeadHad = FindLeadingOppositeHadronInWindow(particle);
3676  if(!okLeadHad && fSelectLeadingHadronAngle) continue;
3677  }
3678 
3679  //
3680  // Charged particles correlation
3681  //
3682  MakeChargedCorrelation(particle);
3683 
3684  // MC
3685  Int_t mcIndex = -1;
3686  Int_t mcTag = particle->GetTag();
3687  Bool_t lostDecayPair = kFALSE;
3688  if(IsDataMC())
3689  {
3690  mcIndex = GetMCTagHistogramIndex(mcTag);
3692  MakeMCChargedCorrelation(particle->GetLabel(), mcIndex,lostDecayPair);
3693  }
3694 
3695  // Do own mixed event with charged,
3696  // add event and remove previous or fill the mixed histograms
3697  if(DoOwnMix())
3698  MakeChargedMixCorrelation(particle);
3699 
3700  //
3701  // Neutral particles correlation
3702  //
3703  if(fNeutralCorr)
3704  MakeNeutralCorrelation(particle);
3705 
3706  //----------------------------------------------------------------
3707  // Fill trigger pT related histograms if not absolute leading
3708 
3709  //
3710  // pT of the trigger, vs trigger origin if MC
3711  //
3712  fhPtTrigger->Fill(pt, GetEventWeight());
3713 
3714 
3715  if(IsDataMC() && mcIndex >=0 && mcIndex < fgkNmcTypes)
3716  {
3717  fhPtTriggerMC[mcIndex]->Fill(pt, GetEventWeight());
3718  if( lostDecayPair )
3719  {
3720  // check index in GetMCTagIndexHistogram
3721  if ( mcIndex == 2 ) fhPtTriggerMC[8]->Fill(pt, GetEventWeight()); // pi0 decay
3722  else if( mcIndex == 4 ) fhPtTriggerMC[9]->Fill(pt, GetEventWeight()); // eta decay
3723  }
3724  }
3725 
3726  //
3727  // pT lead cone, pT sum cone background bins distribution
3728  //
3729  if(fFillBkgBinsHisto)
3730  {
3731  Float_t m02 = particle->GetM02();
3732  Float_t pTLeadTrackInCone = 0;
3733  Float_t pTSumTrackInCone = 0;
3734  Float_t pTLeadClusterInCone = 0;
3735  Float_t pTSumClusterInCone = 0;
3736 
3737  CalculateChargedActivityInCone(particle, pTLeadTrackInCone , pTSumTrackInCone );
3738  CalculateNeutralActivityInCone(particle, pTLeadClusterInCone, pTSumClusterInCone);
3739 
3740  Float_t pTLeadInCone = pTLeadTrackInCone;
3741  if(pTLeadClusterInCone > pTLeadInCone) pTLeadInCone = pTLeadClusterInCone;
3742  Float_t pTSumInCone = pTSumTrackInCone + pTSumClusterInCone;
3743 
3744  // Get the background bin for this cone and trigger
3745  Int_t pTSumBin = -1;
3746  Int_t pTLeadBin = -1;
3747 
3748  for(Int_t ibin = 0; ibin < fNBkgBin; ibin++)
3749  {
3750  if( pTSumInCone >= fBkgBinLimit[ibin] && pTSumInCone < fBkgBinLimit[ibin+1]) pTSumBin = ibin;
3751  if( pTLeadInCone >= fBkgBinLimit[ibin] && pTLeadInCone < fBkgBinLimit[ibin+1]) pTLeadBin = ibin;
3752  }
3753  if(pTSumBin > 0)
3754  {
3755  fhPtSumInConeBin[pTSumBin]->Fill(pt, GetEventWeight());
3756  }
3757 
3758  if(pTLeadBin > 0)
3759  {
3760  fhPtLeadInConeBin[pTLeadBin]->Fill(pt, GetEventWeight());
3761  }
3762 
3763  // Check if it was a decay
3765  {
3766  Int_t decayTag = particle->DecayTag();
3767  if(decayTag < 0) decayTag = 0;
3768 
3769  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
3770  {
3771  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
3772  {
3773  Int_t pTLeadBinDecay = pTLeadBin+ibit*fNBkgBin;
3774  Int_t pTSumBinDecay = pTSumBin+ibit*fNBkgBin;
3775  if( pTLeadBin >=0 ) fhPtLeadConeBinDecay[pTLeadBinDecay]->Fill(pt, GetEventWeight());
3776  if( pTSumBin >=0 ) fhSumPtConeBinDecay [pTSumBinDecay] ->Fill(pt, GetEventWeight());
3777  }
3778  }
3779  }
3780 
3781  if(IsDataMC())
3782  {
3783  Int_t pTLeadBinMC = pTLeadBin+mcIndex*fNBkgBin;
3784  Int_t pTSumBinMC = pTSumBin+mcIndex*fNBkgBin;
3785 
3786  if( pTLeadBin >=0 )
3787  {
3788  fhPtLeadConeBinMC[pTLeadBinMC]->Fill(pt, GetEventWeight());
3789  }
3790 
3791  if( pTSumBin >=0 )
3792  {
3793  fhSumPtConeBinMC [pTSumBinMC]->Fill(pt, GetEventWeight());
3794  }
3795 
3796  if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton))
3797  {
3798  pTLeadBinMC = pTLeadBin+kmcPhoton*fNBkgBin;
3799  pTSumBinMC = pTSumBin+kmcPhoton*fNBkgBin;
3800  if( pTLeadBin >=0 )
3801  {
3802  fhPtLeadConeBinMC[pTLeadBinMC]->Fill(pt, GetEventWeight());
3803  }
3804 
3805  if( pTSumBin >=0 )
3806  {
3807  fhSumPtConeBinMC [ pTSumBinMC]->Fill(pt, GetEventWeight());
3808  }
3809  }
3810 
3811  // Check if decay and if pair is lost
3812  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
3813  {
3814  if ( mcIndex == kmcPi0Decay )
3815  {
3816  pTLeadBinMC = pTLeadBin+kmcPi0DecayLostPair*fNBkgBin;
3817  pTSumBinMC = pTSumBin+kmcPi0DecayLostPair*fNBkgBin;
3818  }
3819  else if(mcIndex == kmcEtaDecay)
3820  {
3821  pTLeadBinMC = pTLeadBin+kmcEtaDecayLostPair*fNBkgBin;
3822  pTSumBinMC = pTSumBin+kmcEtaDecayLostPair*fNBkgBin;
3823  }
3824  else
3825  AliFatal(Form("Lost decay Bit assigned to bad case, mcIndex %d",mcIndex));
3826 
3827  if( pTLeadBin >=0 )
3828  {
3829  fhPtLeadConeBinMC[pTLeadBinMC]->Fill(pt, GetEventWeight());
3830  }
3831 
3832  if( pTSumBin >=0 )
3833  {
3834  fhSumPtConeBinMC [ pTSumBinMC]->Fill(pt, GetEventWeight());
3835  }
3836 
3837  }
3838 
3839  }
3840  }
3841 
3842  // Invariant mass of trigger particle
3843  if(fFillInvMassHisto) InvMassHisto(particle,mcIndex);
3844 
3845  if(fDecayTrigger)
3846  {
3847  Int_t decayTag = particle->DecayTag();
3848  if(decayTag < 0) decayTag = 0;
3849 
3850  for(Int_t ibit = 0; ibit<fNDecayBits; ibit++)
3851  {
3852  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
3853  {
3854  fhPtDecayTrigger[ibit]->Fill(pt, GetEventWeight());
3855 
3856  if(IsDataMC() && mcIndex >=0 && mcIndex < fgkNmcTypes)
3857  {
3858  fhPtDecayTriggerMC[ibit][mcIndex]->Fill(pt, GetEventWeight());
3859  if( lostDecayPair )
3860  {
3861  // check index in GetMCTagIndexHistogram
3862  if( mcIndex == 2 ) fhPtDecayTriggerMC[ibit][8]->Fill(pt, GetEventWeight()); // pi0 decay
3863  if( mcIndex == 4 ) fhPtDecayTriggerMC[ibit][9]->Fill(pt, GetEventWeight()); // eta decay
3864  }
3865  }
3866  }// check bit
3867  }// bit loop
3868  }
3869 
3870  //
3871  // Acceptance of the trigger
3872  //
3873  Float_t phi = particle->Phi();
3874  if( phi < 0 ) phi+=TMath::TwoPi();
3875  fhPhiTrigger->Fill(pt, phi, GetEventWeight());
3876 
3877  fhEtaTrigger->Fill(pt, particle->Eta(), GetEventWeight());
3878  //printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Trigger particle : pt %f, eta %f, phi %f\n",particle->Pt(),particle->Eta(),phi);
3879 
3880  //----------------------------------
3881  // Trigger particle pT vs event bins
3882 
3883  fhPtTriggerBin->Fill(pt, mixEventBin, GetEventWeight());
3884  if(fCorrelVzBin)
3885  fhPtTriggerVzBin->Fill(pt, vzbin, GetEventWeight());
3886 
3888  {
3889  fhPtTriggerCentrality->Fill(pt, cen, GetEventWeight());
3890  fhPtTriggerEventPlane->Fill(pt, ep , GetEventWeight());
3891  }
3892 
3893  //----------------------------------
3894  // Trigger particle pT vs pile-up
3895 
3896  if(IsPileUpAnalysisOn())
3897  {
3898  Int_t vtxBC = GetReader()->GetVertexBC();
3899  if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA) fhPtTriggerVtxBC0->Fill(pt, GetEventWeight());
3900 
3901  if(GetReader()->IsPileUpFromSPD()) fhPtTriggerPileUp[0]->Fill(pt, GetEventWeight());
3902  if(GetReader()->IsPileUpFromEMCal()) fhPtTriggerPileUp[1]->Fill(pt, GetEventWeight());
3903  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTriggerPileUp[2]->Fill(pt, GetEventWeight());
3904  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTriggerPileUp[3]->Fill(pt, GetEventWeight());
3905  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTriggerPileUp[4]->Fill(pt, GetEventWeight());
3906  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTriggerPileUp[5]->Fill(pt, GetEventWeight());
3907  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTriggerPileUp[6]->Fill(pt, GetEventWeight());
3908  }
3909  } // AOD trigger loop
3910 
3911  // Re-init for next event
3912  fLeadingTriggerIndex = -1;
3913 
3914  AliDebug(1,"End fill histograms");
3915 }
3916 
3917 //_______________________________________________________________________________________________________
3923 //_______________________________________________________________________________________________________
3924 void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
3925 {
3926  AliDebug(1,"Make trigger particle - charged hadron correlation");
3927 
3928  Float_t phiTrig = aodParticle->Phi();
3929  Float_t etaTrig = aodParticle->Eta();
3930  Float_t ptTrig = aodParticle->Pt();
3931  Int_t mcTag = aodParticle->GetTag();
3932  Double_t bz = GetReader()->GetInputEvent()->GetMagneticField();
3933 
3934 
3935  Int_t decayTag = 0;
3936  if(fDecayTrigger)
3937  {
3938  //decay = aodParticle->IsTagged();
3939  decayTag = aodParticle->DecayTag();
3940  if(decayTag < 0) decayTag = 0;
3941  // printf("Correlation: pT %2.2f, BTag %d, Tagged %d\n",ptTrig, decayTag, aodParticle->IsTagged());
3942  // printf("\t check bit Pi0 %d, Eta %d, Pi0Side %d, EtaSide %d\n",
3943  // GetNeutralMesonSelection()->CheckDecayBit(decayTag,AliNeutralMesonSelection::kPi0),
3944  // GetNeutralMesonSelection()->CheckDecayBit(decayTag,AliNeutralMesonSelection::kEta),
3945  // GetNeutralMesonSelection()->CheckDecayBit(decayTag,AliNeutralMesonSelection::kPi0Side),
3946  // GetNeutralMesonSelection()->CheckDecayBit(decayTag,AliNeutralMesonSelection::kEtaSide));
3947  }
3948 
3949  Float_t pt = -100. ;
3950  Float_t phi = -100. ;
3951  Float_t eta = -100. ;
3952  Float_t deltaPhi = -100. ;
3953 
3954  TObjArray * reftracks = 0x0;
3955  Int_t nrefs = 0;
3956 
3957  // Mixed event settings
3958  Int_t evtIndex11 = -1 ; // cluster trigger or pi0 trigger
3959  Int_t evtIndex12 = -1 ; // pi0 trigger
3960  Int_t evtIndex13 = -1 ; // charged trigger
3961 
3962  if (GetMixedEvent())
3963  {
3964  evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
3965  evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
3966  evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
3967  }
3968 
3969  // Track multiplicity or cent bin
3970  Int_t cenbin = 0;
3972 
3973  //
3974  // In case of pi0/eta trigger, we may want to check their decay correlation,
3975  // get their decay children
3976  //
3977 
3978  Bool_t decayFound = kFALSE;
3979  if( fPi0Trigger )
3980  {
3981  decayFound = GetDecayPhotonMomentum(aodParticle->GetCaloLabel(0),aodParticle->GetCaloLabel(1),aodParticle->GetDetectorTag());
3982  if(decayFound)
3983  {
3984  fhPtPi0DecayRatio->Fill(ptTrig, fDecayMom1.Pt()/ptTrig, GetEventWeight());
3985  fhPtPi0DecayRatio->Fill(ptTrig, fDecayMom2.Pt()/ptTrig, GetEventWeight());
3986  }
3987  }
3988 
3989  //-----------------------------------------------------------------------
3990  // Track loop, select tracks with good pt, phi and fill AODs or histograms
3991  //-----------------------------------------------------------------------
3992 
3993  for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
3994  {
3995  AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
3996 
3997  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
3998  pt = fTrackVector.Pt();
3999  eta = fTrackVector.Eta();
4000  phi = fTrackVector.Phi() ;
4001  if(phi < 0) phi+=TMath::TwoPi();
4002 
4003  //Select only hadrons in pt range
4004  if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
4005 
4006  //remove trigger itself for correlation when use charged triggers
4007  if( track->GetID() == aodParticle->GetTrackLabel(0) || track->GetID() == aodParticle->GetTrackLabel(1) ||
4008  track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3) )
4009  continue ;
4010 
4011  //Only for mixed event frame
4012  Int_t evtIndex2 = 0 ;
4013  if (GetMixedEvent())
4014  {
4015  evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
4016  if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
4017  continue ;
4018  //vertex cut
4019  if (TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut())
4020  continue;
4021  }
4022 
4023  AliDebug(2,Form("Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f",pt,phi,eta));
4024 
4025  // ------------------------------
4026  // Track type bin or bits setting
4027  //
4028 
4029  //
4030  // * Set the pt associated bin for the defined bins *
4031  //
4032  Int_t assocBin = -1;
4033  for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
4034  {
4035  if(pt > fAssocPtBinLimit[i] && pt < fAssocPtBinLimit[i+1]) assocBin= i;
4036  }
4037 
4038  //
4039  // * Assign to the histogram array a bin corresponding
4040  // to a combination of pTa and vz bins *
4041  //
4042  Int_t nz = 1;
4043  Int_t vz = 0;
4044 
4045  if(fCorrelVzBin)
4046  {
4047  nz = GetNZvertBin();
4048  vz = GetEventVzBin();
4049  }
4050 
4051  Int_t bin = assocBin*nz+vz;
4052 
4053  //printf("assoc Bin = %d, vZ bin = %d, bin = %d \n", assocBin,GetEventVzBin(),bin);
4054 
4055  //
4056  // * Get the status of the TOF bit *
4057  //
4058  ULong_t status = track->GetStatus();
4059  Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
4060  //Double32_t tof = track->GetTOFsignal()*1e-3;
4061  Int_t trackBC = track->GetTOFBunchCrossing(bz);
4062 
4063  Int_t outTOF = -1;
4064  if (okTOF && trackBC!=0) outTOF = 1;
4065  else if(okTOF && trackBC==0) outTOF = 0;
4066 
4067  //----------------
4068  // Fill Histograms
4069 
4070  //
4071  // Azimuthal Angle histograms
4072  //
4073 
4074  deltaPhi = phiTrig-phi;
4075 
4076  //
4077  // Calculate deltaPhi shift so that for the particles on the opposite side
4078  // it is defined between 90 and 270 degrees
4079  // Shift [-360,-90] to [0, 270]
4080  // and [270,360] to [-90,0]
4081  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4082  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4083 
4084  FillChargedAngularCorrelationHistograms(pt, ptTrig, bin, phi, phiTrig, deltaPhi,
4085  eta, etaTrig, decayTag, track->GetHMPIDsignal(),
4086  outTOF, cenbin, mcTag);
4087 
4088  //
4089  // Imbalance zT/xE/pOut histograms
4090  //
4091 
4092  //
4093  // Delta phi cut for momentum imbalance correlation
4094  //
4095  if ( (deltaPhi > fDeltaPhiMinCut) && (deltaPhi < fDeltaPhiMaxCut) )
4096  FillChargedMomentumImbalanceHistograms(ptTrig, pt, deltaPhi, cenbin, track->Charge(),
4097  assocBin, decayTag, outTOF, mcTag);
4098 
4099  //
4100  // Underlying event, right side, default case
4101  //
4102  if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
4103  FillChargedUnderlyingEventHistograms(ptTrig, pt, deltaPhi, cenbin, outTOF,mcTag);
4104 
4105  //
4106  // Several UE calculation, in different perpendicular regions, up to 6:
4107  // left, right, upper-left, lower left, upper-right, lower-right
4108  //
4109  if(fMakeSeveralUE)
4110  FillChargedUnderlyingEventSidesHistograms(ptTrig,pt,deltaPhi,mcTag);
4111 
4112  //
4113  if(fPi0Trigger && decayFound)
4114  FillDecayPhotonCorrelationHistograms(pt, phi, kTRUE) ;
4115 
4116  //
4117  // Add track reference to array
4118  //
4120  {
4121  nrefs++;
4122  if(nrefs==1)
4123  {
4124  reftracks = new TObjArray(0);
4125  TString trackname = Form("%sTracks", GetAODObjArrayName().Data());
4126  reftracks->SetName(trackname.Data());
4127  reftracks->SetOwner(kFALSE);
4128  }
4129 
4130  reftracks->Add(track);
4131  }// reference track to AOD
4132  }// track loop
4133 
4134  //Fill AOD with reference tracks, if not filling histograms
4135  if(fFillAODWithReferences && reftracks)
4136  {
4137  aodParticle->AddObjArray(reftracks);
4138  }
4139 }
4140 
4141 //_________________________________________________________________________________________________________
4143 //_________________________________________________________________________________________________________
4144 void AliAnaParticleHadronCorrelation::MakeChargedMixCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
4145 {
4146  AliDebug(1,Form("Make trigger particle - charged hadron mixed event correlation"));
4147 
4148  if(GetMixedEvent()) return; // This is not the mixed event from general mixing frame
4149 
4150  // Get the event with similar caracteristics
4151  //printf("MakeChargedMixCorrelation for %s\n",GetInputAODName().Data());
4152 
4153  AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
4154 
4155  AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
4156 
4157  if(!inputHandler) return;
4158 
4159  if(!(inputHandler->IsEventSelected( ) & GetReader()->GetEventTriggerMask())) return;
4160 
4161  // Get the pool, check if it exits
4162  Int_t eventBin = GetEventMixBin();
4163 
4164  //Check that the bin exists, if not (bad determination of RP, ntrality or vz bin) do nothing
4165  if(eventBin < 0) return;
4166 
4167  fhEventBin->Fill(eventBin, GetEventWeight());
4168 
4169  // Get neutral clusters pool?
4171  Bool_t neutralMix = fFillNeutralEventMixPool || isoCase ;
4172 
4173  TList * pool = 0;
4174  TList * poolCalo = 0;
4176  {
4177  pool = GetReader()->GetListWithMixedEventsForTracks(eventBin);
4178  if(neutralMix) poolCalo = GetReader()->GetListWithMixedEventsForCalo (eventBin);
4179  }
4180  else
4181  {
4182  pool = fListMixTrackEvents[eventBin];
4183  if(neutralMix) poolCalo = fListMixCaloEvents [eventBin];
4184  }
4185 
4186  if(!pool) return ;
4187 
4188  if( neutralMix && !poolCalo )
4189  AliWarning("Careful, cluster pool not available");
4190 
4191  Double_t ptTrig = aodParticle->Pt();
4192  Double_t etaTrig = aodParticle->Eta();
4193  Double_t phiTrig = aodParticle->Phi();
4194  if(phiTrig < 0.) phiTrig+=TMath::TwoPi();
4195 
4196  AliDebug(1,Form("Pool bin %d size %d, trigger trigger pt=%f, phi=%f, eta=%f",
4197  eventBin,pool->GetSize(), ptTrig,phiTrig,etaTrig));
4198 
4199  Double_t ptAssoc = -999.;
4200  Double_t phiAssoc = -999.;
4201  Double_t etaAssoc = -999.;
4202  Double_t deltaPhi = -999.;
4203  Double_t deltaEta = -999.;
4204  Double_t xE = -999.;
4205 
4206  // Start from first event in pool except if in this same event the pool was filled
4207  Int_t ev0 = 0;
4208  if(GetReader()->GetLastTracksMixedEvent() == GetEventNumber()) ev0 = 1;
4209 
4210  for(Int_t ev=ev0; ev < pool->GetSize(); ev++)
4211  {
4212  //
4213  // Recover the lists of tracks or clusters
4214  //
4215  TObjArray* bgTracks = static_cast<TObjArray*>(pool->At(ev));
4216  TObjArray* bgCalo = 0;
4217 
4218  // Recover the clusters list if requested
4219  if( neutralMix && poolCalo )
4220  {
4221  if(pool->GetSize()!=poolCalo->GetSize())
4222  AliWarning("Different size of calo and track pools");
4223 
4224  bgCalo = static_cast<TObjArray*>(poolCalo->At(ev));
4225 
4226  if(!bgCalo) AliDebug(1,Form("Event %d in calo pool not available?",ev));
4227  }
4228 
4229  //
4230  // Isolate the trigger in the mixed event with mixed tracks and clusters
4231  //
4232  if( OnlyIsolated() )
4233  {
4234  Int_t n=0, nfrac = 0;
4235  Bool_t isolated = kFALSE;
4236  Float_t coneptsum = 0, coneptlead = 0;
4237  GetIsolationCut()->MakeIsolationCut(bgTracks,bgCalo,
4238  GetReader(), GetCaloPID(),
4239  kFALSE, aodParticle, "",
4240  n,nfrac,coneptsum,coneptlead,isolated);
4241 
4242  //printf("AliAnaParticleHadronCorrelation::MakeChargedMixCorrelation() - Isolated? %d - cone %f, ptthres %f",
4243  // isolated,GetIsolationCut()->GetConeSize(),GetIsolationCut()->GetPtThreshold());
4244  //if(bgTracks)printf(" - n track %d", bgTracks->GetEntriesFast());
4245  //printf("\n");
4246 
4247  if(!isolated) continue ;
4248  }
4249 
4250  //
4251  // Check if the trigger is leading of mixed event
4252  //
4253  Int_t nTracks=bgTracks->GetEntriesFast();
4254 
4256  {
4257  Bool_t leading = kTRUE;
4258  for(Int_t jlead = 0;jlead < nTracks; jlead++ )
4259  {
4260  AliAODPWG4Particle *track = (AliAODPWG4Particle*) bgTracks->At(jlead) ;
4261 
4262  ptAssoc = track->Pt();
4263  phiAssoc = track->Phi() ;
4264  if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
4265 
4267  {
4268  deltaPhi = phiTrig-phiAssoc;
4269  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4270  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4271 
4272  if(ptAssoc > ptTrig && deltaPhi < TMath::PiOver2())
4273  {
4274  leading = kFALSE;
4275  break;
4276  }
4277  }
4278  //jump out this event if there is any other particle with pt larger than trigger
4279  else if(fMakeAbsoluteLeading)
4280  {
4281  if(ptAssoc > ptTrig)
4282  {
4283  leading = kFALSE;
4284  break;
4285  }
4286  }
4287  }
4288 
4289  if( !neutralMix && fCheckLeadingWithNeutralClusters )
4290  AliWarning("Leading of clusters requested but no clusters in mixed event");
4291 
4292  if(neutralMix && fCheckLeadingWithNeutralClusters && bgCalo)
4293  {
4294  Int_t nClusters=bgCalo->GetEntriesFast();
4295  for(Int_t jlead = 0;jlead <nClusters; jlead++ )
4296  {
4297  AliAODPWG4Particle *cluster= (AliAODPWG4Particle*) bgCalo->At(jlead) ;
4298 
4299  ptAssoc = cluster->Pt();
4300  phiAssoc = cluster->Phi() ;
4301  if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
4302 
4304  {
4305  deltaPhi = phiTrig-phiAssoc;
4306  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4307  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4308 
4309  if(ptAssoc > ptTrig && deltaPhi < TMath::PiOver2())
4310  {
4311  leading = kFALSE;
4312  break;
4313  }
4314  }
4315  //jump out this event if there is any other particle with pt larger than trigger
4316  else if(fMakeAbsoluteLeading)
4317  {
4318  if(ptAssoc > ptTrig)
4319  {
4320  leading = kFALSE;
4321  break;
4322  }
4323  }
4324  }
4325  }
4326 
4327  if(!leading) continue; // not leading, check the next event in pool
4328  }
4329 
4330  //
4331  // Fill histograms for selected triggers
4332  //
4333 
4334  fhEventMixBin->Fill(eventBin, GetEventWeight());
4335 
4336  //printf("\t Read Pool event %d, nTracks %d\n",ev,nTracks);
4337 
4338  fhPtTriggerMixed ->Fill(ptTrig, GetEventWeight());
4339  fhPhiTriggerMixed ->Fill(ptTrig, phiTrig, GetEventWeight());
4340  fhEtaTriggerMixed ->Fill(ptTrig, etaTrig, GetEventWeight());
4341  fhPtTriggerMixedBin->Fill(ptTrig, eventBin, GetEventWeight());
4342 
4344 
4345  //
4346  // Correlation histograms
4347  //
4348  for(Int_t j1 = 0;j1 <nTracks; j1++ )
4349  {
4350  AliAODPWG4Particle *track = (AliAODPWG4Particle*) bgTracks->At(j1) ;
4351 
4352  if(!track) continue;
4353 
4354  ptAssoc = track->Pt();
4355  etaAssoc = track->Eta();
4356  phiAssoc = track->Phi() ;
4357  if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
4358 
4359  deltaPhi = phiTrig-phiAssoc;
4360  if(deltaPhi < -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4361  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4362  deltaEta = etaTrig-etaAssoc;
4363 
4364  AliDebug(1,Form("deltaPhi= %f, deltaEta=%f",deltaPhi, deltaEta));
4365 
4366  // Angular correlation
4367  fhMixDeltaPhiCharged ->Fill(ptTrig , deltaPhi, GetEventWeight());
4368  fhMixDeltaPhiDeltaEtaCharged->Fill(deltaPhi, deltaEta, GetEventWeight());
4369 
4370  //
4371  // Momentum imbalance
4372  //
4373  if ( (deltaPhi > fDeltaPhiMinCut) && (deltaPhi < fDeltaPhiMaxCut) )
4374  {
4375  xE = -ptAssoc/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
4376 
4377  if( xE < 0.)
4378  AliWarning(Form("Careful!!, negative xE %2.2f for right UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
4379  xE,deltaPhi*TMath::RadToDeg(),TMath::Cos(deltaPhi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
4380 
4381  fhMixXECharged->Fill(ptTrig, xE, GetEventWeight());
4382  if ( xE > 0 ) fhMixHbpXECharged->Fill(ptTrig, TMath::Log(1./xE), GetEventWeight());
4383  }
4384 
4385  //
4386  // Underlying event momentum imbalance
4387  //
4388  if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
4389  {
4390  //Underlying event region
4391  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
4392  Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
4393 
4394  if(uexE < 0.)
4395  AliWarning(Form("Careful!!, negative xE %2.2f for left UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
4396  uexE,randomphi*TMath::RadToDeg(),TMath::Cos(randomphi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
4397 
4398  fhMixXEUeCharged->Fill(ptTrig, uexE, GetEventWeight());
4399  }
4400 
4401  // Set the pt associated bin for the defined bins
4402  Int_t assocBin = -1;
4403  for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
4404  {
4405  if(ptAssoc > fAssocPtBinLimit[i] && ptAssoc < fAssocPtBinLimit[i+1]) assocBin= i;
4406  }
4407 
4408  //
4409  // Assign to the histogram array a bin corresponding to a combination of pTa and vz bins
4410  //
4411  Int_t nz = 1;
4412  Int_t vz = 0;
4413 
4414  if(fCorrelVzBin)
4415  {
4416  nz = GetNZvertBin();
4417  vz = GetEventVzBin();
4418  }
4419 
4420  Int_t bin = assocBin*nz+vz;
4421 
4422  if(bin < 0) continue ; // this pt bin was not considered
4423 
4424  fhMixDeltaPhiChargedAssocPtBin [bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
4425  fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->Fill(deltaPhi, deltaEta, GetEventWeight());
4426 
4427  if(fFillEtaGapsHisto)
4428  {
4429  if(TMath::Abs(deltaEta) > 0.8)
4430  fhMixDeltaPhiChargedAssocPtBinDEta08 [bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
4431  if(TMath::Abs(deltaEta) < 0.01)
4432  fhMixDeltaPhiChargedAssocPtBinDEta0 [bin]->Fill(ptTrig, deltaPhi, GetEventWeight());
4433  }
4434 
4435  } // track loop
4436  } // mixed event loop
4437 }
4438 
4439 //_______________________________________________________________________________________________________
4442 //_______________________________________________________________________________________________________
4443 void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * aodParticle)
4444 {
4445  TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); // For the future, foresee more possible pi0 lists
4446  if(!pi0list) return ;
4447 
4448  Int_t npi0 = pi0list->GetEntriesFast();
4449  if(npi0 == 0) return ;
4450 
4451  AliDebug(1,Form("Particle - pi0 correlation, %d pi0's",npi0));
4452 
4453  Int_t evtIndex11 = 0 ;
4454  Int_t evtIndex12 = 0 ;
4455  if (GetMixedEvent())
4456  {
4457  evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
4458  evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
4459  }
4460 
4461  Float_t pt = -100. ;
4462  Float_t zT = -100. ;
4463  Float_t phi = -100. ;
4464  Float_t eta = -100. ;
4465  Float_t xE = -100. ;
4466  Float_t hbpXE= -100. ;
4467  Float_t hbpZT= -100. ;
4468 
4469  Float_t ptTrig = aodParticle->Pt();
4470  Float_t phiTrig = aodParticle->Phi();
4471  Float_t etaTrig = aodParticle->Eta();
4472  Float_t deltaPhi= -100. ;
4473  Float_t deltaEta= -100. ;
4474 
4475  // In case of pi0/eta trigger, we may want to check their decay correlation,
4476  // get their decay children
4477 
4478  Bool_t decayFound = kFALSE;
4479  if(fPi0Trigger) decayFound = GetDecayPhotonMomentum(aodParticle->GetCaloLabel(0),aodParticle->GetCaloLabel(1),aodParticle->GetDetectorTag());
4480 
4481  TObjArray * refpi0 = 0x0;
4482  Int_t nrefs = 0;
4483 
4484  // Loop on stored AOD pi0
4485 
4486  for(Int_t iaod = 0; iaod < npi0 ; iaod++)
4487  {
4488  AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod));
4489 
4490  Int_t evtIndex2 = 0 ;
4491  Int_t evtIndex3 = 0 ;
4492  if (GetMixedEvent())
4493  {
4494  evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
4495  evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
4496 
4497  if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 ||
4498  evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events
4499  continue ;
4500  }
4501 
4502  pt = pi0->Pt();
4503 
4504  if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
4505 
4506  // Remove trigger itself for correlation when use charged triggers
4507  if(aodParticle->GetCaloLabel(0) >= 0 &&
4508  (pi0->GetCaloLabel(0) == aodParticle->GetCaloLabel(0) || pi0->GetCaloLabel(1) == aodParticle->GetCaloLabel(0))) continue ;
4509 
4510  if( aodParticle->GetCaloLabel(1) >= 0 &&
4511  (pi0->GetCaloLabel(0) == aodParticle->GetCaloLabel(1) || pi0->GetCaloLabel(1) == aodParticle->GetCaloLabel(1))) continue ;
4512 
4513  //
4514  // Angular correlations
4515  //
4516  phi = pi0->Phi() ;
4517  eta = pi0->Eta() ;
4518  deltaEta = etaTrig-eta;
4519  deltaPhi = phiTrig-phi;
4520  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4521  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4522 
4523  fhEtaNeutral ->Fill(pt , eta , GetEventWeight());
4524  fhPhiNeutral ->Fill(pt , phi , GetEventWeight());
4525  fhDeltaEtaNeutral->Fill(ptTrig, deltaEta, GetEventWeight());
4526  fhDeltaPhiNeutral->Fill(ptTrig, deltaPhi, GetEventWeight());
4527 
4528  if ( pt > 2 ) fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi, deltaEta, GetEventWeight());
4529 
4530  //
4531  // Momentum imbalance
4532  //
4533  zT = pt/ptTrig ;
4534 
4535  hbpZT = -100;
4536  hbpXE = -100;
4537 
4538  if(zT > 0 ) hbpZT = TMath::Log(1./zT);
4539 
4540  // Delta phi cut for correlation
4541  if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) )
4542  {
4543  xE =-pt/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
4544 
4545  if( xE < 0. )
4546  AliWarning(Form("Careful!!, negative xE %2.2f for right UE cos(dPhi %2.2f) = %2.2f, check correlation dPhi limits %f to %f",
4547  xE,deltaPhi*TMath::RadToDeg(),TMath::Cos(deltaPhi),fDeltaPhiMinCut*TMath::RadToDeg(),fDeltaPhiMaxCut*TMath::RadToDeg()));
4548 
4549  if( xE > 0 ) hbpXE = TMath::Log(1./xE);
4550 
4551  fhDeltaPhiNeutralPt->Fill(pt , deltaPhi, GetEventWeight());
4552  fhXENeutral ->Fill(ptTrig, xE , GetEventWeight());
4553  fhPtHbpXENeutral ->Fill(ptTrig, hbpXE , GetEventWeight());
4554  fhZTNeutral ->Fill(ptTrig, zT , GetEventWeight());
4555  fhPtHbpZTNeutral ->Fill(ptTrig, hbpZT , GetEventWeight());
4556  }
4557  else if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
4558  {
4559  // Randomize angle for xE calculation
4560  Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
4561 
4562  xE = -(pt/ptTrig)*TMath::Cos(randomphi);
4563  if(xE > 0 ) hbpXE = TMath::Log(1./xE);
4564 
4565  fhDeltaPhiUeNeutralPt->Fill(pt , deltaPhi, GetEventWeight());
4566  fhZTUeNeutral ->Fill(ptTrig, zT , GetEventWeight());
4567  fhPtHbpZTUeNeutral ->Fill(ptTrig, hbpZT , GetEventWeight());
4568  fhXEUeNeutral ->Fill(ptTrig, xE , GetEventWeight());
4569  fhPtHbpXEUeNeutral ->Fill(ptTrig, hbpXE , GetEventWeight());
4570  }
4571 
4572  // Several UE calculation, not sure it is useful
4573  // with partical calorimter acceptance
4574  if(fMakeSeveralUE) FillNeutralUnderlyingEventSidesHistograms(ptTrig,pt,zT,hbpZT,deltaPhi);
4575 
4576  //
4577  // Decay photon correlations
4578  //
4579  if(fPi0Trigger && decayFound)
4580  FillDecayPhotonCorrelationHistograms(pt, phi, kFALSE) ;
4581 
4583  {
4584  nrefs++;
4585  if(nrefs==1)
4586  {
4587  refpi0 = new TObjArray(0);
4588  refpi0->SetName(GetAODObjArrayName()+"Pi0s");
4589  refpi0->SetOwner(kFALSE);
4590  }
4591  refpi0->Add(pi0);
4592  } // put references in trigger AOD
4593 
4594  AliDebug(1,Form("Selected pi0: pt %2.2f, phi %2.2f, eta %2.2f",pt,phi,eta));
4595 
4596  } // loop
4597 
4598  // Fill AOD with reference tracks, if not filling histograms
4599  if(fFillAODWithReferences && refpi0)
4600  {
4601  aodParticle->AddObjArray(refpi0);
4602  }
4603 }
4604 
4605 //__________________________________________________________________________________________________________________
4607 //__________________________________________________________________________________________________________________
4608 void AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(Int_t label, Int_t histoIndex, Bool_t lostDecayPair)
4609 {
4610  AliDebug(1,"Make trigger particle - charged hadron correlation in AOD MC level");
4611 
4612  if( label < 0 )
4613  {
4614  AliDebug(1,Form(" *** bad label ***: label %d", label));
4615  return;
4616  }
4617 
4618  // Do MC correlation for a given particle type range.
4619  // Types defined in GetMCTagHistogramIndex:
4620  // 0 direct gamma; 1 pi0; 2 pi0 decay; 3 eta decay; 4 other decay; 5 electron; 6 other (hadron)
4621  if(histoIndex < fMCGenTypeMin || histoIndex > fMCGenTypeMax) return ;
4622 
4623  AliStack * stack = 0x0 ;
4624  TParticle * primary = 0x0 ;
4625  TClonesArray * mcparticles = 0x0 ;
4626  AliAODMCParticle * aodprimary = 0x0 ;
4627 
4628  Double_t eprim = 0 ;
4629  Double_t ptprim = 0 ;
4630  Double_t phiprim = 0 ;
4631  Double_t etaprim = 0 ;
4632  Int_t nTracks = 0 ;
4633  Int_t iParticle = 0 ;
4634 
4635  Bool_t leadTrig = kTRUE;
4636 
4637  if( GetReader()->ReadStack() )
4638  {
4639  stack = GetMCStack() ;
4640  if(!stack)
4641  {
4642  AliFatal("Stack not available, is the MC handler called? STOP");
4643  return;
4644  }
4645 
4646  //nTracks = stack->GetNtrack() ;
4647  nTracks = stack->GetNprimary();
4648  if( label >= stack->GetNtrack() )
4649  {
4650  if(GetDebug() > 2)
4651  AliInfo(Form("*** large label ***: label %d, n tracks %d", label, stack->GetNtrack()));
4652  return ;
4653  }
4654 
4655  primary = stack->Particle(label);
4656  if ( !primary )
4657  {
4658  AliInfo(Form(" *** no primary ***: label %d", label));
4659  return;
4660  }
4661 
4662  eprim = primary->Energy();
4663  ptprim = primary->Pt();
4664  etaprim = primary->Eta();
4665  phiprim = primary->Phi();
4666  if(phiprim < 0) phiprim+=TMath::TwoPi();
4667 
4668  if(ptprim < 0.01 || eprim < 0.01) return ;
4669 
4670  for (iParticle = 0 ; iParticle < nTracks ; iParticle++)
4671  {
4672  TParticle * particle = stack->Particle(iParticle);
4673 
4674  //keep only final state particles
4675  if( particle->GetStatusCode() != 1 ) continue ;
4676 
4677  //---------- Charged particles ----------------------
4678  Int_t pdg = particle->GetPdgCode();
4679  Int_t charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
4680  if(charge == 0) continue;
4681 
4682  particle->Momentum(fMomentum);
4683 
4684  //Particles in CTS acceptance, make sure to use the same selection as in the reader
4685  Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),kCTS);
4686  //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,fMomentum.Pt(),fMomentum.Eta(),fMomentum.Phi()*TMath::RadToDeg());
4687  if( !inCTS ) continue;
4688 
4689  // Remove conversions
4690  if ( TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode() == 22 ) continue ;
4691 
4692  if ( label == iParticle ) continue; // avoid trigger particle
4693 
4694  Float_t phi = particle->Phi();
4695  if(phi < 0) phi+=TMath::TwoPi();
4696 
4697  Bool_t lead = FillChargedMCCorrelationHistograms(particle->Pt(),phi,particle->Eta(),ptprim,phiprim,etaprim,histoIndex,lostDecayPair);
4698 
4699  if ( !lead ) leadTrig = kFALSE;
4700 
4701  // if ( !lead && (fMakeAbsoluteLeading || fMakeNearSideLeading) ) return;
4702  } // track loop
4703  } // ESD MC
4704  else if( GetReader()->ReadAODMCParticles() )
4705  {
4706  // Get the list of MC particles
4707  mcparticles = GetReader()->GetAODMCParticles();
4708  if( !mcparticles ) return;
4709 
4710  nTracks = mcparticles->GetEntriesFast() ;
4711 
4712  if( label >= nTracks )
4713  {
4714  if(GetDebug() > 2)
4715  AliInfo(Form(" *** large label ***: label %d, n tracks %d", label,nTracks));
4716  return;
4717  }
4718 
4719  // Get the particle
4720  aodprimary = (AliAODMCParticle*) mcparticles->At(label);
4721  if( !aodprimary )
4722  {
4723  AliInfo(Form(" *** no AOD primary ***: label %d", label));
4724  return;
4725  }
4726 
4727  eprim = aodprimary->E();
4728  ptprim = aodprimary->Pt();
4729  etaprim = aodprimary->Eta();
4730  phiprim = aodprimary->Phi();
4731  if(phiprim < 0) phiprim+=TMath::TwoPi();
4732 
4733  if(ptprim < 0.01 || eprim < 0.01) return ;
4734 
4735  for (iParticle = 0; iParticle < nTracks; iParticle++)
4736  {
4737  AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(iParticle);
4738 
4739  if (!part->IsPhysicalPrimary() ) continue; // same as part->GetStatus() !=1
4740 
4741  if ( part->Charge() == 0 ) continue;
4742 
4743  fMomentum.SetPxPyPzE(part->Px(),part->Py(),part->Pz(),part->E());
4744 
4745  //Particles in CTS acceptance, make sure to use the same selection as in the reader
4746  Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),kCTS);
4747  //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,fMomentum.Pt(),fMomentum.Eta(),fMomentum.Phi()*TMath::RadToDeg());
4748  if( !inCTS ) continue;
4749 
4750  // Remove conversions
4751  Int_t indexmother = part->GetMother();
4752  if ( indexmother > -1 )
4753  {
4754  Int_t pdg = part->GetPdgCode();
4755  Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
4756  if (TMath::Abs(pdg) == 11 && mPdg == 22) continue;
4757  }
4758 
4759  if ( label == iParticle ) continue; // avoid trigger particle
4760 
4761  Float_t phi = part->Phi();
4762  if(phi < 0) phi+=TMath::TwoPi();
4763 
4764  Bool_t lead = FillChargedMCCorrelationHistograms(part->Pt(),phi,part->Eta(),ptprim,phiprim,etaprim, histoIndex,lostDecayPair);
4765 
4766  if ( !lead ) leadTrig = kFALSE;
4767  // if ( !lead && (fMakeAbsoluteLeading || fMakeNearSideLeading)) return;
4768  } //MC particle loop
4769  }// AOD MC
4770 
4771  // Trigger MC particle histograms
4772  //if (!lead && (fMakeAbsoluteLeading || fMakeNearSideLeading)) return;
4773 
4774  fhMCPtTrigger [histoIndex]->Fill(ptprim, GetEventWeight());
4775  fhMCPhiTrigger[histoIndex]->Fill(ptprim, phiprim, GetEventWeight());
4776  fhMCEtaTrigger[histoIndex]->Fill(ptprim, etaprim, GetEventWeight());
4777 
4778  if(lostDecayPair)
4779  {
4780  // check index in GetMCTagIndexHistogram
4781  if (histoIndex == 2 && 8 >= fMCGenTypeMin && 8 <= fMCGenTypeMax )
4782  {
4783  // pi0 decay
4784  fhMCPtTrigger [8]->Fill(ptprim, GetEventWeight());
4785  fhMCPhiTrigger[8]->Fill(ptprim, phiprim, GetEventWeight());
4786  fhMCEtaTrigger[8]->Fill(ptprim, etaprim, GetEventWeight());
4787  }
4788  else if(histoIndex == 4 && 9 >= fMCGenTypeMin && 9 <= fMCGenTypeMax )
4789  {
4790  // eta decay
4791  fhMCPtTrigger [9]->Fill(ptprim, GetEventWeight());
4792  fhMCPhiTrigger[9]->Fill(ptprim, phiprim, GetEventWeight());
4793  fhMCEtaTrigger[9]->Fill(ptprim, etaprim, GetEventWeight());
4794  }
4795  }
4796 
4797  if(!leadTrig && (fMakeAbsoluteLeading || fMakeNearSideLeading) )
4798  {
4799  AliDebug(1,Form("Not leading primary trigger: pT %2.2f, phi %2.2f, eta %2.2f",
4800  ptprim,phiprim*TMath::RadToDeg(),etaprim));
4801 
4802  fhMCPtTriggerNotLeading [histoIndex]->Fill(ptprim, GetEventWeight());
4803  fhMCPhiTriggerNotLeading[histoIndex]->Fill(ptprim, phiprim, GetEventWeight());
4804  fhMCEtaTriggerNotLeading[histoIndex]->Fill(ptprim, etaprim, GetEventWeight());
4805 
4806  if(lostDecayPair)
4807  {
4808  // check index in GetMCTagIndexHistogram
4809  if (histoIndex == 2 && 8 >= fMCGenTypeMin && 8 <= fMCGenTypeMax )
4810  {
4811  // pi0 decay
4812  fhMCPtTriggerNotLeading [8]->Fill(ptprim, GetEventWeight());
4813  fhMCPhiTriggerNotLeading[8]->Fill(ptprim, phiprim, GetEventWeight());
4814  fhMCEtaTriggerNotLeading[8]->Fill(ptprim, etaprim, GetEventWeight());
4815  }
4816  else if(histoIndex == 4 && 9 >= fMCGenTypeMin && 9 <= fMCGenTypeMax )
4817  {
4818  // eta decay
4819  fhMCPtTriggerNotLeading [9]->Fill(ptprim, GetEventWeight());
4820  fhMCPhiTriggerNotLeading[9]->Fill(ptprim, phiprim, GetEventWeight());
4821  fhMCEtaTriggerNotLeading[9]->Fill(ptprim, etaprim, GetEventWeight());
4822  }
4823  }
4824  }
4825 }
4826 
4827 //_____________________________________________________________________
4829 //_____________________________________________________________________
4830 void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
4831 {
4832  if(! opt)
4833  return;
4834 
4835  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
4837  printf("Pt trigger > %2.2f; < %2.2f\n", GetMinPt() , GetMaxPt()) ;
4838  printf("Pt associa > %2.2f; < %2.2f\n", fMinAssocPt, fMaxAssocPt) ;
4839  printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
4840  printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
4841  printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ;
4842  printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ;
4843  printf("Isolated Trigger? %d\n" , fSelectIsolated) ;
4844  printf("Several UE? %d\n" , fMakeSeveralUE) ;
4845  printf("Name of AOD Pi0 Branch %s \n", fPi0AODBranchName.Data());
4846  printf("Do Decay-hadron correlation ? %d\n", fPi0Trigger) ;
4847  printf("Select absolute leading for cluster triggers ? %d or Near Side %d\n",
4849  printf("Trigger pt bins %d\n", fNAssocPtBins) ;
4850  for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
4851  printf("\t bin %d = [%2.1f,%2.1f]\n", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
4852  }
4853 
4854 }
4855 
4856 //____________________________________________________________
4858 //____________________________________________________________
4860 {
4861  fNAssocPtBins = n ;
4862 
4863  if(n < 20 && n > 0)
4864  {
4865  fNAssocPtBins = n ;
4866  }
4867  else
4868  {
4869  AliWarning("n = larger than 19 or too small, set to 19");
4870  fNAssocPtBins = 19;
4871  }
4872 }
4873 
4874 //______________________________________________________________________________
4876 //______________________________________________________________________________
4878 {
4879  if(ibin <= fNAssocPtBins || ibin >= 0)
4880  {
4881  fAssocPtBinLimit[ibin] = pt ;
4882  }
4883  else
4884  {
4885  AliWarning(Form("Bin number too large %d > %d or small, nothing done", ibin, fNAssocPtBins)) ;
4886  }
4887 }
4888 
4889 
4890 
4891 //___________________________________________________________________________________________________________
4893 //___________________________________________________________________________________________________________
4894 void AliAnaParticleHadronCorrelation::CalculateChargedActivityInCone(AliAODPWG4ParticleCorrelation * particle,
4895  Float_t & pTLeadTrackInCone, Float_t & pTSumTrackInCone)
4896 {
4897  TObjArray * reftracks = particle->GetObjArray(fAODNamepTInConeHisto+"Tracks");
4898  if(!reftracks) return ;
4899 
4900  for(Int_t itrack=0; itrack < reftracks->GetEntriesFast(); itrack++)
4901  {
4902  AliVTrack* track = (AliVTrack *) reftracks->At(itrack);
4903 
4904  Float_t pTtrack = track->Pt();
4905  // Float_t etaAssoc = track->Eta();
4906  // Float_t phiAssoc = track->Phi();
4907  // Float_t etaTrig = particle->Eta();
4908  // Float_t phiTrig = particle->Phi();
4909  // Float_t dEta = etaTrig - etaAssoc;
4910  // Float_t dPhi = phiTrig - phiAssoc;
4911  // Float_t coneSize = GetIsolationCut()->GetConeSize();
4912 
4913  pTSumTrackInCone+=pTtrack;
4914  if(pTtrack > pTLeadTrackInCone) pTLeadTrackInCone = pTtrack;
4915 
4916  }
4917 
4918 }
4919 
4920 
4921 
4922 //___________________________________________________________________________________________________________
4924 //___________________________________________________________________________________________________________
4925 void AliAnaParticleHadronCorrelation::CalculateNeutralActivityInCone(AliAODPWG4ParticleCorrelation * particle,
4926  Float_t & pTLeadClusterInCone, Float_t & pTSumClusterInCone)
4927 {
4928  TObjArray * refclusters = particle->GetObjArray(fAODNamepTInConeHisto+"Clusters");
4929  if(!refclusters) return ;
4930 
4931  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
4932 
4933  // Get vertex for cluster momentum calculation
4934  Double_t vertex[] = {0,0,0} ; //vertex ;
4935  if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
4936  GetReader()->GetVertex(vertex);
4937 
4938  for(Int_t icalo=0; icalo < refclusters->GetEntriesFast(); icalo++)
4939  {
4940  AliVCluster* calo = (AliVCluster *) refclusters->At(icalo);
4941  calo->GetMomentum(fMomentum,vertex) ;//Assume that come from vertex in straight line
4942 
4943  Float_t pTCluster = fMomentum.Pt();
4944  // Float_t etaAssoc = fMomentum.Eta();
4945  // Float_t phiAssoc = fMomentum.Phi();
4946  // Float_t etaTrig = particle->Eta();
4947  // Float_t phiTrig = particle->Phi();
4948  // Float_t dEta = etaTrig - etaAssoc;
4949  // Float_t dPhi = phiTrig - phiAssoc;
4950  // Float_t coneSize = GetIsolationCut()->GetConeSize();
4951 
4952  pTSumClusterInCone += pTCluster;
4953  if(pTCluster > pTLeadClusterInCone) pTLeadClusterInCone = pTCluster;
4954  }
4955 
4956 }
4957 
Int_t charge
Float_t GetHistoPtMax() const
TH2F * fhDeltaPhiDeltaEtaCharged
! Differences of eta and phi between trigger and charged hadrons.
TH2F * fhMCEtaCharged[fgkNmcTypes]
! MC pure particles charged primary pt vs eta (both associated)
void MakeIsolationCut(TObjArray *plCTS, TObjArray *plNe, AliCaloTrackReader *reader, AliCaloPID *pid, Bool_t bFillAOD, AliAODPWG4ParticleCorrelation *pCandidate, TString aodObjArrayName, Int_t &n, Int_t &nfrac, Float_t &ptSum, Float_t &ptLead, Bool_t &isolated)
TH2F * fhMCMassPtTrigger[fgkNmcTypes]
! Invariant mass of the trigger vs MC origin.
TH2F * fhMCPtXECharged[fgkNmcTypes]
! MC pure particles charged trigger primary pt vs xE
TH2F * fhMCPtAssocDeltaPhi[fgkNmcTypes]
! MC pure particles charged associated primary pt vs delta phi (associated-trigger) ...
void SetLastCaloMixedEvent(Int_t e)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Int_t GetHistoDeltaEtaBins() const
TH1F * fhPtNoLeadingOppositeHadron
! pT trigger for events without opposite hadrons.
TH1F ** fhSumPtConeBinMC
[fNBkgBin*fgkNmcTypes]
TH2F * fhXEChargedVtxBC0
! Trigger particle -charged hadron momentum imbalance histogram.
TH2F * fhMixXEUeCharged
! xE for mixed event in Ue region.
Float_t GetHistoPtMin() const
virtual TObjArray * GetCTSTracks() const
TH2F * fhDeltaPhiChargedPt
! Difference of charged particle phi and trigger particle phi as function of charged. particle pT
TH2F * fhPtHbpXECharged_Cone2
! Trigger particle -charged hadron momentum HBP histogram in cone2 (5pi/6-7pi/6). ...
TH2F * fhPtTrigPout
! Pout =associated pt*sin(delta phi) distribution vs trigger pt
TH2F * fhZTCharged
! Trigger particle -charged hadron momentum imbalance histogram.
TH2F * fhPhiCharged
! Phi distribution of charged particles.
TH2F * fhZTPi0DecayCharged
! Trigger particle (decay from pi0/eta trigger)-charged hadron momentum imbalance histogram ...
TH2F * fhXEDecayCharged[AliNeutralMesonSelection::fgkMaxNDecayBits]
! Trigger particle (decay from pi0)-charged hadron momentum imbalance histogram.
virtual void AddToHistogramsName(TString add)
TList * GetListWithMixedEventsForTracks(Int_t bi) const
void FillNeutralUnderlyingEventSidesHistograms(Float_t ptTrig, Float_t ptAssoc, Float_t zT, Float_t hbpZT, Float_t deltaPhi)
void FillChargedUnderlyingEventHistograms(Float_t ptTrig, Float_t ptAssoc, Float_t deltaPhi, Int_t cenbin, Int_t outTOF, Int_t mcTag)
Fill underlying event histograms.
TList ** fListMixTrackEvents
Containers for tracks in stored events for mixing.
void InitParameters()
Initialize the default parameters of the analysis.
TH2F * fhMixDeltaPhiCharged
! Difference of charged particle phi and trigger particle phi as function of trigger particle pT...
TH2F * fhMCPtHbpZTCharged[fgkNmcTypes]
! MC pure particles charged trigger primary pt vs ln(1/zT)
void MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *particle)
TH2F * fhDeltaPhiNeutral
! Difference of neutral particle phi and trigger particle phi as function of trigger particle pT ...
TH2F * fhZTNegCharged
! Trigger particle -negative charged hadron momentum imbalance histogram.
TH1F * fhPtTriggerIsoCut
! pT distribution of trigger particles after isolation cut selection.
TString fPi0AODBranchName
Name of AOD branch with pi0, not trigger.
TH2F * fhXEUeCharged
! Trigger particle -underlying charged hadron momentum imbalance histogram.
TH1F * fhPtTriggerSSCut
! pT distribution of trigger particles after shower shape selection.
Bool_t ReadAODMCParticles() const
virtual void GetVertex(Double_t vertex[3]) const
Int_t GetHistoTrackMultiplicityMax() const
TH2F * fhMCPhiCharged[fgkNmcTypes]
! MC pure particles charged primary pt vs phi (both associated)
Bool_t fMakeAbsoluteLeading
Requesting absolute leading triggers.
TH1F * fhPtDecayTriggerMC[AliNeutralMesonSelection::fgkMaxNDecayBits][fgkNmcTypes]
! pT distribution of trigger particles, tagged as decay, check the origin of the cluster.
TH1F * fhPtDecayTrigger[AliNeutralMesonSelection::fgkMaxNDecayBits]
! pT distribution of trigger particles, tagged as decay.
TLorentzVector fMomentumIM
! Cluster momentum from Invariant mass.
void FillDecayPhotonCorrelationHistograms(Float_t ptAssoc, Float_t phiAssoc, Bool_t bChargedOrNeutral)
Do correlation with decay photons of triggered pi0 or eta.
void FillEventMixPool()
Fill the pool with tracks or clusters if requested.
TH2F * fhDeltaPhiUeRightUpCharged
! Difference of charged particle from underlying events phi and trigger particle phi ...
TH1F * fhPtTriggerVtxBC0
! pT distribution of trigger particles when vertex is BC0.
void MakeMCChargedCorrelation(Int_t triggerMCLable, Int_t histoIndex, Bool_t lostDecayPair)
Make the trigger-charged particles correlation at the generator level.
TH2F * fhDeltaPhiChargedMC[fgkNmcTypes]
! Trigger particle -charged hadron delta phi histogram, check the origin of the cluster : decay photo...
void SetListWithMixedEventsForTracks(TList **l)
Int_t GetVertexBC(const AliVVertex *vtx)