]>
Commit | Line | Data |
---|---|---|
a3aebfff | 1 | /************************************************************************** |
477d6cee | 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 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: AliAnaParticleIsolation.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ | |
16 | ||
17 | //_________________________________________________________________________ | |
18 | // Class for analysis of particle isolation | |
19 | // Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation) | |
20 | // | |
21 | // Class created from old AliPHOSGammaJet | |
22 | // (see AliRoot versions previous Release 4-09) | |
23 | // | |
24 | // -- Author: Gustavo Conesa (LNF-INFN) | |
25 | ////////////////////////////////////////////////////////////////////////////// | |
26 | ||
27 | ||
28 | // --- ROOT system --- | |
29 | #include <TClonesArray.h> | |
30 | #include <TList.h> | |
0c1383b5 | 31 | #include <TObjString.h> |
477d6cee | 32 | #include <TH2F.h> |
a3aebfff | 33 | //#include <Riostream.h> |
9415d854 | 34 | #include <TClass.h> |
477d6cee | 35 | |
36 | // --- Analysis system --- | |
37 | #include "AliAnaParticleIsolation.h" | |
38 | #include "AliCaloTrackReader.h" | |
39 | #include "AliIsolationCut.h" | |
40 | #include "AliNeutralMesonSelection.h" | |
41 | #include "AliAODPWG4ParticleCorrelation.h" | |
42 | #include "AliMCAnalysisUtils.h" | |
43 | #include "AliAODTrack.h" | |
0ae57829 | 44 | #include "AliVCluster.h" |
477d6cee | 45 | |
46 | ClassImp(AliAnaParticleIsolation) | |
47 | ||
48 | //____________________________________________________________________________ | |
49 | AliAnaParticleIsolation::AliAnaParticleIsolation() : | |
233e0df8 | 50 | AliAnaPartCorrBaseClass(), fCalorimeter(""), |
477d6cee | 51 | fReMakeIC(0), fMakeSeveralIC(0), fMakeInvMass(0), |
52 | fhPtIso(0),fhPhiIso(0),fhEtaIso(0), fhConeSumPt(0), fhPtInCone(0), | |
53 | //Several IC | |
54 | fNCones(0),fNPtThresFrac(0), fConeSizes(), fPtThresholds(), fPtFractions(), | |
55 | //MC | |
56 | fhPtIsoPrompt(0),fhPhiIsoPrompt(0),fhEtaIsoPrompt(0), | |
57 | fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(), | |
58 | fhPtIsoFragmentation(0),fhPhiIsoFragmentation(0),fhEtaIsoFragmentation(0), | |
59 | fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(), | |
60 | fhPtIsoPi0Decay(0),fhPhiIsoPi0Decay(0),fhEtaIsoPi0Decay(0), | |
61 | fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(), | |
62 | fhPtIsoOtherDecay(0),fhPhiIsoOtherDecay(0),fhEtaIsoOtherDecay(0), | |
63 | fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(), | |
64 | fhPtIsoConversion(0),fhPhiIsoConversion(0),fhEtaIsoConversion(0), | |
65 | fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(), | |
66 | fhPtIsoUnknown(0),fhPhiIsoUnknown(0),fhEtaIsoUnknown(0), | |
67 | fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown(), | |
68 | //Histograms settings | |
69 | fHistoNPtSumBins(0), fHistoPtSumMax(0.), fHistoPtSumMin(0.), | |
70 | fHistoNPtInConeBins(0), fHistoPtInConeMax(0.), fHistoPtInConeMin(0.) | |
71 | { | |
72 | //default ctor | |
73 | ||
74 | //Initialize parameters | |
75 | InitParameters(); | |
233e0df8 | 76 | |
477d6cee | 77 | for(Int_t i = 0; i < 5 ; i++){ |
78 | fConeSizes[i] = 0 ; | |
79 | fhPtSumIsolated[i] = 0 ; | |
80 | ||
81 | fhPtSumIsolatedPrompt[i] = 0 ; | |
82 | fhPtSumIsolatedFragmentation[i] = 0 ; | |
83 | fhPtSumIsolatedPi0Decay[i] = 0 ; | |
84 | fhPtSumIsolatedOtherDecay[i] = 0 ; | |
85 | fhPtSumIsolatedConversion[i] = 0 ; | |
86 | fhPtSumIsolatedUnknown[i] = 0 ; | |
87 | ||
88 | for(Int_t j = 0; j < 5 ; j++){ | |
89 | fhPtThresIsolated[i][j] = 0 ; | |
90 | fhPtFracIsolated[i][j] = 0 ; | |
91 | ||
92 | fhPtThresIsolatedPrompt[i][j] = 0 ; | |
93 | fhPtThresIsolatedFragmentation[i][j] = 0 ; | |
94 | fhPtThresIsolatedPi0Decay[i][j] = 0 ; | |
95 | fhPtThresIsolatedOtherDecay[i][j] = 0 ; | |
96 | fhPtThresIsolatedConversion[i][j] = 0 ; | |
97 | fhPtThresIsolatedUnknown[i][j] = 0 ; | |
98 | ||
99 | fhPtFracIsolatedPrompt[i][j] = 0 ; | |
100 | fhPtFracIsolatedFragmentation[i][j] = 0 ; | |
101 | fhPtFracIsolatedPi0Decay[i][j] = 0 ; | |
102 | fhPtFracIsolatedOtherDecay[i][j] = 0 ; | |
103 | fhPtFracIsolatedConversion[i][j] = 0 ; | |
104 | fhPtFracIsolatedUnknown[i][j] = 0 ; | |
105 | ||
106 | } | |
107 | } | |
108 | ||
109 | for(Int_t i = 0; i < 5 ; i++){ | |
110 | fPtFractions[i]= 0 ; | |
111 | fPtThresholds[i]= 0 ; | |
112 | } | |
113 | ||
114 | ||
115 | } | |
477d6cee | 116 | |
117 | //____________________________________________________________________________ | |
118 | AliAnaParticleIsolation::~AliAnaParticleIsolation() | |
119 | { | |
120 | //dtor | |
121 | //do not delete histograms | |
122 | ||
7787a778 | 123 | //delete [] fConeSizes ; |
124 | //delete [] fPtThresholds ; | |
125 | //delete [] fPtFractions ; | |
233e0df8 | 126 | |
477d6cee | 127 | } |
128 | ||
129 | //_________________________________________________________________________ | |
decca433 | 130 | Bool_t AliAnaParticleIsolation::CheckInvMass(const Int_t iaod, const AliAODPWG4Particle * part1) |
477d6cee | 131 | { |
132 | // Search if there is a companion decay photon to the candidate | |
133 | // and discard it in such case | |
134 | // Use it only if isolation candidates are photons | |
135 | // Make sure that no selection on photon pt is done in the input aod photon list. | |
136 | TLorentzVector mom1 = *(part1->Momentum()); | |
137 | TLorentzVector mom2 ; | |
138 | for(Int_t jaod = 0; jaod < GetInputAODBranch()->GetEntriesFast(); jaod++){ | |
139 | if(iaod == jaod) continue ; | |
140 | AliAODPWG4ParticleCorrelation * part2 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(jaod)); | |
141 | mom2 = *(part2->Momentum()); | |
142 | //Select good pair (good phi, pt cuts, aperture and invariant mass) | |
143 | if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)){ | |
1e1befe8 | 144 | if(GetDebug() > 1)printf("AliAnaParticleIsolation::CheckInvMass() - Selected gamma pair: pt %f, phi %f, eta%f\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); |
477d6cee | 145 | return kTRUE ; |
146 | } | |
147 | }//loop | |
148 | ||
149 | return kFALSE; | |
150 | } | |
151 | ||
0c1383b5 | 152 | //________________________________________________________________________ |
153 | TObjString * AliAnaParticleIsolation::GetAnalysisCuts() | |
154 | { | |
155 | //Save parameters used for analysis | |
156 | TString parList ; //this will be list of parameters used for this analysis. | |
5ae09196 | 157 | const Int_t buffersize = 255; |
158 | char onePar[buffersize] ; | |
0c1383b5 | 159 | |
5ae09196 | 160 | snprintf(onePar, buffersize,"--- AliAnaParticleIsolation ---\n") ; |
0c1383b5 | 161 | parList+=onePar ; |
5ae09196 | 162 | snprintf(onePar, buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ; |
0c1383b5 | 163 | parList+=onePar ; |
5ae09196 | 164 | snprintf(onePar, buffersize,"fReMakeIC =%d (Flag for reisolation during histogram filling) \n",fReMakeIC) ; |
0c1383b5 | 165 | parList+=onePar ; |
5ae09196 | 166 | snprintf(onePar, buffersize,"fMakeSeveralIC=%d (Flag for isolation with several cuts at the same time ) \n",fMakeSeveralIC) ; |
0c1383b5 | 167 | parList+=onePar ; |
5ae09196 | 168 | snprintf(onePar, buffersize,"fMakeInvMass=%d (Flag for rejection of candidates with a pi0 inv mass pair) \n",fMakeInvMass) ; |
0c1383b5 | 169 | parList+=onePar ; |
170 | ||
171 | if(fMakeSeveralIC){ | |
5ae09196 | 172 | snprintf(onePar, buffersize,"fNCones =%d (Number of cone sizes) \n",fNCones) ; |
0c1383b5 | 173 | parList+=onePar ; |
5ae09196 | 174 | snprintf(onePar, buffersize,"fNPtThresFrac=%d (Flag for isolation with several cuts at the same time ) \n",fNPtThresFrac) ; |
0c1383b5 | 175 | parList+=onePar ; |
176 | ||
177 | for(Int_t icone = 0; icone < fNCones ; icone++){ | |
5ae09196 | 178 | snprintf(onePar, buffersize,"fConeSizes[%d]=%1.2f (isolation cone size) \n",icone, fConeSizes[icone]) ; |
0c1383b5 | 179 | parList+=onePar ; |
180 | } | |
181 | for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ | |
5ae09196 | 182 | snprintf(onePar, buffersize,"fPtThresholds[%d]=%1.2f (isolation pt threshold) \n",ipt, fPtThresholds[ipt]) ; |
0c1383b5 | 183 | parList+=onePar ; |
184 | } | |
185 | for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ | |
5ae09196 | 186 | snprintf(onePar, buffersize,"fPtFractions[%d]=%1.2f (isolation pt fraction threshold) \n",ipt, fPtFractions[ipt]) ; |
0c1383b5 | 187 | parList+=onePar ; |
188 | } | |
189 | } | |
190 | ||
191 | //Get parameters set in base class. | |
192 | parList += GetBaseParametersList() ; | |
193 | ||
194 | //Get parameters set in IC class. | |
195 | if(!fMakeSeveralIC)parList += GetIsolationCut()->GetICParametersList() ; | |
196 | ||
197 | return new TObjString(parList) ; | |
198 | ||
199 | } | |
200 | ||
477d6cee | 201 | //________________________________________________________________________ |
202 | TList * AliAnaParticleIsolation::GetCreateOutputObjects() | |
203 | { | |
204 | // Create histograms to be saved in output file and | |
205 | // store them in outputContainer | |
206 | TList * outputContainer = new TList() ; | |
207 | outputContainer->SetName("IsolatedParticleHistos") ; | |
208 | ||
5a2dbc3c | 209 | Int_t nptbins = GetHistoPtBins(); |
210 | Int_t nphibins = GetHistoPhiBins(); | |
211 | Int_t netabins = GetHistoEtaBins(); | |
477d6cee | 212 | Float_t ptmax = GetHistoPtMax(); |
213 | Float_t phimax = GetHistoPhiMax(); | |
214 | Float_t etamax = GetHistoEtaMax(); | |
215 | Float_t ptmin = GetHistoPtMin(); | |
216 | Float_t phimin = GetHistoPhiMin(); | |
217 | Float_t etamin = GetHistoEtaMin(); | |
218 | ||
219 | Int_t nptsumbins = fHistoNPtSumBins; | |
220 | Float_t ptsummax = fHistoPtSumMax; | |
221 | Float_t ptsummin = fHistoPtSumMin; | |
222 | Int_t nptinconebins = fHistoNPtInConeBins; | |
223 | Float_t ptinconemax = fHistoPtInConeMax; | |
224 | Float_t ptinconemin = fHistoPtInConeMin; | |
225 | ||
226 | if(!fMakeSeveralIC){ | |
227 | ||
228 | fhConeSumPt = new TH2F | |
a3aebfff | 229 | ("hConePtSum","#Sigma p_{T} in isolation cone ",nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
477d6cee | 230 | fhConeSumPt->SetYTitle("#Sigma p_{T}"); |
a3aebfff | 231 | fhConeSumPt->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 232 | outputContainer->Add(fhConeSumPt) ; |
233 | ||
234 | fhPtInCone = new TH2F | |
a3aebfff | 235 | ("hPtInCone","p_{T} in isolation cone ",nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax); |
477d6cee | 236 | fhPtInCone->SetYTitle("p_{T in cone} (GeV/c)"); |
a3aebfff | 237 | fhPtInCone->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 238 | outputContainer->Add(fhPtInCone) ; |
239 | ||
a3aebfff | 240 | fhPtIso = new TH1F("hPt","Isolated Number of particles",nptbins,ptmin,ptmax); |
477d6cee | 241 | fhPtIso->SetYTitle("N"); |
a3aebfff | 242 | fhPtIso->SetXTitle("p_{T}(GeV/c)"); |
477d6cee | 243 | outputContainer->Add(fhPtIso) ; |
244 | ||
245 | fhPhiIso = new TH2F | |
a3aebfff | 246 | ("hPhi","Isolated Number of particles",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 247 | fhPhiIso->SetYTitle("#phi"); |
a3aebfff | 248 | fhPhiIso->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 249 | outputContainer->Add(fhPhiIso) ; |
250 | ||
251 | fhEtaIso = new TH2F | |
a3aebfff | 252 | ("hEta","Isolated Number of particles",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 253 | fhEtaIso->SetYTitle("#eta"); |
a3aebfff | 254 | fhEtaIso->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 255 | outputContainer->Add(fhEtaIso) ; |
256 | ||
257 | if(IsDataMC()){ | |
258 | ||
a3aebfff | 259 | fhPtIsoPrompt = new TH1F("hPtMCPrompt","Isolated Number of #gamma prompt",nptbins,ptmin,ptmax); |
477d6cee | 260 | fhPtIsoPrompt->SetYTitle("N"); |
261 | fhPtIsoPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); | |
262 | outputContainer->Add(fhPtIsoPrompt) ; | |
263 | ||
264 | fhPhiIsoPrompt = new TH2F | |
a3aebfff | 265 | ("hPhiMCPrompt","Isolated Number of #gamma prompt",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 266 | fhPhiIsoPrompt->SetYTitle("#phi"); |
267 | fhPhiIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); | |
268 | outputContainer->Add(fhPhiIsoPrompt) ; | |
269 | ||
270 | fhEtaIsoPrompt = new TH2F | |
a3aebfff | 271 | ("hEtaMCPrompt","Isolated Number of #gamma prompt ",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 272 | fhEtaIsoPrompt->SetYTitle("#eta"); |
273 | fhEtaIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); | |
274 | outputContainer->Add(fhEtaIsoPrompt) ; | |
275 | ||
a3aebfff | 276 | fhPtIsoFragmentation = new TH1F("hPtMCFragmentation","Isolated Number of #gamma",nptbins,ptmin,ptmax); |
477d6cee | 277 | fhPtIsoFragmentation->SetYTitle("N"); |
278 | fhPtIsoFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); | |
279 | outputContainer->Add(fhPtIsoFragmentation) ; | |
280 | ||
281 | fhPhiIsoFragmentation = new TH2F | |
a3aebfff | 282 | ("hPhiMCFragmentation","Isolated Number of #gamma fragmentation",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 283 | fhPhiIsoFragmentation->SetYTitle("#phi"); |
284 | fhPhiIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); | |
285 | outputContainer->Add(fhPhiIsoFragmentation) ; | |
286 | ||
287 | fhEtaIsoFragmentation = new TH2F | |
a3aebfff | 288 | ("hEtaMCFragmentation","Isolated Number of #gamma fragmentation",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 289 | fhEtaIsoFragmentation->SetYTitle("#eta"); |
290 | fhEtaIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); | |
291 | outputContainer->Add(fhEtaIsoFragmentation) ; | |
292 | ||
a3aebfff | 293 | fhPtIsoPi0Decay = new TH1F("hPtMCPi0Decay","Isolated Number of #gamma from #pi^{0} decay",nptbins,ptmin,ptmax); |
477d6cee | 294 | fhPtIsoPi0Decay->SetYTitle("N"); |
295 | fhPtIsoPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); | |
296 | outputContainer->Add(fhPtIsoPi0Decay) ; | |
297 | ||
298 | fhPhiIsoPi0Decay = new TH2F | |
a3aebfff | 299 | ("hPhiMCPi0Decay","Isolated Number of #gamma from #pi^{0} decay",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 300 | fhPhiIsoPi0Decay->SetYTitle("#phi"); |
301 | fhPhiIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
302 | outputContainer->Add(fhPhiIsoPi0Decay) ; | |
303 | ||
304 | fhEtaIsoPi0Decay = new TH2F | |
a3aebfff | 305 | ("hEtaMCPi0Decay","Isolated Number of #gamma from #pi^{0} decay",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 306 | fhEtaIsoPi0Decay->SetYTitle("#eta"); |
307 | fhEtaIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
308 | outputContainer->Add(fhEtaIsoPi0Decay) ; | |
309 | ||
a3aebfff | 310 | fhPtIsoOtherDecay = new TH1F("hPtMCOtherDecay","Isolated Number of #gamma from non #pi^{0} decay",nptbins,ptmin,ptmax); |
477d6cee | 311 | fhPtIsoOtherDecay->SetYTitle("N"); |
312 | fhPtIsoOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); | |
313 | outputContainer->Add(fhPtIsoOtherDecay) ; | |
314 | ||
315 | fhPhiIsoOtherDecay = new TH2F | |
a3aebfff | 316 | ("hPhiMCOtherDecay","Isolated Number of #gamma from non #pi^{0} decay",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 317 | fhPhiIsoOtherDecay->SetYTitle("#phi"); |
318 | fhPhiIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
319 | outputContainer->Add(fhPhiIsoOtherDecay) ; | |
320 | ||
321 | fhEtaIsoOtherDecay = new TH2F | |
a3aebfff | 322 | ("hEtaMCOtherDecay","Isolated Number of #gamma non #pi^{0} decay",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 323 | fhEtaIsoOtherDecay->SetYTitle("#eta"); |
324 | fhEtaIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); | |
325 | outputContainer->Add(fhEtaIsoOtherDecay) ; | |
326 | ||
a3aebfff | 327 | fhPtIsoConversion = new TH1F("hPtMCConversion","Isolated Number of #gamma converted",nptbins,ptmin,ptmax); |
477d6cee | 328 | fhPtIsoConversion->SetYTitle("N"); |
329 | fhPtIsoConversion->SetXTitle("p_{T #gamma}(GeV/c)"); | |
330 | outputContainer->Add(fhPtIsoConversion) ; | |
331 | ||
332 | fhPhiIsoConversion = new TH2F | |
a3aebfff | 333 | ("hPhiMCConversion","Isolated Number of #gamma converted",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 334 | fhPhiIsoConversion->SetYTitle("#phi"); |
335 | fhPhiIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); | |
336 | outputContainer->Add(fhPhiIsoConversion) ; | |
337 | ||
338 | fhEtaIsoConversion = new TH2F | |
a3aebfff | 339 | ("hEtaMCConversion","Isolated Number of #gamma converted",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 340 | fhEtaIsoConversion->SetYTitle("#eta"); |
341 | fhEtaIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); | |
342 | outputContainer->Add(fhEtaIsoConversion) ; | |
343 | ||
a3aebfff | 344 | fhPtIsoUnknown = new TH1F("hPtMCUnknown","Isolated Number of non #gamma particles",nptbins,ptmin,ptmax); |
477d6cee | 345 | fhPtIsoUnknown->SetYTitle("N"); |
a3aebfff | 346 | fhPtIsoUnknown->SetXTitle("p_{T}(GeV/c)"); |
477d6cee | 347 | outputContainer->Add(fhPtIsoUnknown) ; |
348 | ||
349 | fhPhiIsoUnknown = new TH2F | |
a3aebfff | 350 | ("hPhiMCUnknown","Isolated Number of non #gamma particles",nptbins,ptmin,ptmax,nphibins,phimin,phimax); |
477d6cee | 351 | fhPhiIsoUnknown->SetYTitle("#phi"); |
a3aebfff | 352 | fhPhiIsoUnknown->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 353 | outputContainer->Add(fhPhiIsoUnknown) ; |
354 | ||
355 | fhEtaIsoUnknown = new TH2F | |
a3aebfff | 356 | ("hEtaMCUnknown","Isolated Number of non #gamma particles",nptbins,ptmin,ptmax,netabins,etamin,etamax); |
477d6cee | 357 | fhEtaIsoUnknown->SetYTitle("#eta"); |
a3aebfff | 358 | fhEtaIsoUnknown->SetXTitle("p_{T} (GeV/c)"); |
477d6cee | 359 | outputContainer->Add(fhEtaIsoUnknown) ; |
360 | }//Histos with MC | |
361 | ||
362 | } | |
363 | ||
364 | if(fMakeSeveralIC){ | |
5ae09196 | 365 | const Int_t buffersize = 255; |
366 | char name[buffersize]; | |
367 | char title[buffersize]; | |
477d6cee | 368 | for(Int_t icone = 0; icone<fNCones; icone++){ |
5ae09196 | 369 | snprintf(name, buffersize,"hPtSum_Cone_%d",icone); |
370 | snprintf(title, buffersize,"Candidate cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 371 | fhPtSumIsolated[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
372 | fhPtSumIsolated[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
373 | fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)"); | |
374 | outputContainer->Add(fhPtSumIsolated[icone]) ; | |
375 | ||
376 | if(IsDataMC()){ | |
5ae09196 | 377 | snprintf(name, buffersize,"hPtSumPrompt_Cone_%d",icone); |
378 | snprintf(title, buffersize,"Candidate Prompt cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 379 | fhPtSumIsolatedPrompt[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
380 | fhPtSumIsolatedPrompt[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
381 | fhPtSumIsolatedPrompt[icone]->SetXTitle("p_{T} (GeV/c)"); | |
382 | outputContainer->Add(fhPtSumIsolatedPrompt[icone]) ; | |
383 | ||
5ae09196 | 384 | snprintf(name, buffersize,"hPtSumFragmentation_Cone_%d",icone); |
385 | snprintf(title, buffersize,"Candidate Fragmentation cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 386 | fhPtSumIsolatedFragmentation[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
387 | fhPtSumIsolatedFragmentation[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
388 | fhPtSumIsolatedFragmentation[icone]->SetXTitle("p_{T} (GeV/c)"); | |
389 | outputContainer->Add(fhPtSumIsolatedFragmentation[icone]) ; | |
390 | ||
5ae09196 | 391 | snprintf(name, buffersize,"hPtSumPi0Decay_Cone_%d",icone); |
392 | snprintf(title, buffersize,"Candidate Pi0Decay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 393 | fhPtSumIsolatedPi0Decay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
394 | fhPtSumIsolatedPi0Decay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
395 | fhPtSumIsolatedPi0Decay[icone]->SetXTitle("p_{T} (GeV/c)"); | |
396 | outputContainer->Add(fhPtSumIsolatedPi0Decay[icone]) ; | |
397 | ||
5ae09196 | 398 | snprintf(name, buffersize,"hPtSumOtherDecay_Cone_%d",icone); |
399 | snprintf(title, buffersize,"Candidate OtherDecay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 400 | fhPtSumIsolatedOtherDecay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
401 | fhPtSumIsolatedOtherDecay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
402 | fhPtSumIsolatedOtherDecay[icone]->SetXTitle("p_{T} (GeV/c)"); | |
403 | outputContainer->Add(fhPtSumIsolatedOtherDecay[icone]) ; | |
404 | ||
5ae09196 | 405 | snprintf(name, buffersize,"hPtSumConversion_Cone_%d",icone); |
406 | snprintf(title, buffersize,"Candidate Conversion cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 407 | fhPtSumIsolatedConversion[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
408 | fhPtSumIsolatedConversion[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
409 | fhPtSumIsolatedConversion[icone]->SetXTitle("p_{T} (GeV/c)"); | |
410 | outputContainer->Add(fhPtSumIsolatedConversion[icone]) ; | |
411 | ||
5ae09196 | 412 | snprintf(name, buffersize,"hPtSumUnknown_Cone_%d",icone); |
413 | snprintf(title, buffersize,"Candidate Unknown cone sum p_{T} for cone size %d vs candidate p_{T}",icone); | |
477d6cee | 414 | fhPtSumIsolatedUnknown[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); |
415 | fhPtSumIsolatedUnknown[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); | |
416 | fhPtSumIsolatedUnknown[icone]->SetXTitle("p_{T} (GeV/c)"); | |
417 | outputContainer->Add(fhPtSumIsolatedUnknown[icone]) ; | |
418 | ||
419 | }//Histos with MC | |
420 | ||
421 | for(Int_t ipt = 0; ipt<fNPtThresFrac;ipt++){ | |
5ae09196 | 422 | snprintf(name, buffersize,"hPtThres_Cone_%d_Pt%d",icone,ipt); |
423 | snprintf(title, buffersize,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 424 | fhPtThresIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
425 | fhPtThresIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
426 | outputContainer->Add(fhPtThresIsolated[icone][ipt]) ; | |
427 | ||
5ae09196 | 428 | snprintf(name, buffersize,"hPtFrac_Cone_%d_Pt%d",icone,ipt); |
429 | snprintf(title, buffersize,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 430 | fhPtFracIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
431 | fhPtFracIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
432 | outputContainer->Add(fhPtFracIsolated[icone][ipt]) ; | |
433 | ||
434 | if(IsDataMC()){ | |
5ae09196 | 435 | snprintf(name, buffersize,"hPtThresMCPrompt_Cone_%d_Pt%d",icone,ipt); |
436 | snprintf(title, buffersize,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 437 | fhPtThresIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
438 | fhPtThresIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
439 | outputContainer->Add(fhPtThresIsolatedPrompt[icone][ipt]) ; | |
440 | ||
5ae09196 | 441 | snprintf(name, buffersize,"hPtFracMCPrompt_Cone_%d_Pt%d",icone,ipt); |
442 | snprintf(title, buffersize,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 443 | fhPtFracIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
444 | fhPtFracIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
445 | outputContainer->Add(fhPtFracIsolatedPrompt[icone][ipt]) ; | |
446 | ||
5ae09196 | 447 | snprintf(name, buffersize,"hPtThresMCFragmentation_Cone_%d_Pt%d",icone,ipt); |
448 | snprintf(title, buffersize,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 449 | fhPtThresIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
450 | fhPtThresIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
451 | outputContainer->Add(fhPtThresIsolatedFragmentation[icone][ipt]) ; | |
452 | ||
5ae09196 | 453 | snprintf(name, buffersize,"hPtFracMCFragmentation_Cone_%d_Pt%d",icone,ipt); |
454 | snprintf(title, buffersize,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 455 | fhPtFracIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
456 | fhPtFracIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
457 | outputContainer->Add(fhPtFracIsolatedFragmentation[icone][ipt]) ; | |
458 | ||
5ae09196 | 459 | snprintf(name, buffersize,"hPtThresMCPi0Decay_Cone_%d_Pt%d",icone,ipt); |
460 | snprintf(title, buffersize,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 461 | fhPtThresIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
462 | fhPtThresIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
463 | outputContainer->Add(fhPtThresIsolatedPi0Decay[icone][ipt]) ; | |
464 | ||
5ae09196 | 465 | snprintf(name, buffersize,"hPtFracMCPi0Decay_Cone_%d_Pt%d",icone,ipt); |
466 | snprintf(title, buffersize,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 467 | fhPtFracIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
468 | fhPtFracIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
469 | outputContainer->Add(fhPtFracIsolatedPi0Decay[icone][ipt]) ; | |
470 | ||
5ae09196 | 471 | snprintf(name, buffersize,"hPtThresMCOtherDecay_Cone_%d_Pt%d",icone,ipt); |
472 | snprintf(title, buffersize,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 473 | fhPtThresIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
474 | fhPtThresIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
475 | outputContainer->Add(fhPtThresIsolatedOtherDecay[icone][ipt]) ; | |
476 | ||
5ae09196 | 477 | snprintf(name, buffersize,"hPtFracMCOtherDecay_Cone_%d_Pt%d",icone,ipt); |
478 | snprintf(title, buffersize,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 479 | fhPtFracIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
480 | fhPtFracIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
481 | outputContainer->Add(fhPtFracIsolatedOtherDecay[icone][ipt]) ; | |
482 | ||
5ae09196 | 483 | snprintf(name, buffersize,"hPtThresMCConversion_Cone_%d_Pt%d",icone,ipt); |
484 | snprintf(title, buffersize,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 485 | fhPtThresIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
486 | fhPtThresIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
487 | outputContainer->Add(fhPtThresIsolatedConversion[icone][ipt]) ; | |
488 | ||
5ae09196 | 489 | snprintf(name, buffersize,"hPtFracMCConversion_Cone_%d_Pt%d",icone,ipt); |
490 | snprintf(title, buffersize,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 491 | fhPtFracIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
492 | fhPtFracIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
493 | outputContainer->Add(fhPtFracIsolatedConversion[icone][ipt]) ; | |
494 | ||
5ae09196 | 495 | snprintf(name, buffersize,"hPtThresMCUnknown_Cone_%d_Pt%d",icone,ipt); |
496 | snprintf(title, buffersize,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 497 | fhPtThresIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
498 | fhPtThresIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
499 | outputContainer->Add(fhPtThresIsolatedUnknown[icone][ipt]) ; | |
500 | ||
5ae09196 | 501 | snprintf(name, buffersize,"hPtFracMCUnknown_Cone_%d_Pt%d",icone,ipt); |
502 | snprintf(title, buffersize,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); | |
477d6cee | 503 | fhPtFracIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); |
504 | fhPtFracIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); | |
505 | outputContainer->Add(fhPtFracIsolatedUnknown[icone][ipt]) ; | |
506 | ||
507 | }//Histos with MC | |
508 | ||
509 | }//icone loop | |
510 | }//ipt loop | |
511 | } | |
512 | ||
513 | //Keep neutral meson selection histograms if requiered | |
514 | //Setting done in AliNeutralMesonSelection | |
515 | if(fMakeInvMass && GetNeutralMesonSelection()){ | |
516 | TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; | |
517 | if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) | |
518 | for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; | |
a14fd526 | 519 | delete nmsHistos; |
477d6cee | 520 | } |
521 | ||
477d6cee | 522 | return outputContainer ; |
523 | ||
524 | } | |
525 | ||
526 | //__________________________________________________________________ | |
527 | void AliAnaParticleIsolation::MakeAnalysisFillAOD() | |
528 | { | |
529 | //Do analysis and fill aods | |
530 | //Search for the isolated photon in fCalorimeter with pt > GetMinPt() | |
531 | ||
532 | if(!GetInputAODBranch()){ | |
a3aebfff | 533 | printf("AliAnaParticleIsolation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data()); |
477d6cee | 534 | abort(); |
535 | } | |
a3aebfff | 536 | |
9415d854 | 537 | if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation")){ |
538 | printf("AliAnaParticleIsolation::MakeAnalysisFillAOD() - Wrong type of AOD object, change AOD class name in input AOD: It should be <AliAODPWG4ParticleCorrelation> and not <%s> \n",GetInputAODBranch()->GetClass()->GetName()); | |
539 | abort(); | |
540 | } | |
541 | ||
477d6cee | 542 | Int_t n = 0, nfrac = 0; |
543 | Bool_t isolated = kFALSE ; | |
544 | Float_t coneptsum = 0 ; | |
4a745797 | 545 | TObjArray * pl = 0x0; ; |
477d6cee | 546 | |
547 | //Select the calorimeter for candidate isolation with neutral particles | |
548 | if(fCalorimeter == "PHOS") | |
549 | pl = GetAODPHOS(); | |
550 | else if (fCalorimeter == "EMCAL") | |
551 | pl = GetAODEMCAL(); | |
552 | ||
477d6cee | 553 | //Loop on AOD branch, filled previously in AliAnaPhoton |
554 | TLorentzVector mom ; | |
1e1befe8 | 555 | Int_t naod = GetInputAODBranch()->GetEntriesFast(); |
556 | if(GetDebug() > 0) printf("AliAnaParticleIsolation::MakeAnalysisFillAOD() - Input aod branch entries %d\n", naod); | |
557 | for(Int_t iaod = 0; iaod < naod; iaod++){ | |
a3aebfff | 558 | AliAODPWG4ParticleCorrelation * aodinput = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); |
477d6cee | 559 | |
560 | //If too small or too large pt, skip | |
a3aebfff | 561 | if(aodinput->Pt() < GetMinPt() || aodinput->Pt() > GetMaxPt() ) continue ; |
477d6cee | 562 | |
563 | //Check invariant mass, if pi0, skip. | |
564 | Bool_t decay = kFALSE ; | |
a3aebfff | 565 | if(fMakeInvMass) decay = CheckInvMass(iaod,aodinput); |
477d6cee | 566 | if(decay) continue ; |
a3aebfff | 567 | |
568 | //After cuts, study isolation | |
477d6cee | 569 | n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; |
233e0df8 | 570 | GetIsolationCut()->MakeIsolationCut(GetAODCTS(),pl,GetReader(), kTRUE, aodinput, GetAODObjArrayName(), n,nfrac,coneptsum, isolated); |
a3aebfff | 571 | aodinput->SetIsolated(isolated); |
1e1befe8 | 572 | if(GetDebug() > 1 && isolated) printf("AliAnaParticleIsolation::MakeAnalysisFillAOD() : Particle %d IS ISOLATED \n",iaod); |
573 | ||
477d6cee | 574 | }//loop |
575 | ||
1e1befe8 | 576 | if(GetDebug() > 1) printf("AliAnaParticleIsolation::MakeAnalysisFillAOD() - End fill AODs \n"); |
477d6cee | 577 | |
578 | } | |
579 | ||
580 | //__________________________________________________________________ | |
581 | void AliAnaParticleIsolation::MakeAnalysisFillHistograms() | |
582 | { | |
583 | //Do analysis and fill histograms | |
584 | Int_t n = 0, nfrac = 0; | |
585 | Bool_t isolated = kFALSE ; | |
586 | Float_t coneptsum = 0 ; | |
477d6cee | 587 | //Loop on stored AOD |
588 | Int_t naod = GetInputAODBranch()->GetEntriesFast(); | |
1e1befe8 | 589 | if(GetDebug() > 0) printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Histo aod branch entries %d\n", naod); |
1e68a3f4 | 590 | |
233e0df8 | 591 | //Get vertex for photon momentum calculation |
592 | Double_t vertex[]={0,0,0} ; //vertex ; | |
1e68a3f4 | 593 | //Double_t vertex2[]={0,0,0} ; //vertex ; |
edd59991 | 594 | if(GetReader()->GetDataType() != AliCaloTrackReader::kMC) { |
233e0df8 | 595 | GetReader()->GetVertex(vertex); |
1e68a3f4 | 596 | //if(GetReader()->GetSecondInputAODTree()) GetReader()->GetSecondInputAODVertex(vertex2); |
233e0df8 | 597 | } |
598 | ||
477d6cee | 599 | for(Int_t iaod = 0; iaod < naod ; iaod++){ |
600 | AliAODPWG4ParticleCorrelation* aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); | |
1e68a3f4 | 601 | |
a3aebfff | 602 | Bool_t isolation = aod->IsIsolated(); |
477d6cee | 603 | Float_t ptcluster = aod->Pt(); |
604 | Float_t phicluster = aod->Phi(); | |
605 | Float_t etacluster = aod->Eta(); | |
a3aebfff | 606 | //Recover reference arrays with clusters and tracks |
1e68a3f4 | 607 | TObjArray * refclusters = aod->GetObjArray(GetAODObjArrayName()+"Clusters"); |
b6991fc4 | 608 | TObjArray * reftracks = aod->GetObjArray(GetAODObjArrayName()+"Tracks"); |
1e68a3f4 | 609 | |
610 | //If too small or too large pt, skip | |
611 | if(aod->Pt() < GetMinPt() || aod->Pt() > GetMaxPt() ) continue ; | |
b6991fc4 | 612 | |
477d6cee | 613 | if(fMakeSeveralIC) { |
614 | //Analysis of multiple IC at same time | |
615 | MakeSeveralICAnalysis(aod); | |
616 | continue; | |
617 | } | |
618 | else if(fReMakeIC){ | |
619 | //In case a more strict IC is needed in the produced AOD | |
620 | n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; | |
233e0df8 | 621 | GetIsolationCut()->MakeIsolationCut(reftracks, refclusters, GetReader(), kFALSE, aod, "", n,nfrac,coneptsum, isolated); |
1e1befe8 | 622 | fhConeSumPt->Fill(ptcluster,coneptsum); |
1e68a3f4 | 623 | if(GetDebug() > 0) printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Energy Sum in Isolation Cone %2.2f\n", coneptsum); |
624 | } | |
477d6cee | 625 | |
626 | //Fill pt distribution of particles in cone | |
627 | //Tracks | |
628 | coneptsum=0; | |
1e68a3f4 | 629 | if(reftracks){ |
630 | for(Int_t itrack=0; itrack < reftracks->GetEntriesFast(); itrack++){ | |
631 | AliAODTrack* track = (AliAODTrack *) reftracks->At(itrack); | |
632 | fhPtInCone->Fill(ptcluster,TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py())); | |
633 | coneptsum+=track->Pt(); | |
634 | } | |
635 | } | |
a3aebfff | 636 | |
477d6cee | 637 | //CaloClusters |
1e68a3f4 | 638 | if(refclusters){ |
639 | TLorentzVector mom ; | |
640 | for(Int_t icalo=0; icalo < refclusters->GetEntriesFast(); icalo++){ | |
0ae57829 | 641 | AliVCluster* calo = (AliVCluster *) refclusters->At(icalo); |
1e68a3f4 | 642 | Int_t input = 0; |
643 | // if (fCalorimeter == "EMCAL" && GetReader()->GetAODEMCALNormalInputEntries() <= icalo) input = 1 ; | |
644 | // else if(fCalorimeter == "PHOS" && GetReader()->GetAODPHOSNormalInputEntries() <= icalo) input = 1; | |
645 | ||
646 | //Get Momentum vector, | |
647 | if (input == 0) calo->GetMomentum(mom,vertex) ;//Assume that come from vertex in straight line | |
648 | // else if(input == 1) calo->GetMomentum(mom,vertex2);//Assume that come from vertex in straight line | |
649 | ||
650 | fhPtInCone->Fill(ptcluster, mom.Pt()); | |
651 | coneptsum+=mom.Pt(); | |
652 | } | |
477d6cee | 653 | } |
a3aebfff | 654 | |
1e68a3f4 | 655 | if(GetDebug() > 1) printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Particle %d Energy Sum in Isolation Cone %2.2f\n", iaod, coneptsum); |
1e1befe8 | 656 | |
1e68a3f4 | 657 | if(!fReMakeIC) fhConeSumPt->Fill(ptcluster,coneptsum); |
477d6cee | 658 | |
659 | if(isolation){ | |
1e68a3f4 | 660 | |
661 | if(GetDebug() > 1) printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Particle %d ISOLATED, fill histograms\n", iaod); | |
662 | ||
477d6cee | 663 | fhPtIso ->Fill(ptcluster); |
664 | fhPhiIso ->Fill(ptcluster,phicluster); | |
665 | fhEtaIso ->Fill(ptcluster,etacluster); | |
666 | ||
667 | if(IsDataMC()){ | |
1e68a3f4 | 668 | Int_t tag =aod->GetTag(); |
669 | ||
670 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt)){ | |
671 | fhPtIsoPrompt ->Fill(ptcluster); | |
672 | fhPhiIsoPrompt ->Fill(ptcluster,phicluster); | |
673 | fhEtaIsoPrompt ->Fill(ptcluster,etacluster); | |
674 | } | |
675 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)) | |
676 | { | |
677 | fhPtIsoFragmentation ->Fill(ptcluster); | |
678 | fhPhiIsoFragmentation ->Fill(ptcluster,phicluster); | |
679 | fhEtaIsoFragmentation ->Fill(ptcluster,etacluster); | |
680 | } | |
681 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)) | |
682 | { | |
683 | fhPtIsoPi0Decay ->Fill(ptcluster); | |
684 | fhPhiIsoPi0Decay ->Fill(ptcluster,phicluster); | |
685 | fhEtaIsoPi0Decay ->Fill(ptcluster,etacluster); | |
686 | } | |
687 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) | |
688 | { | |
689 | fhPtIsoOtherDecay ->Fill(ptcluster); | |
690 | fhPhiIsoOtherDecay ->Fill(ptcluster,phicluster); | |
691 | fhEtaIsoOtherDecay ->Fill(ptcluster,etacluster); | |
692 | } | |
693 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) | |
694 | { | |
695 | fhPtIsoConversion ->Fill(ptcluster); | |
696 | fhPhiIsoConversion ->Fill(ptcluster,phicluster); | |
697 | fhEtaIsoConversion ->Fill(ptcluster,etacluster); | |
698 | } | |
699 | else | |
700 | { | |
701 | fhPtIsoUnknown ->Fill(ptcluster); | |
702 | fhPhiIsoUnknown ->Fill(ptcluster,phicluster); | |
703 | fhEtaIsoUnknown ->Fill(ptcluster,etacluster); | |
704 | } | |
477d6cee | 705 | }//Histograms with MC |
706 | ||
707 | }//Isolated histograms | |
708 | ||
709 | }// aod loop | |
710 | ||
711 | } | |
712 | ||
713 | //____________________________________________________________________________ | |
714 | void AliAnaParticleIsolation::InitParameters() | |
715 | { | |
716 | ||
717 | //Initialize the parameters of the analysis. | |
a3aebfff | 718 | SetInputAODName("PWG4Particle"); |
591cc579 | 719 | SetAODObjArrayName("IsolationCone"); |
a3aebfff | 720 | AddToHistogramsName("AnaIsolation_"); |
721 | ||
477d6cee | 722 | fCalorimeter = "PHOS" ; |
723 | fReMakeIC = kFALSE ; | |
724 | fMakeSeveralIC = kFALSE ; | |
725 | fMakeInvMass = kFALSE ; | |
726 | ||
727 | //----------- Several IC----------------- | |
728 | fNCones = 5 ; | |
729 | fNPtThresFrac = 5 ; | |
730 | fConeSizes[0] = 0.1; fConeSizes[1] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4; fConeSizes[4] = 0.5; | |
731 | fPtThresholds[0] = 1.; fPtThresholds[1] = 2.; fPtThresholds[2] = 3.; fPtThresholds[3] = 4.; fPtThresholds[4] = 5.; | |
732 | fPtFractions[0] = 0.05; fPtFractions[1] = 0.075; fPtFractions[2] = 0.1; fPtFractions[3] = 1.25; fPtFractions[4] = 1.5; | |
733 | ||
734 | //------------- Histograms settings ------- | |
735 | fHistoNPtSumBins = 100 ; | |
736 | fHistoPtSumMax = 50 ; | |
737 | fHistoPtSumMin = 0. ; | |
738 | ||
739 | fHistoNPtInConeBins = 100 ; | |
740 | fHistoPtInConeMax = 50 ; | |
741 | fHistoPtInConeMin = 0. ; | |
742 | ||
743 | } | |
744 | ||
745 | //__________________________________________________________________ | |
746 | void AliAnaParticleIsolation::MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelation* ph) | |
747 | { | |
748 | //Isolation Cut Analysis for both methods and different pt cuts and cones | |
749 | Float_t ptC = ph->Pt(); | |
750 | Int_t tag = ph->GetTag(); | |
751 | ||
752 | //Keep original setting used when filling AODs, reset at end of analysis | |
753 | Float_t ptthresorg = GetIsolationCut()->GetPtThreshold(); | |
754 | Float_t ptfracorg = GetIsolationCut()->GetPtFraction(); | |
755 | Float_t rorg = GetIsolationCut()->GetConeSize(); | |
756 | ||
757 | Float_t coneptsum = 0 ; | |
758 | Int_t n[10][10];//[fNCones][fNPtThresFrac]; | |
759 | Int_t nfrac[10][10];//[fNCones][fNPtThresFrac]; | |
760 | Bool_t isolated = kFALSE; | |
761 | ||
762 | //Loop on cone sizes | |
763 | for(Int_t icone = 0; icone<fNCones; icone++){ | |
764 | GetIsolationCut()->SetConeSize(fConeSizes[icone]); | |
765 | coneptsum = 0 ; | |
a3aebfff | 766 | |
477d6cee | 767 | //Loop on ptthresholds |
768 | for(Int_t ipt = 0; ipt<fNPtThresFrac ;ipt++){ | |
769 | n[icone][ipt]=0; | |
770 | nfrac[icone][ipt]=0; | |
771 | GetIsolationCut()->SetPtThreshold(fPtThresholds[ipt]); | |
591cc579 | 772 | GetIsolationCut()->MakeIsolationCut(ph->GetObjArray(GetAODObjArrayName()+"Tracks"), |
773 | ph->GetObjArray(GetAODObjArrayName()+"Clusters"), | |
233e0df8 | 774 | GetReader(), kFALSE, ph, "",n[icone][ipt],nfrac[icone][ipt],coneptsum, isolated); |
a3aebfff | 775 | |
477d6cee | 776 | //Normal ptThreshold cut |
777 | if(n[icone][ipt] == 0) { | |
778 | fhPtThresIsolated[icone][ipt]->Fill(ptC); | |
779 | if(IsDataMC()){ | |
591cc579 | 780 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt)) fhPtThresIsolatedPrompt[icone][ipt]->Fill(ptC) ; |
781 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) fhPtThresIsolatedConversion[icone][ipt]->Fill(ptC) ; | |
782 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)) fhPtThresIsolatedFragmentation[icone][ipt]->Fill(ptC) ; | |
783 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)) fhPtThresIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; | |
784 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay)) fhPtThresIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; | |
477d6cee | 785 | else fhPtThresIsolatedUnknown[icone][ipt]->Fill(ptC) ; |
786 | } | |
787 | } | |
788 | ||
789 | //Pt threshold on pt cand/ pt in cone fraction | |
790 | if(nfrac[icone][ipt] == 0) { | |
791 | fhPtFracIsolated[icone][ipt]->Fill(ptC); | |
792 | if(IsDataMC()){ | |
591cc579 | 793 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt)) fhPtFracIsolatedPrompt[icone][ipt]->Fill(ptC) ; |
794 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) fhPtFracIsolatedConversion[icone][ipt]->Fill(ptC) ; | |
795 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)) fhPtFracIsolatedFragmentation[icone][ipt]->Fill(ptC) ; | |
796 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)) fhPtFracIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; | |
797 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay)) fhPtFracIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; | |
477d6cee | 798 | else fhPtFracIsolatedUnknown[icone][ipt]->Fill(ptC) ; |
799 | } | |
800 | } | |
801 | }//pt thresh loop | |
802 | ||
803 | //Sum in cone histograms | |
804 | fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ; | |
805 | if(IsDataMC()){ | |
591cc579 | 806 | if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt)) fhPtSumIsolatedPrompt[icone]->Fill(ptC,coneptsum) ; |
807 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) fhPtSumIsolatedConversion[icone]->Fill(ptC,coneptsum) ; | |
808 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)) fhPtSumIsolatedFragmentation[icone]->Fill(ptC,coneptsum) ; | |
809 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)) fhPtSumIsolatedPi0Decay[icone]->Fill(ptC,coneptsum) ; | |
810 | else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) || GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay)) fhPtSumIsolatedOtherDecay[icone]->Fill(ptC,coneptsum) ; | |
477d6cee | 811 | else fhPtSumIsolatedUnknown[icone]->Fill(ptC,coneptsum) ; |
812 | } | |
813 | ||
814 | }//cone size loop | |
815 | ||
816 | //Reset original parameters for AOD analysis | |
817 | GetIsolationCut()->SetPtThreshold(ptthresorg); | |
818 | GetIsolationCut()->SetPtFraction(ptfracorg); | |
819 | GetIsolationCut()->SetConeSize(rorg); | |
820 | ||
821 | } | |
822 | ||
823 | //__________________________________________________________________ | |
824 | void AliAnaParticleIsolation::Print(const Option_t * opt) const | |
825 | { | |
826 | ||
827 | //Print some relevant parameters set for the analysis | |
828 | if(! opt) | |
829 | return; | |
830 | ||
831 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; | |
a3aebfff | 832 | AliAnaPartCorrBaseClass::Print(" "); |
477d6cee | 833 | |
834 | printf("ReMake Isolation = %d \n", fReMakeIC) ; | |
835 | printf("Make Several Isolation = %d \n", fMakeSeveralIC) ; | |
836 | printf("Calorimeter for isolation = %s \n", fCalorimeter.Data()) ; | |
837 | ||
838 | if(fMakeSeveralIC){ | |
839 | printf("N Cone Sizes = %d\n", fNCones) ; | |
840 | printf("Cone Sizes = \n") ; | |
841 | for(Int_t i = 0; i < fNCones; i++) | |
842 | printf(" %1.2f;", fConeSizes[i]) ; | |
843 | printf(" \n") ; | |
844 | ||
845 | printf("N pT thresholds/fractions = %d\n", fNPtThresFrac) ; | |
846 | printf(" pT thresholds = \n") ; | |
847 | for(Int_t i = 0; i < fNPtThresFrac; i++) | |
848 | printf(" %2.2f;", fPtThresholds[i]) ; | |
849 | ||
850 | printf(" \n") ; | |
851 | ||
852 | printf(" pT fractions = \n") ; | |
853 | for(Int_t i = 0; i < fNPtThresFrac; i++) | |
854 | printf(" %2.2f;", fPtFractions[i]) ; | |
855 | ||
856 | } | |
857 | ||
858 | printf("Histograms: %3.1f < pT sum < %3.1f, Nbin = %d\n", fHistoPtSumMin, fHistoPtSumMax, fHistoNPtSumBins); | |
859 | printf("Histograms: %3.1f < pT in cone < %3.1f, Nbin = %d\n", fHistoPtInConeMin, fHistoPtInConeMax, fHistoNPtInConeBins); | |
860 | ||
861 | printf(" \n") ; | |
862 | ||
863 | } | |
864 |