]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx
New script to do common-mode-noise analysis of raw data.
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaParticleHadronCorrelation.cxx
CommitLineData
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)
21//////////////////////////////////////////////////////////////////////////////
22
23
24// --- ROOT system ---
25#include "TH2F.h"
477d6cee 26#include "TClonesArray.h"
9415d854 27#include "TClass.h"
1c5acb87 28
29//---- ANALYSIS system ----
1c5acb87 30#include "AliNeutralMesonSelection.h"
31#include "AliAnaParticleHadronCorrelation.h"
32#include "AliCaloTrackReader.h"
33#include "AliCaloPID.h"
34#include "AliAODPWG4ParticleCorrelation.h"
477d6cee 35#include "AliFidutialCut.h"
36#include "AliAODTrack.h"
37#include "AliAODCaloCluster.h"
9415d854 38#include "AliMCAnalysisUtils.h"
39#include "TParticle.h"
40#include "AliStack.h"
1c5acb87 41
42ClassImp(AliAnaParticleHadronCorrelation)
43
44
45//____________________________________________________________________________
dde5a268 46 AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation():
1c5acb87 47 AliAnaPartCorrBaseClass(),
dde5a268 48 fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.), fSelectIsolated(0),
49 fMakeSeveralUE(0), fUeDeltaPhiMaxCut(0.), fUeDeltaPhiMinCut(0.),
477d6cee 50 fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0),
1c5acb87 51 fhDeltaPhiCharged(0), fhDeltaPhiNeutral(0),
52 fhDeltaEtaCharged(0), fhDeltaEtaNeutral(0),
123fc3bd 53 fhDeltaPhiChargedPt(0), fhDeltaPhiNeutralPt(0),
54 fhDeltaPhiUeChargedPt(0), fhDeltaPhiUeNeutralPt(0),
dde5a268 55 fhPtImbalanceNeutral(0), fhPtImbalanceCharged(0),
123fc3bd 56 fhPtImbalanceUeCharged(0),fhPtImbalanceUeNeutral(0),
57 fhDeltaPhiUeLeftCharged(0),fhDeltaPhiUeRightCharged(0),
58 fhDeltaPhiUeLeftNeutral(0),fhDeltaPhiUeRightNeutral(0),
59 fhPtImbalanceUeLeftCharged(0),fhPtImbalanceUeRightCharged(0),
60 fhPtImbalanceUeLeftNeutral(0),fhPtImbalanceUeRightNeutral(0)
1c5acb87 61{
62 //Default Ctor
477d6cee 63
1c5acb87 64 //Initialize parameters
65 InitParameters();
66}
67
68//____________________________________________________________________________
dde5a268 69AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation(const AliAnaParticleHadronCorrelation & g):
1c5acb87 70 AliAnaPartCorrBaseClass(g),
71 fDeltaPhiMaxCut(g.fDeltaPhiMaxCut), fDeltaPhiMinCut(g.fDeltaPhiMinCut),
6639984f 72 fSelectIsolated(g.fSelectIsolated),
dde5a268 73 fMakeSeveralUE(g.fMakeSeveralUE), fUeDeltaPhiMaxCut(g.fUeDeltaPhiMaxCut),
74 fUeDeltaPhiMinCut(g.fUeDeltaPhiMinCut),
1c5acb87 75 fhPhiCharged(g.fhPhiCharged), fhPhiNeutral(g.fhPhiNeutral),
76 fhEtaCharged(g.fhEtaCharged), fhEtaNeutral(g.fhEtaNeutral),
77 fhDeltaPhiCharged(g.fhDeltaPhiCharged),
78 fhDeltaPhiNeutral(g.fhDeltaPhiNeutral),
79 fhDeltaEtaCharged(g.fhDeltaEtaCharged),
80 fhDeltaEtaNeutral(g.fhDeltaEtaNeutral),
dde5a268 81 fhDeltaPhiChargedPt(g.fhDeltaPhiChargedPt),
1c5acb87 82 fhDeltaPhiNeutralPt(g.fhDeltaPhiNeutralPt),
dde5a268 83 fhDeltaPhiUeChargedPt(g.fhDeltaPhiUeChargedPt),
123fc3bd 84 fhDeltaPhiUeNeutralPt(g.fhDeltaPhiUeNeutralPt),
1c5acb87 85 fhPtImbalanceNeutral(g.fhPtImbalanceNeutral),
dde5a268 86 fhPtImbalanceCharged(g.fhPtImbalanceCharged),
87 fhPtImbalanceUeCharged(g.fhPtImbalanceUeCharged),
123fc3bd 88 fhPtImbalanceUeNeutral(g.fhPtImbalanceUeNeutral),
89 fhDeltaPhiUeLeftCharged(g.fhDeltaPhiUeLeftCharged),
90 fhDeltaPhiUeRightCharged(g.fhDeltaPhiUeRightCharged),
91 fhDeltaPhiUeLeftNeutral(g.fhDeltaPhiUeLeftNeutral),
92 fhDeltaPhiUeRightNeutral(g.fhDeltaPhiUeRightNeutral),
dde5a268 93 fhPtImbalanceUeLeftCharged(g.fhPtImbalanceUeLeftCharged),
123fc3bd 94 fhPtImbalanceUeRightCharged(g.fhPtImbalanceUeRightCharged),
95 fhPtImbalanceUeLeftNeutral(g.fhPtImbalanceUeLeftNeutral),
96 fhPtImbalanceUeRightNeutral(g.fhPtImbalanceUeRightNeutral)
1c5acb87 97{
98 // cpy ctor
477d6cee 99
1c5acb87 100}
101
102//_________________________________________________________________________
103AliAnaParticleHadronCorrelation & AliAnaParticleHadronCorrelation::operator = (const AliAnaParticleHadronCorrelation & source)
104{
105 // assignment operator
477d6cee 106
1c5acb87 107 if(this == &source)return *this;
108 ((AliAnaPartCorrBaseClass *)this)->operator=(source);
109
110 fDeltaPhiMaxCut = source.fDeltaPhiMaxCut ;
111 fDeltaPhiMinCut = source.fDeltaPhiMinCut ;
6639984f 112 fSelectIsolated = source.fSelectIsolated ;
dde5a268 113 fMakeSeveralUE = source.fMakeSeveralUE ;
114 fUeDeltaPhiMaxCut = source.fUeDeltaPhiMaxCut ;
115 fUeDeltaPhiMinCut = source.fUeDeltaPhiMinCut ;
1c5acb87 116 fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ;
117 fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ;
118 fhDeltaPhiCharged = source.fhDeltaPhiCharged ;
119 fhDeltaPhiNeutral = source.fhDeltaPhiNeutral ;
1c5acb87 120 fhDeltaEtaCharged = source.fhDeltaEtaCharged ;
121 fhDeltaEtaNeutral = source.fhDeltaEtaNeutral ;
122 fhDeltaPhiChargedPt = source.fhDeltaPhiChargedPt ;
dde5a268 123 fhDeltaPhiNeutralPt = source.fhDeltaPhiNeutralPt ;
124 fhDeltaPhiUeChargedPt = source.fhDeltaPhiUeChargedPt ;
123fc3bd 125 fhDeltaPhiUeNeutralPt = source.fhDeltaPhiUeNeutralPt ;
1c5acb87 126 fhPtImbalanceNeutral = source.fhPtImbalanceNeutral ;
127 fhPtImbalanceCharged = source.fhPtImbalanceCharged ;
dde5a268 128 fhPtImbalanceUeCharged = source.fhPtImbalanceUeCharged ;
123fc3bd 129 fhPtImbalanceUeNeutral = source.fhPtImbalanceUeNeutral ;
130 fhDeltaPhiUeLeftCharged = source.fhDeltaPhiUeLeftCharged ;
131 fhDeltaPhiUeRightCharged = source.fhDeltaPhiUeRightCharged ;
132 fhDeltaPhiUeLeftNeutral = source.fhDeltaPhiUeLeftNeutral ;
133 fhDeltaPhiUeRightNeutral = source.fhDeltaPhiUeRightNeutral ;
dde5a268 134 fhPtImbalanceUeLeftCharged = source.fhPtImbalanceUeLeftCharged ;
135 fhPtImbalanceUeRightCharged = source.fhPtImbalanceUeRightCharged ;
123fc3bd 136 fhPtImbalanceUeLeftNeutral = source.fhPtImbalanceUeLeftNeutral ;
137 fhPtImbalanceUeRightNeutral = source.fhPtImbalanceUeRightNeutral ;
1c5acb87 138 return *this;
139
140}
141
142//________________________________________________________________________
143TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
144{
477d6cee 145
146 // Create histograms to be saved in output file and
147 // store them in fOutputContainer
148 TList * outputContainer = new TList() ;
149 outputContainer->SetName("CorrelationHistos") ;
150
151 Int_t nptbins = GetHistoNPtBins();
152 Int_t nphibins = GetHistoNPhiBins();
153 Int_t netabins = GetHistoNEtaBins();
154 Float_t ptmax = GetHistoPtMax();
155 Float_t phimax = GetHistoPhiMax();
156 Float_t etamax = GetHistoEtaMax();
157 Float_t ptmin = GetHistoPtMin();
158 Float_t phimin = GetHistoPhiMin();
159 Float_t etamin = GetHistoEtaMin();
160
161 //Correlation with charged hadrons
162 if(GetReader()->IsCTSSwitchedOn()) {
163 fhPhiCharged = new TH2F
164 ("PhiCharged","#phi_{h^{#pm}} vs p_{T trigger}",
165 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
166 fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
167 fhPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
168
169 fhEtaCharged = new TH2F
170 ("EtaCharged","#eta_{h^{#pm}} vs p_{T trigger}",
171 nptbins,ptmin,ptmax,netabins,etamin,etamax);
172 fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
173 fhEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
174
175 fhDeltaPhiCharged = new TH2F
176 ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
dde5a268 177 nptbins,ptmin,ptmax,700,-2.,5.);
477d6cee 178 fhDeltaPhiCharged->SetYTitle("#Delta #phi");
179 fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
180
181 fhDeltaPhiChargedPt = new TH2F
9415d854 182 ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#h^{#pm}} vs p_{T h^{#pm}}",
dde5a268 183 nptbins,ptmin,ptmax,700,-2.,5.);
477d6cee 184 fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
185 fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
dde5a268 186
187 fhDeltaPhiUeChargedPt = new TH2F
188 ("DeltaPhiUeChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}}",
189 nptbins,ptmin,ptmax,700,-2.,5.);
190 fhDeltaPhiUeChargedPt->SetYTitle("#Delta #phi");
191 fhDeltaPhiUeChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
477d6cee 192
193 fhDeltaEtaCharged = new TH2F
194 ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
195 nptbins,ptmin,ptmax,200,-2,2);
196 fhDeltaEtaCharged->SetYTitle("#Delta #eta");
197 fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
198
199 fhPtImbalanceCharged =
200 new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
dde5a268 201 nptbins,ptmin,ptmax,1000,0.,2.);
477d6cee 202 fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
203 fhPtImbalanceCharged->SetXTitle("p_{T trigger}");
204
dde5a268 205 fhPtImbalanceUeCharged =
206 new TH2F("CorrelationUeCharged","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger}",
207 nptbins,ptmin,ptmax,1000,0.,2.);
208 fhPtImbalanceUeCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
209 fhPtImbalanceUeCharged->SetXTitle("p_{T trigger}");
210
477d6cee 211 outputContainer->Add(fhPhiCharged) ;
212 outputContainer->Add(fhEtaCharged) ;
213 outputContainer->Add(fhDeltaPhiCharged) ;
214 outputContainer->Add(fhDeltaEtaCharged) ;
477d6cee 215 outputContainer->Add(fhDeltaPhiChargedPt) ;
dde5a268 216 outputContainer->Add(fhDeltaPhiUeChargedPt) ;
217 outputContainer->Add(fhPtImbalanceCharged) ;
218 outputContainer->Add(fhPtImbalanceUeCharged) ;
219
220 if(fMakeSeveralUE){
123fc3bd 221 fhDeltaPhiUeLeftCharged = new TH2F
dde5a268 222 ("DeltaPhiUeLeftChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE left side range of trigger particles",
223 nptbins,ptmin,ptmax,700,-2.,5.);
123fc3bd 224 fhDeltaPhiUeLeftCharged->SetYTitle("#Delta #phi");
225 fhDeltaPhiUeLeftCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
226 outputContainer->Add(fhDeltaPhiUeLeftCharged) ;
dde5a268 227
123fc3bd 228 fhDeltaPhiUeRightCharged = new TH2F
dde5a268 229 ("DeltaPhiUeRightChargedPt","#phi_{trigger} - #phi_{#Ueh^{#pm}} vs p_{T Ueh^{#pm}} with UE right side range of trigger particles",
230 nptbins,ptmin,ptmax,700,-2.,5.);
123fc3bd 231 fhDeltaPhiUeRightCharged->SetYTitle("#Delta #phi");
232 fhDeltaPhiUeRightCharged->SetXTitle("p_{T h^{#pm}} (GeV/c)");
233 outputContainer->Add(fhDeltaPhiUeRightCharged) ;
dde5a268 234
235 fhPtImbalanceUeLeftCharged =
236 new TH2F("CorrelationUeChargedLeft","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE left side of trigger",
237 nptbins,ptmin,ptmax,1000,0.,2.);
238 fhPtImbalanceUeLeftCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
239 fhPtImbalanceUeLeftCharged->SetXTitle("p_{T trigger}");
240 outputContainer->Add(fhPtImbalanceUeLeftCharged) ;
241
242 fhPtImbalanceUeRightCharged =
243 new TH2F("CorrelationUeChargedRight","z_{trigger h^{#pm}} = p_{T Ueh^{#pm}} / p_{T trigger} with UE right side of trigger",
244 nptbins,ptmin,ptmax,1000,0.,2.);
245 fhPtImbalanceUeRightCharged->SetYTitle("z_{trigger Ueh^{#pm}}");
246 fhPtImbalanceUeRightCharged->SetXTitle("p_{T trigger}");
247 outputContainer->Add(fhPtImbalanceUeRightCharged) ;
248 }
477d6cee 249 } //Correlation with charged hadrons
250
251 //Correlation with neutral hadrons
252 if(GetReader()->IsEMCALSwitchedOn() || GetReader()->IsPHOSSwitchedOn()){
253
254 fhPhiNeutral = new TH2F
255 ("PhiNeutral","#phi_{#pi^{0}} vs p_{T trigger}",
256 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
257 fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
258 fhPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
259
260 fhEtaNeutral = new TH2F
261 ("EtaNeutral","#eta_{#pi^{0}} vs p_{T trigger}",
262 nptbins,ptmin,ptmax,netabins,etamin,etamax);
263 fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
264 fhEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
265
266 fhDeltaPhiNeutral = new TH2F
267 ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
268 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
269 fhDeltaPhiNeutral->SetYTitle("#Delta #phi");
270 fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
271
272 fhDeltaPhiNeutralPt = new TH2F
273 ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
dde5a268 274 nptbins,ptmin,ptmax,700,-2.,5.);
477d6cee 275 fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi");
123fc3bd 276 fhDeltaPhiNeutralPt->SetXTitle("p_{T h^{0} (GeV/c)");
277
278 fhDeltaPhiUeNeutralPt = new TH2F
279 ("DeltaPhiUeNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
280 nptbins,ptmin,ptmax,700,-2.,5.);
281 fhDeltaPhiUeNeutralPt->SetYTitle("#Delta #phi");
282 fhDeltaPhiUeNeutralPt->SetXTitle("p_{T h^{0} (GeV/c)");
477d6cee 283
284 fhDeltaEtaNeutral = new TH2F
285 ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
286 nptbins,ptmin,ptmax,200,-2,2);
287 fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
288 fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
289
290 fhPtImbalanceNeutral =
291 new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
dde5a268 292 nptbins,ptmin,ptmax,1000,0.,2.);
477d6cee 293 fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}");
294 fhPtImbalanceNeutral->SetXTitle("p_{T trigger}");
123fc3bd 295
296 fhPtImbalanceUeNeutral =
297 new TH2F("CorrelationUeNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
298 nptbins,ptmin,ptmax,1000,0.,2.);
299 fhPtImbalanceUeNeutral->SetYTitle("z_{trigger #pi^{0}}");
300 fhPtImbalanceUeNeutral->SetXTitle("p_{T trigger}");
301
477d6cee 302 outputContainer->Add(fhPhiNeutral) ;
303 outputContainer->Add(fhEtaNeutral) ;
304 outputContainer->Add(fhDeltaPhiNeutral) ;
123fc3bd 305 outputContainer->Add(fhDeltaPhiNeutralPt) ;
306 outputContainer->Add(fhDeltaPhiUeNeutralPt) ;
477d6cee 307 outputContainer->Add(fhDeltaEtaNeutral) ;
308 outputContainer->Add(fhPtImbalanceNeutral) ;
123fc3bd 309 outputContainer->Add(fhPtImbalanceUeNeutral) ;
310
311 if(fMakeSeveralUE){
312 fhDeltaPhiUeLeftNeutral = new TH2F
313 ("DeltaPhiUeLeftNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T h^{0}} with UE left side range of trigger particles",
314 nptbins,ptmin,ptmax,700,-2.,5.);
315 fhDeltaPhiUeLeftNeutral->SetYTitle("#Delta #phi");
316 fhDeltaPhiUeLeftNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
317 outputContainer->Add(fhDeltaPhiUeLeftNeutral) ;
318
319 fhDeltaPhiUeRightNeutral = new TH2F
320 ("DeltaPhiUeRightNeutralPt","#phi_{trigger} - #phi_{#Ueh^{0}} vs p_{T Ueh^{0}} with UE right side range of trigger particles",
321 nptbins,ptmin,ptmax,700,-2.,5.);
322 fhDeltaPhiUeRightNeutral->SetYTitle("#Delta #phi");
323 fhDeltaPhiUeRightNeutral->SetXTitle("p_{T h^{0}} (GeV/c)");
324 outputContainer->Add(fhDeltaPhiUeRightNeutral) ;
325
326 fhPtImbalanceUeLeftNeutral =
327 new TH2F("CorrelationUeNeutralLeft","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with UE left side of trigger",
328 nptbins,ptmin,ptmax,1000,0.,2.);
329 fhPtImbalanceUeLeftNeutral->SetYTitle("z_{trigger Ueh^{0}}");
330 fhPtImbalanceUeLeftNeutral->SetXTitle("p_{T trigger}");
331 outputContainer->Add(fhPtImbalanceUeLeftNeutral) ;
332
333 fhPtImbalanceUeRightNeutral =
334 new TH2F("CorrelationUeNeutralRight","z_{trigger h^{0}} = p_{T Ueh^{0}} / p_{T trigger} with UE right side of trigger",
335 nptbins,ptmin,ptmax,1000,0.,2.);
336 fhPtImbalanceUeRightNeutral->SetYTitle("z_{trigger Ueh^{0}}");
337 fhPtImbalanceUeRightNeutral->SetXTitle("p_{T trigger}");
338 outputContainer->Add(fhPtImbalanceUeRightNeutral) ;
339 }
340
477d6cee 341 //Keep neutral meson selection histograms if requiered
342 //Setting done in AliNeutralMesonSelection
343 if(GetNeutralMesonSelection()){
344 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
345 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
346 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
347 }
a3aebfff 348
477d6cee 349 }//Correlation with neutral hadrons
350
351 return outputContainer;
a3aebfff 352
1c5acb87 353}
354
477d6cee 355//____________________________________________________________________________
1c5acb87 356void AliAnaParticleHadronCorrelation::InitParameters()
357{
477d6cee 358
1c5acb87 359 //Initialize the parameters of the analysis.
a3aebfff 360 SetInputAODName("PWG4Particle");
361 SetAODRefArrayName("Hadrons");
362 AddToHistogramsName("AnaHadronCorr_");
363
9415d854 364 //Correlation with neutrals
365 //SetOutputAODClassName("AliAODPWG4Particle");
366 //SetOutputAODName("Pi0Correlated");
367
dde5a268 368 SetPtCutRange(0.,300);
1c5acb87 369 fDeltaPhiMinCut = 1.5 ;
370 fDeltaPhiMaxCut = 4.5 ;
6639984f 371 fSelectIsolated = kFALSE;
dde5a268 372 fMakeSeveralUE = kFALSE;
373 fUeDeltaPhiMinCut = 1. ;
374 fUeDeltaPhiMaxCut = 1.5 ;
1c5acb87 375}
376
377//__________________________________________________________________
378void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
379{
380
381 //Print some relevant parameters set for the analysis
382 if(! opt)
383 return;
384
a3aebfff 385 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
386 AliAnaPartCorrBaseClass::Print(" ");
387
1c5acb87 388 printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
389 printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
6639984f 390 printf("Isolated Trigger? %d\n", fSelectIsolated) ;
dde5a268 391 printf("Phi trigger particle-UeHadron < %3.2f\n", fUeDeltaPhiMaxCut) ;
392 printf("Phi trigger particle-UeHadron > %3.2f\n", fUeDeltaPhiMinCut) ;
393 printf("Several UE? %d\n", fMakeSeveralUE) ;
1c5acb87 394}
395
396//____________________________________________________________________________
397void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
398{
477d6cee 399 //Particle-Hadron Correlation Analysis, fill AODs
400
401 if(!GetInputAODBranch()){
a3aebfff 402 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, ABORT \n",GetInputAODName().Data());
477d6cee 403 abort();
404 }
9415d854 405
406 if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){
407 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());
408 abort();
409 }
410
477d6cee 411 if(GetDebug() > 1){
a3aebfff 412 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - Begin hadron correlation analysis, fill AODs \n");
413 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
414 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast());
415 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast());
416 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - In PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast());
477d6cee 417 }
418
419 //Loop on stored AOD particles, trigger
420 Int_t naod = GetInputAODBranch()->GetEntriesFast();
421 for(Int_t iaod = 0; iaod < naod ; iaod++){
422 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
9415d854 423
424 //Make correlation with charged hadrons
477d6cee 425 if(GetReader()->IsCTSSwitchedOn() )
a3aebfff 426 MakeChargedCorrelation(particle, GetAODCTS(),kFALSE);
477d6cee 427
428 //Make correlation with neutral pions
429 //Trigger particle in PHOS, correlation with EMCAL
430 if(particle->GetDetector()=="PHOS" && GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0)
9415d854 431 MakeNeutralCorrelationFillAOD(particle, GetAODEMCAL(),"EMCAL");
477d6cee 432 //Trigger particle in EMCAL, correlation with PHOS
433 else if(particle->GetDetector()=="EMCAL" && GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0)
9415d854 434 MakeNeutralCorrelationFillAOD(particle, GetAODPHOS(),"PHOS");
477d6cee 435 //Trigger particle in CTS, correlation with PHOS, EMCAL and CTS
436 else if(particle->GetDetector()=="CTS" ){
437 if(GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0)
9415d854 438 MakeNeutralCorrelationFillAOD(particle, GetAODPHOS(),"PHOS");
477d6cee 439 if(GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0)
9415d854 440 MakeNeutralCorrelationFillAOD(particle, GetAODEMCAL(),"EMCAL");
477d6cee 441 }
a3aebfff 442
443
477d6cee 444 }//Aod branch loop
445
a3aebfff 446 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() - End fill AODs \n");
477d6cee 447
1c5acb87 448}
449
450//____________________________________________________________________________
451void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
452{
477d6cee 453 //Particle-Hadron Correlation Analysis, fill histograms
454
455 if(!GetInputAODBranch()){
a3aebfff 456 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s >, ABORT \n",GetInputAODName().Data());
477d6cee 457 abort();
458 }
9415d854 459
477d6cee 460 if(GetDebug() > 1){
a3aebfff 461 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Begin hadron correlation analysis, fill histograms \n");
462 printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast());
477d6cee 463 }
9415d854 464
477d6cee 465 //Loop on stored AOD particles
466 Int_t naod = GetInputAODBranch()->GetEntriesFast();
9415d854 467 for(Int_t iaod = 0; iaod < naod ; iaod++){
468 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
469
470 //check if the particle is isolated or if we want to take the isolation into account
471 if(OnlyIsolated() && !particle->IsIsolated()) continue;
472
473 //Make correlation with charged hadrons
474 TRefArray * reftracks = particle->GetRefArray(GetAODRefArrayName()+"Tracks");
475 if(reftracks){
476 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Particle %d, In Track Refs entries %d\n", iaod, reftracks->GetEntriesFast());
477 if(reftracks->GetEntriesFast() > 0) MakeChargedCorrelation(particle, reftracks,kTRUE);
478 }
479
480 //Make correlation with neutral pions
481 if(GetOutputAODBranch() && GetOutputAODBranch()->GetEntriesFast() > 0){
482 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - Particle %d, In Cluster Refs entries %d\n",iaod, GetOutputAODBranch()->GetEntriesFast());
483 MakeNeutralCorrelationFillHistograms(particle);
484 }
485
477d6cee 486 }//Aod branch loop
487
a3aebfff 488 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() - End fill histograms \n");
477d6cee 489
1c5acb87 490}
491
492//____________________________________________________________________________
a3aebfff 493void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4ParticleCorrelation *aodParticle, TRefArray* pl, const Bool_t bFillHisto)
1c5acb87 494{
dde5a268 495 // Charged Hadron Correlation Analysis
496 if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Make trigger particle - charged hadron correlation \n");
497
498 Double_t ptTrig = aodParticle->Pt();
499 Double_t phiTrig = aodParticle->Phi();
500 Double_t pt = -100.;
501 Double_t rat = -100.;
502 Double_t phi = -100. ;
503 Double_t eta = -100. ;
504 Double_t p[3];
505 Bool_t first=kTRUE;
506
507 TRefArray * reftracks =0x0;
508 if(!bFillHisto)
509 reftracks = new TRefArray;
510
511 //Track loop, select tracks with good pt, phi and fill AODs or histograms
512 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
513 AliAODTrack * track = (AliAODTrack *) (pl->At(ipr)) ;
514 track->GetPxPyPz(p) ;
515 TLorentzVector mom(p[0],p[1],p[2],0);
516 pt = mom.Pt();
517 eta = mom.Eta();
518 phi = mom.Phi() ;
519 if(phi < 0) phi+=TMath::TwoPi();
520 rat = pt/ptTrig ;
521
522 if(IsFidutialCutOn()){
523 Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ;
524 if(! in ) continue ;
525 }
526
527 //Select only hadrons in pt range
528 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
529
530 //Selection within angular range
531 Float_t deltaphi = phiTrig-phi;
532 if(deltaphi<-TMath::PiOver2()) deltaphi+=TMath::TwoPi();
533 if(deltaphi>3*TMath::PiOver2()) deltaphi-=TMath::TwoPi();
534
535 if(GetDebug() > 2)
536 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",
537 pt,phi, phiTrig,fDeltaPhiMinCut, deltaphi, fDeltaPhiMaxCut, GetMinPt());
538
539 if(bFillHisto){
540 // Fill Histograms
541 fhEtaCharged->Fill(ptTrig,eta);
542 fhPhiCharged->Fill(ptTrig,phi);
543 fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta);
544 fhDeltaPhiCharged->Fill(ptTrig, deltaphi);
545
546 if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeChargedCorrelation() - Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
123fc3bd 547
548 //delta phi cut for correlation
549 if( (deltaphi > fDeltaPhiMinCut) && ( deltaphi < fDeltaPhiMaxCut) ) {
550 fhDeltaPhiChargedPt->Fill(pt,deltaphi);
551 fhPtImbalanceCharged->Fill(ptTrig,rat);
552 }
553 else {
554 fhDeltaPhiUeChargedPt->Fill(pt,deltaphi);
555 fhPtImbalanceUeCharged->Fill(ptTrig,rat);
556 }
dde5a268 557 //several UE calculation
558 if(fMakeSeveralUE){
559 if((deltaphi<-fUeDeltaPhiMinCut) && (deltaphi >-fUeDeltaPhiMaxCut)){
123fc3bd 560 fhDeltaPhiUeLeftCharged->Fill(pt,deltaphi);
dde5a268 561 fhPtImbalanceUeLeftCharged->Fill(ptTrig,rat);
562 }
563 if((deltaphi>fUeDeltaPhiMinCut) && (deltaphi <fUeDeltaPhiMaxCut)){
123fc3bd 564 fhDeltaPhiUeRightCharged->Fill(pt,deltaphi);
dde5a268 565 fhPtImbalanceUeRightCharged->Fill(ptTrig,rat);
566 }
567 } //several UE calculation
568
dde5a268 569 }
570 else{
571 //Fill AODs
477d6cee 572
dde5a268 573 if(first) {
574 new (reftracks) TRefArray(TProcessID::GetProcessWithUID(track));
575 first = kFALSE;
576 }
9415d854 577
dde5a268 578 reftracks->Add(track);
1c5acb87 579
dde5a268 580 }//aod particle loop
581 }// track loop
9415d854 582
dde5a268 583 //Fill AOD with reference tracks, if not filling histograms
584 if(!bFillHisto && reftracks->GetEntriesFast() > 0) {
585 reftracks->SetName(GetAODRefArrayName()+"Tracks");
586 aodParticle->AddRefArray(reftracks);
587 }
9415d854 588
1c5acb87 589}
9415d854 590
1c5acb87 591//____________________________________________________________________________
9415d854 592void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD(AliAODPWG4ParticleCorrelation * aodParticle,TRefArray* pl, TString detector)
1c5acb87 593{
9415d854 594 // Neutral Pion Correlation Analysis, find pi0, put them in new output aod, if correlation cuts passed
595 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Make trigger particle - neutral hadron correlation \n");
596
597 if(!NewOutputAOD()){
598 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Output aod not created, set AOD class name and branch name in the configuration file, ABORT! \n");
599 abort();
600 }
1c5acb87 601
1c5acb87 602 Double_t phiTrig = aodParticle->Phi();
9415d854 603 Int_t tag = -1;
1c5acb87 604 TLorentzVector gammai;
605 TLorentzVector gammaj;
606
607 Double_t vertex[] = {0,0,0};
1c5acb87 608 if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
609
610 //Cluster loop, select pairs with good pt, phi and fill AODs or histograms
9415d854 611 //Int_t iEvent= GetReader()->GetEventNumber() ;
612 Int_t nclus = pl->GetEntriesFast();
613 for(Int_t iclus = 0;iclus < nclus ; iclus ++ ){
1c5acb87 614 AliAODCaloCluster * calo = (AliAODCaloCluster *) (pl->At(iclus)) ;
9415d854 615
616 //Cluster selection, not charged, with photon or pi0 id and in fidutial cut
617 Int_t pdg=0;
618 if(!SelectCluster(calo, vertex, gammai, pdg)) continue ;
12524a23 619
620 if(GetDebug() > 2)
9415d854 621 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",
622 detector.Data(), gammai.Pt(),gammai.Phi(),phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt());
623
624 //2 gamma overlapped, found with PID
625 if(pdg == AliCaloPID::kPi0){
477d6cee 626
9415d854 627 //Select only hadrons in pt range
628 if(gammai.Pt() < GetMinPt() || gammai.Pt() > GetMaxPt()) continue ;
1c5acb87 629
9415d854 630 //Selection within angular range
631 Float_t phi = gammai.Phi();
632 if(phi < 0) phi+=TMath::TwoPi();
dde5a268 633 //Float_t deltaphi = TMath::Abs(phiTrig-phi);
634 //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ;
477d6cee 635
9415d854 636 AliAODPWG4Particle pi0 = AliAODPWG4Particle(gammai);
637 //pi0.SetLabel(calo->GetLabel(0));
638 pi0.SetPdg(AliCaloPID::kPi0);
639 pi0.SetDetector(detector);
640
641 if(IsDataMC()){
642 pi0.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack()));
643 if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Origin of candidate %d\n",pi0.GetTag());
644 }//Work with stack also
645 //Set the indeces of the original caloclusters
646 pi0.SetCaloLabel(calo->GetID(),-1);
647 AddAODParticle(pi0);
648
649 if(GetDebug() > 2)
650 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Correlated with selected pi0 (pid): pt %f, phi %f\n",pi0.Pt(),pi0.Phi());
651
652 }// pdg = 111
653
654 //Make invariant mass analysis
655 else if(pdg == AliCaloPID::kPhoton){
656 //Search the photon companion in case it comes from a Pi0 decay
657 //Apply several cuts to select the good pair;
658 for(Int_t jclus = iclus+1; jclus < pl->GetEntries() ; jclus ++ ){
659 AliAODCaloCluster * calo2 = (AliAODCaloCluster *) (pl->At(jclus)) ;
477d6cee 660
9415d854 661 //Cluster selection, not charged with photon or pi0 id and in fidutial cut
662 Int_t pdgj=0;
663 if(!SelectCluster(calo2,vertex, gammaj, pdgj)) continue ;
477d6cee 664
9415d854 665 if(pdgj == AliCaloPID::kPhoton ){
666
667 if((gammai+gammaj).Pt() < GetMinPt() || (gammai+gammaj).Pt() > GetMaxPt()) continue ;
1c5acb87 668
9415d854 669 //Selection within angular range
670 Float_t phi = (gammai+gammaj).Phi();
671 if(phi < 0) phi+=TMath::TwoPi();
dde5a268 672 //Float_t deltaphi = TMath::Abs(phiTrig-phi);
673 //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ;
477d6cee 674
9415d854 675 //Select good pair (aperture and invariant mass)
676 if(GetNeutralMesonSelection()->SelectPair(gammai, gammaj)){
1c5acb87 677
9415d854 678 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",
679 (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M());
1c5acb87 680
9415d854 681 TLorentzVector pi0mom = gammai+gammaj;
682 AliAODPWG4Particle pi0 = AliAODPWG4Particle(pi0mom);
683 //pi0.SetLabel(calo->GetLabel(0));
684 pi0.SetPdg(AliCaloPID::kPi0);
685 pi0.SetDetector(detector);
686 if(IsDataMC()){
687 //Check origin of the candidates
688 Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0), GetMCStack());
689 Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(calo2->GetLabel(0), GetMCStack());
477d6cee 690
9415d854 691 if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
692 if(tag1 == AliMCAnalysisUtils::kMCPi0Decay && tag2 == AliMCAnalysisUtils::kMCPi0Decay){
693
694 //Check if pi0 mother is the same
695 Int_t label1 = calo->GetLabel(0);
696 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
697 label1 = mother1->GetFirstMother();
698 //mother1 = GetMCStack()->Particle(label1);//pi0
699
700 Int_t label2 = calo2->GetLabel(0);
701 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
702 label2 = mother2->GetFirstMother();
703 //mother2 = GetMCStack()->Particle(label2);//pi0
704
705 //printf("mother1 %d, mother2 %d\n",label1,label2);
706 if(label1 == label2)
707 tag = AliMCAnalysisUtils::kMCPi0;
477d6cee 708 }
9415d854 709 }//Work with stack also
710 pi0.SetTag(tag);
711 //Set the indeces of the original caloclusters
712 pi0.SetCaloLabel(calo->GetID(), calo2->GetID());
713 AddAODParticle(pi0);
714
715
716 }//Pair selected
717 }//if pair of gammas
718 }//2nd loop
719 }// if pdg = 22
1c5acb87 720 }//1st loop
721
9415d854 722 if(GetDebug() > 1)
723 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillAOD() - End, %d pi0's found \n",GetOutputAODBranch()->GetEntriesFast());
724}
725
726//____________________________________________________________________________
727void AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms(AliAODPWG4ParticleCorrelation * aodParticle)
728{
729 // Neutral Pion Correlation Analysis
730 if(GetDebug() > 1) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistogramS() - Make trigger particle - pi0 correlation, %d pi0's \n",GetOutputAODBranch()->GetEntriesFast());
731
732 Double_t pt = -100.;
733 Double_t rat = -100.;
734 Double_t phi = -100.;
735 Double_t eta = -100.;
736 Double_t ptTrig = aodParticle->Pt();
737 Double_t phiTrig = aodParticle->Phi();
738 Double_t etaTrig = aodParticle->Eta();
739
740 if(!GetOutputAODBranch()){
741 printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
742 abort();
a3aebfff 743 }
9415d854 744
745 //Loop on stored AOD pi0
746 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
747 if(GetDebug() > 0) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelationFillHistograms() - aod branch entries %d\n", naod);
748 for(Int_t iaod = 0; iaod < naod ; iaod++){
749 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
750 Int_t pdg = pi0->GetPdg();
751
752 if(pdg != AliCaloPID::kPi0) continue;
753 pt = pi0->Pt();
754
755 if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
756
757 //Selection within angular range
758 phi = pi0->Phi();
dde5a268 759 //Float_t deltaphi = TMath::Abs(phiTrig-phi);
760 //if( (deltaphi < fDeltaPhiMinCut) || ( deltaphi > fDeltaPhiMaxCut) ) continue ;
761 Float_t deltaphi = phiTrig-phi;
762 if(deltaphi<-TMath::PiOver2()) deltaphi+=TMath::TwoPi();
763 if(deltaphi>3*TMath::PiOver2()) deltaphi-=TMath::TwoPi();
764
9415d854 765 rat = pt/ptTrig ;
766 phi = pi0->Phi() ;
767 eta = pi0->Eta() ;
768
769 fhEtaNeutral->Fill(ptTrig,eta);
770 fhPhiNeutral->Fill(ptTrig,phi);
771 fhDeltaEtaNeutral->Fill(ptTrig,etaTrig-eta);
772 fhDeltaPhiNeutral->Fill(ptTrig,deltaphi);
123fc3bd 773
774 //delta phi cut for correlation
775 if( (deltaphi > fDeltaPhiMinCut) && ( deltaphi < fDeltaPhiMaxCut) ) {
776 fhDeltaPhiNeutralPt->Fill(pt,deltaphi);
777 fhPtImbalanceNeutral->Fill(ptTrig,rat);
778 }
779 else {
780 fhDeltaPhiUeNeutralPt->Fill(pt,deltaphi);
781 fhPtImbalanceUeNeutral->Fill(ptTrig,rat);
782 }
783 //several UE calculation
784 if(fMakeSeveralUE){
785 if((deltaphi<-fUeDeltaPhiMinCut) && (deltaphi >-fUeDeltaPhiMaxCut)){
786 fhDeltaPhiUeLeftNeutral->Fill(pt,deltaphi);
787 fhPtImbalanceUeLeftNeutral->Fill(ptTrig,rat);
dde5a268 788 }
123fc3bd 789 if((deltaphi>fUeDeltaPhiMinCut) && (deltaphi <fUeDeltaPhiMaxCut)){
790 fhDeltaPhiUeRightNeutral->Fill(pt,deltaphi);
791 fhPtImbalanceUeRightNeutral->Fill(ptTrig,rat);
792 }
793 } //several UE calculation
794
dde5a268 795
9415d854 796 if(GetDebug() > 2 ) printf("AliAnaParticleHadronCorrelation::MakeNeutralCorrelation() - Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f \n",pt,phi,eta);
797
798 }//loop
1c5acb87 799}
800
9415d854 801
1c5acb87 802//____________________________________________________________________________
803Bool_t AliAnaParticleHadronCorrelation::SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) const {
9415d854 804 //Select cluster depending on its pid and acceptance selections
805
806 //Skip matched clusters with tracks
12524a23 807 if(calo->GetNTracksMatched() > 0) return kFALSE;
9415d854 808
12524a23 809 TString detector = "";
810 if(calo->IsPHOSCluster()) detector= "PHOS";
811 else if(calo->IsEMCALCluster()) detector= "EMCAL";
812
9415d854 813 //Check PID
814 calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
815 pdg = AliCaloPID::kPhoton;
816 if(IsCaloPIDOn()){
817 //Get most probable PID, 2 options check PID weights (in MC this option is mandatory)
818 //or redo PID, recommended option for EMCal.
9415d854 819
820 if(!IsCaloPIDRecalculationOn() || GetReader()->GetDataType() == AliCaloTrackReader::kMC )
821 pdg = GetCaloPID()->GetPdg(detector,calo->PID(),mom.E());//PID with weights
822 else
823 pdg = GetCaloPID()->GetPdg(detector,mom,calo);//PID recalculated
824
825 if(GetDebug() > 5) printf("AliAnaParticleHadronCorrelation::SelectCluster() - PDG of identified particle %d\n",pdg);
826
827 //If it does not pass pid, skip
12524a23 828 if(pdg != AliCaloPID::kPhoton && pdg != AliCaloPID::kPi0) {
9415d854 829 return kFALSE ;
830 }
12524a23 831 }//PID on
9415d854 832
833 //Check acceptance selection
834 if(IsFidutialCutOn()){
12524a23 835 Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,detector) ;
836 if(! in ) return kFALSE ;
9415d854 837 }
838
839 if(GetDebug() > 5) printf("AliAnaParticleHadronCorrelation::SelectCluster() - Correlation photon selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg);
840
841 return kTRUE;
842
843}