correct title histograms name
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaParticleHadronCorrelation.cxx
CommitLineData
e09cf5ef 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 **************************************************************************/
e09cf5ef 15
16//_________________________________________________________________________
17// Class for the analysis of particle - hadron correlations
18// Particle (for example direct gamma) must be found in a previous analysis
19//-- Author: Gustavo Conesa (LNF-INFN)
20
21// Modified by Yaxian Mao:
22// 1. add the UE subtraction for corrlation study
23// 2. change the correlation variable
24// 3. Only use leading particle(cluster/track) as trigger for correlation (2010/07/02)
25// 4. Make decay photon-hadron correlations where decay contribute pi0 mass (2010/09/09)
26// 5. fill the pout to extract kt at the end, also to study charge asymmetry(2010/10/06)
045396c8 27// 6. Add the possibility for event selection analysis based on vertex and multiplicity bins (10/10/2010)
28// 7. change the way of delta phi cut for UE study due to memory issue (reduce histograms)
29// 8. Add the possibility to request the absolute leading particle at the near side or not, set trigger bins, general clean-up (08/2011)
e09cf5ef 30//////////////////////////////////////////////////////////////////////////////
31
32
33// --- ROOT system ---
34//#include "TClonesArray.h"
35#include "TClass.h"
36#include "TMath.h"
37#include "TH3D.h"
045396c8 38#include "TDatabasePDG.h"
e09cf5ef 39
40//---- ANALYSIS system ----
41#include "AliNeutralMesonSelection.h"
42#include "AliAnaParticleHadronCorrelation.h"
43#include "AliCaloTrackReader.h"
44#include "AliCaloPID.h"
45#include "AliAODPWG4ParticleCorrelation.h"
46#include "AliFiducialCut.h"
47#include "AliVTrack.h"
48#include "AliVCluster.h"
49#include "AliMCAnalysisUtils.h"
50#include "TParticle.h"
51#include "AliStack.h"
52#include "AliAODMCParticle.h"
53#include "AliMixedEvent.h"
54
55ClassImp(AliAnaParticleHadronCorrelation)
56
57
05d0d05d 58//___________________________________________________________________
e09cf5ef 59 AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation():
745913ae 60 AliAnaCaloTrackCorrBaseClass(),
66e64043 61 fMinTriggerPt(0.),
62 fMaxAssocPt(1000.), fMinAssocPt(0.),
05d0d05d 63 fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
64 fSelectIsolated(0), fMakeSeveralUE(0),
65 fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.),
66 fPi0AODBranchName(""), fNeutralCorr(0),
3f150b4b 67 fPi0Trigger(0),
68 fMakeAbsoluteLeading(0), fMakeNearSideLeading(0),
05d0d05d 69 fLeadingTriggerIndex(-1),
70 fNAssocPtBins(0), fAssocPtBinLimit(),
71 //Histograms
72 fhPtLeading(0), fhPhiLeading(0),
73 fhEtaLeading(0), fhDeltaPhiDeltaEtaCharged(0),
74 fhPhiCharged(0), fhEtaCharged(0),
75 fhDeltaPhiCharged(0), fhDeltaEtaCharged(0),
76 fhDeltaPhiChargedPt(0), fhDeltaPhiUeChargedPt(0),
3f150b4b 77 fhXECharged(0), fhXEUeCharged(0),
78 fhXEPosCharged(0), fhXENegCharged(0),
79 fhPtHbpXECharged(0), fhPtHbpXEUeCharged(0),
80 fhZTCharged(0), fhZTUeCharged(0),
81 fhZTPosCharged(0), fhZTNegCharged(0),
82 fhPtHbpZTCharged(0), fhPtHbpZTUeCharged(0),
05d0d05d 83 fhDeltaPhiUeLeftCharged(0), fhDeltaPhiUeRightCharged(0),
3f150b4b 84 fhXEUeLeftCharged(0), fhXEUeRightCharged(0),
85 fhPtHbpXEUeLeftCharged(0), fhPtHbpXEUeRightCharged(0),
86 fhZTUeLeftCharged(0), fhZTUeRightCharged(0),
87 fhPtHbpZTUeLeftCharged(0), fhPtHbpZTUeRightCharged(0),
05d0d05d 88 fhPtTrigPout(0), fhPtTrigCharged(0),
89 fhTrigDeltaPhiCharged(0x0), fhTrigDeltaEtaCharged(0x0),
3f150b4b 90 fhTrigXECorr(0x0), fhTrigXEUeCorr(0x0),
91 fhTrigZTCorr(0x0), fhTrigZTUeCorr(0x0),
05d0d05d 92 fhAssocPt(0), fhAssocPtBkg(0),
06d3bad7 93 fhDeltaPhiAssocPtBin(0), fhDeltaPhiAssocPtBinHMPID(0),fhDeltaPhiAssocPtBinHMPIDAcc(0),
66e64043 94 fhDeltaPhiBradAssocPtBin(0), fhDeltaPhiBrad(0),
95 fhXEAssocPtBin(0), fhXE(0),
3f150b4b 96 fhZTAssocPtBin(0), fhZT(0),
e09cf5ef 97 fhDeltaPhiDeltaEtaNeutral(0),
05d0d05d 98 fhPhiNeutral(0), fhEtaNeutral(0),
99 fhDeltaPhiNeutral(0), fhDeltaEtaNeutral(0),
100 fhDeltaPhiNeutralPt(0), fhDeltaPhiUeNeutralPt(0),
3f150b4b 101 fhXENeutral(0), fhXEUeNeutral(0),
102 fhPtHbpXENeutral(0), fhPtHbpXEUeNeutral(0),
103 fhZTNeutral(0), fhZTUeNeutral(0),
104 fhPtHbpZTNeutral(0), fhPtHbpZTUeNeutral(0),
05d0d05d 105 fhDeltaPhiUeLeftNeutral(0), fhDeltaPhiUeRightNeutral(0),
3f150b4b 106 fhXEUeLeftNeutral(0), fhXEUeRightNeutral(0),
107 fhPtHbpXEUeLeftNeutral(0), fhPtHbpXEUeRightNeutral(0),
108 fhZTUeLeftNeutral(0), fhZTUeRightNeutral(0),
109 fhPtHbpZTUeLeftNeutral(0), fhPtHbpZTUeRightNeutral(0),
e09cf5ef 110 fhPtPi0DecayRatio(0),
3f150b4b 111 fhDeltaPhiDecayCharged(0), fhXEDecayCharged(0), fhZTDecayCharged(0),
112 fhDeltaPhiDecayNeutral(0), fhXEDecayNeutral(0), fhZTDecayNeutral(0),
045396c8 113 fh2phiLeadingParticle(0x0),
114 fhMCLeadingCount(0),
05d0d05d 115 fhMCEtaCharged(0), fhMCPhiCharged(0),
116 fhMCDeltaEtaCharged(0), fhMCDeltaPhiCharged(0x0),
117 fhMCDeltaPhiDeltaEtaCharged(0), fhMCDeltaPhiChargedPt(0),
3f150b4b 118 fhMCPtXECharged(0), fhMCPtHbpXECharged(0),
119 fhMCPtZTCharged(0), fhMCPtHbpZTCharged(0),
045396c8 120 fhMCPtTrigPout(0),
121 fhMCPtAssocDeltaPhi(0)
e09cf5ef 122{
123 //Default Ctor
124
125 //Initialize parameters
126 InitParameters();
127}
128
05d0d05d 129//____________________________________________________________
130TObjString* AliAnaParticleHadronCorrelation::GetAnalysisCuts()
131{
132 //Save parameters used for analysis
133 TString parList ; //this will be list of parameters used for this analysis.
134 const Int_t buffersize = 560;
135 char onePar[buffersize] ;
136
137 snprintf(onePar,buffersize,"--- AliAnaPaticleHadronCorrelation ---\n") ;
138 parList+=onePar ;
66e64043 139 snprintf(onePar,buffersize," Pt Trigger > %3.2f ", fMinTriggerPt) ;
05d0d05d 140 parList+=onePar ;
66e64043 141 snprintf(onePar,buffersize," %3.2f < Pt associated < %3.2f ", fMinAssocPt, fMaxAssocPt) ;
05d0d05d 142 parList+=onePar ;
66e64043 143 snprintf(onePar,buffersize," %3.2f < Phi trigger particle-Hadron < %3.2f ", fDeltaPhiMinCut, fDeltaPhiMaxCut) ;
05d0d05d 144 parList+=onePar ;
66e64043 145 snprintf(onePar,buffersize," %3.2f < Phi trigger particle-UeHadron < %3.2f ", fUeDeltaPhiMinCut, fUeDeltaPhiMaxCut) ;
05d0d05d 146 parList+=onePar ;
66e64043 147 snprintf(onePar,buffersize,"Isolated Trigger? %d\n", fSelectIsolated) ;
05d0d05d 148 parList+=onePar ;
66e64043 149 snprintf(onePar,buffersize,"Several UE? %d\n", fMakeSeveralUE) ;
05d0d05d 150 parList+=onePar ;
66e64043 151 snprintf(onePar,buffersize,"Name of AOD Pi0 Branch %s ", fPi0AODBranchName.Data());
05d0d05d 152 parList+=onePar ;
153 snprintf(onePar,buffersize,"Do Decay-hadron correlation ? %d", fPi0Trigger) ;
154 parList+=onePar ;
3f150b4b 155 snprintf(onePar,buffersize,"Select absolute leading for cluster triggers ? %d or Near Side Leading %d \n",
156 fMakeAbsoluteLeading, fMakeNearSideLeading) ;
05d0d05d 157 parList+=onePar ;
158 snprintf(onePar,buffersize,"Associated particle pt bins %d: ", fNAssocPtBins) ;
159 parList+=onePar ;
160 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
161 snprintf(onePar,buffersize,"bin %d = [%2.1f,%2.1f];", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
162 }
163 parList+=onePar ;
164
165 //Get parameters set in base class.
166 parList += GetBaseParametersList() ;
167
168 //Get parameters set in PID class.
169 //parList += GetCaloPID()->GetPIDParametersList() ;
170
171 //Get parameters set in FiducialCut class (not available yet)
172 //parlist += GetFidCut()->GetFidCutParametersList()
173
174 return new TObjString(parList) ;
175
176}
177
178//________________________________________________________________
e09cf5ef 179TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
180{
181
182 // Create histograms to be saved in output file and
183 // store them in fOutputContainer
184 TList * outputContainer = new TList() ;
185 outputContainer->SetName("CorrelationHistos") ;
186
745913ae 187 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Int_t netabins = GetHistogramRanges()->GetHistoEtaBins();
188 Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax();
189 Float_t ptmin = GetHistogramRanges()->GetHistoPtMin(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
e09cf5ef 190
e09cf5ef 191 fhPtLeading = new TH1F ("hPtLeading","p_T distribution of leading particles", nptbins,ptmin,ptmax);
192 fhPtLeading->SetXTitle("p_{T}^{trig} (GeV/c)");
193
194 fhPhiLeading = new TH2F ("hPhiLeading","#phi distribution of leading Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
195 fhPhiLeading->SetYTitle("#phi (rad)");
196
197 fhEtaLeading = new TH2F ("hEtaLeading","#eta distribution of leading",nptbins,ptmin,ptmax, netabins,etamin,etamax);
198 fhEtaLeading->SetYTitle("#eta ");
045396c8 199
e09cf5ef 200 outputContainer->Add(fhPtLeading);
201 outputContainer->Add(fhPhiLeading);
202 outputContainer->Add(fhEtaLeading);
203
204 //Correlation with charged hadrons
547c2f01 205 if(GetReader()->IsCTSSwitchedOn())
206 {
e09cf5ef 207 fhDeltaPhiDeltaEtaCharged = new TH2F
babcbc9d 208 ("hDeltaPhiDeltaEtaCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
e09cf5ef 209 140,-2.,5.,200,-2,2);
210 fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
211 fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
212
213 fhPhiCharged = new TH2F
babcbc9d 214 ("hPhiCharged","#phi_{h^{#pm}} vs p_{T #pm}",
e09cf5ef 215 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
216 fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
217 fhPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
218
219 fhEtaCharged = new TH2F
babcbc9d 220 ("hEtaCharged","#eta_{h^{#pm}} vs p_{T #pm}",
e09cf5ef 221 nptbins,ptmin,ptmax,netabins,etamin,etamax);
222 fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
223 fhEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
224
225 fhDeltaPhiCharged = new TH2F
babcbc9d 226 ("hDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
e09cf5ef 227 nptbins,ptmin,ptmax,140,-2.,5.);
228 fhDeltaPhiCharged->SetYTitle("#Delta #phi");
229 fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
230
231 fhDeltaPhiChargedPt = new TH2F
babcbc9d 232 ("hDeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
e09cf5ef 233 nptbins,ptmin,ptmax,140,-2.,5.);
234 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
235 fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
236
237 fhDeltaPhiUeChargedPt = new TH2F
babcbc9d 238 ("hDeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
e09cf5ef 239 nptbins,ptmin,ptmax,140,-2.,5.);
240 fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi");
241 fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
242
243 fhDeltaEtaCharged = new TH2F
babcbc9d 244 ("hDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
e09cf5ef 245 nptbins,ptmin,ptmax,200,-2,2);
246 fhDeltaEtaCharged->SetYTitle("#Delta #eta");
247 fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
248
3f150b4b 249 fhXECharged =
250 new TH2F("hXECharged","x_{E} for charged tracks",
e09cf5ef 251 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 252 fhXECharged->SetYTitle("x_{E}");
253 fhXECharged->SetXTitle("p_{T trigger}");
e09cf5ef 254
3f150b4b 255 fhXEUeCharged =
256 new TH2F("hXEUeCharged","x_{E} for Underlying Event",
e09cf5ef 257 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 258 fhXEUeCharged->SetYTitle("x_{E}");
259 fhXEUeCharged->SetXTitle("p_{T trigger}");
e09cf5ef 260
3f150b4b 261 fhXEPosCharged =
262 new TH2F("hXEPositiveCharged","x_{E} for positive charged tracks",
e09cf5ef 263 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 264 fhXEPosCharged->SetYTitle("x_{E}");
265 fhXEPosCharged->SetXTitle("p_{T trigger}");
e09cf5ef 266
3f150b4b 267 fhXENegCharged =
268 new TH2F("hXENegativeCharged","x_{E} for negative charged tracks",
e09cf5ef 269 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 270 fhXENegCharged->SetYTitle("x_{E}");
271 fhXENegCharged->SetXTitle("p_{T trigger}");
e09cf5ef 272
3f150b4b 273 fhPtHbpXECharged =
274 new TH2F("hHbpXECharged","#xi = ln(1/x_{E}) with charged hadrons",
e09cf5ef 275 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 276 fhPtHbpXECharged->SetYTitle("ln(1/x_{E})");
277 fhPtHbpXECharged->SetXTitle("p_{T trigger}");
e09cf5ef 278
3f150b4b 279 fhPtHbpXEUeCharged =
280 new TH2F("hHbpXEUeCharged","#xi = ln(1/x_{E}) with charged hadrons,Underlying Event",
e09cf5ef 281 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 282 fhPtHbpXEUeCharged->SetYTitle("ln(1/x_{E})");
283 fhPtHbpXEUeCharged->SetXTitle("p_{T trigger}");
284
285 fhZTCharged =
286 new TH2F("hZTCharged","z_{T} for charged tracks",
287 nptbins,ptmin,ptmax,200,0.,2.);
288 fhZTCharged->SetYTitle("z_{T}");
289 fhZTCharged->SetXTitle("p_{T trigger}");
290
291 fhZTUeCharged =
292 new TH2F("hZTUeCharged","z_{T} for Underlying Event",
293 nptbins,ptmin,ptmax,200,0.,2.);
294 fhZTUeCharged->SetYTitle("z_{T}");
295 fhZTUeCharged->SetXTitle("p_{T trigger}");
296
297 fhZTPosCharged =
298 new TH2F("hZTPositiveCharged","z_{T} for positive charged tracks",
299 nptbins,ptmin,ptmax,200,0.,2.);
300 fhZTPosCharged->SetYTitle("z_{T}");
301 fhZTPosCharged->SetXTitle("p_{T trigger}");
302
303 fhZTNegCharged =
304 new TH2F("hZTNegativeCharged","z_{T} for negative charged tracks",
305 nptbins,ptmin,ptmax,200,0.,2.);
306 fhZTNegCharged->SetYTitle("z_{T}");
307 fhZTNegCharged->SetXTitle("p_{T trigger}");
308
309 fhPtHbpZTCharged =
310 new TH2F("hHbpZTCharged","#xi = ln(1/z_{T}) with charged hadrons",
311 nptbins,ptmin,ptmax,200,0.,10.);
312 fhPtHbpZTCharged->SetYTitle("ln(1/z_{T})");
313 fhPtHbpZTCharged->SetXTitle("p_{T trigger}");
314
315 fhPtHbpZTUeCharged =
316 new TH2F("hHbpZTUeCharged","#xi = ln(1/z_{T}) with charged hadrons,Underlying Event",
317 nptbins,ptmin,ptmax,200,0.,10.);
318 fhPtHbpZTUeCharged->SetYTitle("ln(1/x_{E})");
319 fhPtHbpZTUeCharged->SetXTitle("p_{T trigger}");
e09cf5ef 320
321 fhPtTrigPout =
babcbc9d 322 new TH2F("hPtTrigPout","Pout with triggers",
e09cf5ef 323 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
324 fhPtTrigPout->SetYTitle("p_{out} (GeV/c)");
325 fhPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
326
e09cf5ef 327 fhPtTrigCharged =
babcbc9d 328 new TH2F("hPtTrigCharged","trgger and charged tracks pt distribution",
e09cf5ef 329 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
330 fhPtTrigCharged->SetYTitle("p_{T h^{#pm}} (GeV/c)");
331 fhPtTrigCharged->SetXTitle("p_{T trigger} (GeV/c)");
332
333 outputContainer->Add(fhDeltaPhiDeltaEtaCharged);
334 outputContainer->Add(fhPhiCharged) ;
335 outputContainer->Add(fhEtaCharged) ;
336 outputContainer->Add(fhDeltaPhiCharged) ;
337 outputContainer->Add(fhDeltaEtaCharged) ;
338 outputContainer->Add(fhDeltaPhiChargedPt) ;
339 outputContainer->Add(fhDeltaPhiUeChargedPt) ;
3f150b4b 340
341 outputContainer->Add(fhXECharged) ;
342 outputContainer->Add(fhXEPosCharged) ;
343 outputContainer->Add(fhXENegCharged) ;
344 outputContainer->Add(fhXEUeCharged) ;
345 outputContainer->Add(fhPtHbpXECharged) ;
346 outputContainer->Add(fhPtHbpXEUeCharged) ;
347
348 outputContainer->Add(fhZTCharged) ;
349 outputContainer->Add(fhZTPosCharged) ;
350 outputContainer->Add(fhZTNegCharged) ;
351 outputContainer->Add(fhZTUeCharged) ;
352 outputContainer->Add(fhPtHbpZTCharged) ;
353 outputContainer->Add(fhPtHbpZTUeCharged) ;
354
e09cf5ef 355 outputContainer->Add(fhPtTrigPout) ;
e09cf5ef 356 outputContainer->Add(fhPtTrigCharged) ;
357
547c2f01 358 if(DoEventSelect())
359 {
e09cf5ef 360 Int_t nMultiBins = GetMultiBin();
361 fhTrigDeltaPhiCharged = new TH2F*[nMultiBins] ;
362 fhTrigDeltaEtaCharged = new TH2F*[nMultiBins] ;
3f150b4b 363 fhTrigXECorr = new TH2F*[nMultiBins] ;
364 fhTrigXEUeCorr = new TH2F*[nMultiBins] ;
365 fhTrigZTCorr = new TH2F*[nMultiBins] ;
366 fhTrigZTUeCorr = new TH2F*[nMultiBins] ;
367
368 for(Int_t im=0; im<nMultiBins; im++)
369 {
e09cf5ef 370 fhTrigDeltaPhiCharged[im] = new TH2F
babcbc9d 371 (Form("hTrigDeltaPhiCharged_%d",im),Form("hTrigDeltaPhiCharged_%d",im), nptbins,ptmin,ptmax, 140,-2.,5.);
e09cf5ef 372 fhTrigDeltaPhiCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
373 fhTrigDeltaPhiCharged[im]->SetYTitle("#Delta #phi");
3f150b4b 374
e09cf5ef 375 fhTrigDeltaEtaCharged[im] = new TH2F
babcbc9d 376 (Form("hTrigDeltaEtaCharged_%d",im),Form("hTrigDeltaEtaCharged_%d",im), nptbins,ptmin,ptmax, 200,-2,2);
e09cf5ef 377 fhTrigDeltaEtaCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
378 fhTrigDeltaEtaCharged[im]->SetYTitle("#Delta #eta");
3f150b4b 379
380 fhTrigXECorr[im] = new TH2F
381 (Form("hTrigXEPtCorr_%d",im),Form("hTrigXEPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
382 fhTrigXECorr[im]->SetYTitle("x_{E trigger h^{#pm}}");
383 fhTrigXECorr[im]->SetXTitle("p_{T trigger}");
384
385 fhTrigXEUeCorr[im] = new TH2F
386 (Form("hTrigXEPtUeCorr_%d",im),Form("hTrigXEPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
387 fhTrigXEUeCorr[im]->SetYTitle("x_{E trigger h^{#pm}}");
388 fhTrigXEUeCorr[im]->SetXTitle("p_{T trigger}");
389
390 fhTrigZTCorr[im] = new TH2F
391 (Form("hTrigZTPtCorr_%d",im),Form("hTrigZTPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
392 fhTrigZTCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
393 fhTrigZTCorr[im]->SetXTitle("p_{T trigger}");
394
395 fhTrigZTUeCorr[im] = new TH2F
396 (Form("hTrigZTPtUeCorr_%d",im),Form("hTrigZTPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
397 fhTrigZTUeCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
398 fhTrigZTUeCorr[im]->SetXTitle("p_{T trigger}");
045396c8 399
e09cf5ef 400 outputContainer->Add(fhTrigDeltaPhiCharged[im]) ;
401 outputContainer->Add(fhTrigDeltaEtaCharged[im]) ;
3f150b4b 402 outputContainer->Add(fhTrigXECorr[im]);
403 outputContainer->Add(fhTrigXEUeCorr[im]);
404 outputContainer->Add(fhTrigZTCorr[im]);
405 outputContainer->Add(fhTrigZTUeCorr[im]);
045396c8 406 }
407 }
408
babcbc9d 409 fhAssocPt = new TH2F("hAssocPt", " Trigger p_{T} vs associated hadron p_{T}",
05d0d05d 410 nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
411 fhAssocPt->SetXTitle("p_{T trigger}");
412 fhAssocPt->SetYTitle("p_{T associated}");
413 outputContainer->Add(fhAssocPt) ;
414
babcbc9d 415 fhAssocPtBkg = new TH2F("hAssocPtBkg", " Trigger p_{T} vs associated hadron p_{T} from background",
05d0d05d 416 nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
417 fhAssocPtBkg->SetXTitle("p_{T trigger}");
418 fhAssocPtBkg->SetYTitle("p_{T associated}");
419 outputContainer->Add(fhAssocPtBkg) ;
420
babcbc9d 421 fhDeltaPhiBrad = new TH2F("hDeltaPhiBrad","atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} ",
66e64043 422 nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
423 fhDeltaPhiBrad->SetXTitle("p_{T trigger}");
424 fhDeltaPhiBrad->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
66e64043 425 outputContainer->Add(fhDeltaPhiBrad) ;
426
babcbc9d 427 fhXE = new TH2F("hXE", "x_{E} vs p_{T trigger}",
3f150b4b 428 nptbins, ptmin, ptmax,200, 0.0, 2.0);
66e64043 429 fhXE->SetXTitle("p_{T trigger}");
430 fhXE->SetYTitle("x_{E}");
66e64043 431 outputContainer->Add(fhXE);
432
3f150b4b 433 fhZT = new TH2F("hZT", "z_{T} vs p_{T trigger}",
434 nptbins, ptmin, ptmax,200, 0.0, 2.0);
435 fhZT->SetXTitle("p_{T trigger}");
436 fhZT->SetYTitle("z_{T}");
437 outputContainer->Add(fhZT);
66e64043 438
05d0d05d 439 fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins] ;
06d3bad7 440 fhDeltaPhiAssocPtBinHMPID= new TH2F*[fNAssocPtBins] ;
441 fhDeltaPhiAssocPtBinHMPIDAcc= new TH2F*[fNAssocPtBins] ;
05d0d05d 442 fhDeltaPhiBradAssocPtBin = new TH2F*[fNAssocPtBins] ;
443 fhXEAssocPtBin = new TH2F*[fNAssocPtBins] ;
3f150b4b 444 fhZTAssocPtBin = new TH2F*[fNAssocPtBins] ;
445
babcbc9d 446 for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
447 {
448 fhDeltaPhiAssocPtBin[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
05d0d05d 449 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
450 nptbins, ptmin, ptmax,140,-2.,5.);
451 fhDeltaPhiAssocPtBin[i]->SetXTitle("p_{T trigger}");
452 fhDeltaPhiAssocPtBin[i]->SetYTitle("#Delta #phi");
06d3bad7 453
babcbc9d 454 fhDeltaPhiAssocPtBinHMPID[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1fHMPID", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
06d3bad7 455 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f], with track having HMPID signal", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
456 nptbins, ptmin, ptmax,140,-2.,5.);
457 fhDeltaPhiAssocPtBinHMPID[i]->SetXTitle("p_{T trigger}");
458 fhDeltaPhiAssocPtBinHMPID[i]->SetYTitle("#Delta #phi");
459
babcbc9d 460 fhDeltaPhiAssocPtBinHMPIDAcc[i] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1fHMPIDAcc", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
06d3bad7 461 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f], with track within 5<phi<20 deg", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
462 nptbins, ptmin, ptmax,140,-2.,5.);
463 fhDeltaPhiAssocPtBinHMPIDAcc[i]->SetXTitle("p_{T trigger}");
464 fhDeltaPhiAssocPtBinHMPIDAcc[i]->SetYTitle("#Delta #phi");
05d0d05d 465
babcbc9d 466 fhDeltaPhiBradAssocPtBin[i] = new TH2F(Form("hDeltaPhiBradPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
05d0d05d 467 Form("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
468 nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
469 fhDeltaPhiBradAssocPtBin[i]->SetXTitle("p_{T trigger}");
470 fhDeltaPhiBradAssocPtBin[i]->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
471
472
babcbc9d 473 fhXEAssocPtBin[i] = new TH2F(Form("hXEAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
66e64043 474 Form("x_{E} vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
3f150b4b 475 nptbins, ptmin, ptmax,200, 0.0, 2.0);
05d0d05d 476 fhXEAssocPtBin[i]->SetXTitle("p_{T trigger}");
477 fhXEAssocPtBin[i]->SetYTitle("x_{E}");
478
3f150b4b 479 fhZTAssocPtBin[i] = new TH2F(Form("hZTAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
480 Form("z_{T} vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
481 nptbins, ptmin, ptmax,200, 0.0, 2.0);
482 fhZTAssocPtBin[i]->SetXTitle("p_{T trigger}");
483 fhZTAssocPtBin[i]->SetYTitle("z_{T}");
484
05d0d05d 485 outputContainer->Add(fhDeltaPhiAssocPtBin[i]) ;
06d3bad7 486 outputContainer->Add(fhDeltaPhiAssocPtBinHMPID[i]) ;
487 outputContainer->Add(fhDeltaPhiAssocPtBinHMPIDAcc[i]) ;
05d0d05d 488 outputContainer->Add(fhDeltaPhiBradAssocPtBin[i]) ;
489 outputContainer->Add(fhXEAssocPtBin[i]);
3f150b4b 490 outputContainer->Add(fhZTAssocPtBin[i]);
e09cf5ef 491 }
045396c8 492
547c2f01 493 if(fPi0Trigger)
494 {
e09cf5ef 495 fhPtPi0DecayRatio = new TH2F
496 ("hPtPi0DecayRatio","p_T of #pi^{0} and the ratio of pt for two decay",
497 nptbins,ptmin,ptmax, 100,0.,2.);
498 fhPtPi0DecayRatio->SetXTitle("p_{T}^{#pi^{0}} (GeV/c)");
499 fhPtPi0DecayRatio->SetYTitle("p_{T}^{Decay}/p_{T}^{#pi^{0}}");
500
501 fhDeltaPhiDecayCharged = new TH2F
babcbc9d 502 ("hDeltaPhiDecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}",
e09cf5ef 503 nptbins,ptmin,ptmax,140,-2.,5.);
504 fhDeltaPhiDecayCharged->SetYTitle("#Delta #phi");
505 fhDeltaPhiDecayCharged->SetXTitle("p_{T Decay} (GeV/c)");
506
3f150b4b 507 fhXEDecayCharged =
508 new TH2F("hXEDecayCharged","x_{E} Decay",
509 nptbins,ptmin,ptmax,200,0.,2.);
510 fhXEDecayCharged->SetYTitle("x_{E}");
511 fhXEDecayCharged->SetXTitle("p_{T decay}");
512
513 fhZTDecayCharged =
514 new TH2F("hZTDecayCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}",
e09cf5ef 515 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 516 fhZTDecayCharged->SetYTitle("z_{decay h^{#pm}}");
517 fhZTDecayCharged->SetXTitle("p_{T decay}");
e09cf5ef 518
519 outputContainer->Add(fhPtPi0DecayRatio) ;
520 outputContainer->Add(fhDeltaPhiDecayCharged) ;
3f150b4b 521 outputContainer->Add(fhXEDecayCharged) ;
522 outputContainer->Add(fhZTDecayCharged) ;
e09cf5ef 523 }
524
547c2f01 525 if(fMakeSeveralUE)
526 {
e09cf5ef 527 fhDeltaPhiUeLeftCharged = new TH2F
babcbc9d 528 ("hDeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
e09cf5ef 529 nptbins,ptmin,ptmax,140,-2.,5.);
530 fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi");
531 fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
532 outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
533
534 fhDeltaPhiUeRightCharged = new TH2F
babcbc9d 535 ("hDeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
e09cf5ef 536 nptbins,ptmin,ptmax,140,-2.,5.);
537 fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi");
538 fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
539 outputContainer->Add(fhDeltaPhiUeRightCharged) ;
540
3f150b4b 541 fhXEUeLeftCharged =
542 new TH2F("hXEUeChargedLeft","x_{E} with UE left side of trigger",
e09cf5ef 543 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 544 fhXEUeLeftCharged->SetYTitle("x_{E Ueh^{#pm}}");
545 fhXEUeLeftCharged->SetXTitle("p_{T trigger}");
546 outputContainer->Add(fhXEUeLeftCharged) ;
e09cf5ef 547
3f150b4b 548 fhXEUeRightCharged =
549 new TH2F("hXEUeChargedRight","x_{E h^{#pm}} with UE right side of trigger",
e09cf5ef 550 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 551 fhXEUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
552 fhXEUeRightCharged->SetXTitle("p_{T trigger}");
553 outputContainer->Add(fhXEUeRightCharged) ;
554
555 fhPtHbpXEUeLeftCharged =
556 new TH2F("hHbpXEUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger",
557 nptbins,ptmin,ptmax,200,0.,10.);
558 fhPtHbpXEUeLeftCharged->SetYTitle("ln(1/x_{E})");
559 fhPtHbpXEUeLeftCharged->SetXTitle("p_{T trigger}");
560 outputContainer->Add(fhPtHbpXEUeLeftCharged) ;
e09cf5ef 561
3f150b4b 562 fhPtHbpXEUeRightCharged =
563 new TH2F("hHbpXEUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger",
e09cf5ef 564 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 565 fhPtHbpXEUeRightCharged->SetYTitle("ln(1/x_{E})");
566 fhPtHbpXEUeRightCharged->SetXTitle("p_{T trigger}");
567 outputContainer->Add(fhPtHbpXEUeRightCharged) ;
568
569 fhZTUeLeftCharged =
570 new TH2F("hZTUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
571 nptbins,ptmin,ptmax,200,0.,2.);
572 fhZTUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
573 fhZTUeLeftCharged->SetXTitle("p_{T trigger}");
574 outputContainer->Add(fhZTUeLeftCharged) ;
575
576 fhZTUeRightCharged =
577 new TH2F("hZTUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
578 nptbins,ptmin,ptmax,200,0.,2.);
579 fhZTUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
580 fhZTUeRightCharged->SetXTitle("p_{T trigger}");
581 outputContainer->Add(fhZTUeRightCharged) ;
e09cf5ef 582
3f150b4b 583 fhPtHbpZTUeLeftCharged =
584 new TH2F("hHbpZTUeChargedLeft","#xi = ln(1/z_{T}) with charged UE left side of trigger",
e09cf5ef 585 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 586 fhPtHbpZTUeLeftCharged->SetYTitle("ln(1/z_{T})");
587 fhPtHbpZTUeLeftCharged->SetXTitle("p_{T trigger}");
588 outputContainer->Add(fhPtHbpZTUeLeftCharged) ;
589
590 fhPtHbpZTUeRightCharged =
591 new TH2F("hHbpZTUeChargedRight","#xi = ln(1/z_{T}) with charged UE right side of trigger",
592 nptbins,ptmin,ptmax,200,0.,10.);
593 fhPtHbpZTUeRightCharged->SetYTitle("ln(1/z_{T})");
594 fhPtHbpZTUeRightCharged->SetXTitle("p_{T trigger}");
595 outputContainer->Add(fhPtHbpZTUeRightCharged) ;
e09cf5ef 596
597 }
598 } //Correlation with charged hadrons
599
600 //Correlation with neutral hadrons
547c2f01 601 if(fNeutralCorr)
602 {
e09cf5ef 603 fhDeltaPhiDeltaEtaNeutral = new TH2F
babcbc9d 604 ("hDeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
e09cf5ef 605 140,-2.,5.,200,-2,2);
606 fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi");
607 fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta");
608
609 fhPhiNeutral = new TH2F
babcbc9d 610 ("hPhiNeutral","#phi_{#pi^{0}} vs p_{T #pi^{0}}",
e09cf5ef 611 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
612 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
613 fhPhiNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
614
615 fhEtaNeutral = new TH2F
babcbc9d 616 ("hEtaNeutral","#eta_{#pi^{0}} vs p_{T #pi^{0}}",
e09cf5ef 617 nptbins,ptmin,ptmax,netabins,etamin,etamax);
618 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
619 fhEtaNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
620
621 fhDeltaPhiNeutral = new TH2F
babcbc9d 622 ("hDeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
e09cf5ef 623 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
624 fhDeltaPhiNeutral->SetYTitle("#Delta #phi");
625 fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
626
627 fhDeltaPhiNeutralPt = new TH2F
babcbc9d 628 ("hDeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
e09cf5ef 629 nptbins,ptmin,ptmax,140,-2.,5.);
630 fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi");
631 fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
632
633 fhDeltaPhiUeNeutralPt = new TH2F
babcbc9d 634 ("hDeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
e09cf5ef 635 nptbins,ptmin,ptmax,140,-2.,5.);
636 fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi");
637 fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
638
639 fhDeltaEtaNeutral = new TH2F
babcbc9d 640 ("hDeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
e09cf5ef 641 nptbins,ptmin,ptmax,200,-2,2);
642 fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
643 fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
644
3f150b4b 645 fhXENeutral =
646 new TH2F("hXENeutral","x_{E} for #pi^{0} associated",
e09cf5ef 647 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 648 fhXENeutral->SetYTitle("x_{E}");
649 fhXENeutral->SetXTitle("p_{T trigger}");
e09cf5ef 650
3f150b4b 651 fhXEUeNeutral =
652 new TH2F("hXEUeNeutral","x_{E} for #pi^{0} associated",
e09cf5ef 653 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 654 fhXEUeNeutral->SetYTitle("x_{E}");
655 fhXEUeNeutral->SetXTitle("p_{T trigger}");
e09cf5ef 656
3f150b4b 657 fhPtHbpXENeutral =
658 new TH2F("hHbpXENeutral","#xi = ln(1/x_{E})for #pi^{0} associated",
e09cf5ef 659 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 660 fhPtHbpXENeutral->SetYTitle("ln(1/x_{E})");
661 fhPtHbpXENeutral->SetXTitle("p_{T trigger}");
e09cf5ef 662
3f150b4b 663 fhPtHbpXEUeNeutral =
664 new TH2F("hHbpXEUeNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
e09cf5ef 665 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 666 fhPtHbpXEUeNeutral->SetYTitle("ln(1/x_{E})");
667 fhPtHbpXEUeNeutral->SetXTitle("p_{T trigger}");
668
669 fhZTNeutral =
670 new TH2F("hZTNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger} for #pi^{0} associated",
671 nptbins,ptmin,ptmax,200,0.,2.);
672 fhZTNeutral->SetYTitle("z_{trigger #pi^{0}}");
673 fhZTNeutral->SetXTitle("p_{T trigger}");
e09cf5ef 674
3f150b4b 675 fhZTUeNeutral =
676 new TH2F("hZTUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger} for #pi^{0} associated",
677 nptbins,ptmin,ptmax,200,0.,2.);
678 fhZTUeNeutral->SetYTitle("z_{trigger #pi^{0}}");
679 fhZTUeNeutral->SetXTitle("p_{T trigger}");
680
681 fhPtHbpZTNeutral =
682 new TH2F("hHbpZTNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
683 nptbins,ptmin,ptmax,200,0.,10.);
684 fhPtHbpZTNeutral->SetYTitle("ln(1/z_{T})");
685 fhPtHbpZTNeutral->SetXTitle("p_{T trigger}");
686
687 fhPtHbpZTUeNeutral =
688 new TH2F("hHbpZTUeNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
689 nptbins,ptmin,ptmax,200,0.,10.);
690 fhPtHbpXEUeNeutral->SetYTitle("ln(1/z_{T})");
691 fhPtHbpXEUeNeutral->SetXTitle("p_{T trigger}");
e09cf5ef 692
693 outputContainer->Add(fhDeltaPhiDeltaEtaNeutral);
694 outputContainer->Add(fhPhiNeutral) ;
695 outputContainer->Add(fhEtaNeutral) ;
696 outputContainer->Add(fhDeltaPhiNeutral) ;
697 outputContainer->Add(fhDeltaPhiNeutralPt) ;
698 outputContainer->Add(fhDeltaPhiUeNeutralPt) ;
699 outputContainer->Add(fhDeltaEtaNeutral) ;
3f150b4b 700 outputContainer->Add(fhXENeutral) ;
701 outputContainer->Add(fhXEUeNeutral) ;
702 outputContainer->Add(fhPtHbpXENeutral) ;
703 outputContainer->Add(fhPtHbpXEUeNeutral) ;
704 outputContainer->Add(fhZTNeutral) ;
705 outputContainer->Add(fhZTUeNeutral) ;
706 outputContainer->Add(fhPtHbpZTNeutral) ;
707 outputContainer->Add(fhPtHbpZTUeNeutral) ;
e09cf5ef 708
babcbc9d 709 if(fPi0Trigger)
710 {
e09cf5ef 711 fhDeltaPhiDecayNeutral = new TH2F
babcbc9d 712 ("hDeltaPhiDecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}",
e09cf5ef 713 nptbins,ptmin,ptmax,140,-2.,5.);
714 fhDeltaPhiDecayNeutral->SetYTitle("#Delta #phi");
715 fhDeltaPhiDecayNeutral->SetXTitle("p_{T Decay} (GeV/c)");
716
3f150b4b 717 fhXEDecayNeutral =
718 new TH2F("hXEDecayNeutral","x_{E} for decay trigger",
719 nptbins,ptmin,ptmax,200,0.,2.);
720 fhXEDecayNeutral->SetYTitle("x_{E}");
721 fhXEDecayNeutral->SetXTitle("p_{T decay}");
722
723 fhZTDecayNeutral =
724 new TH2F("hZTDecayNeutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}",
e09cf5ef 725 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 726 fhZTDecayNeutral->SetYTitle("z_{h^{0}}");
727 fhZTDecayNeutral->SetXTitle("p_{T decay}");
e09cf5ef 728
729 outputContainer->Add(fhDeltaPhiDecayNeutral) ;
3f150b4b 730 outputContainer->Add(fhXEDecayNeutral) ;
731 outputContainer->Add(fhZTDecayNeutral) ;
732
e09cf5ef 733 }
734
547c2f01 735 if(fMakeSeveralUE)
736 {
e09cf5ef 737 fhDeltaPhiUeLeftNeutral = new TH2F
babcbc9d 738 ("hDeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles",
e09cf5ef 739 nptbins,ptmin,ptmax,140,-2.,5.);
740 fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi");
741 fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
742 outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
743
744 fhDeltaPhiUeRightNeutral = new TH2F
babcbc9d 745 ("hDeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles",
e09cf5ef 746 nptbins,ptmin,ptmax,140,-2.,5.);
747 fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi");
748 fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
749 outputContainer->Add(fhDeltaPhiUeRightNeutral) ;
750
3f150b4b 751 fhXEUeLeftNeutral =
752 new TH2F("hXEUeNeutralLeft","x_{E} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
753 nptbins,ptmin,ptmax,140,0.,2.);
754 fhXEUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
755 fhXEUeLeftNeutral->SetXTitle("p_{T trigger}");
756 outputContainer->Add(fhXEUeLeftNeutral) ;
757
758 fhXEUeRightNeutral =
759 new TH2F("hXEUeNeutralRight","x_{E} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
760 nptbins,ptmin,ptmax,200,0.,2.);
761 fhXEUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
762 fhXEUeRightNeutral->SetXTitle("p_{T trigger}");
763 outputContainer->Add(fhXEUeRightNeutral) ;
764
765 fhPtHbpXEUeLeftNeutral =
766 new TH2F("hHbpXEUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger",
767 nptbins,ptmin,ptmax,200,0.,10.);
768 fhPtHbpXEUeLeftNeutral->SetYTitle("ln(1/x_{E})");
769 fhPtHbpXEUeLeftNeutral->SetXTitle("p_{T trigger}");
770 outputContainer->Add(fhPtHbpXEUeLeftNeutral) ;
771
772 fhPtHbpXEUeRightNeutral =
773 new TH2F("hHbpXEUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger",
774 nptbins,ptmin,ptmax,200,0.,10.);
775 fhPtHbpXEUeRightNeutral->SetYTitle("ln(1/x_{E})");
776 fhPtHbpXEUeRightNeutral->SetXTitle("p_{T trigger}");
777 outputContainer->Add(fhPtHbpXEUeRightNeutral) ;
778
779 fhZTUeLeftNeutral =
780 new TH2F("hZTUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
e09cf5ef 781 nptbins,ptmin,ptmax,140,0.,2.);
3f150b4b 782 fhZTUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
783 fhZTUeLeftNeutral->SetXTitle("p_{T trigger}");
784 outputContainer->Add(fhZTUeLeftNeutral) ;
e09cf5ef 785
3f150b4b 786 fhZTUeRightNeutral =
787 new TH2F("hZTUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
e09cf5ef 788 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 789 fhZTUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
790 fhZTUeRightNeutral->SetXTitle("p_{T trigger}");
791 outputContainer->Add(fhZTUeRightNeutral) ;
e09cf5ef 792
3f150b4b 793 fhPtHbpZTUeLeftNeutral =
794 new TH2F("hHbpZTUeNeutralLeft","#xi = ln(1/z_{T}) with neutral UE left side of trigger",
e09cf5ef 795 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 796 fhPtHbpZTUeLeftNeutral->SetYTitle("ln(1/z_{T})");
797 fhPtHbpZTUeLeftNeutral->SetXTitle("p_{T trigger}");
798 outputContainer->Add(fhPtHbpZTUeLeftNeutral) ;
e09cf5ef 799
3f150b4b 800 fhPtHbpZTUeRightNeutral =
801 new TH2F("hHbpZTUeNeutralRight","#xi = ln(1/z_{T}) with neutral UE right side of trigger",
e09cf5ef 802 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 803 fhPtHbpZTUeRightNeutral->SetYTitle("ln(1/z_{T})");
804 fhPtHbpZTUeRightNeutral->SetXTitle("p_{T trigger}");
805 outputContainer->Add(fhPtHbpZTUeRightNeutral) ;
e09cf5ef 806
807 }
fe871b21 808
809 }//Correlation with neutral hadrons
810
811 //if data is MC, fill more histograms
babcbc9d 812 if(IsDataMC())
813 {
814 fh2phiLeadingParticle=new TH2F("h2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
fe871b21 815 fh2phiLeadingParticle->GetXaxis()->SetTitle("p_{T gen Leading} (GeV/c)");
816 fh2phiLeadingParticle->GetYaxis()->SetTitle("(#phi_{rec}-#phi_{gen})/#phi_{gen}");
e09cf5ef 817
babcbc9d 818 fhMCLeadingCount=new TH1F("hMCLeadingTriggerCount","MCLeadingTriggerCount",nptbins,ptmin,ptmax);
fe871b21 819 fhMCLeadingCount->SetXTitle("p_{T trig}");
820
821 fhMCEtaCharged = new TH2F
babcbc9d 822 ("hMCEtaCharged","MC #eta_{h^{#pm}} vs p_{T #pm}",
fe871b21 823 nptbins,ptmin,ptmax,netabins,etamin,etamax);
824 fhMCEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
825 fhMCEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
826
827 fhMCPhiCharged = new TH2F
babcbc9d 828 ("hMCPhiCharged","#MC phi_{h^{#pm}} vs p_{T #pm}",
fe871b21 829 200,ptmin,ptmax,nphibins,phimin,phimax);
830 fhMCPhiCharged->SetYTitle("MC #phi_{h^{#pm}} (rad)");
831 fhMCPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
832
833 fhMCDeltaPhiDeltaEtaCharged = new TH2F
babcbc9d 834 ("hMCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
fe871b21 835 140,-2.,5.,200,-2,2);
836 fhMCDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
837 fhMCDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
838
839 fhMCDeltaEtaCharged = new TH2F
babcbc9d 840 ("hMCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
fe871b21 841 nptbins,ptmin,ptmax,200,-2,2);
842 fhMCDeltaEtaCharged->SetYTitle("#Delta #eta");
843 fhMCDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
844
845 fhMCDeltaPhiCharged = new TH2F
babcbc9d 846 ("hMCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
fe871b21 847 nptbins,ptmin,ptmax,140,-2.,5.);
848 fhMCDeltaPhiCharged->SetYTitle("#Delta #phi");
849 fhMCDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
850
851 fhMCDeltaPhiChargedPt = new TH2F
babcbc9d 852 ("hMCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
fe871b21 853 nptbins,ptmin,ptmax,140,-2.,5.);
854 fhMCDeltaPhiChargedPt->SetYTitle("#Delta #phi");
855 fhMCDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
856
3f150b4b 857 fhMCPtXECharged =
858 new TH2F("hMCPtXECharged","x_{E}",
fe871b21 859 nptbins,ptmin,ptmax,200,0.,2.);
3f150b4b 860 fhMCPtXECharged->SetYTitle("x_{E}");
861 fhMCPtXECharged->SetXTitle("p_{T trigger}");
fe871b21 862
3f150b4b 863 fhMCPtHbpXECharged =
864 new TH2F("hMCHbpXECharged","MC #xi = ln(1/x_{E}) with charged hadrons",
fe871b21 865 nptbins,ptmin,ptmax,200,0.,10.);
3f150b4b 866 fhMCPtHbpXECharged->SetYTitle("ln(1/x_{E})");
867 fhMCPtHbpXECharged->SetXTitle("p_{T trigger}");
868
869 fhMCPtZTCharged =
870 new TH2F("hMCPtZTCharged","z_{T}",
871 nptbins,ptmin,ptmax,200,0.,2.);
872 fhMCPtZTCharged->SetYTitle("z_{T}");
873 fhMCPtZTCharged->SetXTitle("p_{T trigger}");
874
875 fhMCPtHbpZTCharged =
876 new TH2F("hMCHbpZTCharged","MC #xi = ln(1/z_{T}) with charged hadrons",
877 nptbins,ptmin,ptmax,200,0.,10.);
878 fhMCPtHbpZTCharged->SetYTitle("ln(1/z_{T})");
879 fhMCPtHbpZTCharged->SetXTitle("p_{T trigger}");
fe871b21 880
881 fhMCPtTrigPout =
babcbc9d 882 new TH2F("hMCPtTrigPout","AOD MC Pout with triggers",
fe871b21 883 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
884 fhMCPtTrigPout->SetYTitle("p_{out} (GeV/c)");
885 fhMCPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
886
887 fhMCPtAssocDeltaPhi =
babcbc9d 888 new TH2F("hMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
fe871b21 889 nptbins,ptmin,ptmax,140,-2.,5.);
890 fhMCPtAssocDeltaPhi->SetYTitle("#Delta #phi");
891 fhMCPtAssocDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
892
893 outputContainer->Add(fh2phiLeadingParticle);
894 outputContainer->Add(fhMCLeadingCount);
895 outputContainer->Add(fhMCDeltaPhiDeltaEtaCharged);
896 outputContainer->Add(fhMCPhiCharged) ;
897 outputContainer->Add(fhMCEtaCharged) ;
898 outputContainer->Add(fhMCDeltaEtaCharged) ;
899 outputContainer->Add(fhMCDeltaPhiCharged) ;
900
901 outputContainer->Add(fhMCDeltaPhiChargedPt) ;
3f150b4b 902 outputContainer->Add(fhMCPtXECharged) ;
903 outputContainer->Add(fhMCPtZTCharged) ;
904 outputContainer->Add(fhMCPtHbpXECharged) ;
905 outputContainer->Add(fhMCPtHbpZTCharged) ;
fe871b21 906 outputContainer->Add(fhMCPtTrigPout) ;
907 outputContainer->Add(fhMCPtAssocDeltaPhi) ;
908 } //for MC histogram
909
e09cf5ef 910 return outputContainer;
911
912}
913
05d0d05d 914//____________________________________________________
e09cf5ef 915void AliAnaParticleHadronCorrelation::InitParameters()
916{
917
918 //Initialize the parameters of the analysis.
919 SetInputAODName("PWG4Particle");
920 SetAODObjArrayName("Hadrons");
921 AddToHistogramsName("AnaHadronCorr_");
045396c8 922
e09cf5ef 923 SetPtCutRange(0.,300);
045396c8 924 fDeltaPhiMinCut = 1.5 ;
925 fDeltaPhiMaxCut = 4.5 ;
926 fSelectIsolated = kFALSE;
927 fMakeSeveralUE = kFALSE;
928 fUeDeltaPhiMinCut = 1. ;
929 fUeDeltaPhiMaxCut = 1.5 ;
930 fNeutralCorr = kFALSE ;
931 fPi0Trigger = kFALSE ;
045396c8 932
3f150b4b 933 fMakeAbsoluteLeading = kTRUE;
934 fMakeNearSideLeading = kFALSE;
935
66e64043 936 fNAssocPtBins = 7 ;
06d3bad7 937 fAssocPtBinLimit[0] = 1.5 ;
938 fAssocPtBinLimit[1] = 3. ;
939 fAssocPtBinLimit[2] = 5. ;
940 fAssocPtBinLimit[3] = 7. ;
941 fAssocPtBinLimit[4] = 9. ;
942 fAssocPtBinLimit[5] = 12. ;
943 fAssocPtBinLimit[6] = 15. ;
66e64043 944 fAssocPtBinLimit[7] = 20. ;
945 fAssocPtBinLimit[8] = 100.;
946 fAssocPtBinLimit[9] = 200.;
045396c8 947
e09cf5ef 948}
949
05d0d05d 950//__________________________________________________________
e09cf5ef 951void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
952{
953 //Particle-Hadron Correlation Analysis, fill AODs
954
547c2f01 955 if(!GetInputAODBranch())
956 {
e09cf5ef 957 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
958 abort();
959 }
960
547c2f01 961 if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation"))
962 {
e09cf5ef 963 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Wrong type of AOD object, change AOD class name in input AOD: It should be <AliAODPWG4ParticleCorrelation> and not <%s> \n",GetInputAODBranch()->GetClass()->GetName());
964 abort();
965 }
966
967 if(GetDebug() > 1){
968 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n");
969 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
66e64043 970 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetCTSTracks() ->GetEntriesFast());
e09cf5ef 971 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetEMCALClusters()->GetEntriesFast());
66e64043 972 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetPHOSClusters() ->GetEntriesFast());
e09cf5ef 973 }
974
045396c8 975 //Get the vertex and check it is not too large in z
976 Double_t v[3] = {0,0,0}; //vertex ;
977 GetReader()->GetVertex(v);
978 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
979
980 //Loop on stored AOD particles, find leading trigger
66e64043 981 Double_t ptTrig = fMinTriggerPt ;
045396c8 982 fLeadingTriggerIndex = -1 ;
983 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
04f7a616 984 for(Int_t iaod = 0; iaod < naod ; iaod++)
985 {
e09cf5ef 986 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
045396c8 987
04f7a616 988 // Vertex cut in case of mixing
989 Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
990 if(check == 0) continue;
991 if(check == -1) return;
992
045396c8 993 // find the leading particles with highest momentum
547c2f01 994 if (particle->Pt() > ptTrig)
995 {
045396c8 996 ptTrig = particle->Pt() ;
997 fLeadingTriggerIndex = iaod ;
998 }
999 }// finish search of leading trigger particle
e09cf5ef 1000
66e64043 1001
e09cf5ef 1002 //Do correlation with leading particle
547c2f01 1003 if(fLeadingTriggerIndex >= 0)
1004 {
e09cf5ef 1005
045396c8 1006 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
1007
1008 //check if the particle is isolated or if we want to take the isolation into account
1009 if(OnlyIsolated() && !particle->IsIsolated()) return;
1010
e09cf5ef 1011 //Make correlation with charged hadrons
045396c8 1012 Bool_t okcharged = kTRUE;
1013 Bool_t okneutral = kTRUE;
e09cf5ef 1014 if(GetReader()->IsCTSSwitchedOn() )
045396c8 1015 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kFALSE);
e09cf5ef 1016
1017 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
1018 if(fNeutralCorr && pi0list && pi0list->GetEntriesFast() > 0)
045396c8 1019 okneutral = MakeNeutralCorrelation(particle, pi0list,kFALSE);
e09cf5ef 1020
1021 }//Correlate leading
1022
1023 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n");
1024
1025}
1026
05d0d05d 1027//_________________________________________________________________
e09cf5ef 1028void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
1029{
1030 //Particle-Hadron Correlation Analysis, fill histograms
1031
3f150b4b 1032 if(!GetInputAODBranch())
1033 {
e09cf5ef 1034 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
1035 abort();
1036 }
1037
3f150b4b 1038 if(GetDebug() > 1)
1039 {
e09cf5ef 1040 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
1041 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
1042 }
babcbc9d 1043
e09cf5ef 1044 //Get the vertex and check it is not too large in z
1045 Double_t v[3] = {0,0,0}; //vertex ;
1046 GetReader()->GetVertex(v);
1047 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
1048
1049 //Loop on stored AOD particles, find leading
66e64043 1050 Double_t ptTrig = fMinTriggerPt;
04f7a616 1051 if(fLeadingTriggerIndex < 0)
1052 {
1053 //Search leading if not done before
045396c8 1054 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
547c2f01 1055 for(Int_t iaod = 0; iaod < naod ; iaod++)
1056 { //loop on input trigger AOD file
045396c8 1057 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
04f7a616 1058
1059 // Vertex cut in case of mixing
1060 Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
1061 if(check == 0) continue;
1062 if(check == -1) return;
1063
045396c8 1064 //check if the particle is isolated or if we want to take the isolation into account
1065 if(OnlyIsolated() && !particle->IsIsolated()) continue;
e09cf5ef 1066
045396c8 1067 //find the leading particles with highest momentum
547c2f01 1068 if (particle->Pt() > ptTrig)
1069 {
045396c8 1070 ptTrig = particle->Pt() ;
1071 fLeadingTriggerIndex = iaod ;
e09cf5ef 1072 }
547c2f01 1073
1074 }// Finish search of leading trigger particle
1075 }// Search leading if not done before
045396c8 1076
547c2f01 1077 if(fLeadingTriggerIndex >= 0 )
1078 { //using trigger particle to do correlations
1079
045396c8 1080 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
06d3bad7 1081
547c2f01 1082 // Check if trigger is in fiducial region
1083 if(IsFiducialCutOn())
1084 {
1085 Bool_t in = GetFiducialCut()->IsInFiducialCut(*particle->Momentum(),particle->GetDetector()) ;
1086 if(! in ) return ;
1087 }
1088
1089 // Check if the particle is isolated or if we want to take the isolation into account
045396c8 1090 if(OnlyIsolated() && !particle->IsIsolated()) return;
e09cf5ef 1091
547c2f01 1092 // Make correlation with charged hadrons
045396c8 1093 Bool_t okcharged = kTRUE;
1094 Bool_t okneutral = kTRUE;
547c2f01 1095 if(GetReader()->IsCTSSwitchedOn() )
1096 {
045396c8 1097 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kTRUE);
547c2f01 1098 if(IsDataMC())
1099 {
045396c8 1100 MakeMCChargedCorrelation(particle);
1101 }
a5f1e836 1102 }
1103
e09cf5ef 1104 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
547c2f01 1105 if(fNeutralCorr && pi0list)
1106 {
a5f1e836 1107 if(pi0list->GetEntriesFast() > 0)
1108 okneutral = MakeNeutralCorrelation(particle, pi0list,kTRUE);
1109 }
e09cf5ef 1110
045396c8 1111 // Fill leading particle histogram if correlation went well and
1112 // no problem was found, like not absolute leading, or bad vertex in mixing.
547c2f01 1113 if(okcharged && okneutral)
1114 {
045396c8 1115 fhPtLeading->Fill(particle->Pt());
1116 Float_t phi = particle->Phi();
1117 if(phi<0)phi+=TMath::TwoPi();
1118 fhPhiLeading->Fill(particle->Pt(), phi);
1119 fhEtaLeading->Fill(particle->Pt(), particle->Eta());
1120 }//ok charged && neutral
e09cf5ef 1121 }//Aod branch loop
1122
045396c8 1123 //Reinit for next event
1124 fLeadingTriggerIndex = -1;
e09cf5ef 1125
045396c8 1126 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n");
e09cf5ef 1127}
1128
c5693f62 1129//___________________________________________________________________________________________________________
045396c8 1130Bool_t AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle,
c5693f62 1131 const TObjArray* pl, const Bool_t bFillHisto)
e09cf5ef 1132{
1133 // Charged Hadron Correlation Analysis
1134 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n");
1135
045396c8 1136 Int_t evtIndex11 = -1 ; //cluster trigger or pi0 trigger
1137 Int_t evtIndex12 = -1 ; // pi0 trigger
1138 Int_t evtIndex13 = -1 ; // charged trigger
e09cf5ef 1139 Int_t indexPhoton1 = -1 ;
1140 Int_t indexPhoton2 = -1 ;
045396c8 1141
1142 Double_t v[3] = {0,0,0}; //vertex ;
e09cf5ef 1143 GetReader()->GetVertex(v);
e09cf5ef 1144
04f7a616 1145 if (GetMixedEvent())
1146 {
e09cf5ef 1147 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
1148 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
1149 evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
1150 }
1151
e09cf5ef 1152 Double_t phiTrig = aodParticle->Phi();
045396c8 1153 Double_t ptTrig = aodParticle->Pt();
045396c8 1154
1155 Double_t pt = -100. ;
1156 Double_t px = -100. ;
1157 Double_t py = -100. ;
3f150b4b 1158 Double_t zT = -100. ;
045396c8 1159 Double_t xE = -100. ;
3f150b4b 1160 Double_t hbpXE = -100. ;
1161 Double_t hbpZT = -100. ;
045396c8 1162 Double_t phi = -100. ;
1163 Double_t eta = -100. ;
1164 Double_t pout = -100. ;
e09cf5ef 1165
045396c8 1166 Double_t ptDecay1 = 0. ;
1167 Double_t pxDecay1 = 0. ;
1168 Double_t pyDecay1 = 0. ;
1169 Double_t phiDecay1 = 0. ;
1170 Double_t ptDecay2 = 0. ;
1171 Double_t pxDecay2 = 0. ;
1172 Double_t pyDecay2 = 0. ;
1173 Double_t phiDecay2 = 0. ;
1174
1175 Double_t ratDecay1 = -100. ;
1176 Double_t ratDecay2 = -100. ;
1177 Double_t deltaPhi = -100. ;
1178 Double_t deltaPhiOrg = -100. ;
1179 Double_t deltaPhiDecay1 = -100. ;
1180 Double_t deltaPhiDecay2 = -100. ;
1181
1182 TVector3 p3;
e09cf5ef 1183 TLorentzVector photonMom ;
045396c8 1184 TObjArray * clusters = 0x0 ;
1185 TObjArray * reftracks = 0x0;
1186 Int_t nrefs = 0;
1187 Int_t nTracks = GetCTSTracks()->GetEntriesFast() ;
e09cf5ef 1188
547c2f01 1189 if(fPi0Trigger)
1190 {
e09cf5ef 1191 indexPhoton1 = aodParticle->GetCaloLabel (0);
1192 indexPhoton2 = aodParticle->GetCaloLabel (1);
1193 if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
1194
547c2f01 1195 if(indexPhoton1!=-1 && indexPhoton2!=-1)
1196 {
e09cf5ef 1197 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
045396c8 1198 else clusters = GetPHOSClusters() ;
547c2f01 1199
1200 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
1201 {
e09cf5ef 1202 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
1203 photon->GetMomentum(photonMom,GetVertex(0)) ;
547c2f01 1204 if(photon->GetID()==indexPhoton1)
1205 {
e09cf5ef 1206 ptDecay1 = photonMom.Pt();
1207 pxDecay1 = photonMom.Px();
1208 pyDecay1 = photonMom.Py();
1209 phiDecay1 = photonMom.Phi();
1210 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig);
1211 }
547c2f01 1212 if(photon->GetID()==indexPhoton2)
1213 {
e09cf5ef 1214 ptDecay2 = photonMom.Pt();
1215 pxDecay2 = photonMom.Px();
1216 pyDecay2 = photonMom.Py();
1217 phiDecay2 = photonMom.Phi();
1218 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay2/ptTrig);
1219 }
547c2f01 1220
e09cf5ef 1221 if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
547c2f01 1222
e09cf5ef 1223 } //cluster loop
1224 } //index of decay photons found
e09cf5ef 1225 } //make decay-hadron correlation
1226
1227 //Track loop, select tracks with good pt, phi and fill AODs or histograms
547c2f01 1228 for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ )
1229 {
e09cf5ef 1230 AliVTrack * track = (AliVTrack *) (pl->At(ipr)) ;
045396c8 1231
e09cf5ef 1232 Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
1233 p3.SetXYZ(mom[0],mom[1],mom[2]);
1234 pt = p3.Pt();
1235 px = p3.Px();
1236 py = p3.Py();
1237 eta = p3.Eta();
1238 phi = p3.Phi() ;
1239 if(phi < 0) phi+=TMath::TwoPi();
045396c8 1240
e09cf5ef 1241 //Select only hadrons in pt range
66e64043 1242 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
1243
e09cf5ef 1244 //remove trigger itself for correlation when use charged triggers
1245 if( track->GetID() == aodParticle->GetTrackLabel(0) || track->GetID() == aodParticle->GetTrackLabel(1) ||
66e64043 1246 track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3) )
045396c8 1247 continue ;
1248
045396c8 1249 //jump out this event if near side associated particle pt larger than trigger
3f150b4b 1250 if (fMakeNearSideLeading)
547c2f01 1251 {
3f150b4b 1252 if(pt > ptTrig && TMath::Abs(phi-phiTrig) < TMath::PiOver2()) return kFALSE;
1253 }
1254 //jump out this event if there is any other particle with pt larger than trigger
1255 else if(fMakeAbsoluteLeading)
1256 {
1257 if(pt > ptTrig) return kFALSE;
045396c8 1258 }
1259
1260 //Only for mixed event
1261 Int_t evtIndex2 = 0 ;
04f7a616 1262 if (GetMixedEvent())
1263 {
045396c8 1264 evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
1265 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
1266 continue ;
1267 //vertex cut
1268 if (TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut())
1269 return kFALSE;
1270 }
1271
547c2f01 1272 if(fPi0Trigger)
1273 {
1274 if(indexPhoton1!=-1 && indexPhoton2!=-1)
1275 {
e09cf5ef 1276 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1277 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1278 deltaPhiDecay1 = phiDecay1-phi;
1279 deltaPhiDecay2 = phiDecay2-phi;
1280 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1281 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1282 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1283 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
e09cf5ef 1284 }
1285 } //do decay-hadron correlation
045396c8 1286
e09cf5ef 1287 //Selection within angular range
045396c8 1288 deltaPhi = phiTrig-phi;
1289 deltaPhiOrg = deltaPhi;
1290 if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1291 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
1292
3f150b4b 1293 zT = pt/ptTrig ;
1294 hbpZT = -100;
1295 if(zT > 0 ) hbpZT = TMath::Log(1./zT);
1296
66e64043 1297 pout = pt*TMath::Sin(deltaPhi) ;
3f150b4b 1298
66e64043 1299 xE =-pt/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1300 //if(xE <0.)xE =-xE;
3f150b4b 1301 hbpXE = -100;
1302 if(xE > 0 ) hbpXE = TMath::Log(1./xE);
66e64043 1303
e09cf5ef 1304 if(GetDebug() > 2)
66e64043 1305 printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Charged hadron: pt %f, phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f, pT Trig min %2.2f \n",
1306 pt,phi, phiTrig,fDeltaPhiMinCut, deltaPhi, fDeltaPhiMaxCut, fMinTriggerPt);
e09cf5ef 1307
045396c8 1308 // Fill Histograms
3f150b4b 1309 if(bFillHisto)
1310 {
05d0d05d 1311 Int_t assocBin = -1;
1312 for(Int_t i = 0 ; i < fNAssocPtBins ; i++){
66e64043 1313 if(pt > fAssocPtBinLimit[i] && pt < fAssocPtBinLimit[i+1]) assocBin= i;
045396c8 1314 }
1315
05d0d05d 1316 fhAssocPt->Fill(ptTrig,pt);
1317
06d3bad7 1318 //if(xE >= 1 ) printf("pTTrig = %f, pTHadron = %f, xE = %f\n",ptTrig,pt, xE);
66e64043 1319 fhXE->Fill(ptTrig, xE) ;
3f150b4b 1320 fhZT->Fill(ptTrig, zT) ;
66e64043 1321
05d0d05d 1322 if(TMath::Cos(deltaPhi) < 0 && assocBin >= 0 )//away side
3f150b4b 1323 {
05d0d05d 1324 fhXEAssocPtBin[assocBin]->Fill(ptTrig, xE) ;
3f150b4b 1325 fhZTAssocPtBin[assocBin]->Fill(ptTrig, zT) ;
1326 }
05d0d05d 1327
1328 //Hardcoded values, BAD, FIXME
1329 Double_t dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
547c2f01 1330 if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475)
1331 {
05d0d05d 1332 fhAssocPtBkg->Fill(ptTrig, pt);
1333 }
1334
1335 if(dphiBrad<-1./3) dphiBrad += 2;
66e64043 1336 fhDeltaPhiBrad->Fill(ptTrig, dphiBrad);
1337
547c2f01 1338 if(assocBin>=0)
1339 {
05d0d05d 1340 fhDeltaPhiBradAssocPtBin[assocBin]->Fill(ptTrig, dphiBrad);
1341 fhDeltaPhiAssocPtBin [assocBin]->Fill(ptTrig, deltaPhi);
547c2f01 1342 if(track->GetHMPIDsignal()>0)
1343 {
57d8227a 1344 //printf("Track pt %f with HMPID signal %f \n",pt,track->GetHMPIDsignal());
06d3bad7 1345 fhDeltaPhiAssocPtBinHMPID[assocBin]->Fill(ptTrig, deltaPhi);
1346 }
1347
1348 if(phi > 5*TMath::DegToRad() && phi < 20*TMath::DegToRad()){
1349 //printf("Track pt %f in HMPID acceptance phi %f \n ",pt,phi*TMath::RadToDeg() );
1350 fhDeltaPhiAssocPtBinHMPIDAcc[assocBin]->Fill(ptTrig, deltaPhi);
06d3bad7 1351 }
1352
05d0d05d 1353 }
1354
1355 fhEtaCharged ->Fill(pt,eta);
1356 fhPhiCharged ->Fill(pt,phi);
e09cf5ef 1357 fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1358 fhDeltaPhiCharged->Fill(ptTrig, deltaPhi);
3f150b4b 1359 if(pt > 2 ) fhDeltaPhiDeltaEtaCharged->Fill(deltaPhi,aodParticle->Eta()-eta);
e09cf5ef 1360
1361 if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1362 //fill different multiplicity histogram
3f150b4b 1363 if(DoEventSelect())
1364 {
e09cf5ef 1365 for(Int_t im=0; im<GetMultiBin(); im++){
1366 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1)){
045396c8 1367 fhTrigDeltaPhiCharged[im]->Fill(ptTrig,deltaPhi);
e09cf5ef 1368 fhTrigDeltaEtaCharged[im]->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1369 }
e09cf5ef 1370 }
1371 }
66e64043 1372
e09cf5ef 1373 //delta phi cut for correlation
547c2f01 1374 if ( (deltaPhi > fDeltaPhiMinCut) && (deltaPhi < fDeltaPhiMaxCut) )
1375 {
3f150b4b 1376 fhDeltaPhiChargedPt ->Fill(pt ,deltaPhi);
1377 fhXECharged ->Fill(ptTrig, xE);
1378 fhPtHbpXECharged ->Fill(ptTrig, hbpXE);
1379 fhZTCharged ->Fill(ptTrig, zT);
1380 fhPtHbpZTCharged ->Fill(ptTrig, hbpZT);
1381 fhPtTrigPout ->Fill(ptTrig, pout) ;
1382 fhPtTrigCharged ->Fill(ptTrig, pt) ;
1383
1384 if(track->Charge() > 0)
1385 {
1386 fhXEPosCharged->Fill(ptTrig,xE) ;
1387 fhZTPosCharged->Fill(ptTrig,zT) ;
1388 }
1389 else
1390 {
1391 fhXENegCharged->Fill(ptTrig,xE) ;
1392 fhZTNegCharged->Fill(ptTrig,zT) ;
1393 }
1394
e09cf5ef 1395 //fill different multiplicity histogram
3f150b4b 1396 if(DoEventSelect())
1397 {
1398 for(Int_t im=0; im<GetMultiBin(); im++)
1399 {
e09cf5ef 1400 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
3f150b4b 1401 {
1402 fhTrigXECorr[im]->Fill(ptTrig,xE);
1403 fhTrigZTCorr[im]->Fill(ptTrig,zT);
1404 }
e09cf5ef 1405 }
1406 } //multiplicity events selection
1407 } //delta phi cut for correlation
547c2f01 1408 else if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
1409 { //UE study
045396c8 1410 fhDeltaPhiUeChargedPt->Fill(pt,deltaPhi);
3f150b4b 1411
045396c8 1412 Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
1413 Double_t uexE = -(pt/ptTrig)*TMath::Cos(randomphi);
3f150b4b 1414 Double_t uezT = pt/ptTrig;
1415
045396c8 1416 if(uexE < 0.) uexE = -uexE;
3f150b4b 1417
045396c8 1418 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - xe = %f, uexE = %f \n", xE, uexE);
3f150b4b 1419
1420 fhXEUeCharged->Fill(ptTrig,uexE);
1421 if(uexE>0)fhPtHbpXEUeCharged->Fill(ptTrig,TMath::Log(1/uexE));
1422
1423 fhZTUeCharged->Fill(ptTrig,uezT);
1424 if(uexE>0)fhPtHbpZTUeCharged->Fill(ptTrig,TMath::Log(1/uezT));
1425
1426 if(DoEventSelect())
1427 {
1428 for(Int_t im=0; im<GetMultiBin(); im++)
1429 {
e09cf5ef 1430 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
3f150b4b 1431 {
1432 fhTrigXEUeCorr[im]->Fill(ptTrig,xE);
1433 fhTrigZTUeCorr[im]->Fill(ptTrig,zT);
1434 }
e09cf5ef 1435 }
1436 } //multiplicity events selection
1437
1438 } //UE study
1439
547c2f01 1440 if(fPi0Trigger)
1441 {
1442 if(indexPhoton1!=-1 && indexPhoton2!=-1)
1443 {
045396c8 1444 fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
1445 fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
547c2f01 1446
045396c8 1447 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
547c2f01 1448
045396c8 1449 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
3f150b4b 1450 fhXEDecayCharged->Fill(ptDecay1,ratDecay1);
547c2f01 1451
045396c8 1452 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
3f150b4b 1453 fhXEDecayCharged->Fill(ptDecay2,ratDecay2);
547c2f01 1454
045396c8 1455 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
547c2f01 1456
e09cf5ef 1457 } //index of decay photons found
1458 } //make decay-hadron correlation
1459
1460 //several UE calculation
547c2f01 1461 if(fMakeSeveralUE)
1462 {
1463 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
1464 {
3f150b4b 1465 fhDeltaPhiUeLeftCharged->Fill(pt ,deltaPhi);
1466 fhXEUeLeftCharged ->Fill(ptTrig,xE);
1467 fhPtHbpXEUeLeftCharged ->Fill(ptTrig,hbpXE);
1468 fhZTUeLeftCharged ->Fill(ptTrig,zT);
1469 fhPtHbpZTUeLeftCharged ->Fill(ptTrig,hbpZT);
e09cf5ef 1470 }
547c2f01 1471
1472 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut))
1473 {
3f150b4b 1474 fhDeltaPhiUeRightCharged->Fill(pt ,deltaPhi);
1475 fhXEUeRightCharged ->Fill(ptTrig,xE);
1476 fhPtHbpXEUeRightCharged ->Fill(ptTrig,hbpXE);
1477 fhZTUeRightCharged ->Fill(ptTrig,zT);
1478 fhPtHbpZTUeRightCharged ->Fill(ptTrig,hbpZT);
e09cf5ef 1479 }
1480 } //several UE calculation
babcbc9d 1481
e09cf5ef 1482 } //Fill histogram
547c2f01 1483 else
1484 {
e09cf5ef 1485 nrefs++;
547c2f01 1486 if(nrefs==1)
1487 {
e09cf5ef 1488 reftracks = new TObjArray(0);
045396c8 1489 TString trackname = Form("%s+Tracks", GetAODObjArrayName().Data());
1490 reftracks->SetName(trackname.Data());
e09cf5ef 1491 reftracks->SetOwner(kFALSE);
1492 }
1493 reftracks->Add(track);
1494 }//aod particle loop
1495 }// track loop
1496
1497 //Fill AOD with reference tracks, if not filling histograms
547c2f01 1498 if(!bFillHisto && reftracks)
1499 {
e09cf5ef 1500 aodParticle->AddObjArray(reftracks);
1501 }
1502
045396c8 1503 return kTRUE;
e09cf5ef 1504
1505}
1506
05d0d05d 1507//________________________________________________________________________________________________________________
045396c8 1508Bool_t AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * const aodParticle,
c5693f62 1509 const TObjArray* pi0list, const Bool_t bFillHisto)
e09cf5ef 1510{
1511 // Neutral Pion Correlation Analysis
1512 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Make trigger particle - pi0 correlation, %d pi0's \n",pi0list->GetEntriesFast());
1513
1514 Int_t evtIndex11 = 0 ;
1515 Int_t evtIndex12 = 0 ;
04f7a616 1516 if (GetMixedEvent())
1517 {
e09cf5ef 1518 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
1519 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
1520 }
1521
045396c8 1522 Double_t pt = -100. ;
1523 Double_t px = -100. ;
1524 Double_t py = -100. ;
3f150b4b 1525 Double_t zT = -100. ;
045396c8 1526 Double_t phi = -100. ;
1527 Double_t eta = -100. ;
1528 Double_t xE = -100. ;
3f150b4b 1529 Double_t hbpXE= -100. ;
1530 Double_t hbpZT= -100. ;
1531
e09cf5ef 1532 Double_t ptTrig = aodParticle->Pt();
1533 Double_t phiTrig = aodParticle->Phi();
1534 Double_t etaTrig = aodParticle->Eta();
66e64043 1535 //Double_t pxTrig = aodParticle->Px();
1536 //Double_t pyTrig = aodParticle->Py();
e09cf5ef 1537
045396c8 1538 Int_t indexPhoton1 =-1 ;
1539 Int_t indexPhoton2 =-1 ;
1540 Double_t ptDecay1 = 0. ;
e09cf5ef 1541 Double_t pxDecay1 = 0. ;
1542 Double_t pyDecay1 = 0. ;
045396c8 1543 Double_t phiDecay1 = 0. ;
1544 Double_t ptDecay2 = 0. ;
e09cf5ef 1545 Double_t pxDecay2 = 0. ;
1546 Double_t pyDecay2 = 0. ;
045396c8 1547 Double_t phiDecay2 = 0. ;
1548
1549 Double_t ratDecay1 = -100. ;
1550 Double_t ratDecay2 = -100. ;
1551 Double_t deltaPhi = -100. ;
1552 Double_t deltaPhiDecay1 = -100. ;
1553 Double_t deltaPhiDecay2 = -100. ;
e09cf5ef 1554
e09cf5ef 1555 TObjArray * clusters = 0x0 ;
045396c8 1556 TLorentzVector photonMom ;
1557
e09cf5ef 1558 if(fPi0Trigger){
1559 indexPhoton1 = aodParticle->GetCaloLabel (0);
1560 indexPhoton2 = aodParticle->GetCaloLabel (1);
045396c8 1561 if(GetDebug() > 1)
1562 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
e09cf5ef 1563
547c2f01 1564 if(indexPhoton1!=-1 && indexPhoton2!=-1)
1565 {
e09cf5ef 1566 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
1567 else clusters = GetPHOSClusters() ;
547c2f01 1568
1569 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
1570 {
e09cf5ef 1571 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
1572 photon->GetMomentum(photonMom,GetVertex(0)) ;
547c2f01 1573 if(photon->GetID()==indexPhoton1)
1574 {
e09cf5ef 1575 ptDecay1 = photonMom.Pt();
1576 pxDecay1 = photonMom.Px();
1577 pyDecay1 = photonMom.Py();
1578 phiDecay1 = photonMom.Phi();
1579 }
547c2f01 1580
1581 if(photon->GetID()==indexPhoton2)
1582 {
e09cf5ef 1583 ptDecay2 = photonMom.Pt();
1584 pxDecay2 = photonMom.Px();
1585 pyDecay2 = photonMom.Py();
1586 phiDecay2 = photonMom.Phi();
1587 }
547c2f01 1588
045396c8 1589 if(GetDebug() > 1)
1590 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
547c2f01 1591
e09cf5ef 1592 } //photonAOD loop
1593 } //index of decay photons found
547c2f01 1594
e09cf5ef 1595 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig);
547c2f01 1596
e09cf5ef 1597 } //make decay-hadron correlation
1598
1599 TObjArray * refpi0 =0x0;
1600 Int_t nrefs = 0;
1601
1602 //Loop on stored AOD pi0
547c2f01 1603
e09cf5ef 1604 Int_t naod = pi0list->GetEntriesFast();
045396c8 1605 if(GetDebug() > 0)
1606 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod);
547c2f01 1607
1608 for(Int_t iaod = 0; iaod < naod ; iaod++)
1609 {
e09cf5ef 1610 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod));
1611
1612 Int_t evtIndex2 = 0 ;
1613 Int_t evtIndex3 = 0 ;
04f7a616 1614 if (GetMixedEvent())
1615 {
e09cf5ef 1616 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
1617 evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
1618
045396c8 1619 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 ||
1620 evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events
e09cf5ef 1621 continue ;
1622 }
1623
1624 //Int_t pdg = pi0->GetPdg();
1625 //if(pdg != AliCaloPID::kPi0) continue;
1626
1627 pt = pi0->Pt();
1628 px = pi0->Px();
1629 py = pi0->Py();
66e64043 1630
1631 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
1632
1633 //jumped out this event if near side associated particle pt larger than trigger
e09cf5ef 1634 if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2()) break ;
045396c8 1635
e09cf5ef 1636 //Selection within angular range
1637 phi = pi0->Phi();
045396c8 1638 //Float_t deltaPhi = TMath::Abs(phiTrig-phi);
1639 //if( (deltaPhi < fDeltaPhiMinCut) || ( deltaPhi > fDeltaPhiMaxCut) ) continue ;
e09cf5ef 1640
547c2f01 1641 if(bFillHisto)
1642 {
e09cf5ef 1643
045396c8 1644 deltaPhi = phiTrig-phi;
babcbc9d 1645 if(deltaPhi<-TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
045396c8 1646 if(deltaPhi>3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
e09cf5ef 1647
e09cf5ef 1648 phi = pi0->Phi() ;
1649 eta = pi0->Eta() ;
66e64043 1650
3f150b4b 1651 zT = pt/ptTrig ;
1652 xE =-pt/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1653
66e64043 1654 //if(xE <0.)xE =-xE;
e09cf5ef 1655
3f150b4b 1656 hbpXE = -100;
1657 hbpZT = -100;
1658
1659 if(xE > 0 ) hbpXE = TMath::Log(1./xE);
1660 if(zT > 0 ) hbpZT = TMath::Log(1./zT);
1661
547c2f01 1662 if(fPi0Trigger)
1663 {
1664 if(indexPhoton1!=-1 && indexPhoton2!=-1)
1665 {
e09cf5ef 1666 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1667 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1668 deltaPhiDecay1 = phiDecay1-phi;
1669 deltaPhiDecay2 = phiDecay2-phi;
1670 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1671 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1672 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1673 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
1674 fhDeltaPhiDecayNeutral->Fill(ptDecay1, deltaPhiDecay1);
1675 fhDeltaPhiDecayNeutral->Fill(ptDecay2, deltaPhiDecay2);
1676 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
1677 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
3f150b4b 1678 fhXEDecayNeutral->Fill(ptDecay1,ratDecay1);
045396c8 1679 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
3f150b4b 1680 fhXEDecayNeutral->Fill(ptDecay2,ratDecay2);
045396c8 1681 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
e09cf5ef 1682 }
1683 } //do decay-hadron correlation
1684
3f150b4b 1685 fhEtaNeutral ->Fill(pt,eta);
1686 fhPhiNeutral ->Fill(pt,phi);
1687 fhDeltaEtaNeutral ->Fill(ptTrig,etaTrig-eta);
1688 fhDeltaPhiNeutral ->Fill(ptTrig,deltaPhi);
045396c8 1689 fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi,etaTrig-eta);
e09cf5ef 1690
1691 //delta phi cut for correlation
547c2f01 1692 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) )
1693 {
045396c8 1694 fhDeltaPhiNeutralPt->Fill(pt,deltaPhi);
3f150b4b 1695 fhXENeutral ->Fill(ptTrig,xE);
1696 fhPtHbpXENeutral ->Fill(ptTrig,hbpXE);
e09cf5ef 1697 }
547c2f01 1698 else
1699 {
045396c8 1700 fhDeltaPhiUeNeutralPt->Fill(pt,deltaPhi);
3f150b4b 1701 fhXEUeNeutral ->Fill(ptTrig,xE);
1702 fhPtHbpXEUeNeutral ->Fill(ptTrig,hbpXE);
e09cf5ef 1703 }
1704 //several UE calculation
1705 if(fMakeSeveralUE){
547c2f01 1706 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
1707 {
045396c8 1708 fhDeltaPhiUeLeftNeutral->Fill(pt,deltaPhi);
3f150b4b 1709 fhXEUeLeftNeutral ->Fill(ptTrig,xE);
1710 fhPtHbpXEUeLeftNeutral ->Fill(ptTrig,hbpXE);
e09cf5ef 1711 }
547c2f01 1712 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut))
1713 {
045396c8 1714 fhDeltaPhiUeRightNeutral->Fill(pt,deltaPhi);
3f150b4b 1715 fhXEUeRightNeutral ->Fill(ptTrig,xE);
1716 fhPtHbpXEUeRightNeutral ->Fill(ptTrig,hbpXE);
e09cf5ef 1717 }
1718 } //several UE calculation
1719 }
547c2f01 1720 else
1721 {
e09cf5ef 1722 nrefs++;
547c2f01 1723 if(nrefs==1)
1724 {
e09cf5ef 1725 refpi0 = new TObjArray(0);
1726 refpi0->SetName(GetAODObjArrayName()+"Pi0s");
1727 refpi0->SetOwner(kFALSE);
1728 }
1729 refpi0->Add(pi0);
1730 }//put references in trigger AOD
045396c8 1731
1732 if(GetDebug() > 2 )
1733 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1734
1735 }//loop
1736
1737 return kTRUE;
1738}
1739
05d0d05d 1740//_________________________________________________________________________________________________________
045396c8 1741void AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
1742{
1743 // Charged Hadron Correlation Analysis with MC information
1744 if(GetDebug()>1)
1745 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Make trigger particle - charged hadron correlation in AOD MC level\n");
1746
1747 AliStack * stack = 0x0 ;
1748 TParticle * primary = 0x0 ;
1749 TClonesArray * mcparticles0 = 0x0 ;
1750 TClonesArray * mcparticles = 0x0 ;
1751 AliAODMCParticle * aodprimary = 0x0 ;
1752
1753 Double_t eprim = 0 ;
1754 Double_t ptprim = 0 ;
1755 Double_t phiprim = 0 ;
1756 Double_t etaprim = 0 ;
1757 Double_t pxprim = 0 ;
1758 Double_t pyprim = 0 ;
1759 Double_t pzprim = 0 ;
1760 Int_t nTracks = 0 ;
1761 Int_t iParticle = 0 ;
1762 Double_t charge = 0.;
1763
3f150b4b 1764 Double_t mczT =-100 ;
045396c8 1765 Double_t mcxE =-100 ;
3f150b4b 1766 Double_t mchbpXE =-100 ;
1767 Double_t mchbpZT =-100 ;
66e64043 1768 Double_t mcdeltaPhi = -100. ;
1769
045396c8 1770 //Track loop, select tracks with good pt, phi and fill AODs or histograms
1771 //Int_t currentIndex = -1 ;
1772 Double_t mcTrackPt = 0 ;
1773 Double_t mcTrackPhi = 0 ;
1774 Double_t mcTrackEta = 0 ;
1775 Double_t mcTrackPx = 0 ;
1776 Double_t mcTrackPy = 0 ;
1777 Double_t mcTrackPz = 0 ;
66e64043 1778
547c2f01 1779 if(GetReader()->ReadStack())
1780 {
045396c8 1781 nTracks = GetMCStack()->GetNtrack() ;
1782 }
547c2f01 1783 else
1784 {
1785 nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
1786 }
045396c8 1787 //Int_t trackIndex[nTracks];
1788
1789 Int_t label= aodParticle->GetLabel();
1790 if(label<0){
1791 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** bad label ***: label %d \n", label);
1792 return;
1793 }
1794
547c2f01 1795 if(GetReader()->ReadStack())
1796 {
045396c8 1797 stack = GetMCStack() ;
1798 if(!stack) {
1799 printf(" AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation- Stack not available, is the MC handler called? STOP\n");
1800 abort();
1801 }
1802
1803 nTracks=stack->GetNprimary();
547c2f01 1804 if(label >= stack->GetNtrack())
1805 {
045396c8 1806 if(GetDebug() > 2) printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
1807 return ;
1808 }
547c2f01 1809
045396c8 1810 primary = stack->Particle(label);
547c2f01 1811 if(!primary)
1812 {
045396c8 1813 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no primary ***: label %d \n", label);
1814 return;
1815 }
1816
547c2f01 1817 if(primary)
1818 {
2747966a 1819 eprim = primary->Energy();
1820 ptprim = primary->Pt();
1821 phiprim = primary->Phi();
1822 etaprim = primary->Eta();
1823 pxprim = primary->Px();
1824 pyprim = primary->Py();
1825 pzprim = primary->Pz();
1826
1827 if(ptprim < 0.01 || eprim < 0.01) return ;
1828
547c2f01 1829 for (iParticle = 0 ; iParticle < nTracks ; iParticle++)
1830 {
045396c8 1831 TParticle * particle = stack->Particle(iParticle);
1832 TLorentzVector momentum;
3f150b4b 1833
045396c8 1834 //keep only final state particles
1835 if(particle->GetStatusCode()!=1) continue ;
3f150b4b 1836
1837 Int_t pdg = particle->GetPdgCode();
1838
045396c8 1839 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
3f150b4b 1840
045396c8 1841 particle->Momentum(momentum);
1842
1843 //---------- Charged particles ----------------------
547c2f01 1844 if(charge != 0)
1845 {
045396c8 1846 //Particles in CTS acceptance
1847 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
3f150b4b 1848
045396c8 1849 if(TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
3f150b4b 1850
66e64043 1851 if(inCTS)
045396c8 1852 {
1853 mcTrackPt = particle->Pt();
1854 mcTrackPhi = particle->Phi();
1855 mcTrackEta = particle->Eta();
1856 mcTrackPx = particle->Px();
1857 mcTrackPy = particle->Py();
1858 mcTrackPz = particle->Pz();
66e64043 1859 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1860
045396c8 1861 //Select only hadrons in pt range
66e64043 1862 if(mcTrackPt < fMinAssocPt || mcTrackPt > fMaxAssocPt) continue ;
1863
045396c8 1864 //remove trigger itself for correlation when use charged triggers
c5693f62 1865 if(label==iParticle &&
1866 TMath::Abs(mcTrackPt -ptprim ) < 1e-6 &&
1867 TMath::Abs(mcTrackPhi-phiprim) < 1e-6 &&
1868 TMath::Abs(mcTrackEta-etaprim) < 1e-6)
66e64043 1869 continue ;
1870
045396c8 1871 //jumped out this event if near side associated partile pt larger than trigger
66e64043 1872 if( mcTrackPt > ptprim && TMath::Abs(mcTrackPhi-phiprim) < TMath::PiOver2())
045396c8 1873 return ;
1874
66e64043 1875 mcdeltaPhi= phiprim-mcTrackPhi;
1876 if(mcdeltaPhi <= -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1877 if(mcdeltaPhi > 3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1878
3f150b4b 1879 mcdeltaPhi = phiprim-mcTrackPhi;
1880 mczT = mcTrackPt/ptprim ;
1881 mcxE =-mcTrackPt/ptprim*TMath::Cos(mcdeltaPhi);// -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
1882 mchbpXE =-100 ;
1883 mchbpZT =-100 ;
1884 if(mcxE > 0 ) mchbpXE = TMath::Log(1./mcxE);
1885 if(mczT > 0 ) mchbpZT = TMath::Log(1./mczT);
1886
045396c8 1887 // printf("rat = %f, xE = %f, cosi =%f \n", rat, xE, cosi);
1888 // printf("phi = %f \n", phi);
1889
1890 //Selection within angular range
045396c8 1891 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1892 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1893 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
1894 if(GetDebug()>0 )
1895 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Charged hadron: track Pt %f, track Phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f, pT min %2.2f \n",
1896 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
1897 // Fill Histograms
1898 fhMCEtaCharged->Fill(mcTrackPt,mcTrackEta);
1899 fhMCPhiCharged->Fill(mcTrackPt,mcTrackPhi);
1900 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
1901 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
1902 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
045396c8 1903 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,etaprim-mcTrackEta);
1904
1905 //delta phi cut for correlation
1906 if( (mcdeltaPhi > fDeltaPhiMinCut) && ( mcdeltaPhi < fDeltaPhiMaxCut) ) {
1907 fhMCDeltaPhiChargedPt->Fill(mcTrackPt,mcdeltaPhi);
3f150b4b 1908 fhMCPtXECharged ->Fill(ptprim,mcxE);
1909 fhMCPtHbpXECharged ->Fill(ptprim,mchbpXE);
1910 fhMCPtZTCharged ->Fill(ptprim,mczT);
1911 fhMCPtHbpZTCharged ->Fill(ptprim,mchbpZT);
1912 fhMCPtTrigPout ->Fill(ptprim, mcpout) ;
045396c8 1913 }//delta phi cut for correlation
1914 } //tracks after cuts
1915 }//Charged
1916 } //track loop
1917 } //when the leading particles could trace back to MC
1918 } //ESD MC
547c2f01 1919 else if(GetReader()->ReadAODMCParticles())
1920 {
045396c8 1921 //Get the list of MC particles
1922 mcparticles0 = GetReader()->GetAODMCParticles(0);
1923 if(!mcparticles0) return;
547c2f01 1924 if(label >=mcparticles0->GetEntriesFast())
1925 {
045396c8 1926 if(GetDebug() > 2)
1927 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label,mcparticles0->GetEntriesFast());
1928 return;
1929 }
1930 //Get the particle
1931 aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
547c2f01 1932 if(!aodprimary)
1933 {
045396c8 1934 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no AOD primary ***: label %d \n", label);
1935 return;
1936 }
1937
547c2f01 1938 if(aodprimary)
1939 {
2747966a 1940 ptprim = aodprimary->Pt();
1941 phiprim = aodprimary->Phi();
1942 etaprim = aodprimary->Eta();
1943 pxprim = aodprimary->Px();
1944 pyprim = aodprimary->Py();
1945 pzprim = aodprimary->Pz();
1946
1947 if(ptprim < 0.01 || eprim < 0.01) return ;
1948
045396c8 1949 mcparticles= GetReader()->GetAODMCParticles();
547c2f01 1950 for (Int_t i=0; i<nTracks;i++)
1951 {
045396c8 1952 AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(i);
1953 if (!part->IsPhysicalPrimary()) continue;
1954 Int_t pdg = part->GetPdgCode();
1955 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1956 TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());
547c2f01 1957 if(charge != 0)
1958 {
1959 if(part->Pt()> GetReader()->GetCTSPtMin())
1960 {
045396c8 1961 //Particles in CTS acceptance
1962 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
1963 Int_t indexmother=part->GetMother();
1964 if(indexmother>-1)
1965 {
1966 Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
1967 if(TMath::Abs(pdg) == 11 && mPdg == 22) continue;
1968 }
547c2f01 1969
66e64043 1970 if(inCTS)
045396c8 1971 {
66e64043 1972 mcTrackPt =part->Pt();
1973 mcTrackPhi =part->Phi();
1974 mcTrackEta =part->Eta();
1975 mcTrackPx =part->Px();
1976 mcTrackPy =part->Py();
1977 mcTrackPz =part->Pz();
1978 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1979
045396c8 1980 //Select only hadrons in pt range
1981 if(mcTrackPt < GetMinPt() || mcTrackPt > GetMaxPt()) continue ;
c5693f62 1982
045396c8 1983 //remove trigger itself for correlation when use charged triggers
c5693f62 1984 if(label==i &&
1985 TMath::Abs(mcTrackPt -ptprim ) < 1e-6 &&
1986 TMath::Abs(mcTrackPhi-phiprim) < 1e-6 &&
1987 TMath::Abs(mcTrackEta-etaprim) < 1e-6) continue ;
1988
045396c8 1989 //jumped out this event if near side associated partile pt larger than trigger
1990 if( mcTrackPt> ptprim && TMath::Abs(mcTrackPhi-phiprim)<TMath::PiOver2())
1991 return ;
1992
66e64043 1993 mcdeltaPhi= phiprim-mcTrackPhi;
1994 if(mcdeltaPhi <= -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1995 if(mcdeltaPhi > 3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1996
3f150b4b 1997 mczT = mcTrackPt/ptprim ;
66e64043 1998 mcxE =-mcTrackPt/ptprim*TMath::Cos(mcdeltaPhi);// -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
3f150b4b 1999 mchbpXE =-100 ;
2000 mchbpZT =-100 ;
2001 if(mcxE > 0 ) mchbpXE = TMath::Log(1./mcxE);
2002 if(mczT > 0 ) mchbpZT = TMath::Log(1./mczT);
2003
045396c8 2004 //Selection within angular range
045396c8 2005 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
2006 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
2007 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
2008 if(GetDebug()>0)
2009 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Charged hadron: track Pt %f, track Phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f, pT min %2.2f \n",
2010 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
fe871b21 2011
045396c8 2012 // Fill Histograms
fe871b21 2013
66e64043 2014 fhMCEtaCharged ->Fill(mcTrackPt,mcTrackEta);
2015 fhMCPhiCharged ->Fill(mcTrackPt,mcTrackPhi);
045396c8 2016 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
2017 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
2018 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
045396c8 2019 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,etaprim-mcTrackEta);
2020
2021 //delta phi cut for correlation
2022 if( (mcdeltaPhi > fDeltaPhiMinCut) && ( mcdeltaPhi < fDeltaPhiMaxCut) ) {
66e64043 2023 fhMCDeltaPhiChargedPt ->Fill(mcTrackPt,mcdeltaPhi);
3f150b4b 2024 fhMCPtXECharged ->Fill(ptprim,mcxE);
2025 fhMCPtHbpXECharged ->Fill(ptprim,mchbpXE);
2026 fhMCPtZTCharged ->Fill(ptprim,mczT);
2027 fhMCPtHbpZTCharged ->Fill(ptprim,mchbpZT);
66e64043 2028 fhMCPtTrigPout ->Fill(ptprim, mcpout) ;
045396c8 2029 }//delta phi cut for correlation
2030
2031 } //tracks after cuts
2032
2033 } //with minimum pt cut
2034 } //only charged particles
2035 } //MC particle loop
2036 } //when the leading particles could trace back to MC
2037 }// AOD MC
e09cf5ef 2038}
045396c8 2039
05d0d05d 2040//_____________________________________________________________________
2041void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
2042{
2043
2044 //Print some relevant parameters set for the analysis
2045 if(! opt)
2046 return;
2047
2048 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
745913ae 2049 AliAnaCaloTrackCorrBaseClass::Print(" ");
66e64043 2050 printf("Pt trigger > %3.2f\n", fMinTriggerPt) ;
2051 printf("Pt associated hadron < %3.2f\n", fMaxAssocPt) ;
2052 printf("Pt associated hadron > %3.2f\n", fMinAssocPt) ;
2053 printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
2054 printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
2055 printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ;
2056 printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ;
2057 printf("Isolated Trigger? %d\n" , fSelectIsolated) ;
2058 printf("Several UE? %d\n" , fMakeSeveralUE) ;
2059 printf("Name of AOD Pi0 Branch %s \n", fPi0AODBranchName.Data());
05d0d05d 2060 printf("Do Decay-hadron correlation ? %d\n", fPi0Trigger) ;
3f150b4b 2061 printf("Select absolute leading for cluster triggers ? %d or Near Side %d\n",
2062 fMakeAbsoluteLeading, fMakeNearSideLeading) ;
05d0d05d 2063 printf("Trigger pt bins %d\n", fNAssocPtBins) ;
2064 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
2065 printf("\t bin %d = [%2.1f,%2.1f]\n", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
2066 }
2067
2068}
2069
2070//____________________________________________________________
2071void AliAnaParticleHadronCorrelation::SetNAssocPtBins(Int_t n)
045396c8 2072{
2073 // Set number of bins
e09cf5ef 2074
05d0d05d 2075 fNAssocPtBins = n ;
2076
2077
045396c8 2078 if(n < 10 && n > 0)
2079 {
05d0d05d 2080 fNAssocPtBins = n ;
045396c8 2081 }
2082 else
2083 {
2084 printf("n = larger than 9 or too small, set to 9 \n");
05d0d05d 2085 fNAssocPtBins = 9;
045396c8 2086 }
2087}
e09cf5ef 2088
05d0d05d 2089//______________________________________________________________________________
2090void AliAnaParticleHadronCorrelation::SetAssocPtBinLimit(Int_t ibin, Float_t pt)
045396c8 2091{
2092 // Set the list of limits for the trigger pt bins
2093
05d0d05d 2094 if(ibin <= fNAssocPtBins || ibin >= 0)
045396c8 2095 {
05d0d05d 2096 fAssocPtBinLimit[ibin] = pt ;
045396c8 2097 }
2098 else {
05d0d05d 2099 printf("AliAnaParticleHadronCorrelation::SetAssocPtBinLimit() - bin number too large %d > %d or small, nothing done\n", ibin, fNAssocPtBins) ;
045396c8 2100
2101 }
2102}
2103