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