1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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)
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)
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)
30 //////////////////////////////////////////////////////////////////////////////
33 // --- ROOT system ---
34 //#include "TClonesArray.h"
38 #include <TDatabasePDG.h>
40 //---- ANALYSIS system ----
41 #include "AliNeutralMesonSelection.h"
42 #include "AliAnaParticleHadronCorrelation.h"
43 #include "AliCaloTrackReader.h"
44 #include "AliAODPWG4ParticleCorrelation.h"
45 #include "AliFiducialCut.h"
46 #include "AliVTrack.h"
47 #include "AliVCluster.h"
48 #include "AliMCAnalysisUtils.h"
49 #include "TParticle.h"
51 #include "AliAODMCParticle.h"
52 #include "AliMixedEvent.h"
53 #include "AliAnalysisManager.h"
54 #include "AliInputEventHandler.h"
55 #include "AliEventplane.h"
57 ClassImp(AliAnaParticleHadronCorrelation)
60 //___________________________________________________________________
61 AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation():
62 AliAnaCaloTrackCorrBaseClass(),
64 fMaxAssocPt(1000.), fMinAssocPt(0.),
65 fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
66 fSelectIsolated(0), fMakeSeveralUE(0),
67 fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.),
68 fPi0AODBranchName(""), fNeutralCorr(0),
69 fPi0Trigger(0), fDecayTrigger(0),
70 fMakeAbsoluteLeading(0), fMakeNearSideLeading(0),
71 fLeadingTriggerIndex(-1), fHMPIDCorrelation(0), fFillBradHisto(0),
72 fNAssocPtBins(0), fAssocPtBinLimit(),
74 fListMixTrackEvents(), fListMixCaloEvents(),
75 fUseMixStoredInReader(0), fFillNeutralEventMixPool(0),
76 fM02MaxCut(0), fM02MinCut(0),
77 fFillPileUpHistograms(0),
79 fhPtInput(0), fhPtFidCut(0),
80 fhPtLeading(0), fhPtLeadingPileUp(),
81 fhPtLeadingVzBin(0), fhPtLeadingBin(0),
82 fhPhiLeading(0), fhEtaLeading(0),
84 fhPtLeadingCentrality(0), fhPtLeadingEventPlane(0),
85 fhLeadingEventPlaneCentrality(0),
86 fhPtLeadingMixed(0), fhPtLeadingMixedVzBin(0), fhPtLeadingMixedBin(0),
87 fhPhiLeadingMixed(0), fhEtaLeadingMixed(0),
88 fhDeltaPhiDeltaEtaCharged(0),
89 fhPhiCharged(0), fhEtaCharged(0),
90 fhDeltaPhiCharged(0), fhDeltaEtaCharged(0),
91 fhDeltaPhiChargedPt(0), fhDeltaPhiUeChargedPt(0),
93 fhXECharged(0), fhXEUeCharged(0),
94 fhXEPosCharged(0), fhXENegCharged(0),
95 fhPtHbpXECharged(0), fhPtHbpXEUeCharged(0),
96 fhZTCharged(0), fhZTUeCharged(0),
97 fhZTPosCharged(0), fhZTNegCharged(0),
98 fhPtHbpZTCharged(0), fhPtHbpZTUeCharged(0),
99 fhXEChargedMC(), fhDeltaPhiChargedMC(),
100 fhDeltaPhiDeltaEtaChargedPtA3GeV(0),
101 fhDeltaPhiChargedPtA3GeV(0), fhDeltaEtaChargedPtA3GeV(0),
103 fhDeltaPhiChargedPileUp(), fhDeltaEtaChargedPileUp(),
104 fhDeltaPhiChargedPtA3GeVPileUp(), fhDeltaEtaChargedPtA3GeVPileUp(),
105 fhXEChargedPileUp(), fhXEUeChargedPileUp(),
106 fhZTChargedPileUp(), fhZTUeChargedPileUp(),
107 fhPtTrigChargedPileUp(),
108 fhDeltaPhiChargedOtherBC(), fhDeltaPhiChargedPtA3GeVOtherBC(),
109 fhXEChargedOtherBC(), fhXEUeChargedOtherBC(),
110 fhZTChargedOtherBC(), fhZTUeChargedOtherBC(),
111 fhPtTrigChargedOtherBC(),
112 fhDeltaPhiChargedBC0(), fhDeltaPhiChargedPtA3GeVBC0(),
113 fhXEChargedBC0(), fhXEUeChargedBC0(),
114 fhZTChargedBC0(), fhZTUeChargedBC0(),
115 fhPtTrigChargedBC0(),
116 fhDeltaPhiUeLeftCharged(0), fhDeltaPhiUeRightCharged(0),
117 fhDeltaPhiUeLeftUpCharged(0), fhDeltaPhiUeRightUpCharged(0),
118 fhDeltaPhiUeLeftDownCharged(0), fhDeltaPhiUeRightDownCharged(0),
119 fhXEUeLeftCharged(0), fhXEUeRightCharged(0),
120 fhXEUeLeftUpCharged(0), fhXEUeRightUpCharged(0),
121 fhXEUeLeftDownCharged(0), fhXEUeRightDownCharged(0),
122 fhPtHbpXEUeLeftCharged(0), fhPtHbpXEUeRightCharged(0),
123 fhZTUeLeftCharged(0), fhZTUeRightCharged(0),
124 fhPtHbpZTUeLeftCharged(0), fhPtHbpZTUeRightCharged(0),
125 fhPtTrigPout(0), fhPtTrigCharged(0),
126 fhTrigDeltaPhiCharged(0x0), fhTrigDeltaEtaCharged(0x0),
127 fhTrigXECorr(0x0), fhTrigXEUeCorr(0x0),
128 fhTrigZTCorr(0x0), fhTrigZTUeCorr(0x0),
129 fhAssocPtBkg(0), fhDeltaPhiDeltaEtaAssocPtBin(0),
130 fhDeltaPhiAssocPtBin(0),
131 fhDeltaPhiAssocPtBinDEta08(0), fhDeltaPhiAssocPtBinDEta0(0),
132 fhDeltaPhiAssocPtBinHMPID(0), fhDeltaPhiAssocPtBinHMPIDAcc(0),
133 fhDeltaPhiBradAssocPtBin(0), fhDeltaPhiBrad(0),
134 fhXEAssocPtBin(0), fhZTAssocPtBin(0),
135 fhDeltaPhiDeltaEtaNeutral(0),
136 fhPhiNeutral(0), fhEtaNeutral(0),
137 fhDeltaPhiNeutral(0), fhDeltaEtaNeutral(0),
138 fhDeltaPhiNeutralPt(0), fhDeltaPhiUeNeutralPt(0),
139 fhXENeutral(0), fhXEUeNeutral(0),
140 fhPtHbpXENeutral(0), fhPtHbpXEUeNeutral(0),
141 fhZTNeutral(0), fhZTUeNeutral(0),
142 fhPtHbpZTNeutral(0), fhPtHbpZTUeNeutral(0),
143 fhDeltaPhiUeLeftNeutral(0), fhDeltaPhiUeRightNeutral(0),
144 fhXEUeLeftNeutral(0), fhXEUeRightNeutral(0),
145 fhPtHbpXEUeLeftNeutral(0), fhPtHbpXEUeRightNeutral(0),
146 fhZTUeLeftNeutral(0), fhZTUeRightNeutral(0),
147 fhPtHbpZTUeLeftNeutral(0), fhPtHbpZTUeRightNeutral(0),
148 fhPtPi0DecayRatio(0),
149 fhDeltaPhiDecayCharged(0), fhXEDecayCharged(0), fhZTDecayCharged(0),
150 fhDeltaPhiDecayNeutral(0), fhXEDecayNeutral(0), fhZTDecayNeutral(0),
151 fhDeltaPhiDecayChargedAssocPtBin(0),
152 fhXEDecayChargedAssocPtBin(0), fhZTDecayChargedAssocPtBin(0),
153 fh2phiLeadingParticle(0x0), fhMCPtLeading(0),
154 fhMCPhiLeading(0), fhMCEtaLeading(0),
155 fhMCEtaCharged(0), fhMCPhiCharged(0),
156 fhMCDeltaEtaCharged(0), fhMCDeltaPhiCharged(0x0),
157 fhMCDeltaPhiDeltaEtaCharged(0), fhMCDeltaPhiChargedPt(0),
158 fhMCPtXECharged(0), fhMCPtXEUeCharged(0),
159 fhMCPtHbpXECharged(0), fhMCPtHbpXEUeCharged(0),
161 fhMCPtZTCharged(0), fhMCPtHbpZTCharged(0),
162 fhMCPtTrigPout(0), fhMCPtAssocDeltaPhi(0),
165 fhNtracksAll(0), fhNtracksTrigger(0), fhNtracksMB(0),
166 fhNclustersAll(0), fhNclustersTrigger(0), fhNclustersMB(0),
167 fhMixDeltaPhiCharged(0), fhMixDeltaPhiDeltaEtaCharged(0),
168 fhMixXECharged(0), fhMixHbpXECharged(0),
169 fhMixDeltaPhiChargedAssocPtBin(),
170 fhMixDeltaPhiChargedAssocPtBinDEta08(),
171 fhMixDeltaPhiChargedAssocPtBinDEta0(),
172 fhMixDeltaPhiDeltaEtaChargedAssocPtBin(),
173 fhEventBin(0), fhEventMixBin(0)
177 //Initialize parameters
180 for(Int_t i = 0; i < 7; i++)
182 fhPtLeadingMC[i] = 0;
183 fhXEChargedMC[i] = 0;
184 fhDeltaPhiChargedMC[i] = 0;
187 for(Int_t i = 0; i < 7; i++)
189 fhPtLeadingPileUp [i] = 0 ;
190 fhDeltaPhiChargedPileUp [i] = 0 ; fhDeltaEtaChargedPileUp [i] = 0 ;
191 fhXEChargedPileUp [i] = 0 ; fhXEUeChargedPileUp [i] = 0 ;
192 fhZTChargedPileUp [i] = 0 ; fhZTUeChargedPileUp [i] = 0 ;
193 fhPtTrigChargedPileUp [i] = 0 ;
194 fhDeltaPhiChargedPtA3GeVPileUp[i] = 0 ; fhDeltaEtaChargedPtA3GeVPileUp[i] = 0 ;
199 //_________________________________________________________________
200 AliAnaParticleHadronCorrelation::~AliAnaParticleHadronCorrelation()
202 // Remove event containers
206 if(fListMixTrackEvents)
208 for(Int_t iz=0; iz < GetNZvertBin(); iz++)
210 for(Int_t ic=0; ic < GetNCentrBin(); ic++)
212 for(Int_t irp=0; irp<GetNRPBin(); irp++)
214 Int_t bin = GetEventMixBin(ic, iz, irp);
215 fListMixTrackEvents[bin]->Delete() ;
216 delete fListMixTrackEvents[bin] ;
222 delete[] fListMixTrackEvents;
224 if(fListMixCaloEvents)
226 for(Int_t iz=0; iz < GetNZvertBin(); iz++)
228 for(Int_t ic=0; ic < GetNCentrBin(); ic++)
230 for(Int_t irp=0; irp<GetNRPBin(); irp++)
232 Int_t bin = GetEventMixBin(ic, iz, irp);
233 fListMixCaloEvents[bin]->Delete() ;
234 delete fListMixCaloEvents[bin] ;
240 delete[] fListMixCaloEvents;
245 //______________________________________________________________________________________________________________________________________________________
246 void AliAnaParticleHadronCorrelation::FillChargedAngularCorrelationHistograms(const Float_t ptAssoc, const Float_t ptTrig, const Int_t bin,
247 const Float_t phiAssoc, const Float_t phiTrig, Float_t & deltaPhi,
248 const Float_t etaAssoc, const Float_t etaTrig,
249 const Bool_t decay, const Float_t hmpidSignal, const Int_t outTOF,
250 const Int_t nTracks, const Int_t mcTag)
252 // Fill angular correlation related histograms
254 Float_t deltaEta = etaTrig-etaAssoc;
255 deltaPhi = phiTrig-phiAssoc;
256 Float_t deltaPhiOrg = deltaPhi;
258 if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
259 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
261 fhEtaCharged ->Fill(ptAssoc,etaAssoc);
262 fhPhiCharged ->Fill(ptAssoc,phiAssoc);
263 fhDeltaEtaCharged ->Fill(ptTrig ,deltaEta);
264 fhDeltaPhiCharged ->Fill(ptTrig ,deltaPhi);
265 fhDeltaPhiChargedPt->Fill(ptAssoc, deltaPhi);
266 fhDeltaPhiDeltaEtaCharged->Fill(deltaPhi, deltaEta);
270 fhDeltaEtaChargedPtA3GeV ->Fill(ptTrig ,deltaEta);
271 fhDeltaPhiChargedPtA3GeV ->Fill(ptTrig ,deltaPhi);
272 fhDeltaPhiDeltaEtaChargedPtA3GeV->Fill(deltaPhi, deltaEta);
277 if(fFillPileUpHistograms)
281 fhDeltaPhiChargedOtherBC->Fill(ptTrig ,deltaPhi) ;
282 if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVOtherBC->Fill(ptTrig ,deltaPhi) ;
286 fhDeltaPhiChargedBC0->Fill(ptTrig ,deltaPhi) ;
287 if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVBC0->Fill(ptTrig ,deltaPhi) ;
290 if(GetReader()->IsPileUpFromSPD()) { fhDeltaEtaChargedPileUp[0]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[0]->Fill(ptTrig ,deltaPhi) ; }
291 if(GetReader()->IsPileUpFromEMCal()) { fhDeltaEtaChargedPileUp[1]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[1]->Fill(ptTrig ,deltaPhi) ; }
292 if(GetReader()->IsPileUpFromSPDOrEMCal()) { fhDeltaEtaChargedPileUp[2]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[2]->Fill(ptTrig ,deltaPhi) ; }
293 if(GetReader()->IsPileUpFromSPDAndEMCal()) { fhDeltaEtaChargedPileUp[3]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[3]->Fill(ptTrig ,deltaPhi) ; }
294 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) { fhDeltaEtaChargedPileUp[4]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[4]->Fill(ptTrig ,deltaPhi) ; }
295 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) { fhDeltaEtaChargedPileUp[5]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[5]->Fill(ptTrig ,deltaPhi) ; }
296 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) { fhDeltaEtaChargedPileUp[6]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[6]->Fill(ptTrig ,deltaPhi) ; }
302 if(GetReader()->IsPileUpFromSPD()) { fhDeltaEtaChargedPtA3GeVPileUp[0]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[0]->Fill(ptTrig ,deltaPhi) ; }
303 if(GetReader()->IsPileUpFromEMCal()) { fhDeltaEtaChargedPtA3GeVPileUp[1]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[1]->Fill(ptTrig ,deltaPhi) ; }
304 if(GetReader()->IsPileUpFromSPDOrEMCal()) { fhDeltaEtaChargedPtA3GeVPileUp[2]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[2]->Fill(ptTrig ,deltaPhi) ; }
305 if(GetReader()->IsPileUpFromSPDAndEMCal()) { fhDeltaEtaChargedPtA3GeVPileUp[3]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[3]->Fill(ptTrig ,deltaPhi) ; }
306 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) { fhDeltaEtaChargedPtA3GeVPileUp[4]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[4]->Fill(ptTrig ,deltaPhi) ; }
307 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) { fhDeltaEtaChargedPtA3GeVPileUp[5]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[5]->Fill(ptTrig ,deltaPhi) ; }
308 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) { fhDeltaEtaChargedPtA3GeVPileUp[6]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPtA3GeVPileUp[6]->Fill(ptTrig ,deltaPhi) ; }
314 Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
315 fhDeltaPhiChargedMC[mcIndex]->Fill(ptTrig , deltaPhi);
318 if(fDecayTrigger && decay) fhDeltaPhiDecayCharged ->Fill(ptTrig , deltaPhi);
320 Double_t dphiBrad = -100;
323 dphiBrad = atan2(sin(deltaPhiOrg), cos(deltaPhiOrg))/TMath::Pi();//-1 to 1
324 if(TMath::Abs(dphiBrad)>0.325 && TMath::Abs(dphiBrad)<0.475) //Hardcoded values, BAD, FIXME
326 fhAssocPtBkg->Fill(ptTrig, ptAssoc);
329 if(dphiBrad<-1./3) dphiBrad += 2;
330 fhDeltaPhiBrad->Fill(ptTrig, dphiBrad);
333 // Fill histograms in bins of associated particle pT
336 fhDeltaPhiDeltaEtaAssocPtBin [bin]->Fill(deltaPhi,deltaEta);
338 fhDeltaPhiAssocPtBin [bin]->Fill(ptTrig, deltaPhi);
340 if(TMath::Abs(deltaEta)> 0.8)
341 fhDeltaPhiAssocPtBinDEta08 [bin]->Fill(ptTrig, deltaPhi);
343 if(TMath::Abs(deltaEta)< 0.01)
344 fhDeltaPhiAssocPtBinDEta0 [bin]->Fill(ptTrig, deltaPhi);
347 fhDeltaPhiBradAssocPtBin [bin]->Fill(ptTrig, dphiBrad);
349 if(fDecayTrigger && decay)
350 fhDeltaPhiDecayChargedAssocPtBin[bin]->Fill(ptTrig, deltaPhi);
352 if(fHMPIDCorrelation)
354 if( hmpidSignal > 0 )
356 //printf("Track pt %f with HMPID signal %f \n",pt,hmpidSignal);
357 fhDeltaPhiAssocPtBinHMPID[bin]->Fill(ptTrig, deltaPhi);
360 if(phiAssoc > 5*TMath::DegToRad() && phiAssoc < 20*TMath::DegToRad())
362 //printf("Track pt %f in HMPID acceptance phi %f \n ",pt,phi*TMath::RadToDeg() );
363 fhDeltaPhiAssocPtBinHMPIDAcc[bin]->Fill(ptTrig, deltaPhi);
368 //fill different multiplicity histogram
371 for(Int_t im = 0; im<GetMultiBin(); im++)
373 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
375 fhTrigDeltaPhiCharged[im]->Fill(ptTrig,deltaPhi);
376 fhTrigDeltaEtaCharged[im]->Fill(ptTrig,deltaEta);
382 //____________________________________________________________________________________________________________________________________________________
383 Bool_t AliAnaParticleHadronCorrelation::FillChargedMCCorrelationHistograms(const Float_t mcAssocPt, Float_t mcAssocPhi, const Float_t mcAssocEta,
384 const Float_t mcTrigPt, const Float_t mcTrigPhi, const Float_t mcTrigEta)
386 // Fill MC histograms independently of AOD or ESD
388 //Select only hadrons in pt range
389 if(mcAssocPt < fMinAssocPt || mcAssocPt > fMaxAssocPt) return kTRUE ; // exclude but continue
391 if(mcAssocPhi < 0) mcAssocPhi+=TMath::TwoPi();
393 //remove trigger itself for correlation when use charged triggers
394 if(TMath::Abs(mcAssocPt -mcTrigPt ) < 1e-6 &&
395 TMath::Abs(mcAssocPhi-mcTrigPhi) < 1e-6 &&
396 TMath::Abs(mcAssocEta-mcTrigEta) < 1e-6) return kTRUE ; // exclude but continue
399 if( fMakeAbsoluteLeading && mcAssocPt > mcTrigPt ) return kFALSE; // jump event
401 //jump out this event if near side associated partile pt larger than trigger
402 if( fMakeNearSideLeading && mcAssocPt > mcTrigPt &&
403 TMath::Abs(mcAssocPhi-mcTrigPhi)<TMath::PiOver2() ) return kFALSE; // jump event
405 Float_t mcdeltaPhi= mcTrigPhi-mcAssocPhi;
406 if(mcdeltaPhi <= -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
407 if(mcdeltaPhi > 3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
409 Float_t mcxE =-mcAssocPt/mcTrigPt*TMath::Cos(mcdeltaPhi);// -(mcAssocPx*pxprim+mcAssocPy*pyprim)/(mcTrigPt*mcTrigPt);
410 Float_t mchbpXE =-100 ;
411 if(mcxE > 0 ) mchbpXE = TMath::Log(1./mcxE);
413 Float_t mczT = mcAssocPt/mcTrigPt ;
414 Float_t mchbpZT =-100 ;
415 if(mczT > 0 ) mchbpZT = TMath::Log(1./mczT);
417 //Selection within angular range
418 if( mcdeltaPhi< -TMath::PiOver2()) mcdeltaPhi+=TMath::TwoPi();
419 if( mcdeltaPhi>3*TMath::PiOver2()) mcdeltaPhi-=TMath::TwoPi();
421 Double_t mcpout = mcAssocPt*TMath::Sin(mcdeltaPhi) ;
424 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",
425 mcAssocPt,mcAssocPhi, mcTrigPhi,fDeltaPhiMinCut, mcdeltaPhi, fDeltaPhiMaxCut, GetMinPt());
428 fhMCEtaCharged ->Fill(mcAssocPt, mcAssocEta);
429 fhMCPhiCharged ->Fill(mcAssocPt, mcAssocPhi);
430 fhMCDeltaEtaCharged->Fill(mcTrigPt, mcTrigEta-mcAssocEta);
431 fhMCDeltaPhiCharged->Fill(mcTrigPt, mcdeltaPhi);
432 fhMCPtAssocDeltaPhi->Fill(mcAssocPt, mcdeltaPhi);
434 fhMCDeltaPhiDeltaEtaCharged->Fill(mcdeltaPhi,mcTrigEta-mcAssocEta);
436 //delta phi cut for correlation
437 if( (mcdeltaPhi > fDeltaPhiMinCut) && (mcdeltaPhi < fDeltaPhiMaxCut) )
439 fhMCDeltaPhiChargedPt->Fill(mcAssocPt,mcdeltaPhi);
440 fhMCPtXECharged ->Fill(mcTrigPt,mcxE);
441 fhMCPtHbpXECharged ->Fill(mcTrigPt,mchbpXE);
442 fhMCPtZTCharged ->Fill(mcTrigPt,mczT);
443 fhMCPtHbpZTCharged ->Fill(mcTrigPt,mchbpZT);
444 fhMCPtTrigPout ->Fill(mcTrigPt, mcpout) ;
448 if ( (mcdeltaPhi > fUeDeltaPhiMinCut) && (mcdeltaPhi < fUeDeltaPhiMaxCut) )
450 Double_t randomphi = gRandom->Uniform(TMath::Pi()/2,3*TMath::Pi()/2);
451 Double_t mcUexE = -(mcAssocPt/mcTrigPt)*TMath::Cos(randomphi);
453 if(mcUexE < 0.) mcUexE = -mcUexE;
455 fhMCPtXEUeCharged->Fill(mcTrigPt,mcUexE);
456 if(mcUexE > 0) fhMCPtHbpXEUeCharged->Fill(mcTrigPt,TMath::Log(1/mcUexE));
458 fhMCUePart->Fill(mcTrigPt);
464 //___________________________________________________________________________________________________________________
465 void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(const Float_t ptTrig, const Float_t ptAssoc,
466 const Float_t xE, const Float_t hbpXE,
467 const Float_t zT, const Float_t hbpZT,
469 const Int_t nTracks, const Int_t charge,
470 const Int_t bin, const Bool_t decay,
471 const Int_t outTOF, const Int_t mcTag)
474 // Fill mostly momentum imbalance related histograms
476 fhXECharged ->Fill(ptTrig , xE);
477 fhPtHbpXECharged ->Fill(ptTrig , hbpXE);
478 fhZTCharged ->Fill(ptTrig , zT);
479 fhPtHbpZTCharged ->Fill(ptTrig , hbpZT);
480 fhPtTrigPout ->Fill(ptTrig , pout) ;
481 fhPtTrigCharged ->Fill(ptTrig , ptAssoc) ;
484 if(fFillPileUpHistograms)
488 fhXEChargedOtherBC ->Fill(ptTrig,xE);
489 fhZTChargedOtherBC ->Fill(ptTrig,zT);
490 fhPtTrigChargedOtherBC->Fill(ptTrig,ptAssoc);
494 fhXEChargedBC0 ->Fill(ptTrig,xE);
495 fhZTChargedBC0 ->Fill(ptTrig,zT);
496 fhPtTrigChargedBC0->Fill(ptTrig,ptAssoc);
499 if(GetReader()->IsPileUpFromSPD()) { fhXEChargedPileUp[0]->Fill(ptTrig,xE); fhZTChargedPileUp[0]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[0]->Fill(ptTrig,ptAssoc); }
500 if(GetReader()->IsPileUpFromEMCal()) { fhXEChargedPileUp[1]->Fill(ptTrig,xE); fhZTChargedPileUp[1]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[1]->Fill(ptTrig,ptAssoc); }
501 if(GetReader()->IsPileUpFromSPDOrEMCal()) { fhXEChargedPileUp[2]->Fill(ptTrig,xE); fhZTChargedPileUp[2]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[2]->Fill(ptTrig,ptAssoc); }
502 if(GetReader()->IsPileUpFromSPDAndEMCal()) { fhXEChargedPileUp[3]->Fill(ptTrig,xE); fhZTChargedPileUp[3]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[3]->Fill(ptTrig,ptAssoc); }
503 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) { fhXEChargedPileUp[4]->Fill(ptTrig,xE); fhZTChargedPileUp[4]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[4]->Fill(ptTrig,ptAssoc); }
504 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) { fhXEChargedPileUp[5]->Fill(ptTrig,xE); fhZTChargedPileUp[5]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[5]->Fill(ptTrig,ptAssoc); }
505 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) { fhXEChargedPileUp[6]->Fill(ptTrig,xE); fhZTChargedPileUp[6]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[6]->Fill(ptTrig,ptAssoc); }
510 Int_t mcIndex = GetMCTagHistogramIndex(mcTag);
511 fhXEChargedMC [mcIndex]->Fill(ptTrig , xE );
514 if(fDecayTrigger && decay)
516 fhXEDecayCharged->Fill(ptTrig,xE);
517 fhZTDecayCharged->Fill(ptTrig,zT);
518 } // photon decay pi0/eta trigger
520 if(bin >= 0 )//away side
522 fhXEAssocPtBin[bin]->Fill(ptTrig, xE) ;
523 fhZTAssocPtBin[bin]->Fill(ptTrig, zT) ;
525 if(fDecayTrigger && decay)
527 fhXEDecayChargedAssocPtBin[bin]->Fill(ptTrig, xE);
528 fhZTDecayChargedAssocPtBin[bin]->Fill(ptTrig, zT);
534 fhXEPosCharged->Fill(ptTrig,xE) ;
535 fhZTPosCharged->Fill(ptTrig,zT) ;
539 fhXENegCharged->Fill(ptTrig,xE) ;
540 fhZTNegCharged->Fill(ptTrig,zT) ;
543 //fill different multiplicity histogram
546 for(Int_t im=0; im<GetMultiBin(); im++)
548 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
550 fhTrigXECorr[im]->Fill(ptTrig,xE);
551 fhTrigZTCorr[im]->Fill(ptTrig,zT);
554 } //multiplicity events selection
557 //_______________________________________________________________________________________________________________________
558 void AliAnaParticleHadronCorrelation::FillChargedUnderlyingEventHistograms(const Float_t ptTrig, const Float_t ptAssoc,
559 const Float_t deltaPhi, const Int_t nTracks, const Int_t outTOF)
561 // Fill underlying event histograms
563 fhDeltaPhiUeChargedPt->Fill(ptAssoc,deltaPhi);
565 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
566 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
567 Double_t uezT = ptAssoc/ptTrig;
569 if(uexE < 0.) uexE = -uexE;
571 fhXEUeCharged->Fill(ptTrig,uexE);
572 if(uexE > 0) fhPtHbpXEUeCharged->Fill(ptTrig,TMath::Log(1/uexE));
574 fhZTUeCharged->Fill(ptTrig,uezT);
575 if(uexE > 0) fhPtHbpZTUeCharged->Fill(ptTrig,TMath::Log(1/uezT));
579 if(fFillPileUpHistograms)
583 fhXEUeChargedOtherBC->Fill(ptTrig,uexE);
584 fhZTUeChargedOtherBC->Fill(ptTrig,uezT);
588 fhXEUeChargedBC0->Fill(ptTrig,uexE);
589 fhZTUeChargedBC0->Fill(ptTrig,uezT);
592 if(GetReader()->IsPileUpFromSPD()) { fhXEUeChargedPileUp[0]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[0]->Fill(ptTrig,uezT);}
593 if(GetReader()->IsPileUpFromEMCal()) { fhXEUeChargedPileUp[1]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[1]->Fill(ptTrig,uezT);}
594 if(GetReader()->IsPileUpFromSPDOrEMCal()) { fhXEUeChargedPileUp[2]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[2]->Fill(ptTrig,uezT);}
595 if(GetReader()->IsPileUpFromSPDAndEMCal()) { fhXEUeChargedPileUp[3]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[3]->Fill(ptTrig,uezT);}
596 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) { fhXEUeChargedPileUp[4]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[4]->Fill(ptTrig,uezT);}
597 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) { fhXEUeChargedPileUp[5]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[5]->Fill(ptTrig,uezT);}
598 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) { fhXEUeChargedPileUp[6]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[6]->Fill(ptTrig,uezT);}
603 for(Int_t im=0; im<GetMultiBin(); im++)
605 if(nTracks < ( GetMaxMulti() - GetMinMulti() )/GetMultiBin()*(im+1))
607 fhTrigXEUeCorr[im]->Fill(ptTrig,uexE); // xE? CHECK
608 fhTrigZTUeCorr[im]->Fill(ptTrig,uezT); // zT? CHECK
611 } //multiplicity events selection
614 //_____________________________________________________________________________________________________
615 void AliAnaParticleHadronCorrelation::FillChargedUnderlyingEventSidesHistograms(const Float_t ptTrig,
616 const Float_t ptAssoc,
617 const Float_t deltaPhi)
619 // Fill underlying event histograms to the left and right of trigger
620 if((deltaPhi<-fUeDeltaPhiMinCut) || (deltaPhi >2*fUeDeltaPhiMaxCut))
622 fhDeltaPhiUeLeftCharged->Fill(ptAssoc,deltaPhi);
623 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
624 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
625 Double_t uezT = ptAssoc/ptTrig;
627 if(uexE < 0.) uexE = -uexE;
629 fhXEUeLeftCharged->Fill(ptTrig,uexE);
630 if(uexE > 0) fhPtHbpXEUeLeftCharged->Fill(ptTrig,TMath::Log(1/uexE));
632 fhZTUeLeftCharged->Fill(ptTrig,uezT);
633 if(uexE > 0) fhPtHbpZTUeLeftCharged->Fill(ptTrig,TMath::Log(1/uezT));
634 fhDeltaPhiUeLeftCharged->Fill(ptAssoc, deltaPhi);
637 if((deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut))
639 fhDeltaPhiUeRightCharged->Fill(ptAssoc,deltaPhi);
640 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
641 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
642 Double_t uezT = ptAssoc/ptTrig;
644 if(uexE < 0.) uexE = -uexE;
646 fhXEUeRightCharged->Fill(ptTrig,uexE);
647 if(uexE > 0) fhPtHbpXEUeRightCharged->Fill(ptTrig,TMath::Log(1/uexE));
649 fhZTUeRightCharged->Fill(ptTrig,uezT);
650 if(uexE > 0) fhPtHbpZTUeRightCharged->Fill(ptTrig,TMath::Log(1/uezT));
651 fhDeltaPhiUeRightCharged->Fill(ptAssoc, deltaPhi);
654 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-TMath::Pi()/2))
656 fhDeltaPhiUeLeftDownCharged->Fill(ptAssoc,deltaPhi);
657 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
658 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
660 if(uexE < 0.) uexE = -uexE;
662 fhXEUeLeftDownCharged->Fill(ptTrig,uexE);
665 if((deltaPhi>2*fUeDeltaPhiMaxCut) && (deltaPhi <3*TMath::Pi()/2))
667 fhDeltaPhiUeLeftUpCharged->Fill(ptAssoc,deltaPhi);
668 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
669 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
671 if(uexE < 0.) uexE = -uexE;
673 fhXEUeLeftUpCharged->Fill(ptTrig,uexE);
676 if((deltaPhi > TMath::Pi()/2) && (deltaPhi < fUeDeltaPhiMaxCut))
678 fhDeltaPhiUeRightUpCharged->Fill(ptAssoc,deltaPhi);
679 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
680 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
682 if(uexE < 0.) uexE = -uexE;
684 fhXEUeRightUpCharged->Fill(ptTrig,uexE);
687 if((deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < TMath::Pi()/2))
689 fhDeltaPhiUeRightDownCharged->Fill(ptAssoc,deltaPhi);
690 Double_t randomphi = gRandom->Uniform(fDeltaPhiMinCut,fDeltaPhiMaxCut);
691 Double_t uexE = -(ptAssoc/ptTrig)*TMath::Cos(randomphi);
693 if(uexE < 0.) uexE = -uexE;
695 fhXEUeRightDownCharged->Fill(ptTrig,uexE);
699 //______________________________________________________________________________________________________________________________
700 void AliAnaParticleHadronCorrelation::FillDecayPhotonCorrelationHistograms(const Float_t ptAssoc, const Float_t phiAssoc,
701 const TLorentzVector mom1, const TLorentzVector mom2,
702 const Bool_t bChargedOrNeutral)
704 // Do correlation with decay photons of triggered pi0 or eta
706 // Calculate the correlation parameters
707 Float_t ptDecay1 = mom1.Pt();
708 Float_t ptDecay2 = mom2.Pt();
710 Float_t zTDecay1 = -100, zTDecay2 = -100;
711 if(ptDecay1) zTDecay1 = ptAssoc/ptDecay1 ;
712 if(ptDecay2) zTDecay2 = ptAssoc/ptDecay2 ;
714 Float_t deltaPhiDecay1 = mom1.Phi()-phiAssoc;
715 if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
716 if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
718 Float_t deltaPhiDecay2 = mom2.Phi()-phiAssoc;
719 if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
720 if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
722 Float_t xEDecay1 =-zTDecay1*TMath::Cos(deltaPhiDecay1); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
723 Float_t xEDecay2 =-zTDecay2*TMath::Cos(deltaPhiDecay2); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
725 if(bChargedOrNeutral) // correlate with charges
727 fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
728 fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
730 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::FillDecayPhotonHistograms( Charged corr) - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
732 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
734 fhZTDecayCharged->Fill(ptDecay1,zTDecay1);
735 fhXEDecayCharged->Fill(ptDecay1,xEDecay1);
737 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
739 fhZTDecayCharged->Fill(ptDecay2,zTDecay2);
740 fhXEDecayCharged->Fill(ptDecay2,xEDecay2);
743 else // correlate with neutrals
745 fhDeltaPhiDecayCharged->Fill(ptDecay1, deltaPhiDecay1);
746 fhDeltaPhiDecayCharged->Fill(ptDecay2, deltaPhiDecay2);
748 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::FillDecayPhotonHistograms(Neutral corr) - deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaPhiDecay1, deltaPhiDecay2);
750 if( (deltaPhiDecay1 > fDeltaPhiMinCut) && ( deltaPhiDecay1 < fDeltaPhiMaxCut) )
752 fhZTDecayCharged->Fill(ptDecay1,zTDecay1);
753 fhXEDecayCharged->Fill(ptDecay1,xEDecay1);
755 if( (deltaPhiDecay2 > fDeltaPhiMinCut) && ( deltaPhiDecay2 < fDeltaPhiMaxCut) )
757 fhZTDecayCharged->Fill(ptDecay2,zTDecay2);
758 fhXEDecayCharged->Fill(ptDecay2,xEDecay2);
763 //______________________________________________________________________________________________________________________________________________________
764 void AliAnaParticleHadronCorrelation::FillNeutralAngularCorrelationHistograms(const Float_t ptAssoc, const Float_t ptTrig,
765 const Float_t phiAssoc, const Float_t phiTrig, Float_t & deltaPhi,
766 const Float_t etaAssoc, const Float_t etaTrig)
768 // Fill angular correlation related histograms
770 Float_t deltaEta = etaTrig-etaAssoc;
771 deltaPhi = phiTrig-phiAssoc;
773 if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
774 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
776 fhEtaNeutral ->Fill(ptAssoc,etaAssoc);
777 fhPhiNeutral ->Fill(ptAssoc,phiAssoc);
778 fhDeltaEtaNeutral->Fill(ptTrig ,deltaEta);
779 fhDeltaPhiNeutral->Fill(ptTrig ,deltaPhi);
781 if(ptAssoc > 2 ) fhDeltaPhiDeltaEtaNeutral->Fill(deltaPhi, deltaEta);
785 //_____________________________________________________________________________________________________________________________
786 void AliAnaParticleHadronCorrelation::FillNeutralUnderlyingEventSidesHistograms(const Float_t ptTrig, const Float_t ptAssoc,
787 const Float_t xE, const Float_t hbpXE,
788 const Float_t zT, const Float_t hbpZT,
789 const Float_t deltaPhi)
791 // Fill underlying event histograms to the left and right of trigger
793 if((deltaPhi<-fUeDeltaPhiMinCut) && (deltaPhi >-fUeDeltaPhiMaxCut))
795 fhDeltaPhiUeLeftNeutral->Fill(ptAssoc, deltaPhi);
796 fhXEUeLeftNeutral ->Fill(ptTrig , xE);
797 fhPtHbpXEUeLeftNeutral ->Fill(ptTrig , hbpXE);
798 fhZTUeLeftNeutral ->Fill(ptTrig , zT);
799 fhPtHbpZTUeLeftNeutral ->Fill(ptTrig , hbpZT);
802 if((deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut))
804 fhDeltaPhiUeRightNeutral->Fill(ptAssoc, deltaPhi);
805 fhXEUeRightNeutral ->Fill(ptTrig , xE);
806 fhPtHbpXEUeRightNeutral ->Fill(ptTrig , hbpXE);
807 fhZTUeRightNeutral ->Fill(ptTrig , zT);
808 fhPtHbpZTUeRightNeutral ->Fill(ptTrig , hbpZT);
812 //_____________________________________________________________
813 void AliAnaParticleHadronCorrelation::FillChargedEventMixPool()
815 // Mixed event pool filling for tracks
817 //printf("FillChargedEventMixPool for %s\n",GetInputAODName().Data());
819 if(fUseMixStoredInReader && GetReader()->GetLastTracksMixedEvent() == GetEventNumber())
821 //printf("%s : Pool already filled for this event !!!\n",GetInputAODName().Data());
822 return ; // pool filled previously for another trigger
825 Int_t nTracks = GetCTSTracks()->GetEntriesFast();
827 fhNtracksAll->Fill(nTracks);
829 AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
830 AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
832 if(!inputHandler) return ;
834 if( inputHandler->IsEventSelected( ) & GetReader()->GetEventTriggerMask() )
836 fhNtracksTrigger->Fill(nTracks);
839 // Do mixing only with MB event (or the chosen mask), if not skip
840 if( !(inputHandler->IsEventSelected( ) & GetReader()->GetMixEventTriggerMask()) ) return ;
842 fhNtracksMB->Fill(nTracks);
844 Int_t eventBin = GetEventMixBin();
846 //Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
847 if(eventBin < 0) return;
849 TObjArray * mixEventTracks = new TObjArray;
851 if(fUseMixStoredInReader)
853 fListMixTrackEvents[eventBin] = GetReader()->GetListWithMixedEventsForTracks(eventBin);
856 if(!fListMixTrackEvents[eventBin]) fListMixTrackEvents[eventBin] = new TList();
858 //printf("%s ***** Pool Event bin : %d - nTracks %d\n",GetInputAODName().Data(),eventBin, GetCTSTracks()->GetEntriesFast());
860 TList * pool = fListMixTrackEvents[eventBin];
863 for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
865 AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
867 Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
868 p3.SetXYZ(mom[0],mom[1],mom[2]);
869 Float_t pt = p3.Pt();
871 //Select only hadrons in pt range
872 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
874 AliAODPWG4Particle * mixedTrack = new AliAODPWG4Particle(mom[0],mom[1],mom[2],0);
875 mixedTrack->SetDetector("CTS");
876 mixedTrack->SetChargedBit(track->Charge()>0);
877 mixEventTracks->Add(mixedTrack);
880 //Set the event number where the last event was added, to avoid double pool filling
881 GetReader()->SetLastTracksMixedEvent(GetEventNumber());
883 //printf("Add event to pool with %d tracks \n ",mixEventTracks->GetEntries());
884 pool->AddFirst(mixEventTracks);
887 //printf("Pool size %d, max %d\n",pool->GetSize(), GetNMaxEvMix());
889 if(pool->GetSize() > GetNMaxEvMix())
891 TClonesArray * tmp = static_cast<TClonesArray*>(pool->Last()) ;
897 //_____________________________________________________________
898 void AliAnaParticleHadronCorrelation::FillNeutralEventMixPool()
900 // Mixed event pool filling for neutral clusters
901 // Right now only for EMCAL and in isolation case
903 //printf("FillNeutralEventMixPool for %s\n",GetInputAODName().Data());
905 TObjArray * pl = GetEMCALClusters();
906 //if (GetAODObjArrayName.Contains("PHOS") )pl = GetPHOSClusters();
907 //else pl = GetEMCALClusters();
909 Int_t nClusters = pl->GetEntriesFast();
910 fhNclustersAll->Fill(nClusters);
912 if(fUseMixStoredInReader && GetReader()->GetLastCaloMixedEvent() == GetEventNumber())
914 //printf("%s : Pool already filled for this event !!!\n",GetInputAODName().Data());
915 return ; // pool filled previously for another trigger
918 AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
919 AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
921 if(!inputHandler) return ;
923 if( inputHandler->IsEventSelected( ) & GetReader()->GetEventTriggerMask() )
925 fhNclustersTrigger->Fill(nClusters);
928 // Do mixing only with MB event (or the chosen mask), if not skip
929 if( !(inputHandler->IsEventSelected( ) & GetReader()->GetMixEventTriggerMask()) ) return ;
931 fhNclustersMB->Fill(nClusters);
933 Int_t eventBin = GetEventMixBin();
935 //Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
936 if(eventBin < 0) return;
938 TObjArray * mixEventCalo = new TObjArray;
940 if(fUseMixStoredInReader)
942 fListMixCaloEvents[eventBin] = GetReader()->GetListWithMixedEventsForCalo(eventBin);
945 if(!fListMixCaloEvents[eventBin]) fListMixCaloEvents[eventBin] = new TList();
947 TList * poolCalo = fListMixCaloEvents[eventBin];
951 for(Int_t ipr = 0;ipr < nClusters ; ipr ++ )
953 AliVCluster * calo = (AliVCluster *) (pl->At(ipr)) ;
955 // remove matched clusters
956 if( IsTrackMatched( calo, GetReader()->GetInputEvent() ) ) continue ;
958 //Cluster momentum calculation
959 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
961 calo->GetMomentum(mom,GetVertex(0)) ;
962 }//Assume that come from vertex in straight line
965 Double_t vertex[]={0,0,0};
966 calo->GetMomentum(mom,vertex) ;
969 Float_t pt = mom.Pt();
970 //Select only clusters in pt range
971 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
973 AliAODPWG4Particle * mixedCalo = new AliAODPWG4Particle(mom);
974 mixedCalo->SetDetector("EMCAL");
975 mixEventCalo->Add(mixedCalo);
978 //Set the event number where the last event was added, to avoid double pool filling
979 GetReader()->SetLastCaloMixedEvent(GetEventNumber());
981 //printf("Add event to pool with %d clusters \n ",mixEventCalo->GetEntries());
982 poolCalo->AddFirst(mixEventCalo);
985 //printf("Pool size %d, max %d\n",poolCalo->GetSize(), GetNMaxEvMix());
987 if(poolCalo->GetSize() > GetNMaxEvMix())
989 TClonesArray * tmp = static_cast<TClonesArray*>(poolCalo->Last()) ;
990 poolCalo->RemoveLast() ;
995 //____________________________________________________________
996 TObjString* AliAnaParticleHadronCorrelation::GetAnalysisCuts()
998 //Save parameters used for analysis
999 TString parList ; //this will be list of parameters used for this analysis.
1000 const Int_t buffersize = 560;
1001 char onePar[buffersize] ;
1003 snprintf(onePar,buffersize,"--- AliAnaPaticleHadronCorrelation ---\n") ;
1005 snprintf(onePar,buffersize," Pt Trigger > %3.2f ", fMinTriggerPt) ;
1007 snprintf(onePar,buffersize," %3.2f < Pt associated < %3.2f ", fMinAssocPt, fMaxAssocPt) ;
1009 snprintf(onePar,buffersize," %3.2f < Phi trigger particle-Hadron < %3.2f ", fDeltaPhiMinCut, fDeltaPhiMaxCut) ;
1011 snprintf(onePar,buffersize," %3.2f < Phi trigger particle-UeHadron < %3.2f ", fUeDeltaPhiMinCut, fUeDeltaPhiMaxCut) ;
1013 snprintf(onePar,buffersize,"Isolated Trigger? %d\n", fSelectIsolated) ;
1015 snprintf(onePar,buffersize,"Several UE? %d\n", fMakeSeveralUE) ;
1017 snprintf(onePar,buffersize,"Name of AOD Pi0 Branch %s ", fPi0AODBranchName.Data());
1019 snprintf(onePar,buffersize,"Do Decay-hadron correlation ? pi0 %d, decay %d", fPi0Trigger, fDecayTrigger) ;
1021 snprintf(onePar,buffersize,"Select absolute leading for cluster triggers ? %d or Near Side Leading %d \n",
1022 fMakeAbsoluteLeading, fMakeNearSideLeading) ;
1024 snprintf(onePar,buffersize,"Associated particle pt bins %d: ", fNAssocPtBins) ;
1026 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
1027 snprintf(onePar,buffersize,"bin %d = [%2.1f,%2.1f];", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
1031 //Get parameters set in base class.
1032 parList += GetBaseParametersList() ;
1034 //Get parameters set in FiducialCut class (not available yet)
1035 //parlist += GetFidCut()->GetFidCutParametersList()
1037 return new TObjString(parList) ;
1041 //________________________________________________________________
1042 TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
1045 // Create histograms to be saved in output file and
1046 // store them in fOutputContainer
1048 TList * outputContainer = new TList() ;
1049 outputContainer->SetName("CorrelationHistos") ;
1051 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();
1052 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();
1053 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();
1055 Int_t nMixBins = GetNCentrBin()*GetNZvertBin()*GetNRPBin();
1057 TString nameMC[] = {"Photon","Pi0","Pi0Decay","EtaDecay","OtherDecay","Electron","Hadron"};
1058 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1060 // For vz dependent histograms, if option ON
1062 if(fCorrelVzBin) nz = GetNZvertBin();
1066 fhPtInput = new TH1F("hPtInput","p_{T} distribution of input trigger particles", nptbins,ptmin,ptmax);
1067 fhPtInput->SetXTitle("p_{T}^{trig} (GeV/c)");
1068 outputContainer->Add(fhPtInput);
1070 fhPtFidCut = new TH1F("hPtFidCut","p_{T} distribution of input trigger particles after fiducial cut", nptbins,ptmin,ptmax);
1071 fhPtFidCut->SetXTitle("p_{T}^{trig} (GeV/c)");
1072 outputContainer->Add(fhPtFidCut);
1074 fhPtLeading = new TH1F("hPtLeading","p_{T} distribution of leading particles", nptbins,ptmin,ptmax);
1075 fhPtLeading->SetXTitle("p_{T}^{trig} (GeV/c)");
1076 outputContainer->Add(fhPtLeading);
1080 for(Int_t i=0; i < 7; i++)
1082 fhPtLeadingMC[i] = new TH1F(Form("hPtLeading_MC%s",nameMC[i].Data()),
1083 Form("p_{T} distribution of leading particles, trigger origin is %s",nameMC[i].Data()),
1084 nptbins,ptmin,ptmax);
1085 fhPtLeadingMC[i]->SetXTitle("p_{T}^{trig} (GeV/c)");
1086 outputContainer->Add(fhPtLeadingMC[i]);
1092 fhPtLeadingVzBin = new TH2F("hPtLeadingVzBin","p_{T} distribution of leading particles vs vz bin", nptbins,ptmin,ptmax,GetNZvertBin(),0,GetNZvertBin());
1093 fhPtLeadingVzBin->SetXTitle("p_{T}^{trig} (GeV/c)");
1094 fhPtLeadingVzBin->SetYTitle("v_{z} bin");
1095 outputContainer->Add(fhPtLeadingVzBin);
1098 fhPtLeadingBin = new TH2F ("hPtLeadingBin","p_{T} distribution of leading particles", nptbins,ptmin,ptmax,nMixBins,0,nMixBins);
1099 fhPtLeadingBin->SetXTitle("p_{T}^{trig} (GeV/c)");
1100 fhPtLeadingBin->SetYTitle("Bin");
1101 outputContainer->Add(fhPtLeadingBin);
1103 fhPhiLeading = new TH2F ("hPhiLeading","#phi distribution of leading Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
1104 fhPhiLeading->SetYTitle("#phi (rad)");
1105 outputContainer->Add(fhPhiLeading);
1107 fhEtaLeading = new TH2F ("hEtaLeading","#eta distribution of leading",nptbins,ptmin,ptmax, netabins,etamin,etamax);
1108 fhEtaLeading->SetYTitle("#eta ");
1109 outputContainer->Add(fhEtaLeading);
1111 fhPtLeadingCentrality = new TH2F("hPtLeadingCentrality","Leading particle p_{T} vs centrality",nptbins,ptmin,ptmax,100,0.,100) ;
1112 fhPtLeadingCentrality->SetXTitle("p_{T}^{trig} (GeV/c)");
1113 fhPtLeadingCentrality->SetYTitle("Centrality (%)");
1114 outputContainer->Add(fhPtLeadingCentrality) ;
1116 fhPtLeadingEventPlane = new TH2F("hPtLeadingEventPlane","Leading particle p_{T} vs event plane angle",nptbins,ptmin,ptmax, 100,0.,TMath::Pi()) ;
1117 fhPtLeadingEventPlane->SetXTitle("p_{T}^{trig} (GeV/c)");
1118 fhPtLeadingEventPlane->SetXTitle("EP angle (rad)");
1119 outputContainer->Add(fhPtLeadingEventPlane) ;
1121 fhLeadingEventPlaneCentrality = new TH2F("hLeadingEventPlane","Leading particle centrality vs event plane angle",100,0.,100,100,0.,TMath::Pi()) ;
1122 fhLeadingEventPlaneCentrality->SetXTitle("Centrality (%)");
1123 fhLeadingEventPlaneCentrality->SetYTitle("EP angle (rad)");
1124 outputContainer->Add(fhLeadingEventPlaneCentrality) ;
1126 //Correlation with charged hadrons
1127 if(GetReader()->IsCTSSwitchedOn())
1129 fhDeltaPhiDeltaEtaCharged = new TH2F
1130 ("hDeltaPhiDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs #phi_{trigger} - #phi_{h^{#pm}}",
1131 ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
1132 fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi (rad)");
1133 fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
1135 fhDeltaPhiDeltaEtaChargedPtA3GeV = new TH2F
1136 ("hDeltaPhiDeltaEtaChargedPtA3GeV","#eta_{trigger} - #eta_{h^{#pm}} vs #phi_{trigger} - #phi_{h^{#pm}, p_{TA}>3 GeV/c}",
1137 ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
1138 fhDeltaPhiDeltaEtaChargedPtA3GeV->SetXTitle("#Delta #phi (rad)");
1139 fhDeltaPhiDeltaEtaChargedPtA3GeV->SetYTitle("#Delta #eta");
1141 fhPhiCharged = new TH2F
1142 ("hPhiCharged","#phi_{h^{#pm}} vs p_{T #pm}",
1143 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1144 fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
1145 fhPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
1147 fhEtaCharged = new TH2F
1148 ("hEtaCharged","#eta_{h^{#pm}} vs p_{T #pm}",
1149 nptbins,ptmin,ptmax,netabins,etamin,etamax);
1150 fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
1151 fhEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
1153 fhDeltaPhiCharged = new TH2F
1154 ("hDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
1155 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1156 fhDeltaPhiCharged->SetYTitle("#Delta #phi (rad)");
1157 fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
1159 fhDeltaPhiChargedPtA3GeV = new TH2F
1160 ("hDeltaPhiChargedPtA3GeV","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c",
1161 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1162 fhDeltaPhiChargedPtA3GeV->SetYTitle("#Delta #phi (rad)");
1163 fhDeltaPhiChargedPtA3GeV->SetXTitle("p_{T trigger} (GeV/c)");
1166 fhDeltaPhiChargedPt = new TH2F
1167 ("hDeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
1168 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1169 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi (rad)");
1170 fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1172 fhDeltaPhiUeChargedPt = new TH2F
1173 ("hDeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
1174 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1175 fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi (rad)");
1176 fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1178 fhUePart = new TH1F("hUePart","UE particles distribution vs pt trig",
1179 nptbins,ptmin,ptmax);
1180 fhUePart->SetYTitle("dNch");
1181 fhUePart->SetXTitle("p_{T trigger} (GeV/c)");
1184 fhDeltaEtaCharged = new TH2F
1185 ("hDeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
1186 nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1187 fhDeltaEtaCharged->SetYTitle("#Delta #eta");
1188 fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
1190 fhDeltaEtaChargedPtA3GeV = new TH2F
1191 ("hDeltaEtaChargedPtA3GeV","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c",
1192 nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1193 fhDeltaEtaChargedPtA3GeV->SetYTitle("#Delta #eta");
1194 fhDeltaEtaChargedPtA3GeV->SetXTitle("p_{T trigger} (GeV/c)");
1197 new TH2F("hXECharged","x_{E} for charged tracks",
1198 nptbins,ptmin,ptmax,200,0.,2.);
1199 fhXECharged->SetYTitle("x_{E}");
1200 fhXECharged->SetXTitle("p_{T trigger} (GeV/c)");
1203 new TH2F("hXEUeCharged","x_{E} for Underlying Event",
1204 nptbins,ptmin,ptmax,200,0.,2.);
1205 fhXEUeCharged->SetYTitle("x_{E}");
1206 fhXEUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
1209 new TH2F("hXEPositiveCharged","x_{E} for positive charged tracks",
1210 nptbins,ptmin,ptmax,200,0.,2.);
1211 fhXEPosCharged->SetYTitle("x_{E}");
1212 fhXEPosCharged->SetXTitle("p_{T trigger} (GeV/c)");
1215 new TH2F("hXENegativeCharged","x_{E} for negative charged tracks",
1216 nptbins,ptmin,ptmax,200,0.,2.);
1217 fhXENegCharged->SetYTitle("x_{E}");
1218 fhXENegCharged->SetXTitle("p_{T trigger} (GeV/c)");
1221 new TH2F("hHbpXECharged","#xi = ln(1/x_{E}) with charged hadrons",
1222 nptbins,ptmin,ptmax,200,0.,10.);
1223 fhPtHbpXECharged->SetYTitle("ln(1/x_{E})");
1224 fhPtHbpXECharged->SetXTitle("p_{T trigger} (GeV/c)");
1226 fhPtHbpXEUeCharged =
1227 new TH2F("hHbpXEUeCharged","#xi = ln(1/x_{E}) with charged hadrons,Underlying Event",
1228 nptbins,ptmin,ptmax,200,0.,10.);
1229 fhPtHbpXEUeCharged->SetYTitle("ln(1/x_{E})");
1230 fhPtHbpXEUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
1233 new TH2F("hZTCharged","z_{T} for charged tracks",
1234 nptbins,ptmin,ptmax,200,0.,2.);
1235 fhZTCharged->SetYTitle("z_{T}");
1236 fhZTCharged->SetXTitle("p_{T trigger}");
1239 new TH2F("hZTUeCharged","z_{T} for Underlying Event",
1240 nptbins,ptmin,ptmax,200,0.,2.);
1241 fhZTUeCharged->SetYTitle("z_{T}");
1242 fhZTUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
1245 new TH2F("hZTPositiveCharged","z_{T} for positive charged tracks",
1246 nptbins,ptmin,ptmax,200,0.,2.);
1247 fhZTPosCharged->SetYTitle("z_{T}");
1248 fhZTPosCharged->SetXTitle("p_{T trigger} (GeV/c)");
1251 new TH2F("hZTNegativeCharged","z_{T} for negative charged tracks",
1252 nptbins,ptmin,ptmax,200,0.,2.);
1253 fhZTNegCharged->SetYTitle("z_{T}");
1254 fhZTNegCharged->SetXTitle("p_{T trigger} (GeV/c)");
1257 new TH2F("hHbpZTCharged","#xi = ln(1/z_{T}) with charged hadrons",
1258 nptbins,ptmin,ptmax,200,0.,10.);
1259 fhPtHbpZTCharged->SetYTitle("ln(1/z_{T})");
1260 fhPtHbpZTCharged->SetXTitle("p_{T trigger} (GeV/c)");
1262 fhPtHbpZTUeCharged =
1263 new TH2F("hHbpZTUeCharged","#xi = ln(1/z_{T}) with charged hadrons,Underlying Event",
1264 nptbins,ptmin,ptmax,200,0.,10.);
1265 fhPtHbpZTUeCharged->SetYTitle("ln(1/x_{E})");
1266 fhPtHbpZTUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
1269 new TH2F("hPtTrigPout","Pout with triggers",
1270 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
1271 fhPtTrigPout->SetYTitle("p_{out} (GeV/c)");
1272 fhPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
1275 new TH2F("hPtTrigCharged","trigger and charged tracks pt distribution",
1276 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1277 fhPtTrigCharged->SetYTitle("p_{T h^{#pm}} (GeV/c)");
1278 fhPtTrigCharged->SetXTitle("p_{T trigger} (GeV/c)");
1280 outputContainer->Add(fhDeltaPhiDeltaEtaCharged);
1281 outputContainer->Add(fhDeltaPhiDeltaEtaChargedPtA3GeV);
1282 outputContainer->Add(fhPhiCharged) ;
1283 outputContainer->Add(fhEtaCharged) ;
1284 outputContainer->Add(fhDeltaPhiCharged) ;
1285 outputContainer->Add(fhDeltaPhiChargedPtA3GeV) ;
1286 outputContainer->Add(fhDeltaEtaCharged) ;
1287 outputContainer->Add(fhDeltaEtaChargedPtA3GeV) ;
1288 outputContainer->Add(fhDeltaPhiChargedPt) ;
1289 outputContainer->Add(fhDeltaPhiUeChargedPt) ;
1290 outputContainer->Add(fhUePart);
1292 outputContainer->Add(fhXECharged) ;
1296 for(Int_t i=0; i < 7; i++)
1299 fhDeltaPhiChargedMC[i] = new TH2F(Form("hDeltaPhiCharged_MC%s",nameMC[i].Data()),
1300 Form("#Delta #phi for charged tracks, trigger origin is %s",nameMC[i].Data()),
1301 nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
1302 fhDeltaPhiChargedMC[i]->SetYTitle("x_{E}");
1303 fhDeltaPhiChargedMC[i]->SetXTitle("p_{T trigger} (GeV/c)");
1304 outputContainer->Add(fhDeltaPhiChargedMC[i]) ;
1306 fhXEChargedMC[i] = new TH2F(Form("hXECharged_MC%s",nameMC[i].Data()),
1307 Form("x_{E} for charged tracks, trigger origin is %s",nameMC[i].Data()),
1308 nptbins,ptmin,ptmax,200,0.,2.);
1309 fhXEChargedMC[i]->SetYTitle("x_{E}");
1310 fhXEChargedMC[i]->SetXTitle("p_{T trigger} (GeV/c)");
1311 outputContainer->Add(fhXEChargedMC[i]) ;
1315 outputContainer->Add(fhXEPosCharged) ;
1316 outputContainer->Add(fhXENegCharged) ;
1317 outputContainer->Add(fhXEUeCharged) ;
1318 outputContainer->Add(fhPtHbpXECharged) ;
1319 outputContainer->Add(fhPtHbpXEUeCharged) ;
1321 outputContainer->Add(fhZTCharged) ;
1322 outputContainer->Add(fhZTPosCharged) ;
1323 outputContainer->Add(fhZTNegCharged) ;
1324 outputContainer->Add(fhZTUeCharged) ;
1325 outputContainer->Add(fhPtHbpZTCharged) ;
1326 outputContainer->Add(fhPtHbpZTUeCharged) ;
1328 outputContainer->Add(fhPtTrigPout) ;
1329 outputContainer->Add(fhPtTrigCharged) ;
1331 if(fFillPileUpHistograms)
1333 fhDeltaPhiChargedOtherBC = new TH2F
1334 ("hDeltaPhiChargedOtherBC","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, track BC!=0",
1335 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1336 fhDeltaPhiChargedOtherBC->SetYTitle("#Delta #phi (rad)");
1337 fhDeltaPhiChargedOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1339 fhDeltaPhiChargedPtA3GeVOtherBC = new TH2F
1340 ("hDeltaPhiChargedPtA3GeVOtherBC","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c, track BC!=0",
1341 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1342 fhDeltaPhiChargedPtA3GeVOtherBC->SetYTitle("#Delta #phi (rad)");
1343 fhDeltaPhiChargedPtA3GeVOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1345 fhPtTrigChargedOtherBC =
1346 new TH2F("hPtTrigChargedOtherBC","trigger and charged tracks pt distribution, track BC!=0",
1347 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1348 fhPtTrigChargedOtherBC->SetYTitle("p_{T h^{#pm}} (GeV/c)");
1349 fhPtTrigChargedOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1351 fhXEChargedOtherBC =
1352 new TH2F("hXEChargedOtherBC","x_{E} for charged tracks, track BC!=0",
1353 nptbins,ptmin,ptmax,200,0.,2.);
1354 fhXEChargedOtherBC->SetYTitle("x_{E}");
1355 fhXEChargedOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1357 fhXEUeChargedOtherBC =
1358 new TH2F("hXEUeChargedOtherBC","x_{E} for Underlying Event, track BC!=0",
1359 nptbins,ptmin,ptmax,200,0.,2.);
1360 fhXEUeChargedOtherBC->SetYTitle("x_{E}");
1361 fhXEUeChargedOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1363 fhZTChargedOtherBC =
1364 new TH2F("hZTChargedOtherBC","z_{T} for charged tracks, track BC!=0",
1365 nptbins,ptmin,ptmax,200,0.,2.);
1366 fhZTChargedOtherBC->SetYTitle("z_{T}");
1367 fhZTChargedOtherBC->SetXTitle("p_{T trigger}");
1369 fhZTUeChargedOtherBC =
1370 new TH2F("hZTUeChargedOtherBC","z_{T} for Underlying Event, track BC!=0",
1371 nptbins,ptmin,ptmax,200,0.,2.);
1372 fhZTUeChargedOtherBC->SetYTitle("z_{T}");
1373 fhZTUeChargedOtherBC->SetXTitle("p_{T trigger} (GeV/c)");
1375 outputContainer->Add(fhDeltaPhiChargedOtherBC) ;
1376 outputContainer->Add(fhDeltaPhiChargedPtA3GeVOtherBC) ;
1377 outputContainer->Add(fhXEChargedOtherBC) ;
1378 outputContainer->Add(fhXEUeChargedOtherBC) ;
1379 outputContainer->Add(fhZTChargedOtherBC) ;
1380 outputContainer->Add(fhZTUeChargedOtherBC) ;
1381 outputContainer->Add(fhPtTrigChargedOtherBC) ;
1383 fhDeltaPhiChargedBC0 = new TH2F
1384 ("hDeltaPhiChargedBC0","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, track BC==0",
1385 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1386 fhDeltaPhiChargedBC0->SetYTitle("#Delta #phi (rad)");
1387 fhDeltaPhiChargedBC0->SetXTitle("p_{T trigger} (GeV/c)");
1389 fhDeltaPhiChargedPtA3GeVBC0 = new TH2F
1390 ("hDeltaPhiChargedPtA3GeVBC0","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c, track BC==0",
1391 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1392 fhDeltaPhiChargedPtA3GeVBC0->SetYTitle("#Delta #phi (rad)");
1393 fhDeltaPhiChargedPtA3GeVBC0->SetXTitle("p_{T trigger} (GeV/c)");
1395 fhPtTrigChargedBC0 =
1396 new TH2F("hPtTrigChargedBC0","trigger and charged tracks pt distribution, track BC==0",
1397 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1398 fhPtTrigChargedBC0->SetYTitle("p_{T h^{#pm}} (GeV/c)");
1399 fhPtTrigChargedBC0->SetXTitle("p_{T trigger} (GeV/c)");
1402 new TH2F("hXEChargedBC0","x_{E} for charged tracks, track BC==0",
1403 nptbins,ptmin,ptmax,200,0.,2.);
1404 fhXEChargedBC0->SetYTitle("x_{E}");
1405 fhXEChargedBC0->SetXTitle("p_{T trigger} (GeV/c)");
1408 new TH2F("hXEUeChargedBC0","x_{E} for Underlying Event, track BC==0",
1409 nptbins,ptmin,ptmax,200,0.,2.);
1410 fhXEUeChargedBC0->SetYTitle("x_{E}");
1411 fhXEUeChargedBC0->SetXTitle("p_{T trigger} (GeV/c)");
1414 new TH2F("hZTChargedBC0","z_{T} for charged tracks, track BC==0",
1415 nptbins,ptmin,ptmax,200,0.,2.);
1416 fhZTChargedBC0->SetYTitle("z_{T}");
1417 fhZTChargedBC0->SetXTitle("p_{T trigger}");
1420 new TH2F("hZTUeChargedBC0","z_{T} for Underlying Event, track BC==0",
1421 nptbins,ptmin,ptmax,200,0.,2.);
1422 fhZTUeChargedBC0->SetYTitle("z_{T}");
1423 fhZTUeChargedBC0->SetXTitle("p_{T trigger} (GeV/c)");
1425 outputContainer->Add(fhDeltaPhiChargedBC0) ;
1426 outputContainer->Add(fhDeltaPhiChargedPtA3GeVBC0) ;
1427 outputContainer->Add(fhXEChargedBC0) ;
1428 outputContainer->Add(fhXEUeChargedBC0) ;
1429 outputContainer->Add(fhZTChargedBC0) ;
1430 outputContainer->Add(fhZTUeChargedBC0) ;
1431 outputContainer->Add(fhPtTrigChargedBC0) ;
1434 for(Int_t i = 0 ; i < 7 ; i++)
1436 fhPtLeadingPileUp[i] = new TH1F(Form("hPtLeadingPileUp%s",pileUpName[i].Data()),
1437 Form("p_{T} distribution of leading particles, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
1438 fhPtLeadingPileUp[i]->SetXTitle("p_{T}^{trig} (GeV/c)");
1439 outputContainer->Add(fhPtLeadingPileUp[i]);
1441 fhDeltaPhiChargedPileUp[i] = new TH2F(Form("hDeltaPhiChargedPileUp%s",pileUpName[i].Data()),
1442 Form("#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, %s Pile-Up event",pileUpName[i].Data()),
1443 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1444 fhDeltaPhiChargedPileUp[i]->SetYTitle("#Delta #phi (rad)");
1445 fhDeltaPhiChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1446 outputContainer->Add(fhDeltaPhiChargedPileUp[i]) ;
1448 fhDeltaPhiChargedPtA3GeVPileUp[i] = new TH2F(Form("hDeltaPhiChargedPtA3GeVPileUp%s",pileUpName[i].Data()),
1449 Form("#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c, %s Pile-Up event",pileUpName[i].Data()),
1450 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1451 fhDeltaPhiChargedPtA3GeVPileUp[i]->SetYTitle("#Delta #phi (rad)");
1452 fhDeltaPhiChargedPtA3GeVPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1453 outputContainer->Add(fhDeltaPhiChargedPtA3GeVPileUp[i]) ;
1455 fhDeltaEtaChargedPileUp[i] = new TH2F(Form("hDeltaEtaChargedPileUp%s",pileUpName[i].Data()),
1456 Form("#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}, %s Pile-Up event",pileUpName[i].Data()),
1457 nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1458 fhDeltaEtaChargedPileUp[i]->SetYTitle("#Delta #eta");
1459 fhDeltaEtaChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1460 outputContainer->Add(fhDeltaEtaChargedPileUp[i]) ;
1462 fhDeltaEtaChargedPtA3GeVPileUp[i] = new TH2F(Form("hDeltaEtaChargedPtA3GeVPileUp%s",pileUpName[i].Data()),
1463 Form("#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}, p_{TA}>3 GeV/c, %s Pile-Up event",pileUpName[i].Data()),
1464 nptbins,ptmin,ptmax,ndeltaetabins,deltaetamin,deltaetamax);
1465 fhDeltaEtaChargedPtA3GeVPileUp[i]->SetYTitle("#Delta #eta");
1466 fhDeltaEtaChargedPtA3GeVPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1467 outputContainer->Add(fhDeltaEtaChargedPtA3GeVPileUp[i]) ;
1469 fhXEChargedPileUp[i] = new TH2F(Form("hXEChargedPileUp%s",pileUpName[i].Data()),
1470 Form("x_{E} for charged tracks, %s Pile-Up event",pileUpName[i].Data()),
1471 nptbins,ptmin,ptmax,200,0.,2.);
1472 fhXEChargedPileUp[i]->SetYTitle("x_{E}");
1473 fhXEChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1474 outputContainer->Add(fhXEChargedPileUp[i]) ;
1476 fhXEUeChargedPileUp[i] = new TH2F(Form("hXEUeChargedPileUp%s",pileUpName[i].Data()),
1477 Form("x_{E} for Underlying Event, %s Pile-Up event",pileUpName[i].Data()),
1478 nptbins,ptmin,ptmax,200,0.,2.);
1479 fhXEUeChargedPileUp[i]->SetYTitle("x_{E}");
1480 fhXEUeChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1481 outputContainer->Add(fhXEUeChargedPileUp[i]) ;
1483 fhZTChargedPileUp[i] = new TH2F(Form("hZTChargedPileUp%s",pileUpName[i].Data()),
1484 Form("z_{T} for charged tracks, %s Pile-Up event",pileUpName[i].Data()),
1485 nptbins,ptmin,ptmax,200,0.,2.);
1486 fhZTChargedPileUp[i]->SetYTitle("z_{T}");
1487 fhZTChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1488 outputContainer->Add(fhZTChargedPileUp[i]) ;
1490 fhZTUeChargedPileUp[i] = new TH2F(Form("hZTUeChargedPileUp%s",pileUpName[i].Data()),
1491 Form("z_{T} for Underlying Event, %s Pile-Up event",pileUpName[i].Data()),
1492 nptbins,ptmin,ptmax,200,0.,2.);
1493 fhZTUeChargedPileUp[i]->SetYTitle("z_{T}");
1494 fhZTUeChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1495 outputContainer->Add(fhZTUeChargedPileUp[i]) ;
1497 fhPtTrigChargedPileUp[i] = new TH2F(Form("hPtTrigChargedPileUp%s",pileUpName[i].Data()),
1498 Form("trigger and charged tracks pt distribution, %s Pile-Up event",pileUpName[i].Data()),
1499 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1500 fhPtTrigChargedPileUp[i]->SetYTitle("p_{T h^{#pm}} (GeV/c)");
1501 fhPtTrigChargedPileUp[i]->SetXTitle("p_{T trigger} (GeV/c)");
1502 outputContainer->Add(fhPtTrigChargedPileUp[i]) ;
1509 Int_t nMultiBins = GetMultiBin();
1510 fhTrigDeltaPhiCharged = new TH2F*[nMultiBins] ;
1511 fhTrigDeltaEtaCharged = new TH2F*[nMultiBins] ;
1512 fhTrigXECorr = new TH2F*[nMultiBins] ;
1513 fhTrigXEUeCorr = new TH2F*[nMultiBins] ;
1514 fhTrigZTCorr = new TH2F*[nMultiBins] ;
1515 fhTrigZTUeCorr = new TH2F*[nMultiBins] ;
1517 for(Int_t im=0; im<nMultiBins; im++)
1519 fhTrigDeltaPhiCharged[im] = new TH2F
1520 (Form("hTrigDeltaPhiCharged_%d",im),Form("hTrigDeltaPhiCharged_%d",im), nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1521 fhTrigDeltaPhiCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
1522 fhTrigDeltaPhiCharged[im]->SetYTitle("#Delta #phi (rad)");
1524 fhTrigDeltaEtaCharged[im] = new TH2F
1525 (Form("hTrigDeltaEtaCharged_%d",im),Form("hTrigDeltaEtaCharged_%d",im), nptbins,ptmin,ptmax, ndeltaetabins ,deltaetamin,deltaetamax);
1526 fhTrigDeltaEtaCharged[im]->SetXTitle("p_{T trigger} (GeV/c)");
1527 fhTrigDeltaEtaCharged[im]->SetYTitle("#Delta #eta");
1529 fhTrigXECorr[im] = new TH2F
1530 (Form("hTrigXEPtCorr_%d",im),Form("hTrigXEPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
1531 fhTrigXECorr[im]->SetYTitle("x_{E trigger h^{#pm}}");
1532 fhTrigXECorr[im]->SetXTitle("p_{T trigger} (GeV/c)");
1534 fhTrigXEUeCorr[im] = new TH2F
1535 (Form("hTrigXEPtUeCorr_%d",im),Form("hTrigXEPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
1536 fhTrigXEUeCorr[im]->SetYTitle("x_{E trigger h^{#pm}}");
1537 fhTrigXEUeCorr[im]->SetXTitle("p_{T trigger}(GeV/c)");
1539 fhTrigZTCorr[im] = new TH2F
1540 (Form("hTrigZTPtCorr_%d",im),Form("hTrigZTPtCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
1541 fhTrigZTCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
1542 fhTrigZTCorr[im]->SetXTitle("p_{T trigger} (GeV/c)");
1544 fhTrigZTUeCorr[im] = new TH2F
1545 (Form("hTrigZTPtUeCorr_%d",im),Form("hTrigZTPtUeCorr_%d",im), nptbins,ptmin,ptmax,200,0.,2.);
1546 fhTrigZTUeCorr[im]->SetYTitle("z_{trigger h^{#pm}}");
1547 fhTrigZTUeCorr[im]->SetXTitle("p_{T trigger} (GeV/c)");
1549 outputContainer->Add(fhTrigDeltaPhiCharged[im]) ;
1550 outputContainer->Add(fhTrigDeltaEtaCharged[im]) ;
1551 outputContainer->Add(fhTrigXECorr[im]);
1552 outputContainer->Add(fhTrigXEUeCorr[im]);
1553 outputContainer->Add(fhTrigZTCorr[im]);
1554 outputContainer->Add(fhTrigZTUeCorr[im]);
1560 fhAssocPtBkg = new TH2F("hAssocPtBkg", " Trigger p_{T} vs associated hadron p_{T} from background",
1561 nptbins, ptmin, ptmax,nptbins,ptmin,ptmax);
1562 fhAssocPtBkg->SetXTitle("p_{T trigger} (GeV/c)");
1563 fhAssocPtBkg->SetYTitle("p_{T associated} (GeV/c)");
1564 outputContainer->Add(fhAssocPtBkg) ;
1566 fhDeltaPhiBrad = new TH2F("hDeltaPhiBrad","atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} ",
1567 nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
1568 fhDeltaPhiBrad->SetXTitle("p_{T trigger} (GeV/c)");
1569 fhDeltaPhiBrad->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
1570 outputContainer->Add(fhDeltaPhiBrad) ;
1573 fhDeltaPhiDeltaEtaAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1574 fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1575 fhDeltaPhiAssocPtBinDEta08 = new TH2F*[fNAssocPtBins*nz];
1576 fhDeltaPhiAssocPtBinDEta0 = new TH2F*[fNAssocPtBins*nz];
1577 fhXEAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1578 fhZTAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1581 fhDeltaPhiBradAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1583 if(fPi0Trigger || fDecayTrigger)
1585 fhDeltaPhiAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1586 fhDeltaPhiAssocPtBinDEta08 = new TH2F*[fNAssocPtBins*nz];
1587 fhXEAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1588 fhZTAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1589 fhXEDecayChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1590 fhZTDecayChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1591 fhDeltaPhiDecayChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
1594 if(fHMPIDCorrelation)
1596 fhDeltaPhiAssocPtBinHMPID = new TH2F*[fNAssocPtBins*nz];
1597 fhDeltaPhiAssocPtBinHMPIDAcc= new TH2F*[fNAssocPtBins*nz];
1600 for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
1602 for(Int_t z = 0 ; z < nz ; z++)
1609 tz = ", v_{z} bin "+z;
1612 //printf("iAssoc %d, Vz %d, bin %d - sz %s, tz %s \n",i,z,bin,sz.Data(),tz.Data());
1614 fhDeltaPhiDeltaEtaAssocPtBin[bin] = new TH2F(Form("hDeltaPhiDeltaEtaPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1615 Form("#Delta #phi vs #Delta #eta for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1616 ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins,deltaetamin,deltaetamax);
1617 fhDeltaPhiDeltaEtaAssocPtBin[bin]->SetXTitle("#Delta #phi (rad)");
1618 fhDeltaPhiDeltaEtaAssocPtBin[bin]->SetYTitle("#Delta #eta");
1620 fhDeltaPhiAssocPtBin[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1621 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1622 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1623 fhDeltaPhiAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1624 fhDeltaPhiAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
1626 fhDeltaPhiAssocPtBinDEta08[bin] = new TH2F(Form("hDeltaPhiDeltaEta0.8PtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1627 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta > 0.8", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1628 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1629 fhDeltaPhiAssocPtBinDEta08[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1630 fhDeltaPhiAssocPtBinDEta08[bin]->SetYTitle("#Delta #phi (rad)");
1632 fhDeltaPhiAssocPtBinDEta0[bin] = new TH2F(Form("hDeltaPhiDeltaEta0PtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1633 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta = 0.", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1634 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1635 fhDeltaPhiAssocPtBinDEta0[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1636 fhDeltaPhiAssocPtBinDEta0[bin]->SetYTitle("#Delta #phi (rad)");
1638 fhXEAssocPtBin[bin] = new TH2F(Form("hXEAssocPtBin%1.f_%1.f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1639 Form("x_{E} vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1640 nptbins, ptmin, ptmax,200, 0.0, 2.0);
1641 fhXEAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1642 fhXEAssocPtBin[bin]->SetYTitle("x_{E}");
1644 fhZTAssocPtBin[bin] = new TH2F(Form("hZTAssocPtBin%1.f_%1.f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1645 Form("z_{T} vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1646 nptbins, ptmin, ptmax,200, 0.0, 2.0);
1647 fhZTAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1648 fhZTAssocPtBin[bin]->SetYTitle("z_{T}");
1650 outputContainer->Add(fhDeltaPhiDeltaEtaAssocPtBin[bin]) ;
1651 outputContainer->Add(fhDeltaPhiAssocPtBin[bin]) ;
1652 outputContainer->Add(fhDeltaPhiAssocPtBinDEta08[bin]) ;
1653 outputContainer->Add(fhDeltaPhiAssocPtBinDEta0[bin]) ;
1654 outputContainer->Add(fhXEAssocPtBin[bin]);
1655 outputContainer->Add(fhZTAssocPtBin[bin]);
1657 if(fPi0Trigger || fDecayTrigger)
1659 fhDeltaPhiDecayChargedAssocPtBin[bin] = new TH2F(Form("hDeltaPhiPtDecayChargedAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1660 Form("#Delta #phi vs p_{T trigger} tagged as decay for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1661 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1662 fhDeltaPhiDecayChargedAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1663 fhDeltaPhiDecayChargedAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
1665 fhXEDecayChargedAssocPtBin[bin] = new TH2F(Form("hXEDecayChargedAssocPtBin%1.f_%1.f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1666 Form("x_{E} vs p_{T trigger} tagged as decay for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1667 nptbins, ptmin, ptmax,200, 0.0, 2.0);
1668 fhXEDecayChargedAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1669 fhXEDecayChargedAssocPtBin[bin]->SetYTitle("x_{E}");
1671 fhZTDecayChargedAssocPtBin[bin] = new TH2F(Form("hZTDecayChargedAssocPtBin%1.f_%1.f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1672 Form("z_{T} vs p_{T trigger} tagged as decay for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1673 nptbins, ptmin, ptmax,200, 0.0, 2.0);
1674 fhZTDecayChargedAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1675 fhZTDecayChargedAssocPtBin[bin]->SetYTitle("z_{T}");
1677 outputContainer->Add(fhDeltaPhiDecayChargedAssocPtBin[bin]) ;
1678 outputContainer->Add(fhXEDecayChargedAssocPtBin[bin]);
1679 outputContainer->Add(fhZTDecayChargedAssocPtBin[bin]);
1685 fhDeltaPhiBradAssocPtBin[bin] = new TH2F(Form("hDeltaPhiBradPtAssocPt%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1686 Form("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1687 nptbins, ptmin, ptmax,288, -1.0/3.0, 5.0/3.0);
1688 fhDeltaPhiBradAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1689 fhDeltaPhiBradAssocPtBin[bin]->SetYTitle("atan2(sin(#Delta #phi), cos(#Delta #phi))/#pi");
1690 outputContainer->Add(fhDeltaPhiBradAssocPtBin[bin]) ;
1693 if(fHMPIDCorrelation)
1695 fhDeltaPhiAssocPtBinHMPID[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%sHMPID", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1696 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, with track having HMPID signal", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1697 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1698 fhDeltaPhiAssocPtBinHMPID[bin]->SetXTitle("p_{T trigger} (GeV/c)" );
1699 fhDeltaPhiAssocPtBinHMPID[bin]->SetYTitle("#Delta #phi (rad)");
1701 fhDeltaPhiAssocPtBinHMPIDAcc[bin] = new TH2F(Form("hDeltaPhiPtAssocPt%2.1f_%2.1f%sHMPIDAcc", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
1702 Form("#Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, with track within 5<phi<20 deg", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
1703 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1704 fhDeltaPhiAssocPtBinHMPIDAcc[bin]->SetXTitle("p_{T trigger} (GeV/c)");
1705 fhDeltaPhiAssocPtBinHMPIDAcc[bin]->SetYTitle("#Delta #phi (rad)");
1707 outputContainer->Add(fhDeltaPhiAssocPtBinHMPID[bin]) ;
1708 outputContainer->Add(fhDeltaPhiAssocPtBinHMPIDAcc[bin]) ;
1714 if(fPi0Trigger || fDecayTrigger)
1718 fhPtPi0DecayRatio = new TH2F
1719 ("hPtPi0DecayRatio","p_{T} of #pi^{0} and the ratio of pt for two decay",
1720 nptbins,ptmin,ptmax, 100,0.,2.);
1721 fhPtPi0DecayRatio->SetXTitle("p_{T}^{#pi^{0}} (GeV/c)");
1722 fhPtPi0DecayRatio->SetYTitle("p_{T}^{Decay}/p_{T}^{#pi^{0}}");
1723 outputContainer->Add(fhPtPi0DecayRatio) ;
1726 fhDeltaPhiDecayCharged = new TH2F
1727 ("hDeltaPhiDecayCharged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}",
1728 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1729 fhDeltaPhiDecayCharged->SetYTitle("#Delta #phi (rad)");
1730 fhDeltaPhiDecayCharged->SetXTitle("p_{T Decay} (GeV/c)");
1733 new TH2F("hXEDecayCharged","x_{E} Decay",
1734 nptbins,ptmin,ptmax,200,0.,2.);
1735 fhXEDecayCharged->SetYTitle("x_{E}");
1736 fhXEDecayCharged->SetXTitle("p_{T decay} (GeV/c)");
1739 new TH2F("hZTDecayCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}",
1740 nptbins,ptmin,ptmax,200,0.,2.);
1741 fhZTDecayCharged->SetYTitle("z_{decay h^{#pm}}");
1742 fhZTDecayCharged->SetXTitle("p_{T decay} (GeV/c)");
1744 outputContainer->Add(fhDeltaPhiDecayCharged) ;
1745 outputContainer->Add(fhXEDecayCharged) ;
1746 outputContainer->Add(fhZTDecayCharged) ;
1751 fhDeltaPhiUeLeftCharged = new TH2F
1752 ("hDeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
1753 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1754 fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi (rad)");
1755 fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1756 outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
1758 fhDeltaPhiUeRightCharged = new TH2F
1759 ("hDeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
1760 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1761 fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi (rad)");
1762 fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1763 outputContainer->Add(fhDeltaPhiUeRightCharged) ;
1765 fhDeltaPhiUeLeftUpCharged = new TH2F
1766 ("hDeltaPhiUeLeftUpChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left Up side range of trigger particles",
1767 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1768 fhDeltaPhiUeLeftUpCharged->SetYTitle("#Delta #phi (rad)");
1769 fhDeltaPhiUeLeftUpCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1770 outputContainer->Add(fhDeltaPhiUeLeftUpCharged) ;
1772 fhDeltaPhiUeRightUpCharged = new TH2F
1773 ("hDeltaPhiUeRightUpChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right Up side range of trigger particles",
1774 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1775 fhDeltaPhiUeRightUpCharged->SetYTitle("#Delta #phi (rad)");
1776 fhDeltaPhiUeRightUpCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1777 outputContainer->Add(fhDeltaPhiUeRightUpCharged) ;
1779 fhDeltaPhiUeLeftDownCharged = new TH2F
1780 ("hDeltaPhiUeLeftDownChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left Down side range of trigger particles",
1781 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1782 fhDeltaPhiUeLeftDownCharged->SetYTitle("#Delta #phi (rad)");
1783 fhDeltaPhiUeLeftDownCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1784 outputContainer->Add(fhDeltaPhiUeLeftDownCharged) ;
1786 fhDeltaPhiUeRightDownCharged = new TH2F
1787 ("hDeltaPhiUeRightDownChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right Down side range of trigger particles",
1788 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1789 fhDeltaPhiUeRightDownCharged->SetYTitle("#Delta #phi (rad)");
1790 fhDeltaPhiUeRightDownCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
1791 outputContainer->Add(fhDeltaPhiUeRightDownCharged) ;
1794 new TH2F("hXEUeChargedLeft","x_{E} with UE left side of trigger",
1795 nptbins,ptmin,ptmax,200,0.,2.);
1796 fhXEUeLeftCharged->SetYTitle("x_{E Ueh^{#pm}}");
1797 fhXEUeLeftCharged->SetXTitle("p_{T trigger} (GeV/c)");
1798 outputContainer->Add(fhXEUeLeftCharged) ;
1800 fhXEUeRightCharged =
1801 new TH2F("hXEUeChargedRight","x_{E h^{#pm}} with UE right side of trigger",
1802 nptbins,ptmin,ptmax,200,0.,2.);
1803 fhXEUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
1804 fhXEUeRightCharged->SetXTitle("p_{T trigger} (GeV/c)");
1805 outputContainer->Add(fhXEUeRightCharged) ;
1807 fhXEUeLeftUpCharged =
1808 new TH2F("hXEUeChargedLeftUp","x_{E} with UE left Up side of trigger",
1809 nptbins,ptmin,ptmax,200,0.,2.);
1810 fhXEUeLeftUpCharged->SetYTitle("x_{E Ueh^{#pm}}");
1811 fhXEUeLeftUpCharged->SetXTitle("p_{T trigger} (GeV/c)");
1812 outputContainer->Add(fhXEUeLeftUpCharged) ;
1814 fhXEUeRightUpCharged =
1815 new TH2F("hXEUeChargedRightUp","x_{E h^{#pm}} with UE right Up side of trigger",
1816 nptbins,ptmin,ptmax,200,0.,2.);
1817 fhXEUeRightUpCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
1818 fhXEUeRightUpCharged->SetXTitle("p_{T trigger} (GeV/c)");
1819 outputContainer->Add(fhXEUeRightUpCharged) ;
1821 fhXEUeLeftDownCharged =
1822 new TH2F("hXEUeChargedLeftDown","x_{E} with UE left Down side of trigger",
1823 nptbins,ptmin,ptmax,200,0.,2.);
1824 fhXEUeLeftDownCharged->SetYTitle("x_{E Ueh^{#pm}}");
1825 fhXEUeLeftDownCharged->SetXTitle("p_{T trigger} (GeV/c)");
1826 outputContainer->Add(fhXEUeLeftDownCharged) ;
1828 fhXEUeRightDownCharged =
1829 new TH2F("hXEUeChargedRightDown","x_{E h^{#pm}} with UE right Down side of trigger",
1830 nptbins,ptmin,ptmax,200,0.,2.);
1831 fhXEUeRightDownCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
1832 fhXEUeRightDownCharged->SetXTitle("p_{T trigger} (GeV/c)");
1833 outputContainer->Add(fhXEUeRightDownCharged) ;
1835 fhPtHbpXEUeLeftCharged =
1836 new TH2F("hHbpXEUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger",
1837 nptbins,ptmin,ptmax,200,0.,10.);
1838 fhPtHbpXEUeLeftCharged->SetYTitle("ln(1/x_{E})");
1839 fhPtHbpXEUeLeftCharged->SetXTitle("p_{T trigger} (GeV/c)");
1840 outputContainer->Add(fhPtHbpXEUeLeftCharged) ;
1842 fhPtHbpXEUeRightCharged =
1843 new TH2F("hHbpXEUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger",
1844 nptbins,ptmin,ptmax,200,0.,10.);
1845 fhPtHbpXEUeRightCharged->SetYTitle("ln(1/x_{E})");
1846 fhPtHbpXEUeRightCharged->SetXTitle("p_{T trigger} (GeV/c)");
1847 outputContainer->Add(fhPtHbpXEUeRightCharged) ;
1850 new TH2F("hZTUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
1851 nptbins,ptmin,ptmax,200,0.,2.);
1852 fhZTUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
1853 fhZTUeLeftCharged->SetXTitle("p_{T trigger} (GeV/c)");
1854 outputContainer->Add(fhZTUeLeftCharged) ;
1856 fhZTUeRightCharged =
1857 new TH2F("hZTUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
1858 nptbins,ptmin,ptmax,200,0.,2.);
1859 fhZTUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
1860 fhZTUeRightCharged->SetXTitle("p_{T trigger} (GeV/c)");
1861 outputContainer->Add(fhZTUeRightCharged) ;
1863 fhPtHbpZTUeLeftCharged =
1864 new TH2F("hHbpZTUeChargedLeft","#xi = ln(1/z_{T}) with charged UE left side of trigger",
1865 nptbins,ptmin,ptmax,200,0.,10.);
1866 fhPtHbpZTUeLeftCharged->SetYTitle("ln(1/z_{T})");
1867 fhPtHbpZTUeLeftCharged->SetXTitle("p_{T trigger} (GeV/c)");
1868 outputContainer->Add(fhPtHbpZTUeLeftCharged) ;
1870 fhPtHbpZTUeRightCharged =
1871 new TH2F("hHbpZTUeChargedRight","#xi = ln(1/z_{T}) with charged UE right side of trigger",
1872 nptbins,ptmin,ptmax,200,0.,10.);
1873 fhPtHbpZTUeRightCharged->SetYTitle("ln(1/z_{T})");
1874 fhPtHbpZTUeRightCharged->SetXTitle("p_{T trigger} (GeV/c)");
1875 outputContainer->Add(fhPtHbpZTUeRightCharged) ;
1878 } //Correlation with charged hadrons
1880 //Correlation with neutral hadrons
1883 fhDeltaPhiDeltaEtaNeutral = new TH2F
1884 ("hDeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}",
1885 ndeltaphibins ,deltaphimin,deltaphimax, ndeltaetabins ,deltaetamin,deltaetamax);
1886 fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi (rad)");
1887 fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta");
1889 fhPhiNeutral = new TH2F
1890 ("hPhiNeutral","#phi_{#pi^{0}} vs p_{T #pi^{0}}",
1891 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1892 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
1893 fhPhiNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
1895 fhEtaNeutral = new TH2F
1896 ("hEtaNeutral","#eta_{#pi^{0}} vs p_{T #pi^{0}}",
1897 nptbins,ptmin,ptmax,netabins,etamin,etamax);
1898 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
1899 fhEtaNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)");
1901 fhDeltaPhiNeutral = new TH2F
1902 ("hDeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
1903 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1904 fhDeltaPhiNeutral->SetYTitle("#Delta #phi (rad)");
1905 fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1907 fhDeltaPhiNeutralPt = new TH2F
1908 ("hDeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
1909 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1910 fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi (rad)");
1911 fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
1913 fhDeltaPhiUeNeutralPt = new TH2F
1914 ("hDeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
1915 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1916 fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi (rad)");
1917 fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)");
1919 fhDeltaEtaNeutral = new TH2F
1920 ("hDeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
1921 nptbins,ptmin,ptmax, ndeltaetabins ,deltaetamin,deltaetamax);
1922 fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
1923 fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1926 new TH2F("hXENeutral","x_{E} for #pi^{0} associated",
1927 nptbins,ptmin,ptmax,200,0.,2.);
1928 fhXENeutral->SetYTitle("x_{E}");
1929 fhXENeutral->SetXTitle("p_{T trigger} (GeV/c)");
1932 new TH2F("hXEUeNeutral","x_{E} for #pi^{0} associated",
1933 nptbins,ptmin,ptmax,200,0.,2.);
1934 fhXEUeNeutral->SetYTitle("x_{E}");
1935 fhXEUeNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1938 new TH2F("hHbpXENeutral","#xi = ln(1/x_{E})for #pi^{0} associated",
1939 nptbins,ptmin,ptmax,200,0.,10.);
1940 fhPtHbpXENeutral->SetYTitle("ln(1/x_{E})");
1941 fhPtHbpXENeutral->SetXTitle("p_{T trigger} (GeV/c)");
1943 fhPtHbpXEUeNeutral =
1944 new TH2F("hHbpXEUeNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
1945 nptbins,ptmin,ptmax,200,0.,10.);
1946 fhPtHbpXEUeNeutral->SetYTitle("ln(1/x_{E})");
1947 fhPtHbpXEUeNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1950 new TH2F("hZTNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger} for #pi^{0} associated",
1951 nptbins,ptmin,ptmax,200,0.,2.);
1952 fhZTNeutral->SetYTitle("z_{trigger #pi^{0}}");
1953 fhZTNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1956 new TH2F("hZTUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger} for #pi^{0} associated",
1957 nptbins,ptmin,ptmax,200,0.,2.);
1958 fhZTUeNeutral->SetYTitle("z_{trigger #pi^{0}}");
1959 fhZTUeNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1962 new TH2F("hHbpZTNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
1963 nptbins,ptmin,ptmax,200,0.,10.);
1964 fhPtHbpZTNeutral->SetYTitle("ln(1/z_{T})");
1965 fhPtHbpZTNeutral->SetXTitle("p_{T trigger}");
1967 fhPtHbpZTUeNeutral =
1968 new TH2F("hHbpZTUeNeutral","#xi = ln(1/x_{E}) for #pi^{0} associated",
1969 nptbins,ptmin,ptmax,200,0.,10.);
1970 fhPtHbpXEUeNeutral->SetYTitle("ln(1/z_{T})");
1971 fhPtHbpXEUeNeutral->SetXTitle("p_{T trigger} (GeV/c)");
1973 outputContainer->Add(fhDeltaPhiDeltaEtaNeutral);
1974 outputContainer->Add(fhPhiNeutral) ;
1975 outputContainer->Add(fhEtaNeutral) ;
1976 outputContainer->Add(fhDeltaPhiNeutral) ;
1977 outputContainer->Add(fhDeltaPhiNeutralPt) ;
1978 outputContainer->Add(fhDeltaPhiUeNeutralPt) ;
1979 outputContainer->Add(fhDeltaEtaNeutral) ;
1980 outputContainer->Add(fhXENeutral) ;
1981 outputContainer->Add(fhXEUeNeutral) ;
1982 outputContainer->Add(fhPtHbpXENeutral) ;
1983 outputContainer->Add(fhPtHbpXEUeNeutral) ;
1984 outputContainer->Add(fhZTNeutral) ;
1985 outputContainer->Add(fhZTUeNeutral) ;
1986 outputContainer->Add(fhPtHbpZTNeutral) ;
1987 outputContainer->Add(fhPtHbpZTUeNeutral) ;
1989 if(fPi0Trigger || fDecayTrigger)
1991 fhDeltaPhiDecayNeutral = new TH2F
1992 ("hDeltaPhiDecayNeutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}",
1993 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
1994 fhDeltaPhiDecayNeutral->SetYTitle("#Delta #phi (rad)");
1995 fhDeltaPhiDecayNeutral->SetXTitle("p_{T Decay} (GeV/c)");
1998 new TH2F("hXEDecayNeutral","x_{E} for decay trigger",
1999 nptbins,ptmin,ptmax,200,0.,2.);
2000 fhXEDecayNeutral->SetYTitle("x_{E}");
2001 fhXEDecayNeutral->SetXTitle("p_{T decay}");
2004 new TH2F("hZTDecayNeutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}",
2005 nptbins,ptmin,ptmax,200,0.,2.);
2006 fhZTDecayNeutral->SetYTitle("z_{h^{0}}");
2007 fhZTDecayNeutral->SetXTitle("p_{T decay}");
2009 outputContainer->Add(fhDeltaPhiDecayNeutral) ;
2010 outputContainer->Add(fhXEDecayNeutral) ;
2011 outputContainer->Add(fhZTDecayNeutral) ;
2017 fhDeltaPhiUeLeftNeutral = new TH2F
2018 ("hDeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles",
2019 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2020 fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi (rad)");
2021 fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
2022 outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
2024 fhDeltaPhiUeRightNeutral = new TH2F
2025 ("hDeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles",
2026 nptbins,ptmin,ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2027 fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi (rad)");
2028 fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
2029 outputContainer->Add(fhDeltaPhiUeRightNeutral) ;
2032 new TH2F("hXEUeNeutralLeft","x_{E} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
2033 nptbins,ptmin,ptmax,140,0.,2.);
2034 fhXEUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
2035 fhXEUeLeftNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2036 outputContainer->Add(fhXEUeLeftNeutral) ;
2038 fhXEUeRightNeutral =
2039 new TH2F("hXEUeNeutralRight","x_{E} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
2040 nptbins,ptmin,ptmax,200,0.,2.);
2041 fhXEUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
2042 fhXEUeRightNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2043 outputContainer->Add(fhXEUeRightNeutral) ;
2045 fhPtHbpXEUeLeftNeutral =
2046 new TH2F("hHbpXEUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger",
2047 nptbins,ptmin,ptmax,200,0.,10.);
2048 fhPtHbpXEUeLeftNeutral->SetYTitle("ln(1/x_{E})");
2049 fhPtHbpXEUeLeftNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2050 outputContainer->Add(fhPtHbpXEUeLeftNeutral) ;
2052 fhPtHbpXEUeRightNeutral =
2053 new TH2F("hHbpXEUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger",
2054 nptbins,ptmin,ptmax,200,0.,10.);
2055 fhPtHbpXEUeRightNeutral->SetYTitle("ln(1/x_{E})");
2056 fhPtHbpXEUeRightNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2057 outputContainer->Add(fhPtHbpXEUeRightNeutral) ;
2060 new TH2F("hZTUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger",
2061 nptbins,ptmin,ptmax,140,0.,2.);
2062 fhZTUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
2063 fhZTUeLeftNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2064 outputContainer->Add(fhZTUeLeftNeutral) ;
2066 fhZTUeRightNeutral =
2067 new TH2F("hZTUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger",
2068 nptbins,ptmin,ptmax,200,0.,2.);
2069 fhZTUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
2070 fhZTUeRightNeutral->SetXTitle("p_{T trigger} (GeV/c)");
2071 outputContainer->Add(fhZTUeRightNeutral) ;
2073 fhPtHbpZTUeLeftNeutral =
2074 new TH2F("hHbpZTUeNeutralLeft","#xi = ln(1/z_{T}) with neutral UE left side of trigger",
2075 nptbins,ptmin,ptmax,200,0.,10.);
2076 fhPtHbpZTUeLeftNeutral->SetYTitle("ln(1/z_{T})");
2077 fhPtHbpZTUeLeftNeutral->SetXTitle("p_{T trigger}");
2078 outputContainer->Add(fhPtHbpZTUeLeftNeutral) ;
2080 fhPtHbpZTUeRightNeutral =
2081 new TH2F("hHbpZTUeNeutralRight","#xi = ln(1/z_{T}) with neutral UE right side of trigger",
2082 nptbins,ptmin,ptmax,200,0.,10.);
2083 fhPtHbpZTUeRightNeutral->SetYTitle("ln(1/z_{T})");
2084 fhPtHbpZTUeRightNeutral->SetXTitle("p_{T trigger}");
2085 outputContainer->Add(fhPtHbpZTUeRightNeutral) ;
2089 }//Correlation with neutral hadrons
2091 //if data is MC, fill more histograms
2094 fh2phiLeadingParticle=new TH2F("h2phiLeadingParticle","#phi resolustion for trigger particles",nptbins,ptmin,ptmax,100,-1,1);
2095 fh2phiLeadingParticle->GetXaxis()->SetTitle("p_{T gen Leading} (GeV/c)");
2096 fh2phiLeadingParticle->GetYaxis()->SetTitle("(#phi_{rec}-#phi_{gen})/#phi_{gen}");
2098 fhMCPtLeading = new TH1F ("hMCPtLeading","MC : p_{T} distribution of leading particles", nptbins,ptmin,ptmax);
2099 fhMCPtLeading->SetXTitle("p_{T}^{trig} (GeV/c)");
2101 fhMCPhiLeading = new TH2F ("hMCPhiLeading","MC : #phi distribution of leading Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
2102 fhMCPhiLeading->SetYTitle("#phi (rad)");
2104 fhMCEtaLeading = new TH2F ("hMCEtaLeading","MC : #eta distribution of leading",nptbins,ptmin,ptmax, netabins,etamin,etamax);
2105 fhMCEtaLeading->SetYTitle("#eta ");
2108 fhMCEtaCharged = new TH2F
2109 ("hMCEtaCharged","MC #eta_{h^{#pm}} vs p_{T #pm}",
2110 nptbins,ptmin,ptmax,netabins,etamin,etamax);
2111 fhMCEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
2112 fhMCEtaCharged->SetXTitle("p_{T #pm} (GeV/c)");
2114 fhMCPhiCharged = new TH2F
2115 ("hMCPhiCharged","#MC phi_{h^{#pm}} vs p_{T #pm}",
2116 200,ptmin,ptmax,nphibins,phimin,phimax);
2117 fhMCPhiCharged->SetYTitle("MC #phi_{h^{#pm}} (rad)");
2118 fhMCPhiCharged->SetXTitle("p_{T #pm} (GeV/c)");
2120 fhMCDeltaPhiDeltaEtaCharged = new TH2F
2121 ("hMCDeltaPhiDeltaEtaCharged","#MC phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
2122 140,-2.,5.,200,-2,2);
2123 fhMCDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi (rad)");
2124 fhMCDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
2126 fhMCDeltaEtaCharged = new TH2F
2127 ("hMCDeltaEtaCharged","MC #eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger} and p_{T assoc}",
2128 nptbins,ptmin,ptmax,200,-2,2);
2129 fhMCDeltaEtaCharged->SetYTitle("#Delta #eta");
2130 fhMCDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
2132 fhMCDeltaPhiCharged = new TH2F
2133 ("hMCDeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
2134 nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2135 fhMCDeltaPhiCharged->SetYTitle("#Delta #phi (rad)");
2136 fhMCDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
2138 fhMCDeltaPhiChargedPt = new TH2F
2139 ("hMCDeltaPhiChargedPt","MC #phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
2140 nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2141 fhMCDeltaPhiChargedPt->SetYTitle("#Delta #phi (rad)");
2142 fhMCDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
2145 new TH2F("hMCPtXECharged","x_{E}",
2146 nptbins,ptmin,ptmax,200,0.,2.);
2147 fhMCPtXECharged->SetYTitle("x_{E}");
2148 fhMCPtXECharged->SetXTitle("p_{T trigger} (GeV/c)");
2151 new TH2F("hMCPtXEUeCharged","x_{E}",
2152 nptbins,ptmin,ptmax,200,0.,2.);
2153 fhMCPtXEUeCharged->SetYTitle("x_{E}");
2154 fhMCPtXEUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
2156 fhMCPtHbpXECharged =
2157 new TH2F("hMCHbpXECharged","MC #xi = ln(1/x_{E}) with charged hadrons",
2158 nptbins,ptmin,ptmax,200,0.,10.);
2159 fhMCPtHbpXECharged->SetYTitle("ln(1/x_{E})");
2160 fhMCPtHbpXECharged->SetXTitle("p_{T trigger}");
2162 fhMCPtHbpXEUeCharged =
2163 new TH2F("hMCPtHbpXEUeCharged","#xi = ln(1/x_{E}) with charged hadrons,Underlying Event",
2164 nptbins,ptmin,ptmax,200,0.,10.);
2165 fhMCPtHbpXEUeCharged->SetYTitle("ln(1/x_{E})");
2166 fhMCPtHbpXEUeCharged->SetXTitle("p_{T trigger} (GeV/c)");
2169 new TH1F("hMCUePart","MC UE particles distribution vs pt trig",
2170 nptbins,ptmin,ptmax);
2171 fhMCUePart->SetYTitle("dNch");
2172 fhMCUePart->SetXTitle("p_{T trigger} (GeV/c)");
2175 new TH2F("hMCPtZTCharged","z_{T}",
2176 nptbins,ptmin,ptmax,200,0.,2.);
2177 fhMCPtZTCharged->SetYTitle("z_{T}");
2178 fhMCPtZTCharged->SetXTitle("p_{T trigger} (GeV/c)");
2180 fhMCPtHbpZTCharged =
2181 new TH2F("hMCHbpZTCharged","MC #xi = ln(1/z_{T}) with charged hadrons",
2182 nptbins,ptmin,ptmax,200,0.,10.);
2183 fhMCPtHbpZTCharged->SetYTitle("ln(1/z_{T})");
2184 fhMCPtHbpZTCharged->SetXTitle("p_{T trigger} (GeV/c)");
2187 new TH2F("hMCPtTrigPout","AOD MC Pout with triggers",
2188 nptbins,ptmin,ptmax,2*nptbins,-ptmax,ptmax);
2189 fhMCPtTrigPout->SetYTitle("p_{out} (GeV/c)");
2190 fhMCPtTrigPout->SetXTitle("p_{T trigger} (GeV/c)");
2192 fhMCPtAssocDeltaPhi =
2193 new TH2F("hMCPtAssocDeltaPhi","AOD MC delta phi with associated charged hadrons",
2194 nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2195 fhMCPtAssocDeltaPhi->SetYTitle("#Delta #phi (rad)");
2196 fhMCPtAssocDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
2198 outputContainer->Add(fh2phiLeadingParticle);
2199 outputContainer->Add(fhMCPtLeading);
2200 outputContainer->Add(fhMCPhiLeading);
2201 outputContainer->Add(fhMCEtaLeading);
2202 outputContainer->Add(fhMCDeltaPhiDeltaEtaCharged);
2203 outputContainer->Add(fhMCPhiCharged) ;
2204 outputContainer->Add(fhMCEtaCharged) ;
2205 outputContainer->Add(fhMCDeltaEtaCharged) ;
2206 outputContainer->Add(fhMCDeltaPhiCharged) ;
2208 outputContainer->Add(fhMCDeltaPhiChargedPt) ;
2209 outputContainer->Add(fhMCPtXECharged) ;
2210 outputContainer->Add(fhMCPtXEUeCharged) ;
2211 outputContainer->Add(fhMCPtZTCharged) ;
2212 outputContainer->Add(fhMCPtHbpXECharged) ;
2213 outputContainer->Add(fhMCPtHbpXEUeCharged);
2214 outputContainer->Add(fhMCUePart);
2215 outputContainer->Add(fhMCPtHbpZTCharged) ;
2216 outputContainer->Add(fhMCPtTrigPout) ;
2217 outputContainer->Add(fhMCPtAssocDeltaPhi) ;
2218 } //for MC histogram
2222 //create event containers
2224 if(!fUseMixStoredInReader || (fUseMixStoredInReader && !GetReader()->ListWithMixedEventsForTracksExists()))
2226 Int_t nvz = GetNZvertBin();
2227 Int_t nrp = GetNRPBin();
2228 Int_t nce = GetNCentrBin();
2230 fListMixTrackEvents= new TList*[nvz*nrp*nce] ;
2232 for( Int_t ice = 0 ; ice < nce ; ice++ )
2234 for( Int_t ivz = 0 ; ivz < nvz ; ivz++ )
2236 for( Int_t irp = 0 ; irp < nrp ; irp++ )
2238 Int_t bin = GetEventMixBin(ice,ivz,irp); //ic*nvz*nrp+iz*nrp+irp;
2240 //printf("GetCreateOutputObjects - Bins : cent %d, vz %d, RP %d, event %d/%d\n",
2241 // ic,iz, irp, bin);
2243 fListMixTrackEvents[bin] = new TList() ;
2244 fListMixTrackEvents[bin]->SetOwner(kFALSE);
2250 fhPtLeadingMixed = new TH1F ("hPtLeadingMixed","p_{T} distribution of leading particles, used for mixing", nptbins,ptmin,ptmax);
2251 fhPtLeadingMixed->SetXTitle("p_{T}^{trig} (GeV/c)");
2255 fhPtLeadingMixedVzBin = new TH2F ("hPtLeadingMixedVzBin","p_{T} distribution of leading particles, used for mixing", nptbins,ptmin,ptmax,GetNZvertBin(),0,GetNZvertBin());
2256 fhPtLeadingMixedVzBin->SetXTitle("p_{T}^{trig} (GeV/c)");
2257 fhPtLeadingMixedVzBin->SetYTitle("v_{z} bin");
2258 outputContainer->Add(fhPtLeadingMixedVzBin);
2261 fhPtLeadingMixedBin = new TH2F ("hPtLeadingMixedBin","p_{T} distribution of leading particles vs mixing bin", nptbins,ptmin,ptmax,nMixBins,0,nMixBins);
2262 fhPtLeadingMixedBin->SetXTitle("p_{T}^{trig} (GeV/c)");
2263 fhPtLeadingMixedBin->SetYTitle("Bin");
2265 fhPhiLeadingMixed = new TH2F ("hPhiLeadingMixed","#phi distribution of leading Particles, used for mixing",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
2266 fhPhiLeadingMixed->SetYTitle("#phi (rad)");
2268 fhEtaLeadingMixed = new TH2F ("hEtaLeadingMixed","#eta distribution of leading, used for mixing",nptbins,ptmin,ptmax, netabins,etamin,etamax);
2269 fhEtaLeadingMixed->SetYTitle("#eta ");
2271 outputContainer->Add(fhPtLeadingMixed);
2272 outputContainer->Add(fhPtLeadingMixedBin);
2273 outputContainer->Add(fhPhiLeadingMixed);
2274 outputContainer->Add(fhEtaLeadingMixed);
2276 // Fill the cluster pool only in isolation analysis or if requested
2277 if( ( OnlyIsolated() || fFillNeutralEventMixPool) &&
2278 (!fUseMixStoredInReader || (fUseMixStoredInReader && !GetReader()->ListWithMixedEventsForCaloExists())))
2280 Int_t nvz = GetNZvertBin();
2281 Int_t nrp = GetNRPBin();
2282 Int_t nce = GetNCentrBin();
2284 fListMixCaloEvents= new TList*[nvz*nrp*nce] ;
2286 for( Int_t ice = 0 ; ice < nce ; ice++ )
2288 for( Int_t ivz = 0 ; ivz < nvz ; ivz++ )
2290 for( Int_t irp = 0 ; irp < nrp ; irp++ )
2292 Int_t bin = GetEventMixBin(ice,ivz,irp); //ic*nvz*nrp+iz*nrp+irp;
2294 //printf("GetCreateOutputObjects - Bins : cent %d, vz %d, RP %d, event %d/%d\n",
2295 // ic,iz, irp, bin);
2297 fListMixCaloEvents[bin] = new TList() ;
2298 fListMixCaloEvents[bin]->SetOwner(kFALSE);
2304 //Init the list in the reader if not done previously
2305 if(fUseMixStoredInReader)
2307 if( !GetReader()->ListWithMixedEventsForTracksExists() )
2308 GetReader()->SetListWithMixedEventsForTracks(fListMixTrackEvents);
2310 if( !GetReader()->ListWithMixedEventsForCaloExists() )
2311 GetReader()->SetListWithMixedEventsForCalo (fListMixCaloEvents );
2314 fhEventBin=new TH1I("hEventBin","Number of real events per bin(cen,vz,rp)",
2315 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
2316 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
2317 fhEventBin->SetXTitle("bin");
2318 outputContainer->Add(fhEventBin) ;
2320 fhEventMixBin=new TH1I("hEventMixBin","Number of events per bin(cen,vz,rp)",
2321 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
2322 GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
2323 fhEventMixBin->SetXTitle("bin");
2324 outputContainer->Add(fhEventMixBin) ;
2326 fhNtracksAll=new TH1F("hNtracksAll","Number of tracks w/o event trigger",2000,0,2000);
2327 outputContainer->Add(fhNtracksAll);
2329 fhNtracksTrigger=new TH1F("hNtracksTriggerEvent","Number of tracks w/ event trigger",2000,0,2000);
2330 outputContainer->Add(fhNtracksTrigger);
2332 fhNtracksMB=new TH1F("hNtracksMBEvent","Number of tracks w/ event trigger kMB",2000,0,2000);
2333 outputContainer->Add(fhNtracksMB);
2335 if(fFillNeutralEventMixPool || OnlyIsolated())
2337 fhNclustersAll=new TH1F("hNclustersAll","Number of clusters w/o event trigger",2000,0,2000);
2338 outputContainer->Add(fhNclustersAll);
2340 fhNclustersTrigger=new TH1F("hNclustersTriggerEvent","Number of clusters w/ event trigger",2000,0,2000);
2341 outputContainer->Add(fhNclustersTrigger);
2343 fhNclustersMB=new TH1F("hNclustersMBEvent","Number of clusters w/ event trigger kMB",2000,0,2000);
2344 outputContainer->Add(fhNclustersMB);
2347 fhMixDeltaPhiCharged = new TH2F
2348 ("hMixDeltaPhiCharged","Mixed event : #phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
2349 nptbins,ptmin,ptmax,ndeltaphibins ,deltaphimin,deltaphimax);
2350 fhMixDeltaPhiCharged->SetYTitle("#Delta #phi (rad)");
2351 fhMixDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
2352 outputContainer->Add(fhMixDeltaPhiCharged);
2354 fhMixDeltaPhiDeltaEtaCharged = new TH2F
2355 ("hMixDeltaPhiDeltaEtaCharged","Mixed event : #phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}",
2356 ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins ,deltaetamin,deltaetamax);
2357 fhMixDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi (rad)");
2358 fhMixDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta");
2359 outputContainer->Add(fhMixDeltaPhiDeltaEtaCharged);
2362 new TH2F("hMixXECharged","Mixed event : x_{E} for charged tracks",
2363 nptbins,ptmin,ptmax,200,0.,2.);
2364 fhMixXECharged->SetYTitle("x_{E}");
2365 fhMixXECharged->SetXTitle("p_{T trigger} (GeV/c)");
2366 outputContainer->Add(fhMixXECharged);
2369 new TH2F("hMixHbpXECharged","mixed event : #xi = ln(1/x_{E}) with charged hadrons",
2370 nptbins,ptmin,ptmax,200,0.,10.);
2371 fhMixHbpXECharged->SetYTitle("ln(1/x_{E})");
2372 fhMixHbpXECharged->SetXTitle("p_{T trigger} (GeV/c)");
2373 outputContainer->Add(fhMixHbpXECharged);
2375 fhMixDeltaPhiChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2376 fhMixDeltaPhiChargedAssocPtBinDEta08 = new TH2F*[fNAssocPtBins*nz];
2377 fhMixDeltaPhiChargedAssocPtBinDEta0 = new TH2F*[fNAssocPtBins*nz];
2378 fhMixDeltaPhiDeltaEtaChargedAssocPtBin = new TH2F*[fNAssocPtBins*nz];
2380 for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
2382 for(Int_t z = 0 ; z < nz ; z++)
2389 tz = ", v_{z} bin "+z;
2392 //printf("MIX : iAssoc %d, Vz %d, bin %d - sz %s, tz %s \n",i,z,bin,sz.Data(),tz.Data());
2394 fhMixDeltaPhiChargedAssocPtBin[bin] = new TH2F(Form("hMixDeltaPhiChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2395 Form("Mixed event #Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2396 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2397 fhMixDeltaPhiChargedAssocPtBin[bin]->SetXTitle("p_{T trigger} (GeV/c)");
2398 fhMixDeltaPhiChargedAssocPtBin[bin]->SetYTitle("#Delta #phi (rad)");
2400 fhMixDeltaPhiChargedAssocPtBinDEta08[bin] = new TH2F(Form("hMixDeltaPhiDeltaEta0.8ChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2401 Form("Mixed event #Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta > 0.8", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2402 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2403 fhMixDeltaPhiChargedAssocPtBinDEta08[bin]->SetXTitle("p_{T trigger} (GeV/c)");
2404 fhMixDeltaPhiChargedAssocPtBinDEta08[bin]->SetYTitle("#Delta #phi (rad)");
2406 fhMixDeltaPhiChargedAssocPtBinDEta0[bin] = new TH2F(Form("hMixDeltaPhiDeltaEta0ChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2407 Form("Mixed event #Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s, for #Delta #eta = 0", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2408 nptbins, ptmin, ptmax, ndeltaphibins ,deltaphimin,deltaphimax);
2409 fhMixDeltaPhiChargedAssocPtBinDEta0[bin]->SetXTitle("p_{T trigger} (GeV/c)");
2410 fhMixDeltaPhiChargedAssocPtBinDEta0[bin]->SetYTitle("#Delta #phi (rad)");
2412 fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin] = new TH2F(Form("hMixDeltaPhiDeltaEtaChargedAssocPtBin%2.1f_%2.1f%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],sz.Data()),
2413 Form("Mixed event #Delta #phi vs p_{T trigger} for associated p_{T} bin [%2.1f,%2.1f]%s", fAssocPtBinLimit[i], fAssocPtBinLimit[i+1],tz.Data()),
2414 ndeltaphibins ,deltaphimin,deltaphimax,ndeltaetabins ,deltaetamin,deltaetamax);
2415 fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->SetXTitle("#Delta #phi (rad)");
2416 fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->SetYTitle("#Delta #eta");
2418 outputContainer->Add(fhMixDeltaPhiChargedAssocPtBin[bin]);
2419 outputContainer->Add(fhMixDeltaPhiChargedAssocPtBinDEta08[bin]);
2420 outputContainer->Add(fhMixDeltaPhiChargedAssocPtBinDEta0[bin]);
2421 outputContainer->Add(fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]);
2426 return outputContainer;
2430 //_________________________________________________________________________________________________
2431 Bool_t AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum(const AliAODPWG4Particle* trigger,
2432 TLorentzVector & mom1,
2433 TLorentzVector & mom2)
2435 // Get the momentum of the pi0/eta assigned decay photons
2436 // In case of pi0/eta trigger, we may want to check their decay correlation,
2437 // get their decay children
2439 Int_t indexPhoton1 = trigger->GetCaloLabel(0);
2440 Int_t indexPhoton2 = trigger->GetCaloLabel(1);
2441 Float_t ptTrig = trigger->Pt();
2443 if(indexPhoton1!=-1 || indexPhoton2!=-1) return kFALSE;
2446 printf("AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
2448 TObjArray * clusters = 0x0 ;
2449 if(trigger->GetDetector()=="EMCAL") clusters = GetEMCALClusters() ;
2450 else clusters = GetPHOSClusters() ;
2452 for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
2454 AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
2455 if(photon->GetID()==indexPhoton1)
2457 photon->GetMomentum(mom1,GetVertex(0)) ;
2458 if(ptTrig) fhPtPi0DecayRatio->Fill(ptTrig, mom1.Pt()/ptTrig);
2460 if(photon->GetID()==indexPhoton2)
2462 photon->GetMomentum(mom1,GetVertex(0)) ;
2463 if(ptTrig > 0) fhPtPi0DecayRatio->Fill(ptTrig, mom2.Pt()/ptTrig);
2466 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum() - Photon1 = %f, Photon2 = %f \n", mom1.Pt(), mom2.Pt());
2474 //_____________________________________________________________
2475 Int_t AliAnaParticleHadronCorrelation::GetMCTagHistogramIndex(const Int_t mcTag)
2477 // Index of MC histograms depending on MC origin
2479 if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPrompt) ||
2480 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCFragmentation)) return 0;
2481 else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)) return 1;
2482 else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0Decay)) return 2;
2483 else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEtaDecay)) return 3;
2484 else if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCOtherDecay)) return 4;
2485 else if(!GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron)) return 5;
2490 //____________________________________________________
2491 void AliAnaParticleHadronCorrelation::InitParameters()
2494 //Initialize the parameters of the analysis.
2495 SetInputAODName("Particle");
2496 SetAODObjArrayName("Hadrons");
2497 AddToHistogramsName("AnaHadronCorr_");
2499 SetPtCutRange(0.,300);
2500 fDeltaPhiMinCut = 1.5 ;
2501 fDeltaPhiMaxCut = 4.5 ;
2502 fSelectIsolated = kFALSE;
2503 fMakeSeveralUE = kFALSE;
2504 fUeDeltaPhiMinCut = 1. ;
2505 fUeDeltaPhiMaxCut = 1.5 ;
2507 fNeutralCorr = kFALSE ;
2508 fPi0Trigger = kFALSE ;
2509 fDecayTrigger = kFALSE ;
2510 fHMPIDCorrelation = kFALSE ;
2512 fMakeAbsoluteLeading = kTRUE;
2513 fMakeNearSideLeading = kFALSE;
2516 fAssocPtBinLimit[0] = 0.2 ;
2517 fAssocPtBinLimit[1] = 0.5 ;
2518 fAssocPtBinLimit[2] = 1.0 ;
2519 fAssocPtBinLimit[3] = 2.0 ;
2520 fAssocPtBinLimit[4] = 3.0 ;
2521 fAssocPtBinLimit[5] = 4.0 ;
2522 fAssocPtBinLimit[6] = 5.0 ;
2523 fAssocPtBinLimit[7] = 6.0 ;
2524 fAssocPtBinLimit[8] = 7.0 ;
2525 fAssocPtBinLimit[9] = 8.0 ;
2526 fAssocPtBinLimit[10] = 9.0 ;
2527 fAssocPtBinLimit[11] = 10.0 ;
2528 fAssocPtBinLimit[12] = 12.0 ;
2529 fAssocPtBinLimit[13] = 14.0 ;
2530 fAssocPtBinLimit[14] = 16.0 ;
2531 fAssocPtBinLimit[15] = 20.0 ;
2532 fAssocPtBinLimit[16] = 30.0 ;
2533 fAssocPtBinLimit[17] = 40.0 ;
2534 fAssocPtBinLimit[18] = 50.0 ;
2535 fAssocPtBinLimit[19] = 200.0 ;
2538 fUseMixStoredInReader = kTRUE;
2545 //__________________________________________________________
2546 void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
2548 //Particle-Hadron Correlation Analysis, fill AODs
2550 if(!GetInputAODBranch())
2552 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
2556 if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation"))
2558 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());
2564 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n");
2565 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
2566 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetCTSTracks() ->GetEntriesFast());
2567 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetEMCALClusters()->GetEntriesFast());
2568 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetPHOSClusters() ->GetEntriesFast());
2571 //Get the vertex and check it is not too large in z
2572 Double_t v[3] = {0,0,0}; //vertex ;
2573 GetReader()->GetVertex(v);
2574 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
2576 // Fill the pool with tracks if requested
2579 FillChargedEventMixPool();
2580 if(OnlyIsolated() || fFillNeutralEventMixPool)
2581 FillNeutralEventMixPool();
2584 //Loop on stored AOD particles, find leading trigger
2585 Double_t ptTrig = fMinTriggerPt ;
2586 fLeadingTriggerIndex = -1 ;
2587 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
2588 for(Int_t iaod = 0; iaod < naod ; iaod++)
2590 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
2592 // Vertex cut in case of mixing
2593 Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
2594 if(check == 0) continue;
2595 if(check == -1) return;
2597 // find the leading particles with highest momentum
2598 if (particle->Pt() > ptTrig)
2600 ptTrig = particle->Pt() ;
2601 fLeadingTriggerIndex = iaod ;
2603 }// finish search of leading trigger particle
2606 //Do correlation with leading particle
2607 if(fLeadingTriggerIndex >= 0)
2610 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
2612 //check if the particle is isolated or if we want to take the isolation into account
2613 if(OnlyIsolated() && !particle->IsIsolated()) return;
2615 //Make correlation with charged hadrons
2616 Bool_t okcharged = kTRUE;
2617 Bool_t okneutral = kTRUE;
2618 if(GetReader()->IsCTSSwitchedOn() )
2619 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kFALSE);
2621 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
2622 if(fNeutralCorr && pi0list && pi0list->GetEntriesFast() > 0)
2623 okneutral = MakeNeutralCorrelation(particle, pi0list,kFALSE);
2625 }//Correlate leading
2627 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n");
2631 //_________________________________________________________________
2632 void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
2634 //Particle-Hadron Correlation Analysis, fill histograms
2636 if(!GetInputAODBranch())
2638 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
2644 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
2645 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
2648 //Get the vertex and check it is not too large in z
2649 Double_t v[3] = {0,0,0}; //vertex ;
2650 GetReader()->GetVertex(v);
2651 if(!GetMixedEvent() && TMath::Abs(v[2]) > GetZvertexCut()) return ;
2653 //Loop on stored AOD particles, find leading
2654 Double_t ptTrig = fMinTriggerPt;
2655 if(fLeadingTriggerIndex < 0)
2657 //Search leading if not done before
2658 Int_t naod = GetInputAODBranch()->GetEntriesFast() ;
2659 for(Int_t iaod = 0; iaod < naod ; iaod++)
2660 { //loop on input trigger AOD file
2661 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
2663 // Vertex cut in case of mixing
2664 Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
2665 if(check == 0) continue;
2666 if(check == -1) return;
2668 //check if the particle is isolated or if we want to take the isolation into account
2669 if(OnlyIsolated() && !particle->IsIsolated()) continue;
2671 //find the leading particles with highest momentum
2672 if (particle->Pt() > ptTrig)
2674 ptTrig = particle->Pt() ;
2675 fLeadingTriggerIndex = iaod ;
2678 }// Finish search of leading trigger particle
2679 }// Search leading if not done before
2681 if(fLeadingTriggerIndex >= 0 )
2682 { //using trigger particle to do correlations
2684 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(fLeadingTriggerIndex));
2686 // check if it was a calorimeter cluster and if the SS cut was requested, if so, apply it
2687 Int_t clID1 = particle->GetCaloLabel(0) ;
2688 Int_t clID2 = particle->GetCaloLabel(1) ; // for photon clusters should not be set.
2689 //printf("Leading for for %s: id1 %d, id2 %d, min %f, max %f, det %s\n",
2690 // GetInputAODName().Data(),clID1,clID2,fM02MinCut,fM02MaxCut,(particle->GetDetector()).Data());
2692 if(clID1 > 0 && clID2 < 0 && fM02MaxCut > 0 && fM02MinCut > 0)
2695 TObjArray* clusters = 0x0;
2696 if (particle->GetDetector() == "EMCAL") clusters = GetEMCALClusters();
2697 else if(particle->GetDetector() == "PHOS" ) clusters = GetPHOSClusters();
2701 AliVCluster *cluster = FindCluster(clusters,clID1,iclus);
2702 Float_t m02 = cluster->GetM02();
2703 //printf("\t Check m02 = %2.2f\n",m02);
2704 if(m02 > fM02MaxCut || m02 < fM02MinCut)
2706 //printf("\t \t Not accepted\n");
2712 // Check if the particle is isolated or if we want to take the isolation into account
2713 if(OnlyIsolated() && !particle->IsIsolated()) return;
2715 Float_t pt = particle->Pt();
2716 fhPtInput->Fill(pt);
2718 // Check if trigger is in fiducial region
2719 if(IsFiducialCutOn())
2721 Bool_t in = GetFiducialCut()->IsInFiducialCut(*particle->Momentum(),particle->GetDetector()) ;
2725 fhPtFidCut->Fill(pt);
2727 // Make correlation with charged hadrons
2728 Bool_t okcharged = kTRUE;
2729 Bool_t okneutral = kTRUE;
2730 if(GetReader()->IsCTSSwitchedOn() )
2732 okcharged = MakeChargedCorrelation(particle, GetCTSTracks(),kTRUE);
2735 MakeMCChargedCorrelation(particle);
2739 TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists
2740 if(fNeutralCorr && pi0list)
2742 if(pi0list->GetEntriesFast() > 0)
2743 okneutral = MakeNeutralCorrelation(particle, pi0list,kTRUE);
2746 // Fill leading particle histogram if correlation went well and
2747 // no problem was found, like not absolute leading, or bad vertex in mixing.
2748 if(okcharged && okneutral)
2750 fhPtLeading->Fill(pt);
2751 fhPtLeadingBin->Fill(pt,GetEventMixBin());
2752 if(fCorrelVzBin) fhPtLeadingVzBin->Fill(pt,GetEventVzBin());
2754 if(fFillPileUpHistograms)
2756 if(GetReader()->IsPileUpFromSPD()) fhPtLeadingPileUp[0]->Fill(pt);
2757 if(GetReader()->IsPileUpFromEMCal()) fhPtLeadingPileUp[1]->Fill(pt);
2758 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtLeadingPileUp[2]->Fill(pt);
2759 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtLeadingPileUp[3]->Fill(pt);
2760 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtLeadingPileUp[4]->Fill(pt);
2761 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtLeadingPileUp[5]->Fill(pt);
2762 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtLeadingPileUp[6]->Fill(pt);
2765 Float_t phi = particle->Phi();
2766 if(phi<0)phi+=TMath::TwoPi();
2767 fhPhiLeading->Fill(pt, phi);
2769 fhEtaLeading->Fill(pt, particle->Eta());
2770 //printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Leading particle : pt %f, eta %f, phi %f\n",particle->Pt(),particle->Eta(),phi);
2774 Int_t mcIndex = GetMCTagHistogramIndex(particle->GetTag());
2775 fhPtLeadingMC[mcIndex]->Fill(pt);
2778 Float_t cen = GetEventCentrality();
2779 Float_t ep = GetEventPlaneAngle();
2781 fhPtLeadingCentrality ->Fill(pt,cen);
2782 fhPtLeadingEventPlane ->Fill(pt,ep);
2783 fhLeadingEventPlaneCentrality->Fill(cen,ep);
2785 }//ok charged && neutral
2788 //Reinit for next event
2789 fLeadingTriggerIndex = -1;
2791 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n");
2794 //___________________________________________________________________________________________________________
2795 Bool_t AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle,
2796 const TObjArray* pl, const Bool_t bFillHisto)
2798 // Charged Hadron Correlation Analysis
2800 printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n");
2802 Float_t phiTrig = aodParticle->Phi();
2803 Float_t etaTrig = aodParticle->Eta();
2804 Float_t ptTrig = aodParticle->Pt();
2805 Bool_t decay = aodParticle->IsTagged();
2806 Int_t mcTag = aodParticle->GetTag();
2807 Double_t bz = GetReader()->GetInputEvent()->GetMagneticField();
2809 Float_t pt = -100. ;
2810 Float_t zT = -100. ;
2811 Float_t xE = -100. ;
2812 Float_t hbpXE = -100. ;
2813 Float_t hbpZT = -100. ;
2814 Float_t phi = -100. ;
2815 Float_t eta = -100. ;
2816 Float_t pout = -100. ;
2817 Float_t deltaPhi = -100. ;
2820 TLorentzVector photonMom ;
2821 TObjArray * reftracks = 0x0;
2823 Int_t nTracks = GetCTSTracks()->GetEntriesFast() ;
2825 // Mixed event settings
2826 Int_t evtIndex11 = -1 ; // cluster trigger or pi0 trigger
2827 Int_t evtIndex12 = -1 ; // pi0 trigger
2828 Int_t evtIndex13 = -1 ; // charged trigger
2830 Double_t v[3] = {0,0,0}; //vertex ;
2831 GetReader()->GetVertex(v);
2833 if (GetMixedEvent())
2835 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
2836 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
2837 evtIndex13 = GetMixedEvent()->EventIndex(aodParticle->GetTrackLabel(0)) ;
2840 // In case of pi0/eta trigger, we may want to check their decay correlation,
2841 // get their decay children
2842 TLorentzVector decayMom1;
2843 TLorentzVector decayMom2;
2844 Bool_t decayFound = kFALSE;
2845 if(fPi0Trigger && bFillHisto) decayFound = GetDecayPhotonMomentum(aodParticle,decayMom1, decayMom2);
2847 //-----------------------------------------------------------------------
2848 //Track loop, select tracks with good pt, phi and fill AODs or histograms
2849 //-----------------------------------------------------------------------
2851 for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ )
2853 AliVTrack * track = (AliVTrack *) (pl->At(ipr)) ;
2855 Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
2856 p3.SetXYZ(mom[0],mom[1],mom[2]);
2860 if(phi < 0) phi+=TMath::TwoPi();
2862 //Select only hadrons in pt range
2863 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
2865 //remove trigger itself for correlation when use charged triggers
2866 if( track->GetID() == aodParticle->GetTrackLabel(0) || track->GetID() == aodParticle->GetTrackLabel(1) ||
2867 track->GetID() == aodParticle->GetTrackLabel(2) || track->GetID() == aodParticle->GetTrackLabel(3) )
2870 //jump out this event if near side associated particle pt larger than trigger
2871 if (fMakeNearSideLeading)
2873 if(pt > ptTrig && TMath::Abs(phi-phiTrig) < TMath::PiOver2()) return kFALSE;
2875 //jump out this event if there is any other particle with pt larger than trigger
2876 else if(fMakeAbsoluteLeading)
2878 if(pt > ptTrig) return kFALSE;
2881 //Only for mixed event
2882 Int_t evtIndex2 = 0 ;
2883 if (GetMixedEvent())
2885 evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ;
2886 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex13 == evtIndex2 ) // photon and track from different events
2889 if (TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut())
2898 printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
2900 // Set the pt associated bin for the defined bins
2901 Int_t assocBin = -1;
2902 for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
2904 if(pt > fAssocPtBinLimit[i] && pt < fAssocPtBinLimit[i+1]) assocBin= i;
2907 // Assign to the histogram array a bin corresponding to a combination of pTa and vz bins
2913 nz = GetNZvertBin();
2914 vz = GetEventVzBin();
2917 Int_t bin = assocBin*nz+vz;
2919 //printf("assoc Bin = %d, vZ bin = %d, bin = %d \n", assocBin,GetEventVzBin(),bin);
2921 ULong_t status = track->GetStatus();
2922 Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
2923 //Double32_t tof = track->GetTOFsignal()*1e-3;
2924 Int_t trackBC = track->GetTOFBunchCrossing(bz);
2927 if (okTOF && trackBC!=0) outTOF = 1;
2928 else if(okTOF && trackBC==0) outTOF = 0;
2931 // calculate deltaPhi for later, shift when needed
2932 FillChargedAngularCorrelationHistograms(pt, ptTrig, bin, phi, phiTrig, deltaPhi,
2933 eta, etaTrig, decay, track->GetHMPIDsignal(),outTOF,nTracks,mcTag);
2935 // Imbalance zT/xE/pOut
2937 if(zT > 0 ) hbpZT = TMath::Log(1./zT);
2940 xE =-pt/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
2941 //if(xE <0.)xE =-xE;
2942 if(xE > 0 ) hbpXE = TMath::Log(1./xE);
2945 pout = pt*TMath::Sin(deltaPhi) ;
2947 //delta phi cut for momentum imbalance correlation
2948 if ( (deltaPhi > fDeltaPhiMinCut) && (deltaPhi < fDeltaPhiMaxCut) )
2951 FillChargedMomentumImbalanceHistograms(ptTrig, pt, xE, hbpXE, zT, hbpZT, pout,
2952 nTracks, track->Charge(), bin, decay,outTOF,mcTag);
2955 if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
2958 FillChargedUnderlyingEventHistograms(ptTrig, pt, deltaPhi, nTracks,outTOF);
2960 fhUePart->Fill(ptTrig);
2964 if(fPi0Trigger && decayFound)
2965 FillDecayPhotonCorrelationHistograms(pt, phi, decayMom1,decayMom2, kTRUE) ;
2967 //several UE calculation
2968 if(fMakeSeveralUE) FillChargedUnderlyingEventSidesHistograms(ptTrig,pt,deltaPhi);
2976 reftracks = new TObjArray(0);
2977 TString trackname = Form("%s+Tracks", GetAODObjArrayName().Data());
2978 reftracks->SetName(trackname.Data());
2979 reftracks->SetOwner(kFALSE);
2982 reftracks->Add(track);
2984 }//aod particle loop
2987 //Fill AOD with reference tracks, if not filling histograms
2988 if(!bFillHisto && reftracks)
2990 aodParticle->AddObjArray(reftracks);
2993 //Own mixed event, add event and remove previous or fill the mixed histograms
2994 if(DoOwnMix() && bFillHisto)
2996 MakeChargedMixCorrelation(aodParticle);
3004 //_________________________________________________________________________________________________________
3005 void AliAnaParticleHadronCorrelation::MakeChargedMixCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
3007 // Mix current trigger with tracks in another MB event
3009 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelationNew::MakeChargedMixCorrelation() - Make trigger particle - charged hadron mixed event correlation \n");
3011 if(GetMixedEvent()) return; // This is not the mixed event from general mixing frame
3013 // Get the event with similar caracteristics
3014 //printf("MakeChargedMixCorrelation for %s\n",GetInputAODName().Data());
3016 AliAnalysisManager * manager = AliAnalysisManager::GetAnalysisManager();
3018 AliInputEventHandler * inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
3020 if(!inputHandler) return;
3022 if(!(inputHandler->IsEventSelected( ) & GetReader()->GetEventTriggerMask())) return;
3024 // Get the pool, check if it exits
3025 Int_t eventBin = GetEventMixBin();
3027 fhEventBin->Fill(eventBin);
3029 //Check that the bin exists, if not (bad determination of RP, centrality or vz bin) do nothing
3030 if(eventBin < 0) return;
3033 TList * poolCalo = 0;
3034 if(fUseMixStoredInReader)
3036 pool = GetReader()->GetListWithMixedEventsForTracks(eventBin);
3037 if(OnlyIsolated() || fFillNeutralEventMixPool) poolCalo = GetReader()->GetListWithMixedEventsForCalo (eventBin);
3041 pool = fListMixTrackEvents[eventBin];
3042 if(OnlyIsolated() || fFillNeutralEventMixPool) poolCalo = fListMixCaloEvents [eventBin];
3047 if((OnlyIsolated() || fFillNeutralEventMixPool ) && !poolCalo &&
3048 (GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::AliIsolationCut::kOnlyCharged))
3049 printf("AliAnaParticleHadronCorrelation::MakeChargedMixCorrelation() - Careful, cluster pool not available\n");
3051 Double_t ptTrig = aodParticle->Pt();
3052 Double_t etaTrig = aodParticle->Eta();
3053 Double_t phiTrig = aodParticle->Phi();
3054 if(phiTrig < 0.) phiTrig+=TMath::TwoPi();
3057 printf("AliAnaParticleHadronCorrelationNew::MakeChargedMixCorrelation() - Pool bin %d size %d, leading trigger pt=%f, phi=%f, eta=%f\n",
3058 eventBin,pool->GetSize(), ptTrig,phiTrig,etaTrig);
3060 Double_t ptAssoc = -999.;
3061 Double_t phiAssoc = -999.;
3062 Double_t etaAssoc = -999.;
3063 Double_t deltaPhi = -999.;
3064 Double_t deltaEta = -999.;
3065 Double_t xE = -999.;
3066 Double_t hbpXE = -999.;
3068 //Start from first event in pool except if in this same event the pool was filled
3070 if(GetReader()->GetLastTracksMixedEvent() == GetEventNumber()) ev0 = 1;
3072 for(Int_t ev=ev0; ev < pool->GetSize(); ev++)
3074 TObjArray* bgTracks = static_cast<TObjArray*>(pool->At(ev));
3075 TObjArray* bgCalo = 0;
3077 // Check if the particle is isolated in the mixed event, it not, do not fill the histograms
3078 if(OnlyIsolated() || fFillNeutralEventMixPool)
3080 if(pool->GetSize()!=poolCalo->GetSize())
3081 printf("AliAnaParticleHadronCorrelationNew::MakeChargedMixCorrelation() - Different size of calo and track pools\n");
3083 bgCalo = static_cast<TObjArray*>(poolCalo->At(ev));
3086 printf("AliAnaParticleHadronCorrelationNew::MakeChargedMixCorrelation() - Event %d in calo pool not available?\n",ev);
3088 if(OnlyIsolated() && bgCalo)
3090 Int_t n=0; Int_t nfrac = 0; Bool_t isolated = kFALSE; Float_t coneptsum = 0;
3091 GetIsolationCut()->MakeIsolationCut(bgTracks,bgCalo,
3092 GetReader(), GetCaloPID(),
3093 kFALSE, aodParticle, "",
3094 n,nfrac,coneptsum, isolated);
3096 //printf("AliAnaParticleHadronCorrelation::MakeChargedMixCorrelation() - Isolated? %d - cone %f, ptthres %f",
3097 // isolated,GetIsolationCut()->GetConeSize(),GetIsolationCut()->GetPtThreshold());
3098 //if(bgTracks)printf(" - n track %d", bgTracks->GetEntriesFast());
3101 if(!isolated) continue ;
3105 fhEventMixBin->Fill(eventBin);
3107 Int_t nTracks=bgTracks->GetEntriesFast();
3108 //printf("\t Read Pool event %d, nTracks %d\n",ev,nTracks);
3110 //Check if it is leading if mixed event
3111 if(fMakeNearSideLeading || fMakeAbsoluteLeading)
3113 Bool_t leading = kTRUE;
3114 for(Int_t jlead = 0;jlead <nTracks; jlead++ )
3116 AliAODPWG4Particle *track = (AliAODPWG4Particle*) bgTracks->At(jlead) ;
3118 ptAssoc = track->Pt();
3119 phiAssoc = track->Phi() ;
3121 if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
3122 if (fMakeNearSideLeading)
3124 if(ptAssoc > ptTrig && TMath::Abs(phiAssoc-phiTrig) < TMath::PiOver2())
3130 //jump out this event if there is any other particle with pt larger than trigger
3131 else if(fMakeAbsoluteLeading)
3133 if(ptAssoc > ptTrig)
3141 if(fFillNeutralEventMixPool && bgCalo)
3143 Int_t nClusters=bgCalo->GetEntriesFast();
3144 TLorentzVector mom ;
3145 for(Int_t jlead = 0;jlead <nClusters; jlead++ )
3147 AliVCluster *cluster = (AliVCluster*) bgCalo->At(jlead) ;
3149 Double_t vertex[]={0,0,0}; // assume 0 vertex
3150 cluster->GetMomentum(mom,vertex) ;
3153 phiAssoc = mom.Phi() ;
3155 if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
3156 if (fMakeNearSideLeading)
3158 if(ptAssoc > ptTrig && TMath::Abs(phiAssoc-phiTrig) < TMath::PiOver2())
3164 //jump out this event if there is any other particle with pt larger than trigger
3165 else if(fMakeAbsoluteLeading)
3167 if(ptAssoc > ptTrig)
3176 if(!leading) continue; // not leading, check the next event in pool
3180 fhPtLeadingMixed ->Fill(ptTrig);
3181 fhPhiLeadingMixed ->Fill(ptTrig, phiTrig);
3182 fhEtaLeadingMixed ->Fill(ptTrig, etaTrig);
3183 fhPtLeadingMixedBin->Fill(ptTrig,eventBin);
3184 if(fCorrelVzBin)fhPtLeadingMixedVzBin->Fill(ptTrig, GetEventVzBin());
3186 for(Int_t j1 = 0;j1 <nTracks; j1++ )
3188 AliAODPWG4Particle *track = (AliAODPWG4Particle*) bgTracks->At(j1) ;
3190 if(!track) continue;
3192 ptAssoc = track->Pt();
3193 etaAssoc = track->Eta();
3194 phiAssoc = track->Phi() ;
3195 if(phiAssoc < 0) phiAssoc+=TMath::TwoPi();
3197 if(IsFiducialCutOn())
3199 Bool_t in = GetFiducialCut()->IsInFiducialCut(*aodParticle->Momentum(),"CTS") ;
3203 deltaPhi = phiTrig-phiAssoc;
3204 if(deltaPhi < -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
3205 if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
3206 deltaEta = etaTrig-etaAssoc;
3209 printf("AliAnaParticleHadronCorrelationNew::MakeChargedMixCorrelation(): deltaPhi= %f, deltaEta=%f\n",deltaPhi, deltaEta);
3211 // Set the pt associated bin for the defined bins
3212 Int_t assocBin = -1;
3213 for(Int_t i = 0 ; i < fNAssocPtBins ; i++)
3215 if(ptAssoc > fAssocPtBinLimit[i] && ptAssoc < fAssocPtBinLimit[i+1]) assocBin= i;
3218 // Assign to the histogram array a bin corresponding to a combination of pTa and vz bins
3224 nz = GetNZvertBin();
3225 vz = GetEventVzBin();
3228 Int_t bin = assocBin*nz+vz;
3230 fhMixDeltaPhiCharged ->Fill(ptTrig, deltaPhi);
3231 fhMixDeltaPhiDeltaEtaCharged->Fill(deltaPhi, deltaEta);
3233 fhMixDeltaPhiCharged ->Fill(ptTrig, deltaPhi);
3234 fhMixDeltaPhiDeltaEtaCharged->Fill(deltaPhi, deltaEta);
3236 xE =-ptAssoc/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
3237 //if(xE <0.)xE =-xE;
3238 if(xE > 0 ) hbpXE = TMath::Log(1./xE);
3241 if ( (deltaPhi > fDeltaPhiMinCut) && (deltaPhi < fDeltaPhiMaxCut) )
3243 fhMixXECharged->Fill(ptTrig,xE);
3244 fhMixHbpXECharged->Fill(ptTrig,hbpXE);
3247 if(bin < 0) continue ; // this pt bin was not considered
3249 if(TMath::Abs(deltaEta) > 0.8)
3250 fhMixDeltaPhiChargedAssocPtBinDEta08 [bin]->Fill(ptTrig, deltaPhi);
3251 if(TMath::Abs(deltaEta) < 0.01)
3252 fhMixDeltaPhiChargedAssocPtBinDEta0 [bin]->Fill(ptTrig, deltaPhi);
3254 fhMixDeltaPhiChargedAssocPtBin [bin]->Fill(ptTrig, deltaPhi);
3255 fhMixDeltaPhiDeltaEtaChargedAssocPtBin[bin]->Fill(deltaPhi, deltaEta);
3258 } // mixed event loop
3262 //________________________________________________________________________________________________________________
3263 Bool_t AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * const aodParticle,
3264 const TObjArray* pi0list, const Bool_t bFillHisto)
3266 // Neutral Pion Correlation Analysis
3267 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Make trigger particle - pi0 correlation, %d pi0's \n",
3268 pi0list->GetEntriesFast());
3270 Int_t evtIndex11 = 0 ;
3271 Int_t evtIndex12 = 0 ;
3272 if (GetMixedEvent())
3274 evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ;
3275 evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ;
3278 Float_t pt = -100. ;
3279 Float_t zT = -100. ;
3280 Float_t phi = -100. ;
3281 Float_t eta = -100. ;
3282 Float_t xE = -100. ;
3283 Float_t hbpXE= -100. ;
3284 Float_t hbpZT= -100. ;
3286 Float_t ptTrig = aodParticle->Pt();
3287 Float_t phiTrig = aodParticle->Phi();
3288 Float_t etaTrig = aodParticle->Eta();
3289 Float_t deltaPhi= -100. ;
3291 TLorentzVector photonMom ;
3293 // In case of pi0/eta trigger, we may want to check their decay correlation,
3294 // get their decay children
3295 TLorentzVector decayMom1;
3296 TLorentzVector decayMom2;
3297 Bool_t decayFound = kFALSE;
3298 if(fPi0Trigger && bFillHisto) decayFound = GetDecayPhotonMomentum(aodParticle,decayMom1, decayMom2);
3300 TObjArray * refpi0 = 0x0;
3303 //Loop on stored AOD pi0
3305 Int_t naod = pi0list->GetEntriesFast();
3307 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod);
3309 for(Int_t iaod = 0; iaod < naod ; iaod++)
3311 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod));
3313 Int_t evtIndex2 = 0 ;
3314 Int_t evtIndex3 = 0 ;
3315 if (GetMixedEvent())
3317 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ;
3318 evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ;
3320 if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 ||
3321 evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events
3327 if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
3329 //jump out this event if near side associated particle pt larger than trigger
3330 if (fMakeNearSideLeading)
3332 if(pt > ptTrig && TMath::Abs(phi-phiTrig) < TMath::PiOver2()) return kFALSE;
3334 //jump out this event if there is any other particle with pt larger than trigger
3335 else if(fMakeAbsoluteLeading)
3337 if(pt > ptTrig) return kFALSE;
3345 FillNeutralAngularCorrelationHistograms(pt, ptTrig, phi, phiTrig, deltaPhi, eta, etaTrig);
3348 xE =-pt/ptTrig*TMath::Cos(deltaPhi); // -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig);
3350 //if(xE <0.)xE =-xE;
3355 if(xE > 0 ) hbpXE = TMath::Log(1./xE);
3356 if(zT > 0 ) hbpZT = TMath::Log(1./zT);
3358 if(fPi0Trigger && decayFound)
3359 FillDecayPhotonCorrelationHistograms(pt, phi, decayMom1,decayMom2,kFALSE) ;
3361 //delta phi cut for correlation
3362 if( (deltaPhi > fDeltaPhiMinCut) && ( deltaPhi < fDeltaPhiMaxCut) )
3364 fhDeltaPhiNeutralPt->Fill(pt,deltaPhi);
3365 fhXENeutral ->Fill(ptTrig,xE);
3366 fhPtHbpXENeutral ->Fill(ptTrig,hbpXE);
3368 else if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
3370 fhDeltaPhiUeNeutralPt->Fill(pt,deltaPhi);
3371 fhXEUeNeutral ->Fill(ptTrig,xE);
3372 fhPtHbpXEUeNeutral ->Fill(ptTrig,hbpXE);
3375 //several UE calculation
3376 if(fMakeSeveralUE) FillChargedUnderlyingEventSidesHistograms(ptTrig,pt,deltaPhi);
3384 refpi0 = new TObjArray(0);
3385 refpi0->SetName(GetAODObjArrayName()+"Pi0s");
3386 refpi0->SetOwner(kFALSE);
3389 }//put references in trigger AOD
3392 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
3399 //_________________________________________________________________________________________________________
3400 void AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle)
3402 // Charged Hadron Correlation Analysis with MC information
3405 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation() - Make trigger particle - charged hadron correlation in AOD MC level\n");
3407 AliStack * stack = 0x0 ;
3408 TParticle * primary = 0x0 ;
3409 TClonesArray * mcparticles0 = 0x0 ;
3410 TClonesArray * mcparticles = 0x0 ;
3411 AliAODMCParticle * aodprimary = 0x0 ;
3413 Double_t eprim = 0 ;
3414 Double_t ptprim = 0 ;
3415 Double_t phiprim = 0 ;
3416 Double_t etaprim = 0 ;
3418 Int_t iParticle = 0 ;
3419 Double_t charge = 0.;
3421 if(GetReader()->ReadStack())
3423 nTracks = GetMCStack()->GetNtrack() ;
3427 nTracks = GetReader()->GetAODMCParticles()->GetEntriesFast() ;
3429 //Int_t trackIndex[nTracks];
3431 Int_t label= aodParticle->GetLabel();
3434 if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** bad label ***: label %d \n", label);
3438 if(GetReader()->ReadStack())
3440 stack = GetMCStack() ;
3443 printf(" AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation- Stack not available, is the MC handler called? STOP\n");
3447 nTracks=stack->GetNprimary();
3448 if(label >= stack->GetNtrack())
3450 if(GetDebug() > 2) printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
3454 primary = stack->Particle(label);
3457 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no primary ***: label %d \n", label);
3463 eprim = primary->Energy();
3464 ptprim = primary->Pt();
3465 phiprim = primary->Phi();
3466 etaprim = primary->Eta();
3468 if(ptprim < 0.01 || eprim < 0.01) return ;
3470 for (iParticle = 0 ; iParticle < nTracks ; iParticle++)
3472 TParticle * particle = stack->Particle(iParticle);
3473 TLorentzVector momentum;
3475 //keep only final state particles
3476 if(particle->GetStatusCode()!=1) continue ;
3478 Int_t pdg = particle->GetPdgCode();
3480 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
3482 particle->Momentum(momentum);
3484 //---------- Charged particles ----------------------
3487 //Particles in CTS acceptance
3488 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
3490 if(TMath::Abs(pdg) == 11 && stack->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
3494 if( label!=iParticle) // avoid trigger particle
3496 if(!FillChargedMCCorrelationHistograms(particle->Pt(),particle->Phi(),particle->Eta(),ptprim,phiprim,etaprim)) return;
3498 }// in CTS acceptance
3501 } //when the leading particles could trace back to MC
3504 else if(GetReader()->ReadAODMCParticles())
3506 //Get the list of MC particles
3507 mcparticles0 = GetReader()->GetAODMCParticles(0);
3508 if(!mcparticles0) return;
3510 if(label >=mcparticles0->GetEntriesFast())
3513 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** large label ***: label %d, n tracks %d \n", label,mcparticles0->GetEntriesFast());
3518 aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
3521 printf("AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation *** no AOD primary ***: label %d \n", label);
3527 ptprim = aodprimary->Pt();
3528 phiprim = aodprimary->Phi();
3529 etaprim = aodprimary->Eta();
3530 eprim = aodprimary->E();
3532 Bool_t lead = kFALSE;
3534 if(ptprim < 0.01 || eprim < 0.01) return ;
3536 mcparticles= GetReader()->GetAODMCParticles();
3537 for (iParticle = 0; iParticle < nTracks; iParticle++)
3539 AliAODMCParticle *part = (AliAODMCParticle*) mcparticles->At(iParticle);
3541 if (!part->IsPhysicalPrimary()) continue;
3543 Int_t pdg = part->GetPdgCode();
3544 charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
3545 TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());
3549 if(part->Pt()> GetReader()->GetCTSPtMin())
3551 //Particles in CTS acceptance
3552 Bool_t inCTS = GetFiducialCut()->IsInFiducialCut(momentum,"CTS");
3553 Int_t indexmother=part->GetMother();
3557 Int_t mPdg = ((AliAODMCParticle*) mcparticles->At(indexmother)) ->GetPdgCode();
3558 if(TMath::Abs(pdg) == 11 && mPdg == 22) continue;
3563 if( label!=iParticle) // avoid trigger particle
3565 if(!FillChargedMCCorrelationHistograms(part->Pt(),part->Phi(),part->Eta(),ptprim,phiprim,etaprim)) return;
3570 } //only charged particles
3571 } //MC particle loop
3574 fhMCPtLeading->Fill(ptprim);
3575 fhMCPhiLeading->Fill(ptprim,phiprim);
3576 fhMCEtaLeading->Fill(ptprim,etaprim);
3578 } //when the leading particles could trace back to MC
3582 //_____________________________________________________________________
3583 void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
3586 //Print some relevant parameters set for the analysis
3590 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3591 AliAnaCaloTrackCorrBaseClass::Print(" ");
3592 printf("Pt trigger > %3.2f\n", fMinTriggerPt) ;
3593 printf("Pt associated hadron < %3.2f\n", fMaxAssocPt) ;
3594 printf("Pt associated hadron > %3.2f\n", fMinAssocPt) ;
3595 printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
3596 printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
3597 printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ;
3598 printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ;
3599 printf("Isolated Trigger? %d\n" , fSelectIsolated) ;
3600 printf("Several UE? %d\n" , fMakeSeveralUE) ;
3601 printf("Name of AOD Pi0 Branch %s \n", fPi0AODBranchName.Data());
3602 printf("Do Decay-hadron correlation ? %d\n", fPi0Trigger) ;
3603 printf("Select absolute leading for cluster triggers ? %d or Near Side %d\n",
3604 fMakeAbsoluteLeading, fMakeNearSideLeading) ;
3605 printf("Trigger pt bins %d\n", fNAssocPtBins) ;
3606 for (Int_t ibin = 0; ibin<fNAssocPtBins; ibin++) {
3607 printf("\t bin %d = [%2.1f,%2.1f]\n", ibin, fAssocPtBinLimit[ibin], fAssocPtBinLimit[ibin+1]) ;
3612 //____________________________________________________________
3613 void AliAnaParticleHadronCorrelation::SetNAssocPtBins(Int_t n)
3615 // Set number of bins
3626 printf("n = larger than 19 or too small, set to 19 \n");
3631 //______________________________________________________________________________
3632 void AliAnaParticleHadronCorrelation::SetAssocPtBinLimit(Int_t ibin, Float_t pt)
3634 // Set the list of limits for the trigger pt bins
3636 if(ibin <= fNAssocPtBins || ibin >= 0)
3638 fAssocPtBinLimit[ibin] = pt ;
3642 printf("AliAnaParticleHadronCorrelation::SetAssocPtBinLimit() - bin number too large %d > %d or small, nothing done\n", ibin, fNAssocPtBins) ;