]>
Commit | Line | Data |
---|---|---|
1c5acb87 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | /* $Id: $ */ | |
16 | ||
17 | //_________________________________________________________________________ | |
18 | // Class for the analysis of particle - hadron correlations | |
19 | // Particle (for example direct gamma) must be found in a previous analysis | |
20 | //-- Author: Gustavo Conesa (LNF-INFN) | |
dd4871cd | 21 | |
22 | // Modified by Yaxian Mao: | |
23 | // 1. add the UE subtraction for corrlation study | |
24 | // 2. change the correlation variable | |
e6b5d324 | 25 | // 3. Only use leading particle(cluster/track) as trigger for correlation (2010/07/02) |
f8006433 | 26 | // 4. Make decay photon-hadron correlations where decay contribute pi0 mass (2010/09/09) |
1c5acb87 | 27 | ////////////////////////////////////////////////////////////////////////////// |
28 | ||
29 | ||
30 | // --- ROOT system --- | |
f8006433 | 31 | //#include "TClonesArray.h" |
9415d854 | 32 | #include "TClass.h" |
dd4871cd | 33 | #include "TMath.h" |
f8006433 | 34 | #include "TH3D.h" |
1c5acb87 | 35 | |
36 | //---- ANALYSIS system ---- | |
1c5acb87 | 37 | #include "AliNeutralMesonSelection.h" |
38 | #include "AliAnaParticleHadronCorrelation.h" | |
39 | #include "AliCaloTrackReader.h" | |
40 | #include "AliCaloPID.h" | |
41 | #include "AliAODPWG4ParticleCorrelation.h" | |
ff45398a | 42 | #include "AliFiducialCut.h" |
477d6cee | 43 | #include "AliAODTrack.h" |
0ae57829 | 44 | #include "AliVCluster.h" |
9415d854 | 45 | #include "AliMCAnalysisUtils.h" |
46 | #include "TParticle.h" | |
47 | #include "AliStack.h" | |
591cc579 | 48 | #include "AliAODMCParticle.h" |
c8fe2783 | 49 | #include "AliMixedEvent.h" |
1c5acb87 | 50 | |
51 | ClassImp(AliAnaParticleHadronCorrelation) | |
52 | ||
53 | ||
54 | //____________________________________________________________________________ | |
dde5a268 | 55 | AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation(): |
1c5acb87 | 56 | AliAnaPartCorrBaseClass(), |
dde5a268 | 57 | fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.), fSelectIsolated(0), |
58 | fMakeSeveralUE(0), fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.), | |
f8006433 | 59 | fPi0AODBranchName(""),fPi0Trigger(0), |
e6b5d324 | 60 | fhPtLeading(0),fhPhiLeading(0),fhEtaLeading(0), |
b6991fc4 | 61 | fhDeltaPhiDeltaEtaCharged(0),fhDeltaPhiDeltaEtaNeutral(0), |
477d6cee | 62 | fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0), |
1c5acb87 | 63 | fhDeltaPhiCharged(0), fhDeltaPhiNeutral(0), |
64 | fhDeltaEtaCharged(0), fhDeltaEtaNeutral(0), | |
123fc3bd | 65 | fhDeltaPhiChargedPt(0), fhDeltaPhiNeutralPt(0), |
66 | fhDeltaPhiUeChargedPt(0), fhDeltaPhiUeNeutralPt(0), | |
dde5a268 | 67 | fhPtImbalanceNeutral(0), fhPtImbalanceCharged(0), |
123fc3bd | 68 | fhPtImbalanceUeCharged(0),fhPtImbalanceUeNeutral(0), |
dd4871cd | 69 | fhPtHbpCharged(0), fhPtHbpUeCharged(0), |
70 | fhPtHbpNeutral(0), fhPtHbpUeNeutral(0), | |
123fc3bd | 71 | fhDeltaPhiUeLeftCharged(0),fhDeltaPhiUeRightCharged(0), |
72 | fhDeltaPhiUeLeftNeutral(0),fhDeltaPhiUeRightNeutral(0), | |
73 | fhPtImbalanceUeLeftCharged(0),fhPtImbalanceUeRightCharged(0), | |
dd4871cd | 74 | fhPtImbalanceUeLeftNeutral(0),fhPtImbalanceUeRightNeutral(0), |
75 | fhPtHbpUeLeftCharged(0),fhPtHbpUeRightCharged(0), | |
f8006433 | 76 | fhPtHbpUeLeftNeutral(0),fhPtHbpUeRightNeutral(0), |
77 | fhPtPi0DecayRatio(0), | |
78 | fhDeltaPhiDecay1Charged(0),fhDeltaPhiDecay2Charged(0), | |
79 | fhPtImbalanceDecay1Charged(0), fhPtImbalanceDecay2Charged(0), | |
80 | fhDeltaPhiDecay1Neutral(0),fhDeltaPhiDecay2Neutral(0), | |
81 | fhPtImbalanceDecay1Neutral(0), fhPtImbalanceDecay2Neutral(0) | |
1c5acb87 | 82 | { |
83 | //Default Ctor | |
477d6cee | 84 | |
1c5acb87 | 85 | //Initialize parameters |
86 | InitParameters(); | |
87 | } | |
1c5acb87 | 88 | |
1c5acb87 | 89 | //________________________________________________________________________ |
90 | TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects() | |
91 | { | |
477d6cee | 92 | |
93 | // Create histograms to be saved in output file and | |
94 | // store them in fOutputContainer | |
95 | TList * outputContainer = new TList() ; | |
96 | outputContainer->SetName("CorrelationHistos") ; | |
97 | ||
5a2dbc3c | 98 | Int_t nptbins = GetHistoPtBins(); |
99 | Int_t nphibins = GetHistoPhiBins(); | |
100 | Int_t netabins = GetHistoEtaBins(); | |
477d6cee | 101 | Float_t ptmax = GetHistoPtMax(); |
102 | Float_t phimax = GetHistoPhiMax(); | |
103 | Float_t etamax = GetHistoEtaMax(); | |
104 | Float_t ptmin = GetHistoPtMin(); | |
105 | Float_t phimin = GetHistoPhiMin(); | |
106 | Float_t etamin = GetHistoEtaMin(); | |
f8006433 | 107 | |
e6b5d324 | 108 | fhPtLeading = new TH1F ("hPtLeading","p_T distribution of leading particles", nptbins,ptmin,ptmax); |
109 | fhPtLeading->SetXTitle("p_{T}^{trig} (GeV/c)"); | |
110 | ||
111 | fhPhiLeading = new TH2F ("hPhiLeading","#phi distribution of leading Particles",nptbins,ptmin,ptmax, nphibins,phimin,phimax); | |
112 | fhPhiLeading->SetYTitle("#phi (rad)"); | |
113 | ||
114 | fhEtaLeading = new TH2F ("hEtaLeading","#eta distribution of leading",nptbins,ptmin,ptmax, netabins,etamin,etamax); | |
115 | fhEtaLeading->SetYTitle("#eta "); | |
116 | outputContainer->Add(fhPtLeading); | |
117 | outputContainer->Add(fhPhiLeading); | |
118 | outputContainer->Add(fhEtaLeading); | |
477d6cee | 119 | |
120 | //Correlation with charged hadrons | |
121 | if(GetReader()->IsCTSSwitchedOn()) { | |
c8fe2783 | 122 | fhDeltaPhiDeltaEtaCharged = new TH2F |
f8006433 | 123 | ("DeltaPhiDeltaEtaCharged","#phi_{trigger} - #phi_{h^{#pm}} vs #eta_{trigger} - #eta_{h^{#pm}}", |
124 | 140,-2.,5.,200,-2,2); | |
c8fe2783 | 125 | fhDeltaPhiDeltaEtaCharged->SetXTitle("#Delta #phi"); |
126 | fhDeltaPhiDeltaEtaCharged->SetYTitle("#Delta #eta"); | |
127 | ||
477d6cee | 128 | fhPhiCharged = new TH2F |
f8006433 | 129 | ("PhiCharged","#phi_{h^{#pm}} vs p_{T #pm}", |
130 | nptbins,ptmin,ptmax,nphibins,phimin,phimax); | |
477d6cee | 131 | fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)"); |
dd4871cd | 132 | fhPhiCharged->SetXTitle("p_{T #pm} (GeV/c)"); |
477d6cee | 133 | |
134 | fhEtaCharged = new TH2F | |
f8006433 | 135 | ("EtaCharged","#eta_{h^{#pm}} vs p_{T #pm}", |
136 | nptbins,ptmin,ptmax,netabins,etamin,etamax); | |
477d6cee | 137 | fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)"); |
dd4871cd | 138 | fhEtaCharged->SetXTitle("p_{T #pm} (GeV/c)"); |
477d6cee | 139 | |
140 | fhDeltaPhiCharged = new TH2F | |
f8006433 | 141 | ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}", |
142 | nptbins,ptmin,ptmax,140,-2.,5.); | |
477d6cee | 143 | fhDeltaPhiCharged->SetYTitle("#Delta #phi"); |
144 | fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)"); | |
145 | ||
146 | fhDeltaPhiChargedPt = new TH2F | |
f8006433 | 147 | ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}", |
148 | nptbins,ptmin,ptmax,140,-2.,5.); | |
477d6cee | 149 | fhDeltaPhiChargedPt->SetYTitle("#Delta #phi"); |
150 | fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)"); | |
f8006433 | 151 | |
dde5a268 | 152 | fhDeltaPhiUeChargedPt = new TH2F |
f8006433 | 153 | ("DeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}", |
154 | nptbins,ptmin,ptmax,140,-2.,5.); | |
dde5a268 | 155 | fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi"); |
156 | fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)"); | |
477d6cee | 157 | |
158 | fhDeltaEtaCharged = new TH2F | |
f8006433 | 159 | ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}", |
160 | nptbins,ptmin,ptmax,200,-2,2); | |
477d6cee | 161 | fhDeltaEtaCharged->SetYTitle("#Delta #eta"); |
162 | fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)"); | |
163 | ||
164 | fhPtImbalanceCharged = | |
f8006433 | 165 | new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}", |
166 | nptbins,ptmin,ptmax,200,0.,2.); | |
477d6cee | 167 | fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}"); |
168 | fhPtImbalanceCharged->SetXTitle("p_{T trigger}"); | |
169 | ||
dde5a268 | 170 | fhPtImbalanceUeCharged = |
f8006433 | 171 | new TH2F("CorrelationUeCharged","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger}", |
172 | nptbins,ptmin,ptmax,200,0.,2.); | |
dde5a268 | 173 | fhPtImbalanceUeCharged->SetYTitle("z_{trigger Ueh^{#pm}}"); |
174 | fhPtImbalanceUeCharged->SetXTitle("p_{T trigger}"); | |
f8006433 | 175 | |
176 | fhPtHbpCharged = | |
177 | new TH2F("HbpCharged","#xi = ln(1/x_{E}) with charged hadrons", | |
178 | nptbins,ptmin,ptmax,200,0.,10.); | |
dd4871cd | 179 | fhPtHbpCharged->SetYTitle("ln(1/x_{E})"); |
180 | fhPtHbpCharged->SetXTitle("p_{T trigger}"); | |
181 | ||
182 | fhPtHbpUeCharged = | |
f8006433 | 183 | new TH2F("HbpUeCharged","#xi = ln(1/x_{E}) with charged hadrons", |
184 | nptbins,ptmin,ptmax,200,0.,10.); | |
dd4871cd | 185 | fhPtHbpUeCharged->SetYTitle("ln(1/x_{E})"); |
186 | fhPtHbpUeCharged->SetXTitle("p_{T trigger}"); | |
b6991fc4 | 187 | |
c8fe2783 | 188 | outputContainer->Add(fhDeltaPhiDeltaEtaCharged); |
477d6cee | 189 | outputContainer->Add(fhPhiCharged) ; |
190 | outputContainer->Add(fhEtaCharged) ; | |
191 | outputContainer->Add(fhDeltaPhiCharged) ; | |
192 | outputContainer->Add(fhDeltaEtaCharged) ; | |
477d6cee | 193 | outputContainer->Add(fhDeltaPhiChargedPt) ; |
dde5a268 | 194 | outputContainer->Add(fhDeltaPhiUeChargedPt) ; |
195 | outputContainer->Add(fhPtImbalanceCharged) ; | |
196 | outputContainer->Add(fhPtImbalanceUeCharged) ; | |
dd4871cd | 197 | outputContainer->Add(fhPtHbpCharged) ; |
198 | outputContainer->Add(fhPtHbpUeCharged) ; | |
f8006433 | 199 | |
200 | if(fPi0Trigger){ | |
201 | fhPtPi0DecayRatio = new TH3D | |
202 | ("hPtPi0DecayRatio","p_T of #pi^{0} and the ratio of pt for two decay", | |
203 | nptbins,ptmin,ptmax, 100,0.,2.,100,0., 2.); | |
204 | fhPtPi0DecayRatio->SetXTitle("p_{T}^{#pi^{0}} (GeV/c)"); | |
205 | fhPtPi0DecayRatio->SetYTitle("p_{T}^{Decay1}/p_{T}^{#pi^{0}}"); | |
206 | fhPtPi0DecayRatio->SetZTitle("p_{T}^{Decay2}/p_{T}^{#pi^{0}}"); | |
207 | ||
208 | fhDeltaPhiDecay1Charged = new TH2F | |
209 | ("DeltaPhiDecay1Charged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}", | |
210 | nptbins,ptmin,ptmax,140,-2.,5.); | |
211 | fhDeltaPhiDecay1Charged->SetYTitle("#Delta #phi"); | |
212 | fhDeltaPhiDecay1Charged->SetXTitle("p_{T Decay} (GeV/c)"); | |
213 | ||
214 | fhDeltaPhiDecay2Charged = new TH2F | |
215 | ("DeltaPhiDecay2Charged","#phi_{Decay} - #phi_{h^{#pm}} vs p_{T Decay}", | |
216 | nptbins,ptmin,ptmax,140,-2.,5.); | |
217 | fhDeltaPhiDecay2Charged->SetYTitle("#Delta #phi"); | |
218 | fhDeltaPhiDecay2Charged->SetXTitle("p_{T Decay} (GeV/c)"); | |
219 | ||
220 | fhPtImbalanceDecay1Charged = | |
221 | new TH2F("CorrelationDecay1Charged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}", | |
222 | nptbins,ptmin,ptmax,200,0.,2.); | |
223 | fhPtImbalanceDecay1Charged->SetYTitle("z_{decay h^{#pm}}"); | |
224 | fhPtImbalanceDecay1Charged->SetXTitle("p_{T decay}"); | |
225 | ||
226 | fhPtImbalanceDecay2Charged = | |
227 | new TH2F("CorrelationDecay2Charged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T Decay}", | |
228 | nptbins,ptmin,ptmax,200,0.,2.); | |
229 | fhPtImbalanceDecay2Charged->SetYTitle("z_{decay h^{#pm}}"); | |
230 | fhPtImbalanceDecay2Charged->SetXTitle("p_{T decay}"); | |
231 | outputContainer->Add(fhPtPi0DecayRatio) ; | |
232 | outputContainer->Add(fhDeltaPhiDecay1Charged) ; | |
233 | outputContainer->Add(fhDeltaPhiDecay2Charged) ; | |
234 | outputContainer->Add(fhPtImbalanceDecay1Charged) ; | |
235 | outputContainer->Add(fhPtImbalanceDecay2Charged) ; | |
236 | } | |
237 | ||
238 | ||
dde5a268 | 239 | if(fMakeSeveralUE){ |
123fc3bd | 240 | fhDeltaPhiUeLeftCharged = new TH2F |
f8006433 | 241 | ("DeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles", |
242 | nptbins,ptmin,ptmax,140,-2.,5.); | |
123fc3bd | 243 | fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi"); |
244 | fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)"); | |
245 | outputContainer->Add(fhDeltaPhiUeLeftCharged) ; | |
f8006433 | 246 | |
123fc3bd | 247 | fhDeltaPhiUeRightCharged = new TH2F |
f8006433 | 248 | ("DeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles", |
249 | nptbins,ptmin,ptmax,140,-2.,5.); | |
123fc3bd | 250 | fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi"); |
251 | fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)"); | |
252 | outputContainer->Add(fhDeltaPhiUeRightCharged) ; | |
dde5a268 | 253 | |
254 | fhPtImbalanceUeLeftCharged = | |
f8006433 | 255 | new TH2F("CorrelationUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger", |
256 | nptbins,ptmin,ptmax,200,0.,2.); | |
dde5a268 | 257 | fhPtImbalanceUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}"); |
258 | fhPtImbalanceUeLeftCharged->SetXTitle("p_{T trigger}"); | |
259 | outputContainer->Add(fhPtImbalanceUeLeftCharged) ; | |
260 | ||
261 | fhPtImbalanceUeRightCharged = | |
f8006433 | 262 | new TH2F("CorrelationUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger", |
263 | nptbins,ptmin,ptmax,200,0.,2.); | |
dde5a268 | 264 | fhPtImbalanceUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}"); |
265 | fhPtImbalanceUeRightCharged->SetXTitle("p_{T trigger}"); | |
266 | outputContainer->Add(fhPtImbalanceUeRightCharged) ; | |
f8006433 | 267 | |
268 | fhPtHbpUeLeftCharged = | |
269 | new TH2F("HbpUeChargedLeft","#xi = ln(1/x_{E}) with charged UE left side of trigger", | |
270 | nptbins,ptmin,ptmax,200,0.,10.); | |
271 | fhPtHbpUeLeftCharged->SetYTitle("ln(1/x_{E})"); | |
272 | fhPtHbpUeLeftCharged->SetXTitle("p_{T trigger}"); | |
273 | outputContainer->Add(fhPtHbpUeLeftCharged) ; | |
274 | ||
275 | fhPtHbpUeRightCharged = | |
276 | new TH2F("HbpUeChargedRight","#xi = ln(1/x_{E}) with charged UE right side of trigger", | |
277 | nptbins,ptmin,ptmax,200,0.,10.); | |
278 | fhPtHbpUeRightCharged->SetYTitle("ln(1/x_{E})"); | |
279 | fhPtHbpUeRightCharged->SetXTitle("p_{T trigger}"); | |
280 | outputContainer->Add(fhPtHbpUeRightCharged) ; | |
281 | ||
dde5a268 | 282 | } |
477d6cee | 283 | } //Correlation with charged hadrons |
284 | ||
285 | //Correlation with neutral hadrons | |
286 | if(GetReader()->IsEMCALSwitchedOn() || GetReader()->IsPHOSSwitchedOn()){ | |
287 | ||
c8fe2783 | 288 | fhDeltaPhiDeltaEtaNeutral = new TH2F |
f8006433 | 289 | ("DeltaPhiDeltaEtaNeutral","#phi_{trigger} - #phi_{h^{0}} vs #eta_{trigger} - #eta_{h^{0}}", |
290 | 140,-2.,5.,200,-2,2); | |
c8fe2783 | 291 | fhDeltaPhiDeltaEtaNeutral->SetXTitle("#Delta #phi"); |
292 | fhDeltaPhiDeltaEtaNeutral->SetYTitle("#Delta #eta"); | |
b6991fc4 | 293 | |
477d6cee | 294 | fhPhiNeutral = new TH2F |
f8006433 | 295 | ("PhiNeutral","#phi_{#pi^{0}} vs p_{T #pi^{0}}", |
296 | nptbins,ptmin,ptmax,nphibins,phimin,phimax); | |
477d6cee | 297 | fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)"); |
dd4871cd | 298 | fhPhiNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)"); |
477d6cee | 299 | |
300 | fhEtaNeutral = new TH2F | |
f8006433 | 301 | ("EtaNeutral","#eta_{#pi^{0}} vs p_{T #pi^{0}}", |
302 | nptbins,ptmin,ptmax,netabins,etamin,etamax); | |
477d6cee | 303 | fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)"); |
dd4871cd | 304 | fhEtaNeutral->SetXTitle("p_{T #pi^{0}} (GeV/c)"); |
477d6cee | 305 | |
306 | fhDeltaPhiNeutral = new TH2F | |
f8006433 | 307 | ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}", |
308 | nptbins,ptmin,ptmax,nphibins,phimin,phimax); | |
477d6cee | 309 | fhDeltaPhiNeutral->SetYTitle("#Delta #phi"); |
310 | fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)"); | |
311 | ||
312 | fhDeltaPhiNeutralPt = new TH2F | |
f8006433 | 313 | ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}", |
314 | nptbins,ptmin,ptmax,140,-2.,5.); | |
477d6cee | 315 | fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi"); |
de8a210f | 316 | fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)"); |
f8006433 | 317 | |
123fc3bd | 318 | fhDeltaPhiUeNeutralPt = new TH2F |
f8006433 | 319 | ("DeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}", |
320 | nptbins,ptmin,ptmax,140,-2.,5.); | |
123fc3bd | 321 | fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi"); |
de8a210f | 322 | fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0}} (GeV/c)"); |
477d6cee | 323 | |
324 | fhDeltaEtaNeutral = new TH2F | |
f8006433 | 325 | ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}", |
326 | nptbins,ptmin,ptmax,200,-2,2); | |
477d6cee | 327 | fhDeltaEtaNeutral->SetYTitle("#Delta #eta"); |
328 | fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)"); | |
329 | ||
330 | fhPtImbalanceNeutral = | |
f8006433 | 331 | new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}", |
332 | nptbins,ptmin,ptmax,200,0.,2.); | |
477d6cee | 333 | fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}"); |
334 | fhPtImbalanceNeutral->SetXTitle("p_{T trigger}"); | |
f8006433 | 335 | |
123fc3bd | 336 | fhPtImbalanceUeNeutral = |
f8006433 | 337 | new TH2F("CorrelationUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}", |
338 | nptbins,ptmin,ptmax,200,0.,2.); | |
123fc3bd | 339 | fhPtImbalanceUeNeutral->SetYTitle("z_{trigger #pi^{0}}"); |
340 | fhPtImbalanceUeNeutral->SetXTitle("p_{T trigger}"); | |
c8fe2783 | 341 | |
342 | fhPtHbpNeutral = | |
f8006433 | 343 | new TH2F("HbpNeutral","#xi = ln(1/x_{E}) with neutral particles", |
344 | nptbins,ptmin,ptmax,200,0.,10.); | |
c8fe2783 | 345 | fhPtHbpNeutral->SetYTitle("ln(1/x_{E})"); |
346 | fhPtHbpNeutral->SetXTitle("p_{T trigger}"); | |
347 | ||
348 | fhPtHbpUeNeutral = | |
f8006433 | 349 | new TH2F("HbpUeNeutral","#xi = ln(1/x_{E}) with neutral particles", |
350 | nptbins,ptmin,ptmax,200,0.,10.); | |
c8fe2783 | 351 | fhPtHbpUeNeutral->SetYTitle("ln(1/x_{E})"); |
352 | fhPtHbpUeNeutral->SetXTitle("p_{T trigger}"); | |
353 | ||
354 | ||
355 | outputContainer->Add(fhDeltaPhiDeltaEtaNeutral); | |
477d6cee | 356 | outputContainer->Add(fhPhiNeutral) ; |
357 | outputContainer->Add(fhEtaNeutral) ; | |
358 | outputContainer->Add(fhDeltaPhiNeutral) ; | |
123fc3bd | 359 | outputContainer->Add(fhDeltaPhiNeutralPt) ; |
360 | outputContainer->Add(fhDeltaPhiUeNeutralPt) ; | |
477d6cee | 361 | outputContainer->Add(fhDeltaEtaNeutral) ; |
362 | outputContainer->Add(fhPtImbalanceNeutral) ; | |
dd4871cd | 363 | outputContainer->Add(fhPtImbalanceUeNeutral) ; |
c8fe2783 | 364 | outputContainer->Add(fhPtHbpNeutral) ; |
365 | outputContainer->Add(fhPtHbpUeNeutral) ; | |
f8006433 | 366 | |
367 | if(fPi0Trigger){ | |
368 | fhDeltaPhiDecay1Neutral = new TH2F | |
369 | ("DeltaPhiDecay1Neutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}", | |
370 | nptbins,ptmin,ptmax,140,-2.,5.); | |
371 | fhDeltaPhiDecay1Neutral->SetYTitle("#Delta #phi"); | |
372 | fhDeltaPhiDecay1Neutral->SetXTitle("p_{T Decay} (GeV/c)"); | |
373 | ||
374 | fhDeltaPhiDecay2Neutral = new TH2F | |
375 | ("DeltaPhiDecay2Neutral","#phi_{Decay} - #phi_{h^{0}} vs p_{T Decay}", | |
376 | nptbins,ptmin,ptmax,140,-2.,5.); | |
377 | fhDeltaPhiDecay2Neutral->SetYTitle("#Delta #phi"); | |
378 | fhDeltaPhiDecay2Neutral->SetXTitle("p_{T Decay} (GeV/c)"); | |
379 | ||
380 | fhPtImbalanceDecay1Neutral = | |
381 | new TH2F("CorrelationDecay1Neutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}", | |
382 | nptbins,ptmin,ptmax,200,0.,2.); | |
383 | fhPtImbalanceDecay1Neutral->SetYTitle("z_{decay h^{0}}"); | |
384 | fhPtImbalanceDecay1Neutral->SetXTitle("p_{T decay}"); | |
385 | ||
386 | fhPtImbalanceDecay2Neutral = | |
387 | new TH2F("CorrelationDecay2Neutral","z_{trigger h^{0}} = p_{T h^{0}} / p_{T Decay}", | |
388 | nptbins,ptmin,ptmax,200,0.,2.); | |
389 | fhPtImbalanceDecay2Neutral->SetYTitle("z_{decay h^{0}}"); | |
390 | fhPtImbalanceDecay2Neutral->SetXTitle("p_{T decay}"); | |
391 | ||
392 | outputContainer->Add(fhDeltaPhiDecay1Neutral) ; | |
393 | outputContainer->Add(fhDeltaPhiDecay2Neutral) ; | |
394 | outputContainer->Add(fhPtImbalanceDecay1Neutral) ; | |
395 | outputContainer->Add(fhPtImbalanceDecay2Neutral) ; | |
396 | } | |
397 | ||
398 | ||
123fc3bd | 399 | if(fMakeSeveralUE){ |
400 | fhDeltaPhiUeLeftNeutral = new TH2F | |
f8006433 | 401 | ("DeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with neutral UE left side range of trigger particles", |
402 | nptbins,ptmin,ptmax,140,-2.,5.); | |
123fc3bd | 403 | fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi"); |
404 | fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)"); | |
405 | outputContainer->Add(fhDeltaPhiUeLeftNeutral) ; | |
f8006433 | 406 | |
123fc3bd | 407 | fhDeltaPhiUeRightNeutral = new TH2F |
f8006433 | 408 | ("DeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with neutral UE right side range of trigger particles", |
409 | nptbins,ptmin,ptmax,140,-2.,5.); | |
123fc3bd | 410 | fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi"); |
411 | fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)"); | |
412 | outputContainer->Add(fhDeltaPhiUeRightNeutral) ; | |
413 | ||
414 | fhPtImbalanceUeLeftNeutral = | |
f8006433 | 415 | new TH2F("CorrelationUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE left side of trigger", |
416 | nptbins,ptmin,ptmax,140,0.,2.); | |
123fc3bd | 417 | fhPtImbalanceUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}"); |
418 | fhPtImbalanceUeLeftNeutral->SetXTitle("p_{T trigger}"); | |
419 | outputContainer->Add(fhPtImbalanceUeLeftNeutral) ; | |
420 | ||
421 | fhPtImbalanceUeRightNeutral = | |
f8006433 | 422 | new TH2F("CorrelationUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with neutral UE right side of trigger", |
423 | nptbins,ptmin,ptmax,200,0.,2.); | |
123fc3bd | 424 | fhPtImbalanceUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}"); |
425 | fhPtImbalanceUeRightNeutral->SetXTitle("p_{T trigger}"); | |
426 | outputContainer->Add(fhPtImbalanceUeRightNeutral) ; | |
f8006433 | 427 | |
c8fe2783 | 428 | fhPtHbpUeLeftNeutral = |
f8006433 | 429 | new TH2F("HbpUeNeutralLeft","#xi = ln(1/x_{E}) with neutral UE left side of trigger", |
430 | nptbins,ptmin,ptmax,200,0.,10.); | |
c8fe2783 | 431 | fhPtHbpUeLeftNeutral->SetYTitle("ln(1/x_{E})"); |
432 | fhPtHbpUeLeftNeutral->SetXTitle("p_{T trigger}"); | |
433 | outputContainer->Add(fhPtHbpUeLeftNeutral) ; | |
434 | ||
435 | fhPtHbpUeRightNeutral = | |
f8006433 | 436 | new TH2F("HbpUeNeutralRight","#xi = ln(1/x_{E}) with neutral UE right side of trigger", |
437 | nptbins,ptmin,ptmax,200,0.,10.); | |
c8fe2783 | 438 | fhPtHbpUeRightNeutral->SetYTitle("ln(1/x_{E})"); |
439 | fhPtHbpUeRightNeutral->SetXTitle("p_{T trigger}"); | |
440 | outputContainer->Add(fhPtHbpUeRightNeutral) ; | |
441 | ||
123fc3bd | 442 | } |
f8006433 | 443 | |
477d6cee | 444 | //Keep neutral meson selection histograms if requiered |
445 | //Setting done in AliNeutralMesonSelection | |
446 | if(GetNeutralMesonSelection()){ | |
447 | TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; | |
448 | if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) | |
f8006433 | 449 | for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; |
450 | delete nmsHistos; | |
477d6cee | 451 | } |
f8006433 | 452 | |
477d6cee | 453 | }//Correlation with neutral hadrons |
454 | ||
455 | return outputContainer; | |
f8006433 | 456 | |
1c5acb87 | 457 | } |
458 | ||
477d6cee | 459 | //____________________________________________________________________________ |
1c5acb87 | 460 | void AliAnaParticleHadronCorrelation::InitParameters() |
461 | { | |
477d6cee | 462 | |
1c5acb87 | 463 | //Initialize the parameters of the analysis. |
a3aebfff | 464 | SetInputAODName("PWG4Particle"); |
591cc579 | 465 | SetAODObjArrayName("Hadrons"); |
a3aebfff | 466 | AddToHistogramsName("AnaHadronCorr_"); |
467 | ||
dde5a268 | 468 | SetPtCutRange(0.,300); |
1c5acb87 | 469 | fDeltaPhiMinCut = 1.5 ; |
470 | fDeltaPhiMaxCut = 4.5 ; | |
6639984f | 471 | fSelectIsolated = kFALSE; |
dde5a268 | 472 | fMakeSeveralUE = kFALSE; |
473 | fUeDeltaPhiMinCut = 1. ; | |
474 | fUeDeltaPhiMaxCut = 1.5 ; | |
f8006433 | 475 | fPi0Trigger = kFALSE ; |
476 | ||
1c5acb87 | 477 | } |
478 | ||
479 | //__________________________________________________________________ | |
480 | void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const | |
481 | { | |
482 | ||
483 | //Print some relevant parameters set for the analysis | |
484 | if(! opt) | |
485 | return; | |
486 | ||
a3aebfff | 487 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; |
488 | AliAnaPartCorrBaseClass::Print(" "); | |
489 | ||
1c5acb87 | 490 | printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ; |
491 | printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ; | |
6639984f | 492 | printf("Isolated Trigger? %d\n", fSelectIsolated) ; |
dde5a268 | 493 | printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ; |
494 | printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ; | |
495 | printf("Several UE? %d\n", fMakeSeveralUE) ; | |
f8006433 | 496 | printf("Name of AOD Pi0 Branch %s \n",fPi0AODBranchName.Data()); |
497 | printf("Do Decay-hadron correlation ? %d\n", fPi0Trigger) ; | |
498 | ||
499 | ||
500 | } | |
501 | ||
502 | //__________________________________________________________________ | |
503 | TObjString* AliAnaParticleHadronCorrelation::GetAnalysisCuts() | |
504 | { | |
505 | //Save parameters used for analysis | |
506 | TString parList ; //this will be list of parameters used for this analysis. | |
507 | const Int_t buffersize = 255; | |
508 | char onePar[buffersize] ; | |
509 | ||
510 | snprintf(onePar,buffersize,"--- AliAnaPaticleHadronCorrelation ---\n") ; | |
511 | parList+=onePar ; | |
512 | snprintf(onePar,buffersize,"Phi trigger particle-Hadron < %3.2f ", fDeltaPhiMaxCut) ; | |
513 | parList+=onePar ; | |
514 | snprintf(onePar,buffersize,"Phi trigger particle-Hadron > %3.2f ", fDeltaPhiMinCut) ; | |
515 | parList+=onePar ; | |
516 | snprintf(onePar,buffersize,"Isolated Trigger? %d\n", fSelectIsolated) ; | |
517 | parList+=onePar ; | |
518 | snprintf(onePar,buffersize,"Phi trigger particle-UeHadron < %3.2f ", fUeDeltaPhiMaxCut) ; | |
519 | parList+=onePar ; | |
520 | snprintf(onePar,buffersize,"Phi trigger particle-UeHadron > %3.2f ", fUeDeltaPhiMinCut) ; | |
521 | parList+=onePar ; | |
522 | snprintf(onePar,buffersize,"Several UE? %d\n", fMakeSeveralUE) ; | |
523 | parList+=onePar ; | |
524 | snprintf(onePar,buffersize,"Name of AOD Pi0 Branch %s ",fPi0AODBranchName.Data()); | |
525 | parList+=onePar ; | |
526 | snprintf(onePar,buffersize,"Do Decay-hadron correlation ? %d", fPi0Trigger) ; | |
527 | parList+=onePar ; | |
528 | ||
529 | //Get parameters set in base class. | |
530 | parList += GetBaseParametersList() ; | |
531 | ||
532 | //Get parameters set in PID class. | |
533 | //parList += GetCaloPID()->GetPIDParametersList() ; | |
534 | ||
535 | //Get parameters set in FiducialCut class (not available yet) | |
536 | //parlist += GetFidCut()->GetFidCutParametersList() | |
537 | ||
538 | return new TObjString(parList) ; | |
539 | ||
1c5acb87 | 540 | } |
541 | ||
f8006433 | 542 | |
1c5acb87 | 543 | //____________________________________________________________________________ |
544 | void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() | |
545 | { | |
f8006433 | 546 | //Particle-Hadron Correlation Analysis, fill AODs |
477d6cee | 547 | |
548 | if(!GetInputAODBranch()){ | |
591cc579 | 549 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data()); |
477d6cee | 550 | abort(); |
551 | } | |
9415d854 | 552 | |
553 | if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){ | |
c8fe2783 | 554 | 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()); |
555 | abort(); | |
9415d854 | 556 | } |
557 | ||
477d6cee | 558 | if(GetDebug() > 1){ |
a3aebfff | 559 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n"); |
560 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); | |
561 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); | |
562 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); | |
563 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast()); | |
477d6cee | 564 | } |
565 | ||
f8006433 | 566 | //Loop on stored AOD particles, trigger |
b6991fc4 | 567 | Double_t ptTrig = 0.; |
568 | Int_t trigIndex = -1; | |
477d6cee | 569 | Int_t naod = GetInputAODBranch()->GetEntriesFast(); |
570 | for(Int_t iaod = 0; iaod < naod ; iaod++){ | |
571 | AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); | |
f8006433 | 572 | //find the leading particles with highest momentum |
c8fe2783 | 573 | if (particle->Pt()>ptTrig) { |
574 | ptTrig = particle->Pt() ; | |
575 | trigIndex = iaod ; | |
576 | } | |
b6991fc4 | 577 | }//Aod branch loop |
578 | ||
f8006433 | 579 | //Do correlation with leading particle |
b6991fc4 | 580 | if(trigIndex!=-1){ |
581 | ||
c8fe2783 | 582 | AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(trigIndex)); |
f8006433 | 583 | //Make correlation with charged hadrons |
c8fe2783 | 584 | if(GetReader()->IsCTSSwitchedOn() ) |
585 | MakeChargedCorrelation(particle, GetAODCTS(),kFALSE); | |
477d6cee | 586 | |
f8006433 | 587 | TObjArray * pi0list = (TObjArray*) GetAODBranch(fPi0AODBranchName); //For the future, foresee more possible pi0 lists |
588 | if(pi0list && pi0list->GetEntriesFast() > 0) | |
589 | MakeNeutralCorrelation(particle, pi0list,kFALSE); | |
c8fe2783 | 590 | |
b6991fc4 | 591 | }//Correlate leading |
c8fe2783 | 592 | |
a3aebfff | 593 | if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n"); |
477d6cee | 594 | |
1c5acb87 | 595 | } |
596 | ||
597 | //____________________________________________________________________________ | |
598 | void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() | |
599 | { | |
477d6cee | 600 | //Particle-Hadron Correlation Analysis, fill histograms |
601 | ||
602 | if(!GetInputAODBranch()){ | |
591cc579 | 603 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data()); |
477d6cee | 604 | abort(); |
605 | } | |
9415d854 | 606 | |
477d6cee | 607 | if(GetDebug() > 1){ |
a3aebfff | 608 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n"); |
609 | printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); | |
477d6cee | 610 | } |
9415d854 | 611 | |
b6991fc4 | 612 | //Loop on stored AOD particles, find leading |
477d6cee | 613 | Int_t naod = GetInputAODBranch()->GetEntriesFast(); |
b6991fc4 | 614 | Double_t ptTrig = 0.; |
615 | Int_t trigIndex = -1 ; | |
e6b5d324 | 616 | for(Int_t iaod = 0; iaod < naod ; iaod++){ //loop on input trigger AOD file |
9415d854 | 617 | AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); |
618 | ||
619 | //check if the particle is isolated or if we want to take the isolation into account | |
620 | if(OnlyIsolated() && !particle->IsIsolated()) continue; | |
e6b5d324 | 621 | //find the leading particles with highest momentum |
622 | if (particle->Pt()>ptTrig) { | |
623 | ptTrig = particle->Pt() ; | |
624 | trigIndex = iaod ; | |
625 | } | |
626 | }//finish searching for leading trigger particle | |
b6991fc4 | 627 | |
628 | if(trigIndex!=-1){ //using trigger partilce to do correlations | |
e6b5d324 | 629 | AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(trigIndex)); |
b6991fc4 | 630 | |
c8fe2783 | 631 | //Fill leading particle histogram |
632 | fhPtLeading->Fill(particle->Pt()); | |
633 | Float_t phi = particle->Phi(); | |
634 | if(phi<0)phi+=TMath::TwoPi(); | |
635 | fhPhiLeading->Fill(particle->Pt(), phi); | |
636 | fhEtaLeading->Fill(particle->Pt(), particle->Eta()); | |
637 | ||
9415d854 | 638 | //Make correlation with charged hadrons |
591cc579 | 639 | TObjArray * reftracks = particle->GetObjArray(GetAODObjArrayName()+"Tracks"); |
9415d854 | 640 | if(reftracks){ |
e6b5d324 | 641 | if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Leading %d, In Track Refs entries %d\n", trigIndex, reftracks->GetEntriesFast()); |
9415d854 | 642 | if(reftracks->GetEntriesFast() > 0) MakeChargedCorrelation(particle, reftracks,kTRUE); |
643 | } | |
a70a8477 | 644 | |
9415d854 | 645 | //Make correlation with neutral pions |
f8006433 | 646 | TObjArray * refpi0 = particle->GetObjArray(GetAODObjArrayName()+"Pi0s"); |
647 | if(refpi0){ | |
648 | if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Leading %d, In Pi0 Refs entries %d\n",trigIndex, refpi0->GetEntriesFast()); | |
649 | MakeNeutralCorrelation(particle, refpi0, kTRUE); | |
9415d854 | 650 | } |
651 | ||
477d6cee | 652 | }//Aod branch loop |
653 | ||
a3aebfff | 654 | if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n"); |
477d6cee | 655 | |
1c5acb87 | 656 | } |
657 | ||
658 | //____________________________________________________________________________ | |
233e0df8 | 659 | void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle, TObjArray* const pl, const Bool_t bFillHisto) |
1c5acb87 | 660 | { |
f8006433 | 661 | // Charged Hadron Correlation Analysis |
c8fe2783 | 662 | if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n"); |
dde5a268 | 663 | |
c8fe2783 | 664 | Int_t evtIndex11 = 0 ; |
f8006433 | 665 | Int_t evtIndex12 = 0 ; |
666 | Int_t indexPhoton1 = -1 ; | |
667 | Int_t indexPhoton2 = -1 ; | |
668 | ||
c8fe2783 | 669 | if (GetMixedEvent()) { |
670 | evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ; | |
671 | evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ; | |
672 | } | |
673 | ||
674 | Double_t ptTrig = aodParticle->Pt(); | |
675 | Double_t pxTrig = aodParticle->Px(); | |
676 | Double_t pyTrig = aodParticle->Py(); | |
677 | ||
678 | Double_t phiTrig = aodParticle->Phi(); | |
679 | ||
680 | Double_t pt = -100.; | |
681 | Double_t px = -100.; | |
682 | Double_t py = -100.; | |
683 | Double_t rat = -100.; | |
684 | Double_t xE = -100.; | |
685 | Double_t cosi = -100.; | |
686 | Double_t phi = -100. ; | |
687 | Double_t eta = -100. ; | |
688 | TVector3 p3; | |
b6991fc4 | 689 | |
f8006433 | 690 | TObjArray * reftracks = 0x0; |
c8fe2783 | 691 | Int_t nrefs = 0; |
a33b76ed | 692 | |
f8006433 | 693 | Double_t ptDecay1 = 0. ; |
694 | Double_t pxDecay1 = 0. ; | |
695 | Double_t pyDecay1 = 0. ; | |
696 | Double_t phiDecay1 = 0. ; | |
697 | Double_t ptDecay2 = 0. ; | |
698 | Double_t pxDecay2 = 0. ; | |
699 | Double_t pyDecay2 = 0. ; | |
700 | Double_t phiDecay2 = 0. ; | |
701 | ||
702 | Double_t ratDecay1 = -100.; | |
703 | Double_t ratDecay2 = -100.; | |
704 | Float_t deltaphi = -100. ; | |
705 | Float_t deltaphiDecay1 = -100. ; | |
706 | Float_t deltaphiDecay2 = -100. ; | |
707 | TObjArray * clusters = 0x0 ; | |
708 | TLorentzVector photonMom ; | |
709 | ||
710 | if(fPi0Trigger){ | |
711 | indexPhoton1 = aodParticle->GetCaloLabel (0); | |
712 | indexPhoton2 = aodParticle->GetCaloLabel (1); | |
713 | if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2); | |
714 | ||
715 | if(indexPhoton1!=-1 && indexPhoton2!=-1){ | |
716 | if(aodParticle->GetDetector()=="EMCAL") clusters = GetAODEMCAL() ; | |
717 | else clusters = GetAODPHOS() ; | |
718 | for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){ | |
719 | AliVCluster * photon = (AliVCluster*) (clusters->At(iclus)); | |
720 | photon->GetMomentum(photonMom,GetVertex(0)) ; | |
721 | if(photon->GetID()==indexPhoton1) { | |
722 | ptDecay1 = photonMom.Pt(); | |
723 | pxDecay1 = photonMom.Px(); | |
724 | pyDecay1 = photonMom.Py(); | |
725 | phiDecay1 = photonMom.Phi(); | |
726 | } | |
727 | if(photon->GetID()==indexPhoton2) { | |
728 | ptDecay2 = photonMom.Pt(); | |
729 | pxDecay2 = photonMom.Px(); | |
730 | pyDecay2 = photonMom.Py(); | |
731 | phiDecay2 = photonMom.Phi(); | |
732 | } | |
733 | if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2); | |
734 | } //cluster loop | |
735 | } //index of decay photons found | |
736 | if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig); | |
737 | } //make decay-hadron correlation | |
738 | ||
739 | //Track loop, select tracks with good pt, phi and fill AODs or histograms | |
c8fe2783 | 740 | //Int_t currentIndex = -1 ; |
741 | for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ ){ | |
742 | AliAODTrack * track = (AliAODTrack *) (pl->At(ipr)) ; | |
743 | Int_t evtIndex2 = 0 ; | |
744 | if (GetMixedEvent()) { | |
745 | evtIndex2 = GetMixedEvent()->EventIndex(track->GetID()) ; | |
746 | if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2) // photon and track from different events | |
747 | continue ; | |
f8006433 | 748 | // if(currentIndex == evtIndex2) // tracks from different event |
749 | // continue ; | |
750 | // currentIndex = evtIndex2 ; | |
c8fe2783 | 751 | } |
752 | if(track->GetID()==aodParticle->GetTrackLabel(0)) | |
753 | continue ; | |
f8006433 | 754 | |
755 | //if(track->Pt()>ptTrig) | |
756 | //continue ; | |
757 | ||
c8fe2783 | 758 | Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; |
759 | p3.SetXYZ(mom[0],mom[1],mom[2]); | |
760 | pt = p3.Pt(); | |
761 | px = p3.Px(); | |
762 | py = p3.Py(); | |
763 | eta = p3.Eta(); | |
764 | phi = p3.Phi() ; | |
765 | if(phi < 0) phi+=TMath::TwoPi(); | |
766 | rat = pt/ptTrig ; | |
767 | xE = -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig); | |
768 | if(xE <0.)xE =-xE; | |
769 | cosi = TMath::Log(1/xE); | |
f8006433 | 770 | // printf("rat = %f, xE = %f, cosi =%f \n", rat, xE, cosi); |
771 | // printf("phi = %f \n", phi); | |
772 | ||
773 | if(fPi0Trigger){ | |
774 | if(indexPhoton1!=-1 && indexPhoton2!=-1){ | |
775 | if(ptDecay1) ratDecay1 = pt/ptDecay1 ; | |
776 | if(ptDecay2) ratDecay2 = pt/ptDecay2 ; | |
777 | deltaphiDecay1 = phiDecay1-phi; | |
778 | deltaphiDecay2 = phiDecay2-phi; | |
779 | if(deltaphiDecay1< -TMath::PiOver2()) deltaphiDecay1+=TMath::TwoPi(); | |
780 | if(deltaphiDecay1>3*TMath::PiOver2()) deltaphiDecay1-=TMath::TwoPi(); | |
781 | if(deltaphiDecay2< -TMath::PiOver2()) deltaphiDecay2+=TMath::TwoPi(); | |
782 | if(deltaphiDecay2>3*TMath::PiOver2()) deltaphiDecay2-=TMath::TwoPi(); | |
783 | } | |
784 | } //do decay-hadron correlation | |
dde5a268 | 785 | |
c8fe2783 | 786 | if(IsFiducialCutOn()){ |
787 | Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ; | |
788 | if(! in ) continue ; | |
789 | } | |
790 | ||
f8006433 | 791 | //Select only hadrons in pt range |
c8fe2783 | 792 | if(pt < GetMinPt() || pt > GetMaxPt()) continue ; |
dde5a268 | 793 | |
f8006433 | 794 | //Selection within angular range |
795 | deltaphi = phiTrig-phi; | |
c8fe2783 | 796 | if(deltaphi< -TMath::PiOver2()) deltaphi+=TMath::TwoPi(); |
797 | if(deltaphi>3*TMath::PiOver2()) deltaphi-=TMath::TwoPi(); | |
dde5a268 | 798 | |
c8fe2783 | 799 | if(GetDebug() > 2) |
800 | printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Charged hadron: pt %f, phi %f, phi trigger %f. Cuts: delta phi %2.2f < %2.2f < %2.2f, pT min %2.2f \n", | |
801 | pt,phi, phiTrig,fDeltaPhiMinCut, deltaphi, fDeltaPhiMaxCut, GetMinPt()); | |
dde5a268 | 802 | |
c8fe2783 | 803 | if(bFillHisto){ |
f8006433 | 804 | // Fill Histograms |
c8fe2783 | 805 | fhEtaCharged->Fill(pt,eta); |
806 | fhPhiCharged->Fill(pt,phi); | |
807 | fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta); | |
808 | fhDeltaPhiCharged->Fill(ptTrig, deltaphi); | |
809 | fhDeltaPhiDeltaEtaCharged->Fill(deltaphi,aodParticle->Eta()-eta); | |
810 | ||
811 | if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta); | |
812 | ||
f8006433 | 813 | //delta phi cut for correlation |
c8fe2783 | 814 | if( (deltaphi > fDeltaPhiMinCut) && ( deltaphi < fDeltaPhiMaxCut) ) { |
815 | fhDeltaPhiChargedPt->Fill(pt,deltaphi); | |
816 | fhPtImbalanceCharged->Fill(ptTrig,rat); | |
817 | fhPtHbpCharged->Fill(ptTrig,cosi); | |
818 | } | |
123fc3bd | 819 | else { |
c8fe2783 | 820 | fhDeltaPhiUeChargedPt->Fill(pt,deltaphi); |
821 | fhPtImbalanceUeCharged->Fill(ptTrig,rat); | |
822 | fhPtHbpUeCharged->Fill(ptTrig,cosi); | |
123fc3bd | 823 | } |
f8006433 | 824 | |
825 | if(fPi0Trigger){ | |
826 | if(indexPhoton1!=-1 && indexPhoton2!=-1){ | |
827 | fhDeltaPhiDecay1Charged->Fill(ptDecay1, deltaphiDecay1); | |
828 | fhDeltaPhiDecay2Charged->Fill(ptDecay2, deltaphiDecay2); | |
829 | if(GetDebug() > 1)printf("deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaphiDecay1, deltaphiDecay2); | |
830 | if( (deltaphiDecay1 > fDeltaPhiMinCut) && ( deltaphiDecay1 < fDeltaPhiMaxCut) ) | |
831 | fhPtImbalanceDecay1Charged->Fill(ptDecay1,ratDecay1); | |
832 | if( (deltaphiDecay2 > fDeltaPhiMinCut) && ( deltaphiDecay2 < fDeltaPhiMaxCut) ) | |
833 | fhPtImbalanceDecay2Charged->Fill(ptDecay2,ratDecay2); | |
834 | if(GetDebug() > 1)printf("ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2); | |
835 | } //index of decay photons found | |
836 | } //make decay-hadron correlation | |
837 | ||
838 | //several UE calculation | |
dde5a268 | 839 | if(fMakeSeveralUE){ |
c8fe2783 | 840 | if((deltaphi<-fUeDeltaPhiMinCut) && (deltaphi >-fUeDeltaPhiMaxCut)){ |
841 | fhDeltaPhiUeLeftCharged->Fill(pt,deltaphi); | |
842 | fhPtImbalanceUeLeftCharged->Fill(ptTrig,rat); | |
843 | fhPtHbpUeLeftCharged->Fill(ptTrig,cosi); | |
844 | } | |
845 | if((deltaphi>fUeDeltaPhiMinCut) && (deltaphi <fUeDeltaPhiMaxCut)){ | |
846 | fhDeltaPhiUeRightCharged->Fill(pt,deltaphi); | |
847 | fhPtImbalanceUeRightCharged->Fill(ptTrig,rat); | |
848 | fhPtHbpUeRightCharged->Fill(ptTrig,cosi); | |
849 | ||
850 | } | |
dde5a268 | 851 | } //several UE calculation |
c8fe2783 | 852 | |
853 | } | |
854 | else{ | |
855 | nrefs++; | |
856 | if(nrefs==1){ | |
857 | reftracks = new TObjArray(0); | |
858 | reftracks->SetName(GetAODObjArrayName()+"Tracks"); | |
859 | reftracks->SetOwner(kFALSE); | |
860 | } | |
861 | reftracks->Add(track); | |
862 | }//aod particle loop | |
863 | }// track loop | |
9415d854 | 864 | |
f8006433 | 865 | //Fill AOD with reference tracks, if not filling histograms |
c8fe2783 | 866 | if(!bFillHisto && reftracks) { |
867 | aodParticle->AddObjArray(reftracks); | |
868 | } | |
869 | ||
f8006433 | 870 | //delete reftracks; |
9415d854 | 871 | |
1c5acb87 | 872 | } |
9415d854 | 873 | |
f8006433 | 874 | |
875 | ||
876 | //____________________________________________________________________________ | |
877 | //void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD(AliAODPWG4ParticleCorrelation* const aodParticle,TObjArray* const pl, TString detector) | |
878 | //{ | |
879 | // // Neutral Pion Correlation Analysis, find pi0, put them in new output aod, if correlation cuts passed | |
880 | // if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Make trigger particle - neutral hadron correlation \n"); | |
881 | // | |
882 | // if(!NewOutputAOD()){ | |
883 | // printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Output aod not created, set AOD class name and branch name in the configuration file, STOP! \n"); | |
884 | // abort(); | |
885 | // } | |
886 | // | |
887 | // Double_t phiTrig = aodParticle->Phi(); | |
888 | // Int_t tag = 0; | |
889 | // TLorentzVector gammai; | |
890 | // TLorentzVector gammaj; | |
891 | // | |
892 | // //Get vertex for photon momentum calculation | |
893 | // | |
894 | // if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) | |
895 | // { | |
896 | // for (Int_t iev = 0; iev < GetNMixedEvent(); iev++) { | |
897 | // if (!GetMixedEvent()) | |
898 | // GetReader()->GetVertex(GetVertex(iev)); | |
899 | // else | |
900 | // GetMixedEvent()->GetVertexOfEvent(iev)->GetXYZ(GetVertex(iev)); | |
901 | // } | |
902 | // } | |
1e68a3f4 | 903 | // Double_t vertex2[] = {0.0,0.0,0.0} ; //vertex of second input aod |
904 | // if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) | |
905 | // { | |
906 | // if(GetReader()->GetSecondInputAODTree()) GetReader()->GetSecondInputAODVertex(vertex2); | |
907 | // } | |
f8006433 | 908 | // |
909 | // //Cluster loop, select pairs with good pt, phi and fill AODs or histograms | |
910 | // //Int_t iEvent= GetReader()->GetEventNumber() ; | |
911 | // Int_t nclus = pl->GetEntriesFast(); | |
912 | // for(Int_t iclus = 0;iclus < nclus ; iclus ++ ){ | |
913 | // AliVCluster * calo = (AliVCluster *) (pl->At(iclus)) ; | |
914 | // | |
915 | // Int_t evtIndex1 = 0 ; | |
916 | // if (GetMixedEvent()) { | |
917 | // evtIndex1=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ; | |
918 | // } | |
919 | // | |
920 | // | |
921 | // //Input from second AOD? | |
922 | // Int_t inputi = 0; | |
1e68a3f4 | 923 | // if (aodParticle->GetDetector() == "EMCAL" && GetReader()->GetAODEMCALNormalInputEntries() <= iclus) |
924 | // inputi = 1 ; | |
925 | // else if(aodParticle->GetDetector() == "PHOS" && GetReader()->GetAODPHOSNormalInputEntries() <= iclus) | |
926 | // inputi = 1; | |
f8006433 | 927 | // |
928 | // //Cluster selection, not charged, with photon or pi0 id and in fiducial cut | |
929 | // //FIXME | |
930 | // Int_t pdg=0; | |
931 | // //if (inputi == 0 && !SelectCluster(calo, GetVertex(evtIndex1), gammai, pdg)) | |
932 | // continue ; | |
933 | // //MEFIX | |
1e68a3f4 | 934 | // else if(inputi == 1 && !SelectCluster(calo, vertex2, gammai, pdg)) |
935 | // continue ; | |
f8006433 | 936 | // |
937 | // if(GetDebug() > 2) | |
938 | // printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Neutral cluster in %s: pt %f, phi %f, phi trigger %f. Cuts: delta phi min %2.2f, max %2.2f, pT min %2.2f \n", | |
939 | // detector.Data(), gammai.Pt(),gammai.Phi(),phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt()); | |
940 | // | |
941 | // //2 gamma overlapped, found with PID | |
942 | // if(pdg == AliCaloPID::kPi0){ | |
943 | // | |
944 | // //Select only hadrons in pt range | |
945 | // if(gammai.Pt() < GetMinPt() || gammai.Pt() > GetMaxPt()) | |
946 | // continue ; | |
947 | // | |
948 | // //Selection within angular range | |
949 | // Float_t phi = gammai.Phi(); | |
950 | // if(phi < 0) phi+=TMath::TwoPi(); | |
951 | // //Float_t deltaphi = TMath::Abs(phiTrig-phi); | |
952 | // //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ; | |
953 | // | |
954 | // AliAODPWG4Particle pi0 = AliAODPWG4Particle(gammai); | |
955 | // //pi0.SetLabel(calo->GetLabel()); | |
956 | // pi0.SetPdg(AliCaloPID::kPi0); | |
957 | // pi0.SetDetector(detector); | |
958 | // | |
959 | // if(IsDataMC()){ | |
960 | // pi0.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(),GetReader(),inputi)); | |
961 | // if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Origin of candidate %d\n",pi0.GetTag()); | |
962 | // }//Work with stack also | |
963 | // //Set the indeces of the original caloclusters | |
964 | // pi0.SetCaloLabel(calo->GetID(),-1); | |
965 | // AddAODParticle(pi0); | |
966 | // | |
967 | // if(GetDebug() > 2) | |
968 | // printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Correlated with selected pi0 (pid): pt %f, phi %f\n",pi0.Pt(),pi0.Phi()); | |
969 | // | |
970 | // }// pdg = 111 | |
971 | // | |
972 | // //Make invariant mass analysis | |
973 | // else if(pdg == AliCaloPID::kPhoton){ | |
974 | // //Search the photon companion in case it comes from a Pi0 decay | |
975 | // //Apply several cuts to select the good pair; | |
976 | // for(Int_t jclus = iclus+1; jclus < pl->GetEntries() ; jclus ++ ){ | |
977 | // AliVCluster * calo2 = (AliVCluster *) (pl->At(jclus)) ; | |
978 | // Int_t evtIndex2 = 0 ; | |
979 | // if (GetMixedEvent()) { | |
980 | // evtIndex2=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ; | |
981 | // } | |
982 | // if (GetMixedEvent() && (evtIndex1 == evtIndex2)) | |
983 | // continue ; | |
984 | // | |
985 | // //Input from second AOD? | |
986 | // Int_t inputj = 0; | |
1e68a3f4 | 987 | // if (aodParticle->GetDetector() == "EMCAL" && GetReader()->GetAODEMCALNormalInputEntries() <= jclus) |
988 | // inputj = 1; | |
989 | // else if(aodParticle->GetDetector() == "PHOS" && GetReader()->GetAODPHOSNormalInputEntries() <= jclus) | |
990 | // inputj = 1; | |
f8006433 | 991 | // |
992 | // //Cluster selection, not charged with photon or pi0 id and in fiducial cut | |
993 | // Int_t pdgj=0; | |
994 | // //FIXME | |
995 | // //if (inputj == 0 && !SelectCluster(calo2, GetVertex(evtIndex2), gammaj, pdgj)) | |
996 | // continue ; | |
997 | // //MEFIX | |
998 | // | |
1e68a3f4 | 999 | // else if(inputj == 1 && !SelectCluster(calo2, vertex2, gammaj, pdgj)) |
1000 | // continue ; | |
f8006433 | 1001 | // //FIXME |
1002 | // //if(!SelectCluster(calo2,GetVertex(evtIndex2), gammaj, pdgj)) | |
1003 | // //MEFIX | |
1004 | // continue ; | |
1005 | // | |
1006 | // if(pdgj == AliCaloPID::kPhoton ){ | |
1007 | // | |
1008 | // if((gammai+gammaj).Pt() < GetMinPt() || (gammai+gammaj).Pt() > GetMaxPt()) | |
1009 | // continue ; | |
1010 | // | |
1011 | // //Selection within angular range | |
1012 | // Float_t phi = (gammai+gammaj).Phi(); | |
1013 | // if(phi < 0) phi+=TMath::TwoPi(); | |
1014 | // //Float_t deltaphi = TMath::Abs(phiTrig-phi); | |
1015 | // //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ; | |
1016 | // | |
1017 | // //Select good pair (aperture and invariant mass) | |
1018 | // if(GetNeutralMesonSelection()->SelectPair(gammai, gammaj)){ | |
1019 | // | |
1020 | // if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Neutral Hadron Correlation: AOD Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f\n", | |
1021 | // (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M()); | |
1022 | // | |
1023 | // TLorentzVector pi0mom = gammai+gammaj; | |
1024 | // AliAODPWG4Particle pi0 = AliAODPWG4Particle(pi0mom); | |
1025 | // //pi0.SetLabel(calo->GetLabel()); | |
1026 | // pi0.SetPdg(AliCaloPID::kPi0); | |
1027 | // pi0.SetDetector(detector); | |
1028 | // if(IsDataMC()){ | |
1029 | // //Check origin of the candidates | |
1030 | // | |
1031 | // Int_t label1 = calo->GetLabel(); | |
1032 | // Int_t label2 = calo2->GetLabel(); | |
1033 | // Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader(), inputi); | |
1034 | // Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(), inputj); | |
1035 | // | |
1036 | // if(GetDebug() > 0) | |
1037 | // printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2); | |
1038 | // if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) && GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay)){ | |
1039 | // | |
1040 | // //Check if pi0 mother is the same | |
1041 | // if(GetReader()->ReadStack()){ | |
1042 | // TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree | |
1043 | // label1 = mother1->GetFirstMother(); | |
1044 | // //mother1 = GetMCStack()->Particle(label1);//pi0 | |
1045 | // | |
1046 | // TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree | |
1047 | // label2 = mother2->GetFirstMother(); | |
1048 | // //mother2 = GetMCStack()->Particle(label2);//pi0 | |
1049 | // } | |
1050 | // else if(GetReader()->ReadAODMCParticles()){ | |
1051 | // AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(inputi))->At(label1);//photon in kine tree | |
1052 | // label1 = mother1->GetMother(); | |
1053 | // //mother1 = GetMCStack()->Particle(label1);//pi0 | |
1054 | // AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(inputj))->At(label2);//photon in kine tree | |
1055 | // label2 = mother2->GetMother(); | |
1056 | // //mother2 = GetMCStack()->Particle(label2);//pi0 | |
1057 | // } | |
1058 | // | |
1059 | // //printf("mother1 %d, mother2 %d\n",label1,label2); | |
1060 | // if(label1 == label2) | |
1061 | // GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0); | |
1062 | // } | |
1063 | // }//Work with mc information also | |
1064 | // pi0.SetTag(tag); | |
1065 | // //Set the indeces of the original caloclusters | |
1066 | // pi0.SetCaloLabel(calo->GetID(), calo2->GetID()); | |
1067 | // AddAODParticle(pi0); | |
1068 | // | |
1069 | // | |
1070 | // }//Pair selected | |
1071 | // }//if pair of gammas | |
1072 | // }//2nd loop | |
1073 | // }// if pdg = 22 | |
1074 | // }//1st loop | |
1075 | // | |
1076 | // if(GetDebug() > 1) | |
1077 | // printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - End, %d pi0's found \n",GetOutputAODBranch()->GetEntriesFast()); | |
1078 | //} | |
9415d854 | 1079 | |
1080 | //____________________________________________________________________________ | |
f8006433 | 1081 | void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * const aodParticle, TObjArray* pi0list, const Bool_t bFillHisto) |
9415d854 | 1082 | { |
1083 | // Neutral Pion Correlation Analysis | |
f8006433 | 1084 | if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Make trigger particle - pi0 correlation, %d pi0's \n",pi0list->GetEntriesFast()); |
1085 | ||
1086 | Int_t evtIndex11 = 0 ; | |
1087 | Int_t evtIndex12 = 0 ; | |
1088 | if (GetMixedEvent()) { | |
1089 | evtIndex11 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(0)) ; | |
1090 | evtIndex12 = GetMixedEvent()->EventIndexForCaloCluster(aodParticle->GetCaloLabel(1)) ; | |
1091 | } | |
9415d854 | 1092 | |
f8006433 | 1093 | Double_t pt = -100.; |
dd4871cd | 1094 | Double_t px = -100.; |
1095 | Double_t py = -100.; | |
9415d854 | 1096 | Double_t rat = -100.; |
1097 | Double_t phi = -100.; | |
1098 | Double_t eta = -100.; | |
dd4871cd | 1099 | Double_t xE = -100.; |
1100 | Double_t cosi = -100.; | |
f8006433 | 1101 | |
9415d854 | 1102 | Double_t ptTrig = aodParticle->Pt(); |
1103 | Double_t phiTrig = aodParticle->Phi(); | |
1104 | Double_t etaTrig = aodParticle->Eta(); | |
dd4871cd | 1105 | Double_t pxTrig = aodParticle->Px(); |
1106 | Double_t pyTrig = aodParticle->Py(); | |
9415d854 | 1107 | |
f8006433 | 1108 | |
1109 | Int_t indexPhoton1 = -1 ; | |
1110 | Int_t indexPhoton2 = -1 ; | |
1111 | Double_t ptDecay1 = 0. ; | |
1112 | Double_t pxDecay1 = 0. ; | |
1113 | Double_t pyDecay1 = 0. ; | |
1114 | Double_t phiDecay1 = 0. ; | |
1115 | Double_t ptDecay2 = 0. ; | |
1116 | Double_t pxDecay2 = 0. ; | |
1117 | Double_t pyDecay2 = 0. ; | |
1118 | Double_t phiDecay2 = 0. ; | |
1119 | ||
1120 | Double_t ratDecay1 = -100.; | |
1121 | Double_t ratDecay2 = -100.; | |
1122 | Float_t deltaphi = -100. ; | |
1123 | Float_t deltaphiDecay1 = -100. ; | |
1124 | Float_t deltaphiDecay2 = -100. ; | |
1125 | TObjArray * clusters = 0x0 ; | |
1126 | TLorentzVector photonMom ; | |
1127 | if(fPi0Trigger){ | |
1128 | indexPhoton1 = aodParticle->GetCaloLabel (0); | |
1129 | indexPhoton2 = aodParticle->GetCaloLabel (1); | |
1130 | if(GetDebug() > 1)printf("indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2); | |
1131 | ||
1132 | if(indexPhoton1!=-1 && indexPhoton2!=-1){ | |
1133 | if(aodParticle->GetDetector()=="EMCAL") clusters = GetAODEMCAL() ; | |
1134 | else clusters = GetAODPHOS() ; | |
1135 | for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++){ | |
1136 | AliVCluster * photon = (AliVCluster*) (clusters->At(iclus)); | |
1137 | photon->GetMomentum(photonMom,GetVertex(0)) ; | |
1138 | if(photon->GetID()==indexPhoton1) { | |
1139 | ptDecay1 = photonMom.Pt(); | |
1140 | pxDecay1 = photonMom.Px(); | |
1141 | pyDecay1 = photonMom.Py(); | |
1142 | phiDecay1 = photonMom.Phi(); | |
1143 | } | |
1144 | if(photon->GetID()==indexPhoton2) { | |
1145 | ptDecay2 = photonMom.Pt(); | |
1146 | pxDecay2 = photonMom.Px(); | |
1147 | pyDecay2 = photonMom.Py(); | |
1148 | phiDecay2 = photonMom.Phi(); | |
1149 | } | |
1150 | if(GetDebug() > 1)printf("Photon1 = %f, Photon2 = %f \n", ptDecay1, ptDecay2); | |
1151 | } //photonAOD loop | |
1152 | } //index of decay photons found | |
1153 | if(ptTrig && bFillHisto) fhPtPi0DecayRatio->Fill(ptTrig, ptDecay1/ptTrig, ptDecay2/ptTrig); | |
1154 | } //make decay-hadron correlation | |
1155 | ||
1156 | TObjArray * refpi0 =0x0; | |
1157 | Int_t nrefs = 0; | |
9415d854 | 1158 | |
1159 | //Loop on stored AOD pi0 | |
f8006433 | 1160 | Int_t naod = pi0list->GetEntriesFast(); |
9415d854 | 1161 | if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod); |
1162 | for(Int_t iaod = 0; iaod < naod ; iaod++){ | |
f8006433 | 1163 | AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (pi0list->At(iaod)); |
1164 | ||
1165 | Int_t evtIndex2 = 0 ; | |
1166 | Int_t evtIndex3 = 0 ; | |
1167 | if (GetMixedEvent()) { | |
1168 | evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(0)) ; | |
1169 | evtIndex3 = GetMixedEvent()->EventIndexForCaloCluster(pi0->GetCaloLabel(1)) ; | |
1170 | ||
1171 | if (evtIndex11 == evtIndex2 || evtIndex12 == evtIndex2 || evtIndex11 == evtIndex3 || evtIndex12 == evtIndex3) // trigger and pi0 are not from different events | |
1172 | continue ; | |
1173 | } | |
1174 | ||
1175 | //Int_t pdg = pi0->GetPdg(); | |
1176 | //if(pdg != AliCaloPID::kPi0) continue; | |
9415d854 | 1177 | |
9415d854 | 1178 | pt = pi0->Pt(); |
f8006433 | 1179 | px = pi0->Px(); |
1180 | py = pi0->Py(); | |
9415d854 | 1181 | if(pt < GetMinPt() || pt > GetMaxPt()) continue ; |
1182 | ||
1183 | //Selection within angular range | |
1184 | phi = pi0->Phi(); | |
dde5a268 | 1185 | //Float_t deltaphi = TMath::Abs(phiTrig-phi); |
1186 | //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ; | |
9415d854 | 1187 | |
f8006433 | 1188 | if(bFillHisto){ |
1189 | ||
1190 | deltaphi = phiTrig-phi; | |
1191 | if(deltaphi<-TMath::PiOver2()) deltaphi+=TMath::TwoPi(); | |
1192 | if(deltaphi>3*TMath::PiOver2()) deltaphi-=TMath::TwoPi(); | |
1193 | ||
1194 | rat = pt/ptTrig ; | |
1195 | phi = pi0->Phi() ; | |
1196 | eta = pi0->Eta() ; | |
1197 | xE = -(px*pxTrig+py*pyTrig)/(ptTrig*ptTrig); | |
1198 | if(xE <0.)xE =-xE; | |
1199 | cosi = TMath::Log(1/xE); | |
1200 | ||
1201 | if(fPi0Trigger){ | |
1202 | if(indexPhoton1!=-1 && indexPhoton2!=-1){ | |
1203 | if(ptDecay1) ratDecay1 = pt/ptDecay1 ; | |
1204 | if(ptDecay2) ratDecay2 = pt/ptDecay2 ; | |
1205 | deltaphiDecay1 = phiDecay1-phi; | |
1206 | deltaphiDecay2 = phiDecay2-phi; | |
1207 | if(deltaphiDecay1< -TMath::PiOver2()) deltaphiDecay1+=TMath::TwoPi(); | |
1208 | if(deltaphiDecay1>3*TMath::PiOver2()) deltaphiDecay1-=TMath::TwoPi(); | |
1209 | if(deltaphiDecay2< -TMath::PiOver2()) deltaphiDecay2+=TMath::TwoPi(); | |
1210 | if(deltaphiDecay2>3*TMath::PiOver2()) deltaphiDecay2-=TMath::TwoPi(); | |
1211 | fhDeltaPhiDecay1Neutral->Fill(ptDecay1, deltaphiDecay1); | |
1212 | fhDeltaPhiDecay2Neutral->Fill(ptDecay2, deltaphiDecay2); | |
1213 | if(GetDebug() > 1)printf("deltaPhoton1 = %f, deltaPhoton2 = %f \n", deltaphiDecay1, deltaphiDecay2); | |
1214 | if( (deltaphiDecay1 > fDeltaPhiMinCut) && ( deltaphiDecay1 < fDeltaPhiMaxCut) ) | |
1215 | fhPtImbalanceDecay1Neutral->Fill(ptDecay1,ratDecay1); | |
1216 | if( (deltaphiDecay2 > fDeltaPhiMinCut) && ( deltaphiDecay2 < fDeltaPhiMaxCut) ) | |
1217 | fhPtImbalanceDecay2Neutral->Fill(ptDecay2,ratDecay2); | |
1218 | if(GetDebug() > 1)printf("ratPhoton1 = %f, ratPhoton2 = %f \n", pt/ptDecay1, pt/ptDecay2); | |
1219 | } | |
1220 | } //do decay-hadron correlation | |
1221 | ||
1222 | fhEtaNeutral->Fill(pt,eta); | |
1223 | fhPhiNeutral->Fill(pt,phi); | |
1224 | fhDeltaEtaNeutral->Fill(ptTrig,etaTrig-eta); | |
1225 | fhDeltaPhiNeutral->Fill(ptTrig,deltaphi); | |
1226 | fhDeltaPhiDeltaEtaNeutral->Fill(deltaphi,etaTrig-eta); | |
1227 | ||
1228 | //delta phi cut for correlation | |
1229 | if( (deltaphi > fDeltaPhiMinCut) && ( deltaphi < fDeltaPhiMaxCut) ) { | |
1230 | fhDeltaPhiNeutralPt->Fill(pt,deltaphi); | |
1231 | fhPtImbalanceNeutral->Fill(ptTrig,rat); | |
1232 | fhPtHbpNeutral->Fill(ptTrig,cosi); | |
1233 | } | |
123fc3bd | 1234 | else { |
f8006433 | 1235 | fhDeltaPhiUeNeutralPt->Fill(pt,deltaphi); |
1236 | fhPtImbalanceUeNeutral->Fill(ptTrig,rat); | |
1237 | fhPtHbpUeNeutral->Fill(ptTrig,cosi); | |
123fc3bd | 1238 | } |
f8006433 | 1239 | //several UE calculation |
123fc3bd | 1240 | if(fMakeSeveralUE){ |
f8006433 | 1241 | if((deltaphi<-fUeDeltaPhiMinCut) && (deltaphi >-fUeDeltaPhiMaxCut)){ |
1242 | fhDeltaPhiUeLeftNeutral->Fill(pt,deltaphi); | |
1243 | fhPtImbalanceUeLeftNeutral->Fill(ptTrig,rat); | |
1244 | fhPtHbpUeLeftNeutral->Fill(ptTrig,cosi); | |
1245 | } | |
1246 | if((deltaphi>fUeDeltaPhiMinCut) && (deltaphi <fUeDeltaPhiMaxCut)){ | |
1247 | fhDeltaPhiUeRightNeutral->Fill(pt,deltaphi); | |
1248 | fhPtImbalanceUeRightNeutral->Fill(ptTrig,rat); | |
1249 | fhPtHbpUeRightNeutral->Fill(ptTrig,cosi); | |
1250 | } | |
123fc3bd | 1251 | } //several UE calculation |
f8006433 | 1252 | } |
1253 | else{ | |
1254 | nrefs++; | |
1255 | if(nrefs==1){ | |
1256 | refpi0 = new TObjArray(0); | |
1257 | refpi0->SetName(GetAODObjArrayName()+"Pi0s"); | |
1258 | refpi0->SetOwner(kFALSE); | |
1259 | } | |
1260 | refpi0->Add(pi0); | |
1261 | }//put references in trigger AOD | |
1262 | ||
1263 | //if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta); | |
1264 | ||
1265 | }//loop | |
1c5acb87 | 1266 | } |
f8006433 | 1267 | |
9415d854 | 1268 | |
1c5acb87 | 1269 | //____________________________________________________________________________ |
f8006433 | 1270 | //Bool_t AliAnaParticleHadronCorrelation::SelectCluster(AliVCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) { |
1271 | // //Select cluster depending on its pid and acceptance selections | |
1272 | // | |
1273 | // //Skip matched clusters with tracks | |
1274 | // if(IsTrackMatched(calo)) return kFALSE; | |
1275 | // | |
1276 | // TString detector = ""; | |
1277 | // if (calo->IsPHOS()) detector= "PHOS"; | |
1278 | // else if(calo->IsEMCAL()) detector= "EMCAL"; | |
1279 | // | |
1280 | // //Check PID | |
1281 | // calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line | |
1282 | // pdg = AliCaloPID::kPhoton; | |
1283 | // if(IsCaloPIDOn()){ | |
1284 | // //Get most probable PID, 2 options check PID weights (in MC this option is mandatory) | |
1285 | // //or redo PID, recommended option for EMCal. | |
1286 | // | |
1287 | // if(!IsCaloPIDRecalculationOn() || GetReader()->GetDataType() == AliCaloTrackReader::kMC ) | |
1288 | // pdg = GetCaloPID()->GetPdg(detector,calo->GetPID(),mom.E());//PID with weights | |
1289 | // else | |
1290 | // pdg = GetCaloPID()->GetPdg(detector,mom,calo);//PID recalculated | |
1291 | // | |
1292 | // if(GetDebug() > 5) printf("AliAnaParticleHadronCorrelation::SelectCluster() - PDG of identified particle %d\n",pdg); | |
1293 | // | |
1294 | // //If it does not pass pid, skip | |
1295 | // if(pdg != AliCaloPID::kPhoton && pdg != AliCaloPID::kPi0) { | |
1296 | // return kFALSE ; | |
1297 | // } | |
1298 | // }//PID on | |
1299 | // | |
1300 | // //Check acceptance selection | |
1301 | // if(IsFiducialCutOn()){ | |
1302 | // Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,detector) ; | |
1303 | // if(! in ) return kFALSE ; | |
1304 | // } | |
1305 | // | |
1306 | // if(GetDebug() > 5) printf("AliAnaParticleHadronCorrelation::SelectCluster() - Correlation photon selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg); | |
1307 | // | |
1308 | // return kTRUE; | |
1309 | // | |
1310 | //} |