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