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