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