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