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