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