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