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