remove hardcoded bad cells to be removed, pass run number to AODB
[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 }
584
045396c8 585 //if data is MC, fill more histograms
586 if(IsDataMC()){
587 fh2phiLeadingParticle=new TH2F("fh2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
588 fh2phiLeadingParticle->GetXaxis()->SetTitle("p_{T gen Leading} (GeV/c)");
589 fh2phiLeadingParticle->GetYaxis()->SetTitle("(#phi_{rec}-#phi_{gen})/#phi_{gen}");
590
591 fhMCLeadingCount=new TH1F("MCLeadingTriggerCount","MCLeadingTriggerCount",nptbins,ptmin,ptmax);
592 fhMCLeadingCount->SetXTitle("p_{T trig}");
593
594 fhMCEtaCharged = new TH2F
595 ("MCEtaCharged","MC #eta_{h^{#pm}} vs p_{T #pm}",
596 nptbins,ptmin,ptmax,netabins,etamin,etamax);
597 fhMCEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
598 fhMCEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
599
600 fhMCPhiCharged = new TH2F
601 ("MCPhiCharged","#MC phi_{h^{#pm}} vs p_{T #pm}",
602 200,ptmin,ptmax,nphibins,phimin,phimax);
603 fhMCPhiCharged->SetYTitle("MC #phi_{h^{#pm}} (rad)");
604 fhMCPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
605
606 fhMCDeltaPhiDeltaEtaCharged = new TH2F
607 ("MCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
608 140,-2.,5.,200,-2,2);
609 fhMCDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi");
610 fhMCDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
611
612 fhMCDeltaEtaCharged = new TH2F
613 ("MCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
614 nptbins,ptmin,ptmax,200,-2,2);
615 fhMCDeltaEtaCharged->SetYTitle("#Delta #eta");
616 fhMCDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
617
618 fhMCDeltaPhiCharged = new TH2F
619 ("MCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
620 nptbins,ptmin,ptmax,140,-2.,5.);
621 fhMCDeltaPhiCharged->SetYTitle("#Delta #phi");
622 fhMCDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
623
624 fhMCDeltaPhiChargedPt = new TH2F
625 ("MCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
626 nptbins,ptmin,ptmax,140,-2.,5.);
627 fhMCDeltaPhiChargedPt->SetYTitle("#Delta #phi");
628 fhMCDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
629
630 fhMCPtImbalanceCharged =
631 new TH2F("MCCorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
632 nptbins,ptmin,ptmax,200,0.,2.);
633 fhMCPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
634 fhMCPtImbalanceCharged->SetXTitle("p_{T trigger}");
635
636 fhMCPtHbpCharged =
637 new TH2F("MCHbpCharged","MC #xi = ln(1/x_{E}) with charged hadrons",
638 nptbins,ptmin,ptmax,200,0.,10.);
639 fhMCPtHbpCharged->SetYTitle("ln(1/x_{E})");
640 fhMCPtHbpCharged->SetXTitle("p_{T trigger}");
641
642 fhMCPtTrigPout =
643 new TH2F("MCPtTrigPout","AOD MC Pout with triggers",
644 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
645 fhMCPtTrigPout->SetYTitle("p_{out} (GeV/c)");
646 fhMCPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
647
648 fhMCPtAssocDeltaPhi =
649 new TH2F("fhMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
650 nptbins,ptmin,ptmax,140,-2.,5.);
651 fhMCPtAssocDeltaPhi->SetYTitle("#Delta #phi");
652 fhMCPtAssocDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
653
654 outputContainer->Add(fh2phiLeadingParticle);
655 outputContainer->Add(fhMCLeadingCount);
656 outputContainer->Add(fhMCDeltaPhiDeltaEtaCharged);
657 outputContainer->Add(fhMCPhiCharged) ;
658 outputContainer->Add(fhMCEtaCharged) ;
659 outputContainer->Add(fhMCDeltaEtaCharged) ;
660 outputContainer->Add(fhMCDeltaPhiCharged) ;
661
662 outputContainer->Add(fhMCDeltaPhiChargedPt) ;
663 outputContainer->Add(fhMCPtImbalanceCharged) ;
664 outputContainer->Add(fhMCPtHbpCharged) ;
665 outputContainer->Add(fhMCPtTrigPout) ;
666 outputContainer->Add(fhMCPtAssocDeltaPhi) ;
667 } //for MC histogram
668
e09cf5ef 669 //Keep neutral meson selection histograms if requiered
670 //Setting done in AliNeutralMesonSelection
671 if(GetNeutralMesonSelection()){
672 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
673 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
674 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
675 delete nmsHistos;
676 }
677
678 }//Correlation with neutral hadrons
679
680 return outputContainer;
681
682}
683
05d0d05d 684//____________________________________________________
e09cf5ef 685void AliAnaParticleHadronCorrelation::InitParameters()
686{
687
688 //Initialize the parameters of the analysis.
689 SetInputAODName("PWG4Particle");
690 SetAODObjArrayName("Hadrons");
691 AddToHistogramsName("AnaHadronCorr_");
045396c8 692
e09cf5ef 693 SetPtCutRange(0.,300);
045396c8 694 fDeltaPhiMinCut = 1.5 ;
695 fDeltaPhiMaxCut = 4.5 ;
696 fSelectIsolated = kFALSE;
697 fMakeSeveralUE = kFALSE;
698 fUeDeltaPhiMinCut = 1. ;
699 fUeDeltaPhiMaxCut = 1.5 ;
700 fNeutralCorr = kFALSE ;
701 fPi0Trigger = kFALSE ;
702 fMakeAbsoluteLeading = kTRUE;
703
05d0d05d 704 fNAssocPtBins = 7 ;
705 fAssocPtBinLimit[0] = 2. ;
706 fAssocPtBinLimit[1] = 4. ;
707 fAssocPtBinLimit[2] = 6. ;
708 fAssocPtBinLimit[3] = 8. ;
709 fAssocPtBinLimit[4] = 10. ;
710 fAssocPtBinLimit[5] = 13. ;
711 fAssocPtBinLimit[6] = 16. ;
712 fAssocPtBinLimit[7] = 20. ;
713 fAssocPtBinLimit[8] = 100.;
714 fAssocPtBinLimit[9] = 200.;
045396c8 715
e09cf5ef 716}
717
05d0d05d 718//__________________________________________________________
e09cf5ef 719void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
720{
721 //Particle-Hadron Correlation Analysis, fill AODs
722
723 if(!GetInputAODBranch()){
724 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
725 abort();
726 }
727
728 if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){
729 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());
730 abort();
731 }
732
733 if(GetDebug() > 1){
734 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n");
735 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
736 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetCTSTracks()->GetEntriesFast());
737 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetEMCALClusters()->GetEntriesFast());
738 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetPHOSClusters()->GetEntriesFast());
739 }
740
045396c8 741 //Get the vertex and check it is not too large in z
742 Double_t v[3] = {0,0,0}; //vertex ;
743 GetReader()->GetVertex(v);
744 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
745
746 //Loop on stored AOD particles, find leading trigger
747 Double_t ptTrig = GetMinPt() ;
748 fLeadingTriggerIndex = -1 ;
749 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
e09cf5ef 750 for(Int_t iaod = 0; iaod < naod ; iaod++){
751 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
045396c8 752
753 //vertex cut in case of mixing
754 if (GetMixedEvent()) {
755 Int_t evt=-1;
756 Int_t id =-1;
757 if (particle->GetCaloLabel(0) >= 0 ){
758 id=particle->GetCaloLabel(0);
759 if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
760 }
761 else if(particle->GetTrackLabel(0) >= 0 ){
762 id=particle->GetTrackLabel(0);
763 if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
764 }
765 else continue;
766
767 if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut())
768 return ;
e09cf5ef 769 }
045396c8 770
771 // find the leading particles with highest momentum
772 if (particle->Pt() > ptTrig) {
773 ptTrig = particle->Pt() ;
774 fLeadingTriggerIndex = iaod ;
775 }
776 }// finish search of leading trigger particle
e09cf5ef 777
778 //Do correlation with leading particle
045396c8 779 if(fLeadingTriggerIndex >= 0){
e09cf5ef 780
045396c8 781 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
782
783 //check if the particle is isolated or if we want to take the isolation into account
784 if(OnlyIsolated() && !particle->IsIsolated()) return;
785
e09cf5ef 786 //Make correlation with charged hadrons
045396c8 787 Bool_t okcharged = kTRUE;
788 Bool_t okneutral = kTRUE;
e09cf5ef 789 if(GetReader()->IsCTSSwitchedOn() )
045396c8 790 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kFALSE);
e09cf5ef 791
792 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
793 if(fNeutralCorr && pi0list && pi0list->GetEntriesFast() > 0)
045396c8 794 okneutral = MakeNeutralCorrelation(particle, pi0list,kFALSE);
e09cf5ef 795
796 }//Correlate leading
797
798 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n");
799
800}
801
05d0d05d 802//_________________________________________________________________
e09cf5ef 803void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
804{
805 //Particle-Hadron Correlation Analysis, fill histograms
806
807 if(!GetInputAODBranch()){
808 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
809 abort();
810 }
811
812 if(GetDebug() > 1){
813 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
814 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
815 }
816
817 //Get the vertex and check it is not too large in z
818 Double_t v[3] = {0,0,0}; //vertex ;
819 GetReader()->GetVertex(v);
820 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
821
822 //Loop on stored AOD particles, find leading
045396c8 823 Double_t ptTrig = GetMinPt() ;
824 if(fLeadingTriggerIndex < 0){//Search leading if not done before
825 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
826 for(Int_t iaod = 0; iaod < naod ; iaod++){ //loop on input trigger AOD file
827 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
828 //vertex cut in case of mixing
829 if (GetMixedEvent()) {
830 Int_t evt=-1;
831 Int_t id =-1;
832 if (particle->GetCaloLabel(0) >= 0 ){
833 id=particle->GetCaloLabel(0);
834 if(id >= 0 )evt= GetMixedEvent()-> EventIndexForCaloCluster(id) ;
835 }
836 else if(particle->GetTrackLabel(0) >= 0 ){
837 id=particle->GetTrackLabel(0);
838 if(id >= 0 )evt= GetMixedEvent()->EventIndex(id) ;
839 }
840 else continue;
841
842 if (TMath::Abs(GetVertex(evt)[2]) > GetZvertexCut())
843 return ;
e09cf5ef 844 }
05d0d05d 845
045396c8 846 //check if the particle is isolated or if we want to take the isolation into account
847 if(OnlyIsolated() && !particle->IsIsolated()) continue;
e09cf5ef 848
045396c8 849 //check if inside the vertex cut
850 //find the leading particles with highest momentum
851 if (particle->Pt() > ptTrig) {
852 ptTrig = particle->Pt() ;
853 fLeadingTriggerIndex = iaod ;
e09cf5ef 854 }
045396c8 855 }//finish search of leading trigger particle
856 }//Search leading if not done before
857
858 if(fLeadingTriggerIndex >= 0 ){ //using trigger particle to do correlations
859 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
860
861 //check if the particle is isolated or if we want to take the isolation into account
862 if(OnlyIsolated() && !particle->IsIsolated()) return;
e09cf5ef 863
864 //Make correlation with charged hadrons
045396c8 865 Bool_t okcharged = kTRUE;
866 Bool_t okneutral = kTRUE;
867 if(GetReader()->IsCTSSwitchedOn() ){
868 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kTRUE);
a5f1e836 869 if(IsDataMC()){
045396c8 870 MakeMCChargedCorrelation(particle);
871 }
a5f1e836 872 }
873
e09cf5ef 874 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
a5f1e836 875 if(fNeutralCorr && pi0list){
876 if(pi0list->GetEntriesFast() > 0)
877 okneutral = MakeNeutralCorrelation(particle, pi0list,kTRUE);
878 }
e09cf5ef 879
045396c8 880 // Fill leading particle histogram if correlation went well and
881 // no problem was found, like not absolute leading, or bad vertex in mixing.
882 if(okcharged && okneutral){
883 fhPtLeading->Fill(particle->Pt());
884 Float_t phi = particle->Phi();
885 if(phi<0)phi+=TMath::TwoPi();
886 fhPhiLeading->Fill(particle->Pt(), phi);
887 fhEtaLeading->Fill(particle->Pt(), particle->Eta());
888 }//ok charged && neutral
e09cf5ef 889 }//Aod branch loop
890
045396c8 891 //Reinit for next event
892 fLeadingTriggerIndex = -1;
e09cf5ef 893
045396c8 894 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n");
e09cf5ef 895}
896
05d0d05d 897//_________________________________________________________________________________________________________
045396c8 898Bool_t AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle,
899 TObjArray* pl, const Bool_t bFillHisto)
e09cf5ef 900{
901 // Charged Hadron Correlation Analysis
902 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n");
903
045396c8 904 Int_t evtIndex11 = -1 ; //cluster trigger or pi0 trigger
905 Int_t evtIndex12 = -1 ; // pi0 trigger
906 Int_t evtIndex13 = -1 ; // charged trigger
e09cf5ef 907 Int_t indexPhoton1 = -1 ;
908 Int_t indexPhoton2 = -1 ;
045396c8 909
910 Double_t v[3] = {0,0,0}; //vertex ;
e09cf5ef 911 GetReader()->GetVertex(v);
e09cf5ef 912
913 if (GetMixedEvent()) {
914 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
915 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
916 evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
917 }
918
e09cf5ef 919 Double_t phiTrig = aodParticle->Phi();
045396c8 920 Double_t etaTrig = aodParticle->Eta();
921 Double_t ptTrig = aodParticle->Pt();
045396c8 922
923 Double_t pt = -100. ;
924 Double_t px = -100. ;
925 Double_t py = -100. ;
926 Double_t rat = -100. ;
927 Double_t xE = -100. ;
928 Double_t cosi = -100. ;
929 Double_t phi = -100. ;
930 Double_t eta = -100. ;
931 Double_t pout = -100. ;
e09cf5ef 932
045396c8 933 Double_t ptDecay1 = 0. ;
934 Double_t pxDecay1 = 0. ;
935 Double_t pyDecay1 = 0. ;
936 Double_t phiDecay1 = 0. ;
937 Double_t ptDecay2 = 0. ;
938 Double_t pxDecay2 = 0. ;
939 Double_t pyDecay2 = 0. ;
940 Double_t phiDecay2 = 0. ;
941
942 Double_t ratDecay1 = -100. ;
943 Double_t ratDecay2 = -100. ;
944 Double_t deltaPhi = -100. ;
945 Double_t deltaPhiOrg = -100. ;
946 Double_t deltaPhiDecay1 = -100. ;
947 Double_t deltaPhiDecay2 = -100. ;
948
949 TVector3 p3;
e09cf5ef 950 TLorentzVector photonMom ;
045396c8 951 TObjArray * clusters = 0x0 ;
952 TObjArray * reftracks = 0x0;
953 Int_t nrefs = 0;
954 Int_t nTracks = GetCTSTracks()->GetEntriesFast() ;
e09cf5ef 955
956 if(fPi0Trigger){
957 indexPhoton1 = aodParticle->GetCaloLabel (0);
958 indexPhoton2 = aodParticle->GetCaloLabel (1);
959 if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
960
961 if(indexPhoton1!=-1 && indexPhoton2!=-1){
962 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
045396c8 963 else clusters = GetPHOSClusters() ;
e09cf5ef 964 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
965 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
966 photon->GetMomentum(photonMom,GetVertex(0)) ;
967 if(photon->GetID()==indexPhoton1) {
968 ptDecay1 = photonMom.Pt();
969 pxDecay1 = photonMom.Px();
970 pyDecay1 = photonMom.Py();
971 phiDecay1 = photonMom.Phi();
972 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig);
973 }
974 if(photon->GetID()==indexPhoton2) {
975 ptDecay2 = photonMom.Pt();
976 pxDecay2 = photonMom.Px();
977 pyDecay2 = photonMom.Py();
978 phiDecay2 = photonMom.Phi();
979 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay2/ptTrig);
980 }
981 if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
982 } //cluster loop
983 } //index of decay photons found
e09cf5ef 984 } //make decay-hadron correlation
985
986 //Track loop, select tracks with good pt, phi and fill AODs or histograms
e09cf5ef 987 for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ ){
988 AliVTrack * track = (AliVTrack *) (pl->At(ipr)) ;
045396c8 989
e09cf5ef 990 Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
991 p3.SetXYZ(mom[0],mom[1],mom[2]);
992 pt = p3.Pt();
993 px = p3.Px();
994 py = p3.Py();
995 eta = p3.Eta();
996 phi = p3.Phi() ;
997 if(phi < 0) phi+=TMath::TwoPi();
045396c8 998
e09cf5ef 999 //Select only hadrons in pt range
1000 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
1001 //remove trigger itself for correlation when use charged triggers
1002 if( track->GetID() == aodParticle->GetTrackLabel(0) || track->GetID() == aodParticle->GetTrackLabel(1) ||
045396c8 1003 track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3) )
1004 continue ;
1005
e09cf5ef 1006 if(IsFiducialCutOn()){
1007 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ;
1008 if(! in ) continue ;
1009 }
045396c8 1010
1011 //jump out this event if near side associated particle pt larger than trigger
1012 if (fMakeAbsoluteLeading){
1013 if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2()) return kFALSE;
1014 }
1015
1016 //Only for mixed event
1017 Int_t evtIndex2 = 0 ;
1018 if (GetMixedEvent()) {
1019 evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
1020 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
1021 continue ;
1022 //vertex cut
1023 if (TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut())
1024 return kFALSE;
1025 }
1026
1027 if(fPi0Trigger){
e09cf5ef 1028 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1029 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1030 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1031 deltaPhiDecay1 = phiDecay1-phi;
1032 deltaPhiDecay2 = phiDecay2-phi;
1033 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1034 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1035 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1036 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
e09cf5ef 1037 }
1038 } //do decay-hadron correlation
045396c8 1039
e09cf5ef 1040 //Selection within angular range
045396c8 1041 deltaPhi = phiTrig-phi;
1042 deltaPhiOrg = deltaPhi;
1043 if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1044 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
1045
1046 pout = pt*TMath::Sin(deltaPhi) ;
1047 rat = pt/ptTrig ;
1048 xE =-pt/ptTrig*TMath::Cos(deltaPhi);
05d0d05d 1049 cosi =-100;
1050 if(xE > 0 ) cosi = TMath::Log(1/xE);
c514f286 1051 else {
05d0d05d 1052 if(GetDebug() > 1 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - xE=%f negative or null, check!, pT %f, ptTrig %f\n", xE,pt,ptTrig);
1053 //return kFALSE; // shbould return or continue?
c514f286 1054 }
e09cf5ef 1055
1056 if(GetDebug() > 2)
1057 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 1058 pt,phi, phiTrig,fDeltaPhiMinCut, deltaPhi, fDeltaPhiMaxCut, GetMinPt());
e09cf5ef 1059
045396c8 1060 // Fill Histograms
e09cf5ef 1061 if(bFillHisto){
045396c8 1062
05d0d05d 1063 Int_t assocBin = -1;
1064 for(Int_t i = 0 ; i < fNAssocPtBins ; i++){
1065 if(ptTrig > fAssocPtBinLimit[i] && ptTrig < fAssocPtBinLimit[i+1]) assocBin= i;
045396c8 1066 }
1067
05d0d05d 1068 fhAssocPt->Fill(ptTrig,pt);
1069
1070 if(TMath::Cos(deltaPhi) < 0 && assocBin >= 0 )//away side
1071 fhXEAssocPtBin[assocBin]->Fill(ptTrig, xE) ;
1072
1073 //Hardcoded values, BAD, FIXME
1074 Double_t dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
1075 if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475){
1076 fhAssocPtBkg->Fill(ptTrig, pt);
1077 }
1078
1079 if(dphiBrad<-1./3) dphiBrad += 2;
1080 if(assocBin>=0){
1081 fhDeltaPhiBradAssocPtBin[assocBin]->Fill(ptTrig, dphiBrad);
1082 fhDeltaPhiAssocPtBin [assocBin]->Fill(ptTrig, deltaPhi);
1083 }
1084
1085 fhEtaCharged ->Fill(pt,eta);
1086 fhPhiCharged ->Fill(pt,phi);
e09cf5ef 1087 fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1088 fhDeltaPhiCharged->Fill(ptTrig, deltaPhi);
1089 fhDeltaPhiDeltaEtaCharged->Fill(deltaPhi,aodParticle->Eta()-eta);
e09cf5ef 1090
1091 if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1092 //fill different multiplicity histogram
1093 if(DoEventSelect()){
1094 for(Int_t im=0; im<GetMultiBin(); im++){
1095 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1)){
045396c8 1096 fhTrigDeltaPhiCharged[im]->Fill(ptTrig,deltaPhi);
e09cf5ef 1097 fhTrigDeltaEtaCharged[im]->Fill(ptTrig,aodParticle->Eta()-eta);
045396c8 1098 }
e09cf5ef 1099 }
1100 }
1101 //delta phi cut for correlation
045396c8 1102 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) {
1103 fhDeltaPhiChargedPt->Fill(pt,deltaPhi);
e09cf5ef 1104 fhPtImbalanceCharged->Fill(ptTrig,xE);
05d0d05d 1105 fhPtHbpCharged ->Fill(ptTrig, cosi);
1106 fhPtTrigPout ->Fill(ptTrig, pout) ;
e09cf5ef 1107 fhPtTrigCharged->Fill(ptTrig, pt) ;
05d0d05d 1108 if(track->Charge() > 0) fhPtImbalancePosCharged->Fill(ptTrig,xE) ;
1109 else fhPtImbalanceNegCharged->Fill(ptTrig,xE) ;
e09cf5ef 1110 //fill different multiplicity histogram
1111 if(DoEventSelect()){
1112 for(Int_t im=0; im<GetMultiBin(); im++){
1113 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
1114 fhTrigCorr[im]->Fill(ptTrig,xE);
1115 }
1116 } //multiplicity events selection
1117 } //delta phi cut for correlation
045396c8 1118 else if ((deltaPhi > fUeDeltaPhiMinCut) && ( deltaPhi < fUeDeltaPhiMaxCut)) { //UE study
1119 fhDeltaPhiUeChargedPt->Fill(pt,deltaPhi);
1120 Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
1121 Double_t uexE = -(pt/ptTrig)*TMath::Cos(randomphi);
1122 if(uexE < 0.) uexE = -uexE;
1123 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - xe = %f, uexE = %f \n", xE, uexE);
1124 fhPtImbalanceUeCharged->Fill(ptTrig,uexE);
c514f286 1125 if(uexE>0)fhPtHbpUeCharged->Fill(ptTrig,TMath::Log(1/uexE));
e09cf5ef 1126 if(DoEventSelect()){
1127 for(Int_t im=0; im<GetMultiBin(); im++){
1128 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
1129 fhTrigUeCorr[im]->Fill(ptTrig,xE);
1130 }
1131 } //multiplicity events selection
1132
1133 } //UE study
1134
1135 if(fPi0Trigger){
1136 if(indexPhoton1!=-1 && indexPhoton2!=-1){
045396c8 1137 fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
1138 fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
1139 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
1140 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
e09cf5ef 1141 fhPtImbalanceDecayCharged->Fill(ptDecay1,ratDecay1);
045396c8 1142 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
e09cf5ef 1143 fhPtImbalanceDecayCharged->Fill(ptDecay2,ratDecay2);
045396c8 1144 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
e09cf5ef 1145 } //index of decay photons found
1146 } //make decay-hadron correlation
1147
1148 //several UE calculation
1149 if(fMakeSeveralUE){
045396c8 1150 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){
1151 fhDeltaPhiUeLeftCharged->Fill(pt,deltaPhi);
e09cf5ef 1152 fhPtImbalanceUeLeftCharged->Fill(ptTrig,rat);
1153 fhPtHbpUeLeftCharged->Fill(ptTrig,cosi);
1154 }
045396c8 1155 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){
1156 fhDeltaPhiUeRightCharged->Fill(pt,deltaPhi);
e09cf5ef 1157 fhPtImbalanceUeRightCharged->Fill(ptTrig,rat);
1158 fhPtHbpUeRightCharged->Fill(ptTrig,cosi);
1159
1160 }
1161 } //several UE calculation
1162
045396c8 1163 //Fill leading particle histogram
1164 fhPtLeading->Fill(ptTrig);
1165 if(phiTrig<0)phiTrig+=TMath::TwoPi();
1166 fhPhiLeading->Fill(ptTrig, phiTrig);
1167 fhEtaLeading->Fill(ptTrig, etaTrig);
1168
e09cf5ef 1169 } //Fill histogram
1170 else{
1171 nrefs++;
1172 if(nrefs==1){
1173 reftracks = new TObjArray(0);
045396c8 1174 TString trackname = Form("%s+Tracks", GetAODObjArrayName().Data());
1175 reftracks->SetName(trackname.Data());
e09cf5ef 1176 reftracks->SetOwner(kFALSE);
1177 }
1178 reftracks->Add(track);
1179 }//aod particle loop
1180 }// track loop
1181
1182 //Fill AOD with reference tracks, if not filling histograms
1183 if(!bFillHisto && reftracks) {
1184 aodParticle->AddObjArray(reftracks);
1185 }
1186
045396c8 1187 return kTRUE;
e09cf5ef 1188
1189}
1190
05d0d05d 1191//________________________________________________________________________________________________________________
045396c8 1192Bool_t AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * const aodParticle,
1193 TObjArray* pi0list, const Bool_t bFillHisto)
e09cf5ef 1194{
1195 // Neutral Pion Correlation Analysis
1196 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Make trigger particle - pi0 correlation, %d pi0's \n",pi0list->GetEntriesFast());
1197
1198 Int_t evtIndex11 = 0 ;
1199 Int_t evtIndex12 = 0 ;
1200 if (GetMixedEvent()) {
1201 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
1202 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
1203 }
1204
045396c8 1205 Double_t pt = -100. ;
1206 Double_t px = -100. ;
1207 Double_t py = -100. ;
1208 Double_t rat = -100. ;
1209 Double_t phi = -100. ;
1210 Double_t eta = -100. ;
1211 Double_t xE = -100. ;
1212 Double_t cosi = -100. ;
e09cf5ef 1213
1214 Double_t ptTrig = aodParticle->Pt();
1215 Double_t phiTrig = aodParticle->Phi();
1216 Double_t etaTrig = aodParticle->Eta();
1217 Double_t pxTrig = aodParticle->Px();
1218 Double_t pyTrig = aodParticle->Py();
1219
045396c8 1220 Int_t indexPhoton1 =-1 ;
1221 Int_t indexPhoton2 =-1 ;
1222 Double_t ptDecay1 = 0. ;
e09cf5ef 1223 Double_t pxDecay1 = 0. ;
1224 Double_t pyDecay1 = 0. ;
045396c8 1225 Double_t phiDecay1 = 0. ;
1226 Double_t ptDecay2 = 0. ;
e09cf5ef 1227 Double_t pxDecay2 = 0. ;
1228 Double_t pyDecay2 = 0. ;
045396c8 1229 Double_t phiDecay2 = 0. ;
1230
1231 Double_t ratDecay1 = -100. ;
1232 Double_t ratDecay2 = -100. ;
1233 Double_t deltaPhi = -100. ;
1234 Double_t deltaPhiDecay1 = -100. ;
1235 Double_t deltaPhiDecay2 = -100. ;
e09cf5ef 1236
e09cf5ef 1237 TObjArray * clusters = 0x0 ;
045396c8 1238 TLorentzVector photonMom ;
1239
e09cf5ef 1240 if(fPi0Trigger){
1241 indexPhoton1 = aodParticle->GetCaloLabel (0);
1242 indexPhoton2 = aodParticle->GetCaloLabel (1);
045396c8 1243 if(GetDebug() > 1)
1244 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
e09cf5ef 1245
1246 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1247 if(aodParticle->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
1248 else clusters = GetPHOSClusters() ;
1249 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){
1250 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
1251 photon->GetMomentum(photonMom,GetVertex(0)) ;
1252 if(photon->GetID()==indexPhoton1) {
1253 ptDecay1 = photonMom.Pt();
1254 pxDecay1 = photonMom.Px();
1255 pyDecay1 = photonMom.Py();
1256 phiDecay1 = photonMom.Phi();
1257 }
1258 if(photon->GetID()==indexPhoton2) {
1259 ptDecay2 = photonMom.Pt();
1260 pxDecay2 = photonMom.Px();
1261 pyDecay2 = photonMom.Py();
1262 phiDecay2 = photonMom.Phi();
1263 }
045396c8 1264 if(GetDebug() > 1)
1265 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2);
e09cf5ef 1266 } //photonAOD loop
1267 } //index of decay photons found
1268 if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig);
1269 } //make decay-hadron correlation
1270
1271 TObjArray * refpi0 =0x0;
1272 Int_t nrefs = 0;
1273
1274 //Loop on stored AOD pi0
1275 Int_t naod = pi0list->GetEntriesFast();
045396c8 1276 if(GetDebug() > 0)
1277 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod);
e09cf5ef 1278 for(Int_t iaod = 0; iaod < naod ; iaod++){
1279 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod));
1280
1281 Int_t evtIndex2 = 0 ;
1282 Int_t evtIndex3 = 0 ;
1283 if (GetMixedEvent()) {
1284 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
1285 evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
1286
045396c8 1287 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 ||
1288 evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events
e09cf5ef 1289 continue ;
1290 }
1291
1292 //Int_t pdg = pi0->GetPdg();
1293 //if(pdg != AliCaloPID::kPi0) continue;
1294
1295 pt = pi0->Pt();
1296 px = pi0->Px();
1297 py = pi0->Py();
1298 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
1299 //jumped out this event if near side associated partile pt larger than trigger
1300 if(pt > ptTrig && TMath::Abs(phi-phiTrig)<TMath::PiOver2()) break ;
045396c8 1301
e09cf5ef 1302 //Selection within angular range
1303 phi = pi0->Phi();
045396c8 1304 //Float_t deltaPhi = TMath::Abs(phiTrig-phi);
1305 //if( (deltaPhi < fDeltaPhiMinCut) || ( deltaPhi > fDeltaPhiMaxCut) ) continue ;
e09cf5ef 1306
1307 if(bFillHisto){
1308
045396c8 1309 deltaPhi = phiTrig-phi;
1310 if(deltaPhi<-TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
1311 if(deltaPhi>3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
e09cf5ef 1312
1313 rat = pt/ptTrig ;
1314 phi = pi0->Phi() ;
1315 eta = pi0->Eta() ;
1316 xE = -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
1317 if(xE <0.)xE =-xE;
1318 cosi = TMath::Log(1/xE);
1319
1320 if(fPi0Trigger){
1321 if(indexPhoton1!=-1 && indexPhoton2!=-1){
1322 if(ptDecay1) ratDecay1 = pt/ptDecay1 ;
1323 if(ptDecay2) ratDecay2 = pt/ptDecay2 ;
045396c8 1324 deltaPhiDecay1 = phiDecay1-phi;
1325 deltaPhiDecay2 = phiDecay2-phi;
1326 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
1327 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
1328 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
1329 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
1330 fhDeltaPhiDecayNeutral->Fill(ptDecay1, deltaPhiDecay1);
1331 fhDeltaPhiDecayNeutral->Fill(ptDecay2, deltaPhiDecay2);
1332 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
1333 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
e09cf5ef 1334 fhPtImbalanceDecayNeutral->Fill(ptDecay1,ratDecay1);
045396c8 1335 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
e09cf5ef 1336 fhPtImbalanceDecayNeutral->Fill(ptDecay2,ratDecay2);
045396c8 1337 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2);
e09cf5ef 1338 }
1339 } //do decay-hadron correlation
1340
1341 fhEtaNeutral->Fill(pt,eta);
1342 fhPhiNeutral->Fill(pt,phi);
1343 fhDeltaEtaNeutral->Fill(ptTrig,etaTrig-eta);
045396c8 1344 fhDeltaPhiNeutral->Fill(ptTrig,deltaPhi);
1345 fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi,etaTrig-eta);
e09cf5ef 1346
1347 //delta phi cut for correlation
045396c8 1348 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) ) {
1349 fhDeltaPhiNeutralPt->Fill(pt,deltaPhi);
e09cf5ef 1350 fhPtImbalanceNeutral->Fill(ptTrig,rat);
1351 fhPtHbpNeutral->Fill(ptTrig,cosi);
1352 }
1353 else {
045396c8 1354 fhDeltaPhiUeNeutralPt->Fill(pt,deltaPhi);
e09cf5ef 1355 fhPtImbalanceUeNeutral->Fill(ptTrig,rat);
1356 fhPtHbpUeNeutral->Fill(ptTrig,cosi);
1357 }
1358 //several UE calculation
1359 if(fMakeSeveralUE){
045396c8 1360 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut)){
1361 fhDeltaPhiUeLeftNeutral->Fill(pt,deltaPhi);
e09cf5ef 1362 fhPtImbalanceUeLeftNeutral->Fill(ptTrig,rat);
1363 fhPtHbpUeLeftNeutral->Fill(ptTrig,cosi);
1364 }
045396c8 1365 if((deltaPhi>fUeDeltaPhiMinCut) && (deltaPhi <fUeDeltaPhiMaxCut)){
1366 fhDeltaPhiUeRightNeutral->Fill(pt,deltaPhi);
e09cf5ef 1367 fhPtImbalanceUeRightNeutral->Fill(ptTrig,rat);
1368 fhPtHbpUeRightNeutral->Fill(ptTrig,cosi);
1369 }
1370 } //several UE calculation
1371 }
1372 else{
1373 nrefs++;
1374 if(nrefs==1){
1375 refpi0 = new TObjArray(0);
1376 refpi0->SetName(GetAODObjArrayName()+"Pi0s");
1377 refpi0->SetOwner(kFALSE);
1378 }
1379 refpi0->Add(pi0);
1380 }//put references in trigger AOD
045396c8 1381
1382 if(GetDebug() > 2 )
1383 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
1384
1385 }//loop
1386
1387 return kTRUE;
1388}
1389
05d0d05d 1390//_________________________________________________________________________________________________________
045396c8 1391void AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
1392{
1393 // Charged Hadron Correlation Analysis with MC information
1394 if(GetDebug()>1)
1395 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Make trigger particle - charged hadron correlation in AOD MC level\n");
1396
1397 AliStack * stack = 0x0 ;
1398 TParticle * primary = 0x0 ;
1399 TClonesArray * mcparticles0 = 0x0 ;
1400 TClonesArray * mcparticles = 0x0 ;
1401 AliAODMCParticle * aodprimary = 0x0 ;
1402
1403 Double_t eprim = 0 ;
1404 Double_t ptprim = 0 ;
1405 Double_t phiprim = 0 ;
1406 Double_t etaprim = 0 ;
1407 Double_t pxprim = 0 ;
1408 Double_t pyprim = 0 ;
1409 Double_t pzprim = 0 ;
1410 Int_t nTracks = 0 ;
1411 Int_t iParticle = 0 ;
1412 Double_t charge = 0.;
1413
1414 Double_t mcrat =-100 ;
1415 Double_t mcxE =-100 ;
1416 Double_t mccosi =-100 ;
1417
1418 //Track loop, select tracks with good pt, phi and fill AODs or histograms
1419 //Int_t currentIndex = -1 ;
1420 Double_t mcTrackPt = 0 ;
1421 Double_t mcTrackPhi = 0 ;
1422 Double_t mcTrackEta = 0 ;
1423 Double_t mcTrackPx = 0 ;
1424 Double_t mcTrackPy = 0 ;
1425 Double_t mcTrackPz = 0 ;
1426
1427 if(GetReader()->ReadStack()){
1428 nTracks = GetMCStack()->GetNtrack() ;
1429 }
1430 else nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
1431 //Int_t trackIndex[nTracks];
1432
1433 Int_t label= aodParticle->GetLabel();
1434 if(label<0){
1435 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** bad label ***: label %d \n", label);
1436 return;
1437 }
1438
1439 if(GetReader()->ReadStack()){
1440 stack = GetMCStack() ;
1441 if(!stack) {
1442 printf(" AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation- Stack not available, is the MC handler called? STOP\n");
1443 abort();
1444 }
1445
1446 nTracks=stack->GetNprimary();
1447 if(label >= stack->GetNtrack()) {
1448 if(GetDebug() > 2) printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
1449 return ;
1450 }
1451 primary = stack->Particle(label);
1452 if(!primary){
1453 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no primary ***: label %d \n", label);
1454 return;
1455 }
1456
1457 eprim = primary->Energy();
1458 ptprim = primary->Pt();
1459 phiprim = primary->Phi();
1460 etaprim = primary->Eta();
1461 pxprim = primary->Px();
1462 pyprim = primary->Py();
1463 pzprim = primary->Pz();
1464
1465 if(primary){
e09cf5ef 1466
045396c8 1467 for (iParticle = 0 ; iParticle < nTracks ; iParticle++) {
1468 TParticle * particle = stack->Particle(iParticle);
1469 TLorentzVector momentum;
1470 //keep only final state particles
1471 if(particle->GetStatusCode()!=1) continue ;
1472 Int_t pdg = particle->GetPdgCode();
1473 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1474 particle->Momentum(momentum);
1475
1476 //---------- Charged particles ----------------------
1477 if(charge != 0){
1478 //Particles in CTS acceptance
1479 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
1480 if(TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
1481 if(inCTS&&momentum.Pt() >GetMinPt())
1482 {
1483 mcTrackPt = particle->Pt();
1484 mcTrackPhi = particle->Phi();
1485 mcTrackEta = particle->Eta();
1486 mcTrackPx = particle->Px();
1487 mcTrackPy = particle->Py();
1488 mcTrackPz = particle->Pz();
1489 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1490 //Select only hadrons in pt range
1491 if(mcTrackPt < GetMinPt() || mcTrackPt > GetMaxPt()) continue ;
1492 //remove trigger itself for correlation when use charged triggers
1493 if(label==iParticle && mcTrackPt==ptprim && mcTrackPhi==phiprim && mcTrackEta==etaprim)
1494 continue ;
1495 //jumped out this event if near side associated partile pt larger than trigger
1496 if( mcTrackPt> ptprim && TMath::Abs(mcTrackPhi-phiprim)<TMath::PiOver2())
1497 return ;
1498
1499 mcrat = mcTrackPt/ptprim ;
1500 mcxE = -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
1501 if(mcxE <0.) mcxE =-mcxE;
1502 mccosi = TMath::Log(1/mcxE);
1503 // printf("rat = %f, xE = %f, cosi =%f \n", rat, xE, cosi);
1504 // printf("phi = %f \n", phi);
1505
1506 //Selection within angular range
1507 Double_t mcdeltaPhi = phiprim-mcTrackPhi;
1508 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1509 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1510 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
1511 if(GetDebug()>0 )
1512 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",
1513 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
1514 // Fill Histograms
1515 fhMCEtaCharged->Fill(mcTrackPt,mcTrackEta);
1516 fhMCPhiCharged->Fill(mcTrackPt,mcTrackPhi);
1517 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
1518 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
1519 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
1520 // fhDeltaPhiCharged->Fill(ptTrig, deltaPhi);
1521 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,etaprim-mcTrackEta);
1522
1523 //delta phi cut for correlation
1524 if( (mcdeltaPhi > fDeltaPhiMinCut) && ( mcdeltaPhi < fDeltaPhiMaxCut) ) {
1525 fhMCDeltaPhiChargedPt->Fill(mcTrackPt,mcdeltaPhi);
1526 fhMCPtImbalanceCharged->Fill(ptprim,mcxE);
1527 fhMCPtHbpCharged->Fill(ptprim,mccosi);
1528 fhMCPtTrigPout->Fill(ptprim, mcpout) ;
1529 }//delta phi cut for correlation
1530 } //tracks after cuts
1531 }//Charged
1532 } //track loop
1533 } //when the leading particles could trace back to MC
1534 } //ESD MC
1535 else if(GetReader()->ReadAODMCParticles()){
1536 //Get the list of MC particles
1537 mcparticles0 = GetReader()->GetAODMCParticles(0);
1538 if(!mcparticles0) return;
1539 if(label >=mcparticles0->GetEntriesFast()){
1540 if(GetDebug() > 2)
1541 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label,mcparticles0->GetEntriesFast());
1542 return;
1543 }
1544 //Get the particle
1545 aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
1546 if(!aodprimary) {
1547 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no AOD primary ***: label %d \n", label);
1548 return;
1549 }
1550
1551 ptprim = aodprimary->Pt();
1552 phiprim = aodprimary->Phi();
1553 etaprim =aodprimary->Eta();
1554 pxprim =aodprimary->Px();
1555 pyprim =aodprimary->Py();
1556 pzprim =aodprimary->Pz();
1557 if(aodprimary){
1558 mcparticles= GetReader()->GetAODMCParticles();
1559 for (Int_t i=0; i<nTracks;i++) {
1560 AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(i);
1561 if (!part->IsPhysicalPrimary()) continue;
1562 Int_t pdg = part->GetPdgCode();
1563 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1564 TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());
1565 if(charge != 0){
1566 if(part->Pt()> GetReader()->GetCTSPtMin()){
1567 //Particles in CTS acceptance
1568 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
1569 Int_t indexmother=part->GetMother();
1570 if(indexmother>-1)
1571 {
1572 Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
1573 if(TMath::Abs(pdg) == 11 && mPdg == 22) continue;
1574 }
1575 if(inCTS&&momentum.Pt() >GetMinPt())
1576 {
1577 mcTrackPt=part->Pt();
1578 mcTrackPhi=part->Phi();
1579 mcTrackEta=part->Eta();
1580 mcTrackPx=part->Px();
1581 mcTrackPy=part->Py();
1582 mcTrackPz=part->Pz();
1583 if(mcTrackPhi < 0) mcTrackPhi+=TMath::TwoPi();
1584 //Select only hadrons in pt range
1585 if(mcTrackPt < GetMinPt() || mcTrackPt > GetMaxPt()) continue ;
1586 //remove trigger itself for correlation when use charged triggers
1587 if(label==i && mcTrackPt==ptprim && mcTrackPhi==phiprim && mcTrackEta==etaprim)
1588 continue ;
1589 //jumped out this event if near side associated partile pt larger than trigger
1590 if( mcTrackPt> ptprim && TMath::Abs(mcTrackPhi-phiprim)<TMath::PiOver2())
1591 return ;
1592
1593 mcrat = mcTrackPt/ptprim ;
1594 mcxE = -(mcTrackPx*pxprim+mcTrackPy*pyprim)/(ptprim*ptprim);
1595 if(mcxE <0.)mcxE =-mcxE;
1596 mccosi = TMath::Log(1/mcxE);
1597
1598 //Selection within angular range
1599 Double_t mcdeltaPhi = phiprim-mcTrackPhi;
1600 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
1601 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
1602 Double_t mcpout = mcTrackPt*TMath::Sin(mcdeltaPhi) ;
1603 if(GetDebug()>0)
1604 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",
1605 mcTrackPt,mcTrackPhi, phiprim,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
1606 // Fill Histograms
1607 fhMCEtaCharged->Fill(mcTrackPt,mcTrackEta);
1608 fhMCPhiCharged->Fill(mcTrackPt,mcTrackPhi);
1609 fhMCDeltaEtaCharged->Fill(ptprim,etaprim-mcTrackEta);
1610 fhMCDeltaPhiCharged->Fill(ptprim,mcdeltaPhi);
1611 fhMCPtAssocDeltaPhi->Fill(mcTrackPt, mcdeltaPhi);
1612 // fhDeltaPhiCharged->Fill(ptTrig, deltaPhi);
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