New reference run for SPD
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / 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 **************************************************************************/
15/* $Id: $ */
16
17//_________________________________________________________________________
18// Class for the analysis of particle - hadron correlations
19// Particle (for example direct gamma) must be found in a previous analysis
20//-- Author: Gustavo Conesa (LNF-INFN)
21
22// Modified by Yaxian Mao:
23// 1. add the UE subtraction for corrlation study
24// 2. change the correlation variable
25// 3. Only use leading particle(cluster/track) as trigger for correlation (2010/07/02)
26// 4. Make decay photon-hadron correlations where decay contribute pi0 mass (2010/09/09)
27// 5. fill the pout to extract kt at the end, also to study charge asymmetry(2010/10/06)
045396c8 28// 6. Add the possibility for event selection analysis based on vertex and multiplicity bins (10/10/2010)
29// 7. change the way of delta phi cut for UE study due to memory issue (reduce histograms)
30// 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 31//////////////////////////////////////////////////////////////////////////////
32
33
34// --- ROOT system ---
35//#include "TClonesArray.h"
36#include "TClass.h"
37#include "TMath.h"
38#include "TH3D.h"
045396c8 39#include "TDatabasePDG.h"
e09cf5ef 40
41//---- ANALYSIS system ----
42#include "AliNeutralMesonSelection.h"
43#include "AliAnaParticleHadronCorrelation.h"
44#include "AliCaloTrackReader.h"
45#include "AliCaloPID.h"
46#include "AliAODPWG4ParticleCorrelation.h"
47#include "AliFiducialCut.h"
48#include "AliVTrack.h"
49#include "AliVCluster.h"
50#include "AliMCAnalysisUtils.h"
51#include "TParticle.h"
52#include "AliStack.h"
53#include "AliAODMCParticle.h"
54#include "AliMixedEvent.h"
55
56ClassImp(AliAnaParticleHadronCorrelation)
57
58
05d0d05d 59//___________________________________________________________________
e09cf5ef 60 AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation():
61 AliAnaPartCorrBaseClass(),
05d0d05d 62 fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
63 fSelectIsolated(0), fMakeSeveralUE(0),
64 fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.),
65 fPi0AODBranchName(""), fNeutralCorr(0),
66 fPi0Trigger(0), fMakeAbsoluteLeading(0),
67 fLeadingTriggerIndex(-1),
68 fNAssocPtBins(0), fAssocPtBinLimit(),
69 //Histograms
70 fhPtLeading(0), fhPhiLeading(0),
71 fhEtaLeading(0), fhDeltaPhiDeltaEtaCharged(0),
72 fhPhiCharged(0), fhEtaCharged(0),
73 fhDeltaPhiCharged(0), fhDeltaEtaCharged(0),
74 fhDeltaPhiChargedPt(0), fhDeltaPhiUeChargedPt(0),
75 fhPtImbalanceCharged(0), fhPtImbalanceUeCharged(0),
76 fhPtImbalancePosCharged(0), fhPtImbalanceNegCharged(0),
77 fhPtHbpCharged(0), fhPtHbpUeCharged(0),
78 fhDeltaPhiUeLeftCharged(0), fhDeltaPhiUeRightCharged(0),
79 fhPtImbalanceUeLeftCharged(0), fhPtImbalanceUeRightCharged(0),
80 fhPtHbpUeLeftCharged(0), fhPtHbpUeRightCharged(0),
81 fhPtTrigPout(0), fhPtTrigCharged(0),
82 fhTrigDeltaPhiCharged(0x0), fhTrigDeltaEtaCharged(0x0),
83 fhTrigCorr(0x0), fhTrigUeCorr(0x0),
84 fhAssocPt(0), fhAssocPtBkg(0),
85 fhDeltaPhiAssocPtBin(0), fhDeltaPhiBradAssocPtBin(0),
86 fhXEAssocPtBin(0),
e09cf5ef 87 fhDeltaPhiDeltaEtaNeutral(0),
05d0d05d 88 fhPhiNeutral(0), fhEtaNeutral(0),
89 fhDeltaPhiNeutral(0), fhDeltaEtaNeutral(0),
90 fhDeltaPhiNeutralPt(0), fhDeltaPhiUeNeutralPt(0),
91 fhPtImbalanceNeutral(0), fhPtImbalanceUeNeutral(0),
92 fhPtHbpNeutral(0), fhPtHbpUeNeutral(0),
93 fhDeltaPhiUeLeftNeutral(0), fhDeltaPhiUeRightNeutral(0),
94 fhPtImbalanceUeLeftNeutral(0), fhPtImbalanceUeRightNeutral(0),
95 fhPtHbpUeLeftNeutral(0), fhPtHbpUeRightNeutral(0),
e09cf5ef 96 fhPtPi0DecayRatio(0),
05d0d05d 97 fhDeltaPhiDecayCharged(0), fhPtImbalanceDecayCharged(0),
98 fhDeltaPhiDecayNeutral(0), fhPtImbalanceDecayNeutral(0),
045396c8 99 fh2phiLeadingParticle(0x0),
100 fhMCLeadingCount(0),
05d0d05d 101 fhMCEtaCharged(0), fhMCPhiCharged(0),
102 fhMCDeltaEtaCharged(0), fhMCDeltaPhiCharged(0x0),
103 fhMCDeltaPhiDeltaEtaCharged(0), fhMCDeltaPhiChargedPt(0),
045396c8 104 fhMCPtImbalanceCharged(0),
105 fhMCPtHbpCharged(0),
106 fhMCPtTrigPout(0),
107 fhMCPtAssocDeltaPhi(0)
e09cf5ef 108{
109 //Default Ctor
110
111 //Initialize parameters
112 InitParameters();
113}
114
05d0d05d 115//____________________________________________________________
116TObjString* AliAnaParticleHadronCorrelation::GetAnalysisCuts()
117{
118 //Save parameters used for analysis
119 TString parList ; //this will be list of parameters used for this analysis.
120 const Int_t buffersize = 560;
121 char onePar[buffersize] ;
122
123 snprintf(onePar,buffersize,"--- AliAnaPaticleHadronCorrelation ---\n") ;
124 parList+=onePar ;
125 snprintf(onePar,buffersize,"Phi trigger particle-Hadron < %3.2f ", fDeltaPhiMaxCut) ;
126 parList+=onePar ;
127 snprintf(onePar,buffersize,"Phi trigger particle-Hadron > %3.2f ", fDeltaPhiMinCut) ;
128 parList+=onePar ;
129 snprintf(onePar,buffersize,"Isolated Trigger? %d\n", fSelectIsolated) ;
130 parList+=onePar ;
131 snprintf(onePar,buffersize,"Phi trigger particle-UeHadron < %3.2f ", fUeDeltaPhiMaxCut) ;
132 parList+=onePar ;
133 snprintf(onePar,buffersize,"Phi trigger particle-UeHadron > %3.2f ", fUeDeltaPhiMinCut) ;
134 parList+=onePar ;
135 snprintf(onePar,buffersize,"Several UE? %d\n", fMakeSeveralUE) ;
136 parList+=onePar ;
137 snprintf(onePar,buffersize,"Name of AOD Pi0 Branch %s ",fPi0AODBranchName.Data());
138 parList+=onePar ;
139 snprintf(onePar,buffersize,"Do Decay-hadron correlation ? %d", fPi0Trigger) ;
140 parList+=onePar ;
141 snprintf(onePar,buffersize,"Select absolute leading for cluster triggers ? %d\n", fMakeAbsoluteLeading) ;
142 parList+=onePar ;
143 snprintf(onePar,buffersize,"Associated particle pt bins %d: ", fNAssocPtBins) ;
144 parList+=onePar ;
145 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
146 snprintf(onePar,buffersize,"bin %d = [%2.1f,%2.1f];", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
147 }
148 parList+=onePar ;
149
150 //Get parameters set in base class.
151 parList += GetBaseParametersList() ;
152
153 //Get parameters set in PID class.
154 //parList += GetCaloPID()->GetPIDParametersList() ;
155
156 //Get parameters set in FiducialCut class (not available yet)
157 //parlist += GetFidCut()->GetFidCutParametersList()
158
159 return new TObjString(parList) ;
160
161}
162
163//________________________________________________________________
e09cf5ef 164TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
165{
166
167 // Create histograms to be saved in output file and
168 // store them in fOutputContainer
169 TList * outputContainer = new TList() ;
170 outputContainer->SetName("CorrelationHistos") ;
171
05d0d05d 172 Int_t nptbins = GetHistoPtBins(); Int_t nphibins = GetHistoPhiBins(); Int_t netabins = GetHistoEtaBins();
173 Float_t ptmax = GetHistoPtMax(); Float_t phimax = GetHistoPhiMax(); Float_t etamax = GetHistoEtaMax();
174 Float_t ptmin = GetHistoPtMin(); Float_t phimin = GetHistoPhiMin(); Float_t etamin = GetHistoEtaMin();
e09cf5ef 175
e09cf5ef 176 fhPtLeading = new TH1F ("hPtLeading","p_T distribution of leading particles", nptbins,ptmin,ptmax);
177 fhPtLeading->SetXTitle("p_{T}^{trig} (GeV/c)");
178
179 fhPhiLeading = new TH2F ("hPhiLeading","#phi distribution of leading Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
180 fhPhiLeading->SetYTitle("#phi (rad)");
181
182 fhEtaLeading = new TH2F ("hEtaLeading","#eta distribution of leading",nptbins,ptmin,ptmax, netabins,etamin,etamax);
183 fhEtaLeading->SetYTitle("#eta ");
045396c8 184
e09cf5ef 185 outputContainer->Add(fhPtLeading);
186 outputContainer->Add(fhPhiLeading);
187 outputContainer->Add(fhEtaLeading);
188
189 //Correlation with charged hadrons
190 if(GetReader()->IsCTSSwitchedOn()) {
191 fhDeltaPhiDeltaEtaCharged = new TH2F
192 ("DeltaPhiDeltaEtaCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
193 140,-2.,5.,200,-2,2);
194 fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
195 fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
196
197 fhPhiCharged = new TH2F
198 ("PhiCharged","#phi_{h^{#pm}} vs p_{T #pm}",
199 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
200 fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
201 fhPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
202
203 fhEtaCharged = new TH2F
204 ("EtaCharged","#eta_{h^{#pm}} vs p_{T #pm}",
205 nptbins,ptmin,ptmax,netabins,etamin,etamax);
206 fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
207 fhEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
208
209 fhDeltaPhiCharged = new TH2F
210 ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
211 nptbins,ptmin,ptmax,140,-2.,5.);
212 fhDeltaPhiCharged->SetYTitle("#Delta #phi");
213 fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
214
215 fhDeltaPhiChargedPt = new TH2F
216 ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
217 nptbins,ptmin,ptmax,140,-2.,5.);
218 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
219 fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
220
221 fhDeltaPhiUeChargedPt = new TH2F
222 ("DeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
223 nptbins,ptmin,ptmax,140,-2.,5.);
224 fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi");
225 fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
226
227 fhDeltaEtaCharged = new TH2F
228 ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
229 nptbins,ptmin,ptmax,200,-2,2);
230 fhDeltaEtaCharged->SetYTitle("#Delta #eta");
231 fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
232
233 fhPtImbalanceCharged =
234 new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
235 nptbins,ptmin,ptmax,200,0.,2.);
236 fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
237 fhPtImbalanceCharged->SetXTitle("p_{T trigger}");
238
239 fhPtImbalanceUeCharged =
240 new TH2F("CorrelationUeCharged","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger}",
241 nptbins,ptmin,ptmax,200,0.,2.);
242 fhPtImbalanceUeCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
243 fhPtImbalanceUeCharged->SetXTitle("p_{T trigger}");
244
245 fhPtImbalancePosCharged =
246 new TH2F("CorrelationPositiveCharged","z_{trigger h^{+}} = p_{T h^{+}} / p_{T trigger}",
247 nptbins,ptmin,ptmax,200,0.,2.);
248 fhPtImbalancePosCharged->SetYTitle("z_{trigger h^{+}}");
249 fhPtImbalancePosCharged->SetXTitle("p_{T trigger}");
250
251 fhPtImbalanceNegCharged =
252 new TH2F("CorrelationNegativeCharged","z_{trigger h^{-}} = p_{T h^{-}} / p_{T trigger}",
253 nptbins,ptmin,ptmax,200,0.,2.);
254 fhPtImbalanceNegCharged->SetYTitle("z_{trigger h^{-}}");
255 fhPtImbalanceNegCharged->SetXTitle("p_{T trigger}");
256
257 fhPtHbpCharged =
258 new TH2F("HbpCharged","#xi = ln(1/x_{E}) with charged hadrons",
259 nptbins,ptmin,ptmax,200,0.,10.);
260 fhPtHbpCharged->SetYTitle("ln(1/x_{E})");
261 fhPtHbpCharged->SetXTitle("p_{T trigger}");
262
263 fhPtHbpUeCharged =
264 new TH2F("HbpUeCharged","#xi = ln(1/x_{E}) with charged hadrons",
265 nptbins,ptmin,ptmax,200,0.,10.);
266 fhPtHbpUeCharged->SetYTitle("ln(1/x_{E})");
267 fhPtHbpUeCharged->SetXTitle("p_{T trigger}");
268
269 fhPtTrigPout =
270 new TH2F("PtTrigPout","Pout with triggers",
271 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
272 fhPtTrigPout->SetYTitle("p_{out} (GeV/c)");
273 fhPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
274
e09cf5ef 275 fhPtTrigCharged =
276 new TH2F("PtTrigCharged","trgger and charged tracks pt distribution",
277 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
278 fhPtTrigCharged->SetYTitle("p_{T h^{#pm}} (GeV/c)");
279 fhPtTrigCharged->SetXTitle("p_{T trigger} (GeV/c)");
280
281 outputContainer->Add(fhDeltaPhiDeltaEtaCharged);
282 outputContainer->Add(fhPhiCharged) ;
283 outputContainer->Add(fhEtaCharged) ;
284 outputContainer->Add(fhDeltaPhiCharged) ;
285 outputContainer->Add(fhDeltaEtaCharged) ;
286 outputContainer->Add(fhDeltaPhiChargedPt) ;
287 outputContainer->Add(fhDeltaPhiUeChargedPt) ;
288 outputContainer->Add(fhPtImbalanceCharged) ;
289 outputContainer->Add(fhPtImbalancePosCharged) ;
290 outputContainer->Add(fhPtImbalanceNegCharged) ;
291 outputContainer->Add(fhPtImbalanceUeCharged) ;
292 outputContainer->Add(fhPtHbpCharged) ;
293 outputContainer->Add(fhPtHbpUeCharged) ;
294 outputContainer->Add(fhPtTrigPout) ;
e09cf5ef 295 outputContainer->Add(fhPtTrigCharged) ;
296
297 if(DoEventSelect()){
298 Int_t nMultiBins = GetMultiBin();
299 fhTrigDeltaPhiCharged = new TH2F*[nMultiBins] ;
300 fhTrigDeltaEtaCharged = new TH2F*[nMultiBins] ;
05d0d05d 301 fhTrigCorr = new TH2F*[nMultiBins];
302 fhTrigUeCorr = new TH2F*[nMultiBins];
e09cf5ef 303 for(Int_t im=0; im<nMultiBins; im++){
304 fhTrigDeltaPhiCharged[im] = new TH2F
305 (Form("fhTrigDeltaPhiCharged_%d",im),Form("fhTrigDeltaPhiCharged_%d",im), nptbins,ptmin,ptmax, 140,-2.,5.);
306 fhTrigDeltaPhiCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
307 fhTrigDeltaPhiCharged[im]->SetYTitle("#Delta #phi");
308 fhTrigDeltaEtaCharged[im] = new TH2F
309 (Form("fhTrigDeltaEtaCharged_%d",im),Form("fhTrigDeltaEtaCharged_%d",im), nptbins,ptmin,ptmax, 200,-2,2);
310 fhTrigDeltaEtaCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
311 fhTrigDeltaEtaCharged[im]->SetYTitle("#Delta #eta");
312 fhTrigCorr[im] = new TH2F
313 (Form("fhTrigPtCorr_%d",im),Form("fhTrigPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
314 fhTrigCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
315 fhTrigCorr[im]->SetXTitle("p_{T trigger}");
316 fhTrigUeCorr[im] = new TH2F
317 (Form("fhTrigPtUeCorr_%d",im),Form("fhTrigPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
318 fhTrigUeCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
319 fhTrigUeCorr[im]->SetXTitle("p_{T trigger}");
045396c8 320
e09cf5ef 321 outputContainer->Add(fhTrigDeltaPhiCharged[im]) ;
322 outputContainer->Add(fhTrigDeltaEtaCharged[im]) ;
323 outputContainer->Add(fhTrigCorr[im]);
324 outputContainer->Add(fhTrigUeCorr[im]);
325
045396c8 326 }
327 }
328
05d0d05d 329 fhAssocPt = new TH2F("fhAssocPt", " Trigger p_{T} vs associated hadron p_{T}",
330 nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
331 fhAssocPt->SetXTitle("p_{T trigger}");
332 fhAssocPt->SetYTitle("p_{T associated}");
333 outputContainer->Add(fhAssocPt) ;
334
335 fhAssocPtBkg = new TH2F("fhAssocPtBkg", " Trigger p_{T} vs associated hadron p_{T} from background",
336 nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
337 fhAssocPtBkg->SetXTitle("p_{T trigger}");
338 fhAssocPtBkg->SetYTitle("p_{T associated}");
339 outputContainer->Add(fhAssocPtBkg) ;
340
341 fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins] ;
342 fhDeltaPhiBradAssocPtBin = new TH2F*[fNAssocPtBins] ;
343 fhXEAssocPtBin = new TH2F*[fNAssocPtBins] ;
344 for(Int_t i = 0 ; i < fNAssocPtBins ; i++){
345 fhDeltaPhiAssocPtBin[i] = new TH2F(Form("fhDeltaPhiPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
346 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
347 nptbins, ptmin, ptmax,140,-2.,5.);
348 fhDeltaPhiAssocPtBin[i]->SetXTitle("p_{T trigger}");
349 fhDeltaPhiAssocPtBin[i]->SetYTitle("#Delta #phi");
350
351 fhDeltaPhiBradAssocPtBin[i] = new TH2F(Form("fhDeltaPhiBradPtAssocPt%2.1f_%2.1f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
352 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]),
353 nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
354 fhDeltaPhiBradAssocPtBin[i]->SetXTitle("p_{T trigger}");
355 fhDeltaPhiBradAssocPtBin[i]->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
356
357
358 fhXEAssocPtBin[i] = new TH2F(Form("fhXEAssocPtBin%1.f_%1.f", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
359 Form("x_[E] vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1]),
360 nptbins, ptmin, ptmax,50, 0.0, 2.0);
361 fhXEAssocPtBin[i]->SetXTitle("p_{T trigger}");
362 fhXEAssocPtBin[i]->SetYTitle("x_{E}");
363
364 outputContainer->Add(fhDeltaPhiAssocPtBin[i]) ;
365 outputContainer->Add(fhDeltaPhiBradAssocPtBin[i]) ;
366 outputContainer->Add(fhXEAssocPtBin[i]);
e09cf5ef 367 }
045396c8 368
e09cf5ef 369 if(fPi0Trigger){
370 fhPtPi0DecayRatio = new TH2F
371 ("hPtPi0DecayRatio","p_T of #pi^{0} and the ratio of pt for two decay",
372 nptbins,ptmin,ptmax, 100,0.,2.);
373 fhPtPi0DecayRatio->SetXTitle("p_{T}^{#pi^{0}} (GeV/c)");
374 fhPtPi0DecayRatio->SetYTitle("p_{T}^{Decay}/p_{T}^{#pi^{0}}");
375
376 fhDeltaPhiDecayCharged = new TH2F
377 ("DeltaPhiDecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}",
378 nptbins,ptmin,ptmax,140,-2.,5.);
379 fhDeltaPhiDecayCharged->SetYTitle("#Delta #phi");
380 fhDeltaPhiDecayCharged->SetXTitle("p_{T Decay} (GeV/c)");
381
382 fhPtImbalanceDecayCharged =
383 new TH2F("CorrelationDecayCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}",
384 nptbins,ptmin,ptmax,200,0.,2.);
385 fhPtImbalanceDecayCharged->SetYTitle("z_{decay h^{#pm}}");
386 fhPtImbalanceDecayCharged->SetXTitle("p_{T decay}");
387
388 outputContainer->Add(fhPtPi0DecayRatio) ;
389 outputContainer->Add(fhDeltaPhiDecayCharged) ;
390 outputContainer->Add(fhPtImbalanceDecayCharged) ;
391 }
392
393
394 if(fMakeSeveralUE){
395 fhDeltaPhiUeLeftCharged = new TH2F
396 ("DeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
397 nptbins,ptmin,ptmax,140,-2.,5.);
398 fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi");
399 fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
400 outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
401
402 fhDeltaPhiUeRightCharged = new TH2F
403 ("DeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
404 nptbins,ptmin,ptmax,140,-2.,5.);
405 fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi");
406 fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
407 outputContainer->Add(fhDeltaPhiUeRightCharged) ;
408
409 fhPtImbalanceUeLeftCharged =
410 new TH2F("CorrelationUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
411 nptbins,ptmin,ptmax,200,0.,2.);
412 fhPtImbalanceUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
413 fhPtImbalanceUeLeftCharged->SetXTitle("p_{T trigger}");
414 outputContainer->Add(fhPtImbalanceUeLeftCharged) ;
415
416 fhPtImbalanceUeRightCharged =
417 new TH2F("CorrelationUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
418 nptbins,ptmin,ptmax,200,0.,2.);
419 fhPtImbalanceUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
420 fhPtImbalanceUeRightCharged->SetXTitle("p_{T trigger}");
421 outputContainer->Add(fhPtImbalanceUeRightCharged) ;
422
423 fhPtHbpUeLeftCharged =
424 new TH2F("HbpUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger",
425 nptbins,ptmin,ptmax,200,0.,10.);
426 fhPtHbpUeLeftCharged->SetYTitle("ln(1/x_{E})");
427 fhPtHbpUeLeftCharged->SetXTitle("p_{T trigger}");
428 outputContainer->Add(fhPtHbpUeLeftCharged) ;
429
430 fhPtHbpUeRightCharged =
431 new TH2F("HbpUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger",
432 nptbins,ptmin,ptmax,200,0.,10.);
433 fhPtHbpUeRightCharged->SetYTitle("ln(1/x_{E})");
434 fhPtHbpUeRightCharged->SetXTitle("p_{T trigger}");
435 outputContainer->Add(fhPtHbpUeRightCharged) ;
436
437 }
438 } //Correlation with charged hadrons
439
440 //Correlation with neutral hadrons
441 if(fNeutralCorr){
442
443 fhDeltaPhiDeltaEtaNeutral = new TH2F
444 ("DeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
445 140,-2.,5.,200,-2,2);
446 fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi");
447 fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta");
448
449 fhPhiNeutral = new TH2F
450 ("PhiNeutral","#phi_{#pi^{0}} vs p_{T #pi^{0}}",
451 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
452 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
453 fhPhiNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
454
455 fhEtaNeutral = new TH2F
456 ("EtaNeutral","#eta_{#pi^{0}} vs p_{T #pi^{0}}",
457 nptbins,ptmin,ptmax,netabins,etamin,etamax);
458 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
459 fhEtaNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
460
461 fhDeltaPhiNeutral = new TH2F
462 ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
463 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
464 fhDeltaPhiNeutral->SetYTitle("#Delta #phi");
465 fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
466
467 fhDeltaPhiNeutralPt = new TH2F
468 ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
469 nptbins,ptmin,ptmax,140,-2.,5.);
470 fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi");
471 fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
472
473 fhDeltaPhiUeNeutralPt = new TH2F
474 ("DeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
475 nptbins,ptmin,ptmax,140,-2.,5.);
476 fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi");
477 fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
478
479 fhDeltaEtaNeutral = new TH2F
480 ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
481 nptbins,ptmin,ptmax,200,-2,2);
482 fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
483 fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
484
485 fhPtImbalanceNeutral =
486 new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
487 nptbins,ptmin,ptmax,200,0.,2.);
488 fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}");
489 fhPtImbalanceNeutral->SetXTitle("p_{T trigger}");
490
491 fhPtImbalanceUeNeutral =
492 new TH2F("CorrelationUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
493 nptbins,ptmin,ptmax,200,0.,2.);
494 fhPtImbalanceUeNeutral->SetYTitle("z_{trigger #pi^{0}}");
495 fhPtImbalanceUeNeutral->SetXTitle("p_{T trigger}");
496
497 fhPtHbpNeutral =
498 new TH2F("HbpNeutral","#xi = ln(1/x_{E}) with neutral particles",
499 nptbins,ptmin,ptmax,200,0.,10.);
500 fhPtHbpNeutral->SetYTitle("ln(1/x_{E})");
501 fhPtHbpNeutral->SetXTitle("p_{T trigger}");
502
503 fhPtHbpUeNeutral =
504 new TH2F("HbpUeNeutral","#xi = ln(1/x_{E}) with neutral particles",
505 nptbins,ptmin,ptmax,200,0.,10.);
506 fhPtHbpUeNeutral->SetYTitle("ln(1/x_{E})");
507 fhPtHbpUeNeutral->SetXTitle("p_{T trigger}");
508
509
510 outputContainer->Add(fhDeltaPhiDeltaEtaNeutral);
511 outputContainer->Add(fhPhiNeutral) ;
512 outputContainer->Add(fhEtaNeutral) ;
513 outputContainer->Add(fhDeltaPhiNeutral) ;
514 outputContainer->Add(fhDeltaPhiNeutralPt) ;
515 outputContainer->Add(fhDeltaPhiUeNeutralPt) ;
516 outputContainer->Add(fhDeltaEtaNeutral) ;
517 outputContainer->Add(fhPtImbalanceNeutral) ;
518 outputContainer->Add(fhPtImbalanceUeNeutral) ;
519 outputContainer->Add(fhPtHbpNeutral) ;
520 outputContainer->Add(fhPtHbpUeNeutral) ;
521
522 if(fPi0Trigger){
523 fhDeltaPhiDecayNeutral = new TH2F
524 ("DeltaPhiDecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}",
525 nptbins,ptmin,ptmax,140,-2.,5.);
526 fhDeltaPhiDecayNeutral->SetYTitle("#Delta #phi");
527 fhDeltaPhiDecayNeutral->SetXTitle("p_{T Decay} (GeV/c)");
528
529 fhPtImbalanceDecayNeutral =
530 new TH2F("CorrelationDecayNeutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}",
531 nptbins,ptmin,ptmax,200,0.,2.);
532 fhPtImbalanceDecayNeutral->SetYTitle("z_{decay h^{0}}");
533 fhPtImbalanceDecayNeutral->SetXTitle("p_{T decay}");
534
535 outputContainer->Add(fhDeltaPhiDecayNeutral) ;
536 outputContainer->Add(fhPtImbalanceDecayNeutral) ;
537 }
538
539
540 if(fMakeSeveralUE){
541 fhDeltaPhiUeLeftNeutral = new TH2F
542 ("DeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles",
543 nptbins,ptmin,ptmax,140,-2.,5.);
544 fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi");
545 fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
546 outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
547
548 fhDeltaPhiUeRightNeutral = new TH2F
549 ("DeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles",
550 nptbins,ptmin,ptmax,140,-2.,5.);
551 fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi");
552 fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
553 outputContainer->Add(fhDeltaPhiUeRightNeutral) ;
554
555 fhPtImbalanceUeLeftNeutral =
556 new TH2F("CorrelationUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
557 nptbins,ptmin,ptmax,140,0.,2.);
558 fhPtImbalanceUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
559 fhPtImbalanceUeLeftNeutral->SetXTitle("p_{T trigger}");
560 outputContainer->Add(fhPtImbalanceUeLeftNeutral) ;
561
562 fhPtImbalanceUeRightNeutral =
563 new TH2F("CorrelationUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
564 nptbins,ptmin,ptmax,200,0.,2.);
565 fhPtImbalanceUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
566 fhPtImbalanceUeRightNeutral->SetXTitle("p_{T trigger}");
567 outputContainer->Add(fhPtImbalanceUeRightNeutral) ;
568
569 fhPtHbpUeLeftNeutral =
570 new TH2F("HbpUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger",
571 nptbins,ptmin,ptmax,200,0.,10.);
572 fhPtHbpUeLeftNeutral->SetYTitle("ln(1/x_{E})");
573 fhPtHbpUeLeftNeutral->SetXTitle("p_{T trigger}");
574 outputContainer->Add(fhPtHbpUeLeftNeutral) ;
575
576 fhPtHbpUeRightNeutral =
577 new TH2F("HbpUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger",
578 nptbins,ptmin,ptmax,200,0.,10.);
579 fhPtHbpUeRightNeutral->SetYTitle("ln(1/x_{E})");
580 fhPtHbpUeRightNeutral->SetXTitle("p_{T trigger}");
581 outputContainer->Add(fhPtHbpUeRightNeutral) ;
582
583 }
fe871b21 584
585 }//Correlation with neutral hadrons
586
587 //if data is MC, fill more histograms
588 if(IsDataMC()){
e09cf5ef 589
fe871b21 590 fh2phiLeadingParticle=new TH2F("fh2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
591 fh2phiLeadingParticle->GetXaxis()->SetTitle("p_{T gen Leading} (GeV/c)");
592 fh2phiLeadingParticle->GetYaxis()->SetTitle("(#phi_{rec}-#phi_{gen})/#phi_{gen}");
e09cf5ef 593
fe871b21 594 fhMCLeadingCount=new TH1F("MCLeadingTriggerCount","MCLeadingTriggerCount",nptbins,ptmin,ptmax);
595 fhMCLeadingCount->SetXTitle("p_{T trig}");
596
597 fhMCEtaCharged = new TH2F
598 ("MCEtaCharged","MC #eta_{h^{#pm}} vs p_{T #pm}",
599 nptbins,ptmin,ptmax,netabins,etamin,etamax);
600 fhMCEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
601 fhMCEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
602
603 fhMCPhiCharged = new TH2F
604 ("MCPhiCharged","#MC phi_{h^{#pm}} vs p_{T #pm}",
605 200,ptmin,ptmax,nphibins,phimin,phimax);
606 fhMCPhiCharged->SetYTitle("MC #phi_{h^{#pm}} (rad)");
607 fhMCPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
608
609 fhMCDeltaPhiDeltaEtaCharged = new TH2F
610 ("MCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
611 140,-2.,5.,200,-2,2);
612 fhMCDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
613 fhMCDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
614
615 fhMCDeltaEtaCharged = new TH2F
616 ("MCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
617 nptbins,ptmin,ptmax,200,-2,2);
618 fhMCDeltaEtaCharged->SetYTitle("#Delta #eta");
619 fhMCDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
620
621 fhMCDeltaPhiCharged = new TH2F
622 ("MCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
623 nptbins,ptmin,ptmax,140,-2.,5.);
624 fhMCDeltaPhiCharged->SetYTitle("#Delta #phi");
625 fhMCDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
626
627 fhMCDeltaPhiChargedPt = new TH2F
628 ("MCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
629 nptbins,ptmin,ptmax,140,-2.,5.);
630 fhMCDeltaPhiChargedPt->SetYTitle("#Delta #phi");
631 fhMCDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
632
633 fhMCPtImbalanceCharged =
634 new TH2F("MCCorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
635 nptbins,ptmin,ptmax,200,0.,2.);
636 fhMCPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
637 fhMCPtImbalanceCharged->SetXTitle("p_{T trigger}");
638
639 fhMCPtHbpCharged =
640 new TH2F("MCHbpCharged","MC #xi = ln(1/x_{E}) with charged hadrons",
641 nptbins,ptmin,ptmax,200,0.,10.);
642 fhMCPtHbpCharged->SetYTitle("ln(1/x_{E})");
643 fhMCPtHbpCharged->SetXTitle("p_{T trigger}");
644
645 fhMCPtTrigPout =
646 new TH2F("MCPtTrigPout","AOD MC Pout with triggers",
647 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
648 fhMCPtTrigPout->SetYTitle("p_{out} (GeV/c)");
649 fhMCPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
650
651 fhMCPtAssocDeltaPhi =
652 new TH2F("fhMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
653 nptbins,ptmin,ptmax,140,-2.,5.);
654 fhMCPtAssocDeltaPhi->SetYTitle("#Delta #phi");
655 fhMCPtAssocDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
656
657 outputContainer->Add(fh2phiLeadingParticle);
658 outputContainer->Add(fhMCLeadingCount);
659 outputContainer->Add(fhMCDeltaPhiDeltaEtaCharged);
660 outputContainer->Add(fhMCPhiCharged) ;
661 outputContainer->Add(fhMCEtaCharged) ;
662 outputContainer->Add(fhMCDeltaEtaCharged) ;
663 outputContainer->Add(fhMCDeltaPhiCharged) ;
664
665 outputContainer->Add(fhMCDeltaPhiChargedPt) ;
666 outputContainer->Add(fhMCPtImbalanceCharged) ;
667 outputContainer->Add(fhMCPtHbpCharged) ;
668 outputContainer->Add(fhMCPtTrigPout) ;
669 outputContainer->Add(fhMCPtAssocDeltaPhi) ;
670 } //for MC histogram
671
e09cf5ef 672
673 return outputContainer;
674
675}
676
05d0d05d 677//____________________________________________________
e09cf5ef 678void AliAnaParticleHadronCorrelation::InitParameters()
679{
680
681 //Initialize the parameters of the analysis.
682 SetInputAODName("PWG4Particle");
683 SetAODObjArrayName("Hadrons");
684 AddToHistogramsName("AnaHadronCorr_");
045396c8 685
e09cf5ef 686 SetPtCutRange(0.,300);
045396c8 687 fDeltaPhiMinCut = 1.5 ;
688 fDeltaPhiMaxCut = 4.5 ;
689 fSelectIsolated = kFALSE;
690 fMakeSeveralUE = kFALSE;
691 fUeDeltaPhiMinCut = 1. ;
692 fUeDeltaPhiMaxCut = 1.5 ;
693 fNeutralCorr = kFALSE ;
694 fPi0Trigger = kFALSE ;
695 fMakeAbsoluteLeading = kTRUE;
696
05d0d05d 697 fNAssocPtBins = 7 ;
698 fAssocPtBinLimit[0] = 2. ;
699 fAssocPtBinLimit[1] = 4. ;
700 fAssocPtBinLimit[2] = 6. ;
701 fAssocPtBinLimit[3] = 8. ;
702 fAssocPtBinLimit[4] = 10. ;
703 fAssocPtBinLimit[5] = 13. ;
704 fAssocPtBinLimit[6] = 16. ;
705 fAssocPtBinLimit[7] = 20. ;
706 fAssocPtBinLimit[8] = 100.;
707 fAssocPtBinLimit[9] = 200.;
045396c8 708
e09cf5ef 709}
710
05d0d05d 711//__________________________________________________________
e09cf5ef 712void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
713{
714 //Particle-Hadron Correlation Analysis, fill AODs
715
716 if(!GetInputAODBranch()){
717 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
718 abort();
719 }
720
721 if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){
722 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());
723 abort();
724 }
725
726 if(GetDebug() > 1){
727 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n");
728 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
729 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetCTSTracks()->GetEntriesFast());
730 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetEMCALClusters()->GetEntriesFast());
731 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetPHOSClusters()->GetEntriesFast());
732 }
733
045396c8 734 //Get the vertex and check it is not too large in z
735 Double_t v[3] = {0,0,0}; //vertex ;
736 GetReader()->GetVertex(v);
737 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
738
739 //Loop on stored AOD particles, find leading trigger
740 Double_t ptTrig = GetMinPt() ;
741 fLeadingTriggerIndex = -1 ;
742 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
e09cf5ef 743 for(Int_t iaod = 0; iaod < naod ; iaod++){
744 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
045396c8 745
746 //vertex cut in case of mixing
747 if (GetMixedEvent()) {
748 Int_t evt=-1;
749 Int_t id =-1;
750 if (particle->GetCaloLabel(0) >= 0 ){
751 id=particle->GetCaloLabel(0);
752 if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
753 }
754 else if(particle->GetTrackLabel(0) >= 0 ){
755 id=particle->GetTrackLabel(0);
756 if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
757 }
758 else continue;
759
760 if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut())
761 return ;
e09cf5ef 762 }
045396c8 763
764 // find the leading particles with highest momentum
765 if (particle->Pt() > ptTrig) {
766 ptTrig = particle->Pt() ;
767 fLeadingTriggerIndex = iaod ;
768 }
769 }// finish search of leading trigger particle
e09cf5ef 770
771 //Do correlation with leading particle
045396c8 772 if(fLeadingTriggerIndex >= 0){
e09cf5ef 773
045396c8 774 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
775
776 //check if the particle is isolated or if we want to take the isolation into account
777 if(OnlyIsolated() && !particle->IsIsolated()) return;
778
e09cf5ef 779 //Make correlation with charged hadrons
045396c8 780 Bool_t okcharged = kTRUE;
781 Bool_t okneutral = kTRUE;
e09cf5ef 782 if(GetReader()->IsCTSSwitchedOn() )
045396c8 783 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kFALSE);
e09cf5ef 784
785 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
786 if(fNeutralCorr && pi0list && pi0list->GetEntriesFast() > 0)
045396c8 787 okneutral = MakeNeutralCorrelation(particle, pi0list,kFALSE);
e09cf5ef 788
789 }//Correlate leading
790
791 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n");
792
793}
794
05d0d05d 795//_________________________________________________________________
e09cf5ef 796void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
797{
798 //Particle-Hadron Correlation Analysis, fill histograms
799
800 if(!GetInputAODBranch()){
801 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
802 abort();
803 }
804
805 if(GetDebug() > 1){
806 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
807 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
808 }
809
810 //Get the vertex and check it is not too large in z
811 Double_t v[3] = {0,0,0}; //vertex ;
812 GetReader()->GetVertex(v);
813 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
814
815 //Loop on stored AOD particles, find leading
045396c8 816 Double_t ptTrig = GetMinPt() ;
817 if(fLeadingTriggerIndex < 0){//Search leading if not done before
818 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
819 for(Int_t iaod = 0; iaod < naod ; iaod++){ //loop on input trigger AOD file
820 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
821 //vertex cut in case of mixing
822 if (GetMixedEvent()) {
823 Int_t evt=-1;
824 Int_t id =-1;
825 if (particle->GetCaloLabel(0) >= 0 ){
826 id=particle->GetCaloLabel(0);
827 if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
828 }
829 else if(particle->GetTrackLabel(0) >= 0 ){
830 id=particle->GetTrackLabel(0);
831 if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
832 }
833 else continue;
834
835 if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut())
836 return ;
e09cf5ef 837 }
05d0d05d 838
045396c8 839 //check if the particle is isolated or if we want to take the isolation into account
840 if(OnlyIsolated() && !particle->IsIsolated()) continue;
e09cf5ef 841
045396c8 842 //check if inside the vertex cut
843 //find the leading particles with highest momentum
844 if (particle->Pt() > ptTrig) {
845 ptTrig = particle->Pt() ;
846 fLeadingTriggerIndex = iaod ;
e09cf5ef 847 }
045396c8 848 }//finish search of leading trigger particle
849 }//Search leading if not done before
850
851 if(fLeadingTriggerIndex >= 0 ){ //using trigger particle to do correlations
852 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
853
854 //check if the particle is isolated or if we want to take the isolation into account
855 if(OnlyIsolated() && !particle->IsIsolated()) return;
e09cf5ef 856
857 //Make correlation with charged hadrons
045396c8 858 Bool_t okcharged = kTRUE;
859 Bool_t okneutral = kTRUE;
860 if(GetReader()->IsCTSSwitchedOn() ){
861 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kTRUE);
a5f1e836 862 if(IsDataMC()){
045396c8 863 MakeMCChargedCorrelation(particle);
864 }
a5f1e836 865 }
866
e09cf5ef 867 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
a5f1e836 868 if(fNeutralCorr && pi0list){
869 if(pi0list->GetEntriesFast() > 0)
870 okneutral = MakeNeutralCorrelation(particle, pi0list,kTRUE);
871 }
e09cf5ef 872
045396c8 873 // Fill leading particle histogram if correlation went well and
874 // no problem was found, like not absolute leading, or bad vertex in mixing.
875 if(okcharged && okneutral){
876 fhPtLeading->Fill(particle->Pt());
877 Float_t phi = particle->Phi();
878 if(phi<0)phi+=TMath::TwoPi();
879 fhPhiLeading->Fill(particle->Pt(), phi);
880 fhEtaLeading->Fill(particle->Pt(), particle->Eta());
881 }//ok charged && neutral
e09cf5ef 882 }//Aod branch loop
883
045396c8 884 //Reinit for next event
885 fLeadingTriggerIndex = -1;
e09cf5ef 886
045396c8 887 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n");
e09cf5ef 888}
889
c5693f62 890//___________________________________________________________________________________________________________
045396c8 891Bool_t AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle,
c5693f62 892 const TObjArray* pl, const Bool_t bFillHisto)
e09cf5ef 893{
894 // Charged Hadron Correlation Analysis
895 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n");
896
045396c8 897 Int_t evtIndex11 = -1 ; //cluster trigger or pi0 trigger
898 Int_t evtIndex12 = -1 ; // pi0 trigger
899 Int_t evtIndex13 = -1 ; // charged trigger
e09cf5ef 900 Int_t indexPhoton1 = -1 ;
901 Int_t indexPhoton2 = -1 ;
045396c8 902
903 Double_t v[3] = {0,0,0}; //vertex ;
e09cf5ef 904 GetReader()->GetVertex(v);
e09cf5ef 905
906 if (GetMixedEvent()) {
907 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
908 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
909 evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
910 }
911
e09cf5ef 912 Double_t phiTrig = aodParticle->Phi();
045396c8 913 Double_t etaTrig = aodParticle->Eta();
914 Double_t ptTrig = aodParticle->Pt();
045396c8 915
916 Double_t pt = -100. ;
917 Double_t px = -100. ;
918 Double_t py = -100. ;
919 Double_t rat = -100. ;
920 Double_t xE = -100. ;
921 Double_t cosi = -100. ;
922 Double_t phi = -100. ;
923 Double_t eta = -100. ;
924 Double_t pout = -100. ;
e09cf5ef 925
045396c8 926 Double_t ptDecay1 = 0. ;
927 Double_t pxDecay1 = 0. ;
928 Double_t pyDecay1 = 0. ;
929 Double_t phiDecay1 = 0. ;
930 Double_t ptDecay2 = 0. ;
931 Double_t pxDecay2 = 0. ;
932 Double_t pyDecay2 = 0. ;
933 Double_t phiDecay2 = 0. ;
934
935 Double_t ratDecay1 = -100. ;
936 Double_t ratDecay2 = -100. ;
937 Double_t deltaPhi = -100. ;
938 Double_t deltaPhiOrg = -100. ;
939 Double_t deltaPhiDecay1 = -100. ;
940 Double_t deltaPhiDecay2 = -100. ;
941
942 TVector3 p3;
e09cf5ef 943 TLorentzVector photonMom ;
045396c8 944 TObjArray * clusters = 0x0 ;
945 TObjArray * reftracks = 0x0;
946 Int_t nrefs = 0;
947 Int_t nTracks = GetCTSTracks()->GetEntriesFast() ;
e09cf5ef 948
949 if(fPi0Trigger){
950 indexPhoton1 = aodParticle->GetCaloLabel (0);
951 indexPhoton2 = aodParticle->GetCaloLabel (1);
952 if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
953
954 if(indexPhoton1!=-1 && indexPhoton2!=-1){
955 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
045396c8 956 else clusters = GetPHOSClusters() ;
e09cf5ef 957 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
958 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
959 photon->GetMomentum(photonMom,GetVertex(0)) ;
960 if(photon->GetID()==indexPhoton1) {
961 ptDecay1 = photonMom.Pt();
962 pxDecay1 = photonMom.Px();
963 pyDecay1 = photonMom.Py();
964 phiDecay1 = photonMom.Phi();
965 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig);
966 }
967 if(photon->GetID()==indexPhoton2) {
968 ptDecay2 = photonMom.Pt();
969 pxDecay2 = photonMom.Px();
970 pyDecay2 = photonMom.Py();
971 phiDecay2 = photonMom.Phi();
972 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay2/ptTrig);
973 }
974 if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
975 } //cluster loop
976 } //index of decay photons found
e09cf5ef 977 } //make decay-hadron correlation
978
979 //Track loop, select tracks with good pt, phi and fill AODs or histograms
e09cf5ef 980 for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ ){
981 AliVTrack * track = (AliVTrack *) (pl->At(ipr)) ;
045396c8 982
e09cf5ef 983 Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
984 p3.SetXYZ(mom[0],mom[1],mom[2]);
985 pt = p3.Pt();
986 px = p3.Px();
987 py = p3.Py();
988 eta = p3.Eta();
989 phi = p3.Phi() ;
990 if(phi < 0) phi+=TMath::TwoPi();
045396c8 991
e09cf5ef 992 //Select only hadrons in pt range
993 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
994 //remove trigger itself for correlation when use charged triggers
995 if( track->GetID() == aodParticle->GetTrackLabel(0) || track->GetID() == aodParticle->GetTrackLabel(1) ||
045396c8 996 track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3) )
997 continue ;
998
e09cf5ef 999 if(IsFiducialCutOn()){
1000 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ;
1001 if(! in ) continue ;
1002 }
045396c8 1003
1004 //jump out this event if near side associated particle pt larger than trigger
1005 if (fMakeAbsoluteLeading){
1006 if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2()) return kFALSE;
1007 }
1008
1009 //Only for mixed event
1010 Int_t evtIndex2 = 0 ;
1011 if (GetMixedEvent()) {
1012 evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
1013 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
1014 continue ;
1015 //vertex cut
1016 if (TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut())
1017 return kFALSE;
1018 }
1019
1020 if(fPi0Trigger){
e09cf5ef 1021 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1022 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1023 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1024 deltaPhiDecay1 = phiDecay1-phi;
1025 deltaPhiDecay2 = phiDecay2-phi;
1026 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1027 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1028 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1029 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
e09cf5ef 1030 }
1031 } //do decay-hadron correlation
045396c8 1032
e09cf5ef 1033 //Selection within angular range
045396c8 1034 deltaPhi = phiTrig-phi;
1035 deltaPhiOrg = deltaPhi;
1036 if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1037 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
1038
1039 pout = pt*TMath::Sin(deltaPhi) ;
1040 rat = pt/ptTrig ;
1041 xE =-pt/ptTrig*TMath::Cos(deltaPhi);
05d0d05d 1042 cosi =-100;
1043 if(xE > 0 ) cosi = TMath::Log(1/xE);
c514f286 1044 else {
05d0d05d 1045 if(GetDebug() > 1 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - xE=%f negative or null, check!, pT %f, ptTrig %f\n", xE,pt,ptTrig);
1046 //return kFALSE; // shbould return or continue?
c514f286 1047 }
e09cf5ef 1048
1049 if(GetDebug() > 2)
1050 printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Charged hadron: pt %f, phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f, pT min %2.2f \n",
045396c8 1051 pt,phi, phiTrig,fDeltaPhiMinCut, deltaPhi, fDeltaPhiMaxCut, GetMinPt());
e09cf5ef 1052
045396c8 1053 // Fill Histograms
e09cf5ef 1054 if(bFillHisto){
045396c8 1055
05d0d05d 1056 Int_t assocBin = -1;
1057 for(Int_t i = 0 ; i < fNAssocPtBins ; i++){
1058 if(ptTrig > fAssocPtBinLimit[i] && ptTrig < fAssocPtBinLimit[i+1]) assocBin= i;
045396c8 1059 }
1060
05d0d05d 1061 fhAssocPt->Fill(ptTrig,pt);
1062
1063 if(TMath::Cos(deltaPhi) < 0 && assocBin >= 0 )//away side
1064 fhXEAssocPtBin[assocBin]->Fill(ptTrig, xE) ;
1065
1066 //Hardcoded values, BAD, FIXME
1067 Double_t dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
1068 if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475){
1069 fhAssocPtBkg->Fill(ptTrig, pt);
1070 }
1071
1072 if(dphiBrad<-1./3) dphiBrad += 2;
1073 if(assocBin>=0){
1074 fhDeltaPhiBradAssocPtBin[assocBin]->Fill(ptTrig, dphiBrad);
1075 fhDeltaPhiAssocPtBin [assocBin]->Fill(ptTrig, deltaPhi);
1076 }
1077
1078 fhEtaCharged ->Fill(pt,eta);
1079 fhPhiCharged ->Fill(pt,phi);
e09cf5ef 1080 fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1081 fhDeltaPhiCharged->Fill(ptTrig, deltaPhi);
1082 fhDeltaPhiDeltaEtaCharged->Fill(deltaPhi,aodParticle->Eta()-eta);
e09cf5ef 1083
1084 if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1085 //fill different multiplicity histogram
1086 if(DoEventSelect()){
1087 for(Int_t im=0; im<GetMultiBin(); im++){
1088 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1)){
045396c8 1089 fhTrigDeltaPhiCharged[im]->Fill(ptTrig,deltaPhi);
e09cf5ef 1090 fhTrigDeltaEtaCharged[im]->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1091 }
e09cf5ef 1092 }
1093 }
1094 //delta phi cut for correlation
045396c8 1095 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) {
1096 fhDeltaPhiChargedPt->Fill(pt,deltaPhi);
e09cf5ef 1097 fhPtImbalanceCharged->Fill(ptTrig,xE);
05d0d05d 1098 fhPtHbpCharged ->Fill(ptTrig, cosi);
1099 fhPtTrigPout ->Fill(ptTrig, pout) ;
e09cf5ef 1100 fhPtTrigCharged->Fill(ptTrig, pt) ;
05d0d05d 1101 if(track->Charge() > 0) fhPtImbalancePosCharged->Fill(ptTrig,xE) ;
1102 else fhPtImbalanceNegCharged->Fill(ptTrig,xE) ;
e09cf5ef 1103 //fill different multiplicity histogram
1104 if(DoEventSelect()){
1105 for(Int_t im=0; im<GetMultiBin(); im++){
1106 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
1107 fhTrigCorr[im]->Fill(ptTrig,xE);
1108 }
1109 } //multiplicity events selection
1110 } //delta phi cut for correlation
045396c8 1111 else if ((deltaPhi > fUeDeltaPhiMinCut) && ( deltaPhi < fUeDeltaPhiMaxCut)) { //UE study
1112 fhDeltaPhiUeChargedPt->Fill(pt,deltaPhi);
1113 Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
1114 Double_t uexE = -(pt/ptTrig)*TMath::Cos(randomphi);
1115 if(uexE < 0.) uexE = -uexE;
1116 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - xe = %f, uexE = %f \n", xE, uexE);
1117 fhPtImbalanceUeCharged->Fill(ptTrig,uexE);
c514f286 1118 if(uexE>0)fhPtHbpUeCharged->Fill(ptTrig,TMath::Log(1/uexE));
e09cf5ef 1119 if(DoEventSelect()){
1120 for(Int_t im=0; im<GetMultiBin(); im++){
1121 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
1122 fhTrigUeCorr[im]->Fill(ptTrig,xE);
1123 }
1124 } //multiplicity events selection
1125
1126 } //UE study
1127
1128 if(fPi0Trigger){
1129 if(indexPhoton1!=-1 && indexPhoton2!=-1){
045396c8 1130 fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
1131 fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
1132 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
1133 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
e09cf5ef 1134 fhPtImbalanceDecayCharged->Fill(ptDecay1,ratDecay1);
045396c8 1135 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
e09cf5ef 1136 fhPtImbalanceDecayCharged->Fill(ptDecay2,ratDecay2);
045396c8 1137 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
e09cf5ef 1138 } //index of decay photons found
1139 } //make decay-hadron correlation
1140
1141 //several UE calculation
1142 if(fMakeSeveralUE){
045396c8 1143 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){
1144 fhDeltaPhiUeLeftCharged->Fill(pt,deltaPhi);
e09cf5ef 1145 fhPtImbalanceUeLeftCharged->Fill(ptTrig,rat);
1146 fhPtHbpUeLeftCharged->Fill(ptTrig,cosi);
1147 }
045396c8 1148 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){
1149 fhDeltaPhiUeRightCharged->Fill(pt,deltaPhi);
e09cf5ef 1150 fhPtImbalanceUeRightCharged->Fill(ptTrig,rat);
1151 fhPtHbpUeRightCharged->Fill(ptTrig,cosi);
1152
1153 }
1154 } //several UE calculation
1155
045396c8 1156 //Fill leading particle histogram
1157 fhPtLeading->Fill(ptTrig);
1158 if(phiTrig<0)phiTrig+=TMath::TwoPi();
1159 fhPhiLeading->Fill(ptTrig, phiTrig);
1160 fhEtaLeading->Fill(ptTrig, etaTrig);
1161
e09cf5ef 1162 } //Fill histogram
1163 else{
1164 nrefs++;
1165 if(nrefs==1){
1166 reftracks = new TObjArray(0);
045396c8 1167 TString trackname = Form("%s+Tracks", GetAODObjArrayName().Data());
1168 reftracks->SetName(trackname.Data());
e09cf5ef 1169 reftracks->SetOwner(kFALSE);
1170 }
1171 reftracks->Add(track);
1172 }//aod particle loop
1173 }// track loop
1174
1175 //Fill AOD with reference tracks, if not filling histograms
1176 if(!bFillHisto && reftracks) {
1177 aodParticle->AddObjArray(reftracks);
1178 }
1179
045396c8 1180 return kTRUE;
e09cf5ef 1181
1182}
1183
05d0d05d 1184//________________________________________________________________________________________________________________
045396c8 1185Bool_t AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * const aodParticle,
c5693f62 1186 const TObjArray* pi0list, const Bool_t bFillHisto)
e09cf5ef 1187{
1188 // Neutral Pion Correlation Analysis
1189 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Make trigger particle - pi0 correlation, %d pi0's \n",pi0list->GetEntriesFast());
1190
1191 Int_t evtIndex11 = 0 ;
1192 Int_t evtIndex12 = 0 ;
1193 if (GetMixedEvent()) {
1194 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
1195 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
1196 }
1197
045396c8 1198 Double_t pt = -100. ;
1199 Double_t px = -100. ;
1200 Double_t py = -100. ;
1201 Double_t rat = -100. ;
1202 Double_t phi = -100. ;
1203 Double_t eta = -100. ;
1204 Double_t xE = -100. ;
1205 Double_t cosi = -100. ;
e09cf5ef 1206
1207 Double_t ptTrig = aodParticle->Pt();
1208 Double_t phiTrig = aodParticle->Phi();
1209 Double_t etaTrig = aodParticle->Eta();
1210 Double_t pxTrig = aodParticle->Px();
1211 Double_t pyTrig = aodParticle->Py();
1212
045396c8 1213 Int_t indexPhoton1 =-1 ;
1214 Int_t indexPhoton2 =-1 ;
1215 Double_t ptDecay1 = 0. ;
e09cf5ef 1216 Double_t pxDecay1 = 0. ;
1217 Double_t pyDecay1 = 0. ;
045396c8 1218 Double_t phiDecay1 = 0. ;
1219 Double_t ptDecay2 = 0. ;
e09cf5ef 1220 Double_t pxDecay2 = 0. ;
1221 Double_t pyDecay2 = 0. ;
045396c8 1222 Double_t phiDecay2 = 0. ;
1223
1224 Double_t ratDecay1 = -100. ;
1225 Double_t ratDecay2 = -100. ;
1226 Double_t deltaPhi = -100. ;
1227 Double_t deltaPhiDecay1 = -100. ;
1228 Double_t deltaPhiDecay2 = -100. ;
e09cf5ef 1229
e09cf5ef 1230 TObjArray * clusters = 0x0 ;
045396c8 1231 TLorentzVector photonMom ;
1232
e09cf5ef 1233 if(fPi0Trigger){
1234 indexPhoton1 = aodParticle->GetCaloLabel (0);
1235 indexPhoton2 = aodParticle->GetCaloLabel (1);
045396c8 1236 if(GetDebug() > 1)
1237 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
e09cf5ef 1238
1239 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1240 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
1241 else clusters = GetPHOSClusters() ;
1242 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
1243 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
1244 photon->GetMomentum(photonMom,GetVertex(0)) ;
1245 if(photon->GetID()==indexPhoton1) {
1246 ptDecay1 = photonMom.Pt();
1247 pxDecay1 = photonMom.Px();
1248 pyDecay1 = photonMom.Py();
1249 phiDecay1 = photonMom.Phi();
1250 }
1251 if(photon->GetID()==indexPhoton2) {
1252 ptDecay2 = photonMom.Pt();
1253 pxDecay2 = photonMom.Px();
1254 pyDecay2 = photonMom.Py();
1255 phiDecay2 = photonMom.Phi();
1256 }
045396c8 1257 if(GetDebug() > 1)
1258 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
e09cf5ef 1259 } //photonAOD loop
1260 } //index of decay photons found
1261 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig);
1262 } //make decay-hadron correlation
1263
1264 TObjArray * refpi0 =0x0;
1265 Int_t nrefs = 0;
1266
1267 //Loop on stored AOD pi0
1268 Int_t naod = pi0list->GetEntriesFast();
045396c8 1269 if(GetDebug() > 0)
1270 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod);
e09cf5ef 1271 for(Int_t iaod = 0; iaod < naod ; iaod++){
1272 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod));
1273
1274 Int_t evtIndex2 = 0 ;
1275 Int_t evtIndex3 = 0 ;
1276 if (GetMixedEvent()) {
1277 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
1278 evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
1279
045396c8 1280 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 ||
1281 evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events
e09cf5ef 1282 continue ;
1283 }
1284
1285 //Int_t pdg = pi0->GetPdg();
1286 //if(pdg != AliCaloPID::kPi0) continue;
1287
1288 pt = pi0->Pt();
1289 px = pi0->Px();
1290 py = pi0->Py();
1291 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
1292 //jumped out this event if near side associated partile pt larger than trigger
1293 if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2()) break ;
045396c8 1294
e09cf5ef 1295 //Selection within angular range
1296 phi = pi0->Phi();
045396c8 1297 //Float_t deltaPhi = TMath::Abs(phiTrig-phi);
1298 //if( (deltaPhi < fDeltaPhiMinCut) || ( deltaPhi > fDeltaPhiMaxCut) ) continue ;
e09cf5ef 1299
1300 if(bFillHisto){
1301
045396c8 1302 deltaPhi = phiTrig-phi;
1303 if(deltaPhi<-TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1304 if(deltaPhi>3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
e09cf5ef 1305
1306 rat = pt/ptTrig ;
1307 phi = pi0->Phi() ;
1308 eta = pi0->Eta() ;
1309 xE = -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1310 if(xE <0.)xE =-xE;
1311 cosi = TMath::Log(1/xE);
1312
1313 if(fPi0Trigger){
1314 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1315 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1316 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1317 deltaPhiDecay1 = phiDecay1-phi;
1318 deltaPhiDecay2 = phiDecay2-phi;
1319 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1320 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1321 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1322 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
1323 fhDeltaPhiDecayNeutral->Fill(ptDecay1, deltaPhiDecay1);
1324 fhDeltaPhiDecayNeutral->Fill(ptDecay2, deltaPhiDecay2);
1325 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
1326 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
e09cf5ef 1327 fhPtImbalanceDecayNeutral->Fill(ptDecay1,ratDecay1);
045396c8 1328 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
e09cf5ef 1329 fhPtImbalanceDecayNeutral->Fill(ptDecay2,ratDecay2);
045396c8 1330 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
e09cf5ef 1331 }
1332 } //do decay-hadron correlation
1333
1334 fhEtaNeutral->Fill(pt,eta);
1335 fhPhiNeutral->Fill(pt,phi);
1336 fhDeltaEtaNeutral->Fill(ptTrig,etaTrig-eta);
045396c8 1337 fhDeltaPhiNeutral->Fill(ptTrig,deltaPhi);
1338 fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi,etaTrig-eta);
e09cf5ef 1339
1340 //delta phi cut for correlation
045396c8 1341 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) {
1342 fhDeltaPhiNeutralPt->Fill(pt,deltaPhi);
e09cf5ef 1343 fhPtImbalanceNeutral->Fill(ptTrig,rat);
1344 fhPtHbpNeutral->Fill(ptTrig,cosi);
1345 }
1346 else {
045396c8 1347 fhDeltaPhiUeNeutralPt->Fill(pt,deltaPhi);
e09cf5ef 1348 fhPtImbalanceUeNeutral->Fill(ptTrig,rat);
1349 fhPtHbpUeNeutral->Fill(ptTrig,cosi);
1350 }
1351 //several UE calculation
1352 if(fMakeSeveralUE){
045396c8 1353 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){
1354 fhDeltaPhiUeLeftNeutral->Fill(pt,deltaPhi);
e09cf5ef 1355 fhPtImbalanceUeLeftNeutral->Fill(ptTrig,rat);
1356 fhPtHbpUeLeftNeutral->Fill(ptTrig,cosi);
1357 }
045396c8 1358 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){
1359 fhDeltaPhiUeRightNeutral->Fill(pt,deltaPhi);
e09cf5ef 1360 fhPtImbalanceUeRightNeutral->Fill(ptTrig,rat);
1361 fhPtHbpUeRightNeutral->Fill(ptTrig,cosi);
1362 }
1363 } //several UE calculation
1364 }
1365 else{
1366 nrefs++;
1367 if(nrefs==1){
1368 refpi0 = new TObjArray(0);
1369 refpi0->SetName(GetAODObjArrayName()+"Pi0s");
1370 refpi0->SetOwner(kFALSE);
1371 }
1372 refpi0->Add(pi0);
1373 }//put references in trigger AOD
045396c8 1374
1375 if(GetDebug() > 2 )
1376 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1377
1378 }//loop
1379
1380 return kTRUE;
1381}
1382
05d0d05d 1383//_________________________________________________________________________________________________________
045396c8 1384void AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
1385{
1386 // Charged Hadron Correlation Analysis with MC information
1387 if(GetDebug()>1)
1388 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Make trigger particle - charged hadron correlation in AOD MC level\n");
1389
1390 AliStack * stack = 0x0 ;
1391 TParticle * primary = 0x0 ;
1392 TClonesArray * mcparticles0 = 0x0 ;
1393 TClonesArray * mcparticles = 0x0 ;
1394 AliAODMCParticle * aodprimary = 0x0 ;
1395
1396 Double_t eprim = 0 ;
1397 Double_t ptprim = 0 ;
1398 Double_t phiprim = 0 ;
1399 Double_t etaprim = 0 ;
1400 Double_t pxprim = 0 ;
1401 Double_t pyprim = 0 ;
1402 Double_t pzprim = 0 ;
1403 Int_t nTracks = 0 ;
1404 Int_t iParticle = 0 ;
1405 Double_t charge = 0.;
1406
1407 Double_t mcrat =-100 ;
1408 Double_t mcxE =-100 ;
1409 Double_t mccosi =-100 ;
1410
1411 //Track loop, select tracks with good pt, phi and fill AODs or histograms
1412 //Int_t currentIndex = -1 ;
1413 Double_t mcTrackPt = 0 ;
1414 Double_t mcTrackPhi = 0 ;
1415 Double_t mcTrackEta = 0 ;
1416 Double_t mcTrackPx = 0 ;
1417 Double_t mcTrackPy = 0 ;
1418 Double_t mcTrackPz = 0 ;
1419
1420 if(GetReader()->ReadStack()){
1421 nTracks = GetMCStack()->GetNtrack() ;
1422 }
1423 else nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
1424 //Int_t trackIndex[nTracks];
1425
1426 Int_t label= aodParticle->GetLabel();
1427 if(label<0){
1428 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** bad label ***: label %d \n", label);
1429 return;
1430 }
1431
1432 if(GetReader()->ReadStack()){
1433 stack = GetMCStack() ;
1434 if(!stack) {
1435 printf(" AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation- Stack not available, is the MC handler called? STOP\n");
1436 abort();
1437 }
1438
1439 nTracks=stack->GetNprimary();
1440 if(label >= stack->GetNtrack()) {
1441 if(GetDebug() > 2) printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
1442 return ;
1443 }
1444 primary = stack->Particle(label);
1445 if(!primary){
1446 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no primary ***: label %d \n", label);
1447 return;
1448 }
1449
1450 eprim = primary->Energy();
1451 ptprim = primary->Pt();
1452 phiprim = primary->Phi();
1453 etaprim = primary->Eta();
1454 pxprim = primary->Px();
1455 pyprim = primary->Py();
1456 pzprim = primary->Pz();
1457
1458 if(primary){
e09cf5ef 1459
045396c8 1460 for (iParticle = 0 ; iParticle < nTracks ; iParticle++) {
1461 TParticle * particle = stack->Particle(iParticle);
1462 TLorentzVector momentum;
1463 //keep only final state particles
1464 if(particle->GetStatusCode()!=1) continue ;
1465 Int_t pdg = particle->GetPdgCode();
1466 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1467 particle->Momentum(momentum);
1468
1469 //---------- Charged particles ----------------------
1470 if(charge != 0){
1471 //Particles in CTS acceptance
1472 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
1473 if(TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
1474 if(inCTS&&momentum.Pt() >GetMinPt())
1475 {
1476 mcTrackPt = particle->Pt();
1477 mcTrackPhi = particle->Phi();
1478 mcTrackEta = particle->Eta();
1479 mcTrackPx = particle->Px();
1480 mcTrackPy = particle->Py();
1481 mcTrackPz = particle->Pz();
1482 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1483 //Select only hadrons in pt range
1484 if(mcTrackPt < GetMinPt() || mcTrackPt > GetMaxPt()) continue ;
1485 //remove trigger itself for correlation when use charged triggers
c5693f62 1486 if(label==iParticle &&
1487 TMath::Abs(mcTrackPt -ptprim ) < 1e-6 &&
1488 TMath::Abs(mcTrackPhi-phiprim) < 1e-6 &&
1489 TMath::Abs(mcTrackEta-etaprim) < 1e-6)
045396c8 1490 continue ;
1491 //jumped out this event if near side associated partile pt larger than trigger
1492 if( mcTrackPt> ptprim && TMath::Abs(mcTrackPhi-phiprim)<TMath::PiOver2())
1493 return ;
1494
1495 mcrat = mcTrackPt/ptprim ;
1496 mcxE = -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
1497 if(mcxE <0.) mcxE =-mcxE;
1498 mccosi = TMath::Log(1/mcxE);
1499 // printf("rat = %f, xE = %f, cosi =%f \n", rat, xE, cosi);
1500 // printf("phi = %f \n", phi);
1501
1502 //Selection within angular range
1503 Double_t mcdeltaPhi = phiprim-mcTrackPhi;
1504 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1505 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1506 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
1507 if(GetDebug()>0 )
1508 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",
1509 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
1510 // Fill Histograms
1511 fhMCEtaCharged->Fill(mcTrackPt,mcTrackEta);
1512 fhMCPhiCharged->Fill(mcTrackPt,mcTrackPhi);
1513 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
1514 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
1515 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
045396c8 1516 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,etaprim-mcTrackEta);
1517
1518 //delta phi cut for correlation
1519 if( (mcdeltaPhi > fDeltaPhiMinCut) && ( mcdeltaPhi < fDeltaPhiMaxCut) ) {
1520 fhMCDeltaPhiChargedPt->Fill(mcTrackPt,mcdeltaPhi);
1521 fhMCPtImbalanceCharged->Fill(ptprim,mcxE);
1522 fhMCPtHbpCharged->Fill(ptprim,mccosi);
1523 fhMCPtTrigPout->Fill(ptprim, mcpout) ;
1524 }//delta phi cut for correlation
1525 } //tracks after cuts
1526 }//Charged
1527 } //track loop
1528 } //when the leading particles could trace back to MC
1529 } //ESD MC
1530 else if(GetReader()->ReadAODMCParticles()){
1531 //Get the list of MC particles
1532 mcparticles0 = GetReader()->GetAODMCParticles(0);
1533 if(!mcparticles0) return;
1534 if(label >=mcparticles0->GetEntriesFast()){
1535 if(GetDebug() > 2)
1536 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label,mcparticles0->GetEntriesFast());
1537 return;
1538 }
1539 //Get the particle
1540 aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
1541 if(!aodprimary) {
1542 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no AOD primary ***: label %d \n", label);
1543 return;
1544 }
1545
1546 ptprim = aodprimary->Pt();
1547 phiprim = aodprimary->Phi();
1548 etaprim =aodprimary->Eta();
1549 pxprim =aodprimary->Px();
1550 pyprim =aodprimary->Py();
1551 pzprim =aodprimary->Pz();
1552 if(aodprimary){
1553 mcparticles= GetReader()->GetAODMCParticles();
1554 for (Int_t i=0; i<nTracks;i++) {
1555 AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(i);
1556 if (!part->IsPhysicalPrimary()) continue;
1557 Int_t pdg = part->GetPdgCode();
1558 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1559 TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());
1560 if(charge != 0){
1561 if(part->Pt()> GetReader()->GetCTSPtMin()){
1562 //Particles in CTS acceptance
1563 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
1564 Int_t indexmother=part->GetMother();
1565 if(indexmother>-1)
1566 {
1567 Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
1568 if(TMath::Abs(pdg) == 11 && mPdg == 22) continue;
1569 }
1570 if(inCTS&&momentum.Pt() >GetMinPt())
1571 {
1572 mcTrackPt=part->Pt();
1573 mcTrackPhi=part->Phi();
1574 mcTrackEta=part->Eta();
1575 mcTrackPx=part->Px();
1576 mcTrackPy=part->Py();
1577 mcTrackPz=part->Pz();
1578 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1579 //Select only hadrons in pt range
1580 if(mcTrackPt < GetMinPt() || mcTrackPt > GetMaxPt()) continue ;
c5693f62 1581
045396c8 1582 //remove trigger itself for correlation when use charged triggers
c5693f62 1583 if(label==i &&
1584 TMath::Abs(mcTrackPt -ptprim ) < 1e-6 &&
1585 TMath::Abs(mcTrackPhi-phiprim) < 1e-6 &&
1586 TMath::Abs(mcTrackEta-etaprim) < 1e-6) continue ;
1587
045396c8 1588 //jumped out this event if near side associated partile pt larger than trigger
1589 if( mcTrackPt> ptprim && TMath::Abs(mcTrackPhi-phiprim)<TMath::PiOver2())
1590 return ;
1591
1592 mcrat = mcTrackPt/ptprim ;
1593 mcxE = -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
1594 if(mcxE <0.)mcxE =-mcxE;
1595 mccosi = TMath::Log(1/mcxE);
1596
1597 //Selection within angular range
1598 Double_t mcdeltaPhi = phiprim-mcTrackPhi;
1599 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1600 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1601 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
1602 if(GetDebug()>0)
1603 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",
1604 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
fe871b21 1605
045396c8 1606 // Fill Histograms
fe871b21 1607
045396c8 1608 fhMCEtaCharged->Fill(mcTrackPt,mcTrackEta);
1609 fhMCPhiCharged->Fill(mcTrackPt,mcTrackPhi);
1610 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
1611 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
1612 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
045396c8 1613 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,etaprim-mcTrackEta);
1614
1615 //delta phi cut for correlation
1616 if( (mcdeltaPhi > fDeltaPhiMinCut) && ( mcdeltaPhi < fDeltaPhiMaxCut) ) {
1617 fhMCDeltaPhiChargedPt->Fill(mcTrackPt,mcdeltaPhi);
1618 fhMCPtImbalanceCharged->Fill(ptprim,mcxE);
1619 fhMCPtHbpCharged->Fill(ptprim,mccosi);
1620 fhMCPtTrigPout->Fill(ptprim, mcpout) ;
1621 }//delta phi cut for correlation
1622
1623 } //tracks after cuts
1624
1625 } //with minimum pt cut
1626 } //only charged particles
1627 } //MC particle loop
1628 } //when the leading particles could trace back to MC
1629 }// AOD MC
e09cf5ef 1630}
045396c8 1631
05d0d05d 1632//_____________________________________________________________________
1633void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
1634{
1635
1636 //Print some relevant parameters set for the analysis
1637 if(! opt)
1638 return;
1639
1640 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1641 AliAnaPartCorrBaseClass::Print(" ");
1642
1643 printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
1644 printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
1645 printf("Isolated Trigger? %d\n", fSelectIsolated) ;
1646 printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ;
1647 printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ;
1648 printf("Several UE? %d\n", fMakeSeveralUE) ;
1649 printf("Name of AOD Pi0 Branch %s \n",fPi0AODBranchName.Data());
1650 printf("Do Decay-hadron correlation ? %d\n", fPi0Trigger) ;
1651 printf("Select absolute leading for cluster triggers ? %d\n", fMakeAbsoluteLeading) ;
1652 printf("Trigger pt bins %d\n", fNAssocPtBins) ;
1653 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
1654 printf("\t bin %d = [%2.1f,%2.1f]\n", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
1655 }
1656
1657}
1658
1659//____________________________________________________________
1660void AliAnaParticleHadronCorrelation::SetNAssocPtBins(Int_t n)
045396c8 1661{
1662 // Set number of bins
e09cf5ef 1663
05d0d05d 1664 fNAssocPtBins = n ;
1665
1666
045396c8 1667 if(n < 10 && n > 0)
1668 {
05d0d05d 1669 fNAssocPtBins = n ;
045396c8 1670 }
1671 else
1672 {
1673 printf("n = larger than 9 or too small, set to 9 \n");
05d0d05d 1674 fNAssocPtBins = 9;
045396c8 1675 }
1676}
e09cf5ef 1677
05d0d05d 1678//______________________________________________________________________________
1679void AliAnaParticleHadronCorrelation::SetAssocPtBinLimit(Int_t ibin, Float_t pt)
045396c8 1680{
1681 // Set the list of limits for the trigger pt bins
1682
05d0d05d 1683 if(ibin <= fNAssocPtBins || ibin >= 0)
045396c8 1684 {
05d0d05d 1685 fAssocPtBinLimit[ibin] = pt ;
045396c8 1686 }
1687 else {
05d0d05d 1688 printf("AliAnaParticleHadronCorrelation::SetAssocPtBinLimit() - bin number too large %d > %d or small, nothing done\n", ibin, fNAssocPtBins) ;
045396c8 1689
1690 }
1691}
1692