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