]>
Commit | Line | Data |
---|---|---|
35151011 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2008, 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 | ||
16 | /* $Id$ */ | |
17 | ||
18 | //************************************************************************* | |
19 | // Class AliAnalysisTaskSEDplusCorrelations | |
20 | // AliAnalysisTaskSE for the D+ candidates Invariant Mass Histogram and | |
21 | //comparison of heavy-flavour decay candidates | |
22 | // to MC truth (kinematics stored in the AOD) | |
23 | // Authors: Sadhana Dash (correlation) | |
24 | ///////////////////////////////////////////////////////////// | |
25 | ||
26 | #include <TClonesArray.h> | |
27 | #include <TNtuple.h> | |
28 | #include <TCanvas.h> | |
29 | #include <TList.h> | |
30 | #include <TString.h> | |
31 | #include <TDatabasePDG.h> | |
32 | ||
33 | #include <AliAnalysisDataSlot.h> | |
34 | #include <AliAnalysisDataContainer.h> | |
35 | #include "AliAnalysisManager.h" | |
36 | #include "AliRDHFCutsDplustoKpipi.h" | |
37 | #include "AliAODHandler.h" | |
38 | #include "AliAODEvent.h" | |
39 | #include "AliAODPidHF.h" | |
40 | #include "AliAODVertex.h" | |
41 | #include "AliAODTrack.h" | |
42 | #include "AliAODRecoDecayHF3Prong.h" | |
43 | #include "AliAnalysisVertexingHF.h" | |
44 | #include "AliAnalysisTaskSE.h" | |
45 | #include "AliAnalysisTaskSEDplusCorrelations.h" | |
46 | #include "AliNormalizationCounter.h" | |
47 | #include "AliVParticle.h" | |
48 | #include "AliHFAssociatedTrackCuts.h" | |
49 | #include "AliReducedParticle.h" | |
50 | #include "AliHFCorrelator.h" | |
51 | ||
52 | ||
53 | using std::cout; | |
54 | using std::endl; | |
55 | ||
56 | ClassImp(AliAnalysisTaskSEDplusCorrelations) | |
57 | ||
58 | ||
59 | //________________________________________________________________________ | |
60 | AliAnalysisTaskSEDplusCorrelations::AliAnalysisTaskSEDplusCorrelations(): | |
61 | AliAnalysisTaskSE(), | |
62 | fOutput(0), | |
63 | fCorrelator(0), | |
64 | fSelect(0), | |
65 | fDisplacement(0), | |
66 | fHistNEvents(0), | |
67 | fMCSources(0), | |
68 | fK0Origin(0), | |
69 | fKaonOrigin(0), | |
70 | fInvMassK0S(0), | |
71 | fEventMix(0), | |
72 | fPtVsMass(0), | |
73 | fPtVsMassTC(0), | |
74 | fYVsPt(0), | |
75 | fYVsPtTC(0), | |
76 | fYVsPtSig(0), | |
77 | fYVsPtSigTC(0), | |
78 | fUpmasslimit(1.965), | |
79 | fLowmasslimit(1.765), | |
80 | fNPtBins(0), | |
81 | fBinWidth(0.002), | |
82 | fListCuts(0), | |
83 | fListCutsAsso(0), | |
84 | fRDCutsAnalysis(0), | |
85 | fCuts(0), | |
86 | fCounter(0), | |
87 | fReadMC(kFALSE), | |
88 | fUseBit(kTRUE), | |
89 | fMixing(kFALSE), | |
90 | fSystem(kFALSE) | |
91 | { | |
92 | // Default constructor | |
93 | ||
94 | for(Int_t i=0;i<3*kMaxPtBins;i++){ | |
95 | if(fMassVsdPhiHistHad[i])fMassVsdPhiHistHad[i]=0; | |
96 | if(fMassVsdEtaHistHad[i])fMassVsdEtaHistHad[i]=0; | |
97 | if(fMassVsdPhiHistKaon[i])fMassVsdPhiHistKaon[i]=0; | |
98 | if(fMassVsdEtaHistKaon[i])fMassVsdEtaHistKaon[i]=0; | |
99 | if(fMassVsdPhiHistKshort[i])fMassVsdPhiHistKshort[i]=0; | |
100 | if(fMassVsdEtaHistKshort[i])fMassVsdEtaHistKshort[i]=0; | |
101 | if(fMassVsdPhiHistLeadHad[i])fMassVsdPhiHistLeadHad[i]=0; | |
102 | if(fMassVsdEtaHistLeadHad[i])fMassVsdEtaHistLeadHad[i]=0; | |
103 | if(fMassHistK0S[i])fMassHistK0S[i]=0; | |
104 | if(fLeadPt[i])fLeadPt[i]=0; | |
105 | if(fMassHist[i])fMassHist[i]=0; | |
106 | if(fMassHistTCPlus[i])fMassHistTCPlus[i]=0; | |
107 | if(fMassHistTCMinus[i])fMassHistTCMinus[i]=0; | |
108 | } | |
109 | ||
110 | for(Int_t i=0;i<kMaxPtBins+1;i++){ | |
111 | fArrayBinLimits[i]=0; | |
112 | } | |
113 | ||
114 | } | |
115 | ||
116 | //________________________________________________________________________ | |
117 | AliAnalysisTaskSEDplusCorrelations::AliAnalysisTaskSEDplusCorrelations(const char *name,AliRDHFCutsDplustoKpipi *dpluscutsana, AliHFAssociatedTrackCuts *asstrkcuts): | |
118 | AliAnalysisTaskSE(name), | |
119 | fOutput(0), | |
120 | fCorrelator(0), | |
121 | fSelect(0), | |
122 | fDisplacement(0), | |
123 | fHistNEvents(0), | |
124 | fMCSources(0), | |
125 | fK0Origin(0), | |
126 | fKaonOrigin(0), | |
127 | fInvMassK0S(0), | |
128 | fEventMix(0), | |
129 | fPtVsMass(0), | |
130 | fPtVsMassTC(0), | |
131 | fYVsPt(0), | |
132 | fYVsPtTC(0), | |
133 | fYVsPtSig(0), | |
134 | fYVsPtSigTC(0), | |
135 | fUpmasslimit(1.965), | |
136 | fLowmasslimit(1.765), | |
137 | fNPtBins(0), | |
138 | fBinWidth(0.002), | |
139 | fListCuts(0), | |
140 | fListCutsAsso(0), | |
141 | fRDCutsAnalysis(dpluscutsana), | |
142 | fCuts(asstrkcuts), | |
143 | fCounter(0), | |
144 | fReadMC(kFALSE), | |
145 | fUseBit(kTRUE), | |
146 | fMixing(kFALSE), | |
147 | fSystem(kFALSE) | |
148 | { | |
149 | // | |
150 | // Standrd constructor | |
151 | // | |
152 | fNPtBins=fRDCutsAnalysis->GetNPtBins(); | |
153 | ||
154 | ||
155 | for(Int_t i=0;i<3*kMaxPtBins;i++){ | |
156 | if(fMassVsdPhiHistHad[i])fMassVsdPhiHistHad[i]=0; | |
157 | if(fMassVsdEtaHistHad[i])fMassVsdEtaHistHad[i]=0; | |
158 | if(fMassVsdPhiHistKaon[i])fMassVsdPhiHistKaon[i]=0; | |
159 | if(fMassVsdEtaHistKaon[i])fMassVsdEtaHistKaon[i]=0; | |
160 | if(fMassVsdPhiHistKshort[i])fMassVsdPhiHistKshort[i]=0; | |
161 | if(fMassVsdEtaHistKshort[i])fMassVsdEtaHistKshort[i]=0; | |
162 | if(fMassVsdPhiHistLeadHad[i])fMassVsdPhiHistLeadHad[i]=0; | |
163 | if(fMassVsdEtaHistLeadHad[i])fMassVsdEtaHistLeadHad[i]=0; | |
164 | if(fMassHistK0S[i])fMassHistK0S[i]=0; | |
165 | if(fLeadPt[i])fLeadPt[i]=0; | |
166 | if(fMassHist[i])fMassHist[i]=0; | |
167 | if(fMassHistTC[i])fMassHistTC[i]=0; | |
168 | if(fMassHistTCPlus[i])fMassHistTCPlus[i]=0; | |
169 | if(fMassHistTCMinus[i])fMassHistTCMinus[i]=0; | |
170 | ||
171 | ||
172 | } | |
173 | ||
174 | for(Int_t i=0;i<kMaxPtBins+1;i++){ | |
175 | fArrayBinLimits[i]=0; | |
176 | } | |
177 | ||
178 | ||
179 | // Default constructor | |
180 | // Output slot #1 writes into a TList container | |
181 | DefineOutput(1,TList::Class()); //My private output | |
182 | // Output slot #2 writes cut to private output | |
183 | // DefineOutput(2,AliRDHFCutsDplusCorrelationstoKpipi::Class()); | |
184 | DefineOutput(2,TList::Class()); | |
185 | // Output slot #3 writes cut to private output | |
186 | DefineOutput(3,AliNormalizationCounter::Class()); | |
187 | DefineOutput(4,AliHFAssociatedTrackCuts::Class()); | |
188 | ||
189 | ||
190 | } | |
191 | ||
192 | //________________________________________________________________________ | |
193 | AliAnalysisTaskSEDplusCorrelations::~AliAnalysisTaskSEDplusCorrelations() | |
194 | { | |
195 | // | |
196 | // Destructor | |
197 | // | |
198 | delete fOutput; | |
199 | delete fListCuts; | |
200 | delete fRDCutsAnalysis; | |
201 | delete fCuts; | |
202 | delete fCounter; | |
203 | delete fCorrelator; | |
204 | ||
205 | ||
206 | } | |
207 | //_________________________________________________________________ | |
208 | void AliAnalysisTaskSEDplusCorrelations::SetMassLimits(Float_t range){ | |
209 | // set invariant mass limits | |
210 | Float_t bw=GetBinWidth(); | |
211 | fUpmasslimit = 1.865+range; | |
212 | fLowmasslimit = 1.865-range; | |
213 | SetBinWidth(bw); | |
214 | } | |
215 | //_________________________________________________________________ | |
216 | void AliAnalysisTaskSEDplusCorrelations::SetMassLimits(Float_t lowlimit, Float_t uplimit){ | |
217 | // set invariant mass limits | |
218 | if(uplimit>lowlimit) | |
219 | { | |
220 | Float_t bw=GetBinWidth(); | |
221 | fUpmasslimit = lowlimit; | |
222 | fLowmasslimit = uplimit; | |
223 | SetBinWidth(bw); | |
224 | } | |
225 | } | |
226 | //________________________________________________________________ | |
227 | void AliAnalysisTaskSEDplusCorrelations::SetBinWidth(Float_t w){ | |
228 | // Define width of mass bins | |
229 | Float_t width=w; | |
230 | Int_t nbins=(Int_t)((fUpmasslimit-fLowmasslimit)/width+0.5); | |
231 | Int_t missingbins=4-nbins%4; | |
232 | nbins=nbins+missingbins; | |
233 | width=(fUpmasslimit-fLowmasslimit)/nbins; | |
234 | if(missingbins!=0){ | |
235 | printf("AliAnalysisTaskSEDplusCorrelations::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width); | |
236 | } | |
237 | else{ | |
238 | if(fDebug>1) printf("AliAnalysisTaskSEDplusCorrelations::SetBinWidth: width set to %f\n",width); | |
239 | } | |
240 | fBinWidth=width; | |
241 | } | |
242 | //_________________________________________________________________ | |
243 | Int_t AliAnalysisTaskSEDplusCorrelations::GetNBinsHistos(){ | |
244 | // Compute number of mass bins | |
245 | return (Int_t)((fUpmasslimit-fLowmasslimit)/fBinWidth+0.5); | |
246 | } | |
247 | ||
248 | ||
249 | //__________________________________________ | |
250 | void AliAnalysisTaskSEDplusCorrelations::Init(){ | |
251 | // | |
252 | // Initialization | |
253 | // | |
254 | if(fDebug > 1) printf("AnalysisTaskSEDplusCorrelations::Init() \n"); | |
255 | ||
256 | //PostData(2,fRDCutsloose);//we should then put those cuts in a tlist if we have more than 1 | |
257 | fListCuts=new TList(); | |
258 | // fListCutsAsso=new TList(); | |
259 | ||
260 | AliRDHFCutsDplustoKpipi *analysis = new AliRDHFCutsDplustoKpipi(*fRDCutsAnalysis); | |
261 | analysis->SetName("AnalysisCuts"); | |
262 | ||
263 | // AliHFAssociatedTrackCuts *trkcuts = new AliHFAssociatedTrackCuts(*fCuts); | |
264 | //trkcuts->SetName("Assotrkcuts"); | |
265 | ||
266 | fListCuts->Add(analysis); | |
267 | //fListCuts->Add(trkcuts); | |
268 | ||
269 | ||
270 | ||
271 | PostData(2,fListCuts); | |
272 | PostData(4,fCuts); | |
273 | ||
274 | return; | |
275 | } | |
276 | ||
277 | //________________________________________________________________________ | |
278 | void AliAnalysisTaskSEDplusCorrelations::UserCreateOutputObjects() | |
279 | { | |
280 | // Create the output container | |
281 | // | |
282 | if(fDebug > 1) printf("AnalysisTaskSEDplusCorrelations::UserCreateOutputObjects() \n"); | |
283 | // correlator creation and definition | |
284 | ||
285 | Double_t Pi = TMath::Pi(); | |
286 | fCorrelator = new AliHFCorrelator("Correlator",fCuts,fSystem); // fCuts is the hadron cut object, fSystem to switch between pp or PbPb | |
287 | fCorrelator->SetDeltaPhiInterval((-0.5-1./32)*Pi,(1.5-1./32)*Pi); // set correct phi interval | |
288 | //fCorrelator->SetDeltaPhiInterval(-1.57,4.71); | |
289 | fCorrelator->SetEventMixing(fMixing); //set kFALSE/kTRUE for mixing Off/On | |
290 | fCorrelator->SetAssociatedParticleType(fSelect); // set 1/2/3 for hadron/kaons/kzeros | |
291 | fCorrelator->SetApplyDisplacementCut(fDisplacement); //set kFALSE/kTRUE for using the displacement cut | |
292 | fCorrelator->SetUseMC(fReadMC); | |
34538691 | 293 | fCorrelator->SetPIDmode(2); |
35151011 | 294 | |
295 | Bool_t pooldef = fCorrelator->DefineEventPool(); | |
296 | ||
297 | if(!pooldef) AliInfo("Warning:: Event pool not defined properly"); | |
298 | ||
299 | ||
300 | // Several histograms are more conveniently managed in a TList | |
301 | fOutput = new TList(); | |
302 | fOutput->SetOwner(); | |
303 | fOutput->SetName("OutputHistos"); | |
304 | ||
305 | TString hisname; | |
306 | Int_t index=0; | |
307 | Int_t nbins=GetNBinsHistos(); | |
8d35b368 | 308 | |
309 | ||
310 | Int_t nbinsphi = 32; | |
311 | Double_t philow = -0.5*Pi - Pi/32; // shift the bin by half the width so that at 0 is it the bin center | |
312 | Double_t phiup = 1.5*Pi - Pi/32; | |
313 | ||
314 | Int_t nbinseta = 16; | |
315 | Double_t etalow = -1.6; // shift the bin by half the width so that at 0 is it the bin center | |
316 | Double_t etaup = +1.6; | |
317 | ||
318 | ||
35151011 | 319 | |
320 | for(Int_t i=0;i<fNPtBins;i++){ | |
321 | ||
322 | index=GetHistoIndex(i); | |
323 | ||
324 | ||
325 | hisname.Form("hMassVsdPhiHad%d",i); | |
8d35b368 | 326 | fMassVsdPhiHistHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 327 | fMassVsdPhiHistHad[index]->Sumw2(); |
328 | ||
329 | hisname.Form("hMassVsdEtaHad%d",i); | |
8d35b368 | 330 | fMassVsdEtaHistHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 331 | fMassVsdEtaHistHad[index]->Sumw2(); |
332 | ||
333 | hisname.Form("hMassVsdPhiKaon%d",i); | |
8d35b368 | 334 | fMassVsdPhiHistKaon[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 335 | fMassVsdPhiHistKaon[index]->Sumw2(); |
336 | ||
337 | hisname.Form("hMassVsdEtaKaon%d",i); | |
8d35b368 | 338 | fMassVsdEtaHistKaon[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 339 | fMassVsdEtaHistKaon[index]->Sumw2(); |
340 | ||
341 | hisname.Form("hMassVsdPhiK0%d",i); | |
8d35b368 | 342 | fMassVsdPhiHistKshort[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 343 | fMassVsdPhiHistKshort[index]->Sumw2(); |
344 | ||
345 | hisname.Form("hMassVsdEtaK0%d",i); | |
8d35b368 | 346 | fMassVsdEtaHistKshort[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 347 | fMassVsdEtaHistKshort[index]->Sumw2(); |
348 | ||
349 | hisname.Form("hMassVsdPhiLeadHad%d",i); | |
8d35b368 | 350 | fMassVsdPhiHistLeadHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 351 | fMassVsdPhiHistLeadHad[index]->Sumw2(); |
352 | ||
353 | hisname.Form("hMassVsdEtaLeadHad%d",i); | |
8d35b368 | 354 | fMassVsdEtaHistLeadHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 355 | fMassVsdEtaHistLeadHad[index]->Sumw2(); |
356 | ||
357 | hisname.Form("hMassPtK0S%d",i); | |
358 | fMassHistK0S[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.3,0.8); | |
359 | fMassHistK0S[index]->Sumw2(); | |
360 | ||
361 | hisname.Form("hLeadPt%d",i); | |
362 | fLeadPt[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.0,50); | |
363 | fLeadPt[index]->Sumw2(); | |
364 | ||
365 | ||
366 | hisname.Form("hMassPt%d",i); | |
367 | fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
368 | fMassHist[index]->Sumw2(); | |
369 | ||
370 | ||
371 | hisname.Form("hMassPt%dTC",i); | |
372 | fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
373 | fMassHistTC[index]->Sumw2(); | |
374 | ||
375 | hisname.Form("hMassPt%dTCPlus",i); | |
376 | fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
377 | fMassHistTCPlus[index]->Sumw2(); | |
378 | ||
379 | hisname.Form("hMassPt%dTCMinus",i); | |
380 | fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
381 | fMassHistTCMinus[index]->Sumw2(); | |
382 | ||
383 | ||
384 | ||
385 | index=GetSignalHistoIndex(i); | |
386 | ||
387 | hisname.Form("hMassVsdPhiHadSig%d",i); | |
8d35b368 | 388 | fMassVsdPhiHistHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 389 | fMassVsdPhiHistHad[index]->Sumw2(); |
390 | ||
391 | hisname.Form("hMassVsdEtaHadSig%d",i); | |
8d35b368 | 392 | fMassVsdEtaHistHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 393 | fMassVsdEtaHistHad[index]->Sumw2(); |
394 | ||
395 | hisname.Form("hMassVsdPhiKaonSig%d",i); | |
8d35b368 | 396 | fMassVsdPhiHistKaon[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 397 | fMassVsdPhiHistKaon[index]->Sumw2(); |
398 | ||
399 | hisname.Form("hMassVsdEtaKaonSig%d",i); | |
8d35b368 | 400 | fMassVsdEtaHistKaon[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 401 | fMassVsdEtaHistKaon[index]->Sumw2(); |
402 | ||
403 | hisname.Form("hMassVsdPhiK0Sig%d",i); | |
8d35b368 | 404 | fMassVsdPhiHistKshort[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 405 | fMassVsdPhiHistKshort[index]->Sumw2(); |
406 | ||
407 | hisname.Form("hMassVsdEtaK0Sig%d",i); | |
8d35b368 | 408 | fMassVsdEtaHistKshort[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 409 | fMassVsdEtaHistKshort[index]->Sumw2(); |
410 | ||
411 | hisname.Form("hMassVsdPhiLeadHadSig%d",i); | |
8d35b368 | 412 | fMassVsdPhiHistLeadHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 413 | fMassVsdPhiHistLeadHad[index]->Sumw2(); |
414 | ||
415 | hisname.Form("hMassVsdEtaLeadHadSig%d",i); | |
8d35b368 | 416 | fMassVsdEtaHistLeadHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 417 | fMassVsdEtaHistLeadHad[index]->Sumw2(); |
418 | ||
419 | ||
420 | hisname.Form("hSigPtK0S%d",i); | |
421 | fMassHistK0S[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.3,0.8); | |
422 | fMassHistK0S[index]->Sumw2(); | |
423 | ||
424 | hisname.Form("hSigLeadPt%d",i); | |
425 | fLeadPt[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.0,50); | |
426 | fLeadPt[index]->Sumw2(); | |
427 | ||
428 | hisname.Form("hSigPt%d",i); | |
429 | fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
430 | fMassHist[index]->Sumw2(); | |
431 | ||
432 | hisname.Form("hSigPt%dTC",i); | |
433 | fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
434 | fMassHistTC[index]->Sumw2(); | |
435 | hisname.Form("hSigPt%dTCPlus",i); | |
436 | fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
437 | fMassHistTCPlus[index]->Sumw2(); | |
438 | hisname.Form("hSigPt%dTCMinus",i); | |
439 | fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
440 | fMassHistTCMinus[index]->Sumw2(); | |
441 | ||
442 | ||
443 | ||
444 | index=GetBackgroundHistoIndex(i); | |
445 | ||
446 | hisname.Form("hMassVsdPhiBkgHad%d",i); | |
8d35b368 | 447 | fMassVsdPhiHistHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 448 | fMassVsdPhiHistHad[index]->Sumw2(); |
449 | ||
450 | hisname.Form("hMassVsdEtaBkgHad%d",i); | |
8d35b368 | 451 | fMassVsdEtaHistHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 452 | fMassVsdEtaHistHad[index]->Sumw2(); |
453 | ||
454 | hisname.Form("hMassVsdPhiBkgKaon%d",i); | |
8d35b368 | 455 | fMassVsdPhiHistKaon[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 456 | fMassVsdPhiHistKaon[index]->Sumw2(); |
457 | ||
458 | hisname.Form("hMassVsdEtaBkgKaon%d",i); | |
8d35b368 | 459 | fMassVsdEtaHistKaon[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 460 | fMassVsdEtaHistKaon[index]->Sumw2(); |
461 | ||
462 | hisname.Form("hMassVsdPhiBkgKshort%d",i); | |
8d35b368 | 463 | fMassVsdPhiHistKshort[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 464 | fMassVsdPhiHistKshort[index]->Sumw2(); |
465 | ||
466 | ||
467 | hisname.Form("hMassVsdPhiBkgKshort%d",i); | |
8d35b368 | 468 | fMassVsdEtaHistKshort[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 469 | fMassVsdEtaHistKshort[index]->Sumw2(); |
470 | ||
471 | hisname.Form("hMassVsdPhiBkgLeadHad%d",i); | |
8d35b368 | 472 | fMassVsdPhiHistLeadHad[index]=new TH2F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup); |
35151011 | 473 | fMassVsdPhiHistLeadHad[index]->Sumw2(); |
474 | ||
475 | hisname.Form("hMassVsdPhiBkgKshort%d",i); | |
8d35b368 | 476 | fMassVsdEtaHistLeadHad[index]=new TH3D(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit,nbinsphi,philow,phiup,nbinseta,etalow,etaup); |
35151011 | 477 | fMassVsdEtaHistLeadHad[index]->Sumw2(); |
478 | ||
479 | hisname.Form("hBkgPtK0S%d",i); | |
480 | fMassHistK0S[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.3,0.8); | |
481 | fMassHistK0S[index]->Sumw2(); | |
482 | ||
483 | hisname.Form("hLeadBkgPt%d",i); | |
484 | fLeadPt[index]=new TH1F(hisname.Data(),hisname.Data(),500,0.0,50); | |
485 | fLeadPt[index]->Sumw2(); | |
486 | ||
487 | hisname.Form("hBkgPt%dTC",i); | |
488 | fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
489 | fMassHistTC[index]->Sumw2(); | |
490 | ||
491 | hisname.Form("hBkgPt%dTCPlus",i); | |
492 | fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
493 | fMassHistTCPlus[index]->Sumw2(); | |
494 | ||
495 | hisname.Form("hBkgPt%dTCMinus",i); | |
496 | fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit); | |
497 | fMassHistTCMinus[index]->Sumw2(); | |
498 | } | |
499 | ||
500 | ||
501 | for(Int_t i=0; i<3*fNPtBins; i++){ | |
502 | fOutput->Add(fMassVsdPhiHistHad[i]); | |
503 | fOutput->Add(fMassVsdEtaHistHad[i]); | |
504 | fOutput->Add(fMassVsdPhiHistKaon[i]); | |
505 | fOutput->Add(fMassVsdEtaHistKaon[i]); | |
506 | fOutput->Add(fMassVsdPhiHistKshort[i]); | |
507 | fOutput->Add(fMassVsdEtaHistKshort[i]); | |
508 | fOutput->Add(fMassVsdPhiHistLeadHad[i]); | |
509 | fOutput->Add(fMassVsdEtaHistLeadHad[i]); | |
35151011 | 510 | fOutput->Add(fMassHistK0S[i]); |
511 | fOutput->Add(fLeadPt[i]); | |
512 | fOutput->Add(fMassHist[i]); | |
513 | fOutput->Add(fMassHistTC[i]); | |
514 | fOutput->Add(fMassHistTCPlus[i]); | |
515 | fOutput->Add(fMassHistTCMinus[i]); | |
516 | ||
517 | ||
518 | ||
519 | } | |
520 | fInvMassK0S = new TH2F("K0S","K0S", 500,0.3,0.8,500,0,50); | |
521 | fInvMassK0S->GetXaxis()->SetTitle("Invariant Mass (#pi #pi) (GeV/c^{2})"); | |
522 | fInvMassK0S->GetYaxis()->SetTitle("K0S pt (GeV/c)"); | |
523 | fOutput->Add(fInvMassK0S); | |
524 | ||
525 | fMCSources = new TH1F("MCSources","Origin of associated particles in MC", 10, -0.5, 9.5); | |
526 | fMCSources->GetXaxis()->SetBinLabel(1,"All "); | |
527 | fMCSources->GetXaxis()->SetBinLabel(2," from Heavy flavour"); | |
528 | fMCSources->GetXaxis()->SetBinLabel(3," from c->D"); | |
529 | fMCSources->GetXaxis()->SetBinLabel(4," from b->D"); | |
530 | fMCSources->GetXaxis()->SetBinLabel(5," from b->B"); | |
531 | if(fReadMC) fOutput->Add(fMCSources); | |
532 | ||
533 | fK0Origin = new TH1F("K0Origin","Origin of K0 ", 10, -0.5, 5.5); | |
534 | fK0Origin->GetXaxis()->SetBinLabel(1,"All K0s"); | |
535 | fK0Origin->GetXaxis()->SetBinLabel(2,"K0s from Heavy flavour"); | |
536 | fK0Origin->GetXaxis()->SetBinLabel(3,"K0s from Charm"); | |
537 | fK0Origin->GetXaxis()->SetBinLabel(4,"K0s from Beauty"); | |
538 | if(fReadMC) fOutput->Add(fK0Origin); | |
539 | ||
540 | fKaonOrigin = new TH1F("K0Origin","Origin of Kaon ", 10, -0.5, 5.5); | |
541 | fKaonOrigin->GetXaxis()->SetBinLabel(1,"All Kaons"); | |
542 | fKaonOrigin->GetXaxis()->SetBinLabel(2,"Kaons from Heavy flavour"); | |
543 | fKaonOrigin->GetXaxis()->SetBinLabel(3,"Kaons from Charm"); | |
544 | fKaonOrigin->GetXaxis()->SetBinLabel(4,"Kaons from Beauty"); | |
545 | if(fReadMC) fOutput->Add(fKaonOrigin); | |
546 | ||
547 | ||
548 | ||
549 | fEventMix = new TH2F("EventMixingCheck","EventMixingCheck",5,-0.5,4.5,7,-0.5,6.5); | |
550 | if(fMixing)fOutput->Add(fEventMix); | |
551 | ||
552 | ||
553 | fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5); | |
554 | fHistNEvents->GetXaxis()->SetBinLabel(1,"nEventsAnal"); | |
555 | fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents accepted"); | |
556 | fHistNEvents->GetXaxis()->SetBinLabel(3,"Rejected due to trigger"); | |
557 | fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected pileup events"); | |
558 | fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to centrality"); | |
559 | fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vtxz"); | |
560 | fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to Physics Sel"); | |
561 | fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate"); | |
562 | fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask"); | |
563 | fHistNEvents->GetXaxis()->SetBinLabel(10,"D+ after loose cuts"); | |
564 | fHistNEvents->GetXaxis()->SetBinLabel(11,"D+ after tight cuts"); | |
565 | ||
566 | fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE); | |
567 | fHistNEvents->Sumw2(); | |
568 | fHistNEvents->SetMinimum(0); | |
569 | fOutput->Add(fHistNEvents); | |
570 | ||
571 | fPtVsMass=new TH2F("hPtVsMass","PtVsMass (prod. cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.); | |
572 | fPtVsMassTC=new TH2F("hPtVsMassTC","PtVsMass (analysis cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.); | |
573 | fYVsPt=new TH2F("hYVsPt","YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.); | |
574 | fYVsPtTC=new TH2F("hYVsPtTC","YvsPt (analysis cuts)",40,0.,20.,80,-2.,2.); | |
575 | fYVsPtSig=new TH2F("hYVsPtSig","YvsPt (MC, only sig., prod. cuts)",40,0.,20.,80,-2.,2.); | |
576 | fYVsPtSigTC=new TH2F("hYVsPtSigTC","YvsPt (MC, only Sig, analysis cuts)",40,0.,20.,80,-2.,2.); | |
577 | ||
578 | fOutput->Add(fPtVsMass); | |
579 | fOutput->Add(fPtVsMassTC); | |
580 | fOutput->Add(fYVsPt); | |
581 | fOutput->Add(fYVsPtTC); | |
582 | fOutput->Add(fYVsPtSig); | |
583 | fOutput->Add(fYVsPtSigTC); | |
584 | ||
585 | ||
586 | // Counter for Normalization | |
587 | TString normName="NormalizationCounter"; | |
588 | AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer(); | |
589 | if(cont)normName=(TString)cont->GetName(); | |
590 | fCounter = new AliNormalizationCounter(normName.Data()); | |
591 | fCounter->Init(); | |
592 | ||
593 | ||
594 | ||
595 | PostData(1,fOutput); | |
596 | PostData(3,fCounter); | |
597 | return; | |
598 | } | |
599 | ||
600 | //________________________________________________________________________ | |
601 | void AliAnalysisTaskSEDplusCorrelations::UserExec(Option_t */*option*/) | |
602 | { | |
603 | // Do the analysis | |
604 | AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent()); | |
605 | TClonesArray *array3Prong = 0; | |
606 | ||
607 | if(!fMixing){ | |
608 | if(fSelect==1) cout << "TASK::Correlation with hadrons on SE "<< endl; | |
609 | if(fSelect==2) cout << "TASK::Correlation with kaons on SE "<< endl; | |
610 | if(fSelect==3) cout << "TASK::Correlation with kzeros on SE "<< endl; | |
611 | } | |
612 | if(fMixing){ | |
613 | if(fSelect==1) cout << "TASK::Correlation with hadrons on ME "<< endl; | |
614 | if(fSelect==2) cout << "TASK::Correlation with kaons on ME "<< endl; | |
615 | if(fSelect==3) cout << "TASK::Correlation with kzeros on ME "<< endl; | |
616 | } | |
617 | ||
618 | ||
619 | if(!aod && AODEvent() && IsStandardAOD()) { | |
620 | ||
621 | aod = dynamic_cast<AliAODEvent*> (AODEvent()); | |
622 | AliAODHandler* aodHandler = (AliAODHandler*) | |
623 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
624 | if(aodHandler->GetExtensions()) { | |
625 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root"); | |
626 | AliAODEvent *aodFromExt = ext->GetAOD(); | |
627 | array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong"); | |
628 | } | |
629 | } else if(aod) { | |
630 | array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong"); | |
631 | } | |
632 | ||
633 | if(!aod || !array3Prong) { | |
634 | printf("AliAnalysisTaskSEDplusCorrelations::UserExec: Charm3Prong branch not found!\n"); | |
635 | return; | |
636 | } | |
637 | ||
638 | ||
639 | // the AODs with null vertex pointer didn't pass the PhysSel | |
640 | if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return; | |
641 | fCounter->StoreEvent(aod,fRDCutsAnalysis,fReadMC); | |
642 | fHistNEvents->Fill(0); // count event | |
643 | ||
644 | ||
645 | Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod); | |
646 | ||
647 | ||
648 | ||
649 | PostData(1,fOutput); | |
650 | if(!isEvSel)return; | |
651 | fHistNEvents->Fill(1); | |
652 | ||
34538691 | 653 | // set PIDResponse for associated tracks |
654 | fCorrelator->SetPidAssociated(); | |
35151011 | 655 | |
656 | TClonesArray *arrayMC=0; | |
657 | AliAODMCHeader *mcHeader=0; | |
658 | // AOD primary vertex | |
659 | AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex(); | |
660 | // vtx1->Print(); | |
661 | TString primTitle = vtx1->GetTitle(); | |
662 | //if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0)fHistNEvents->Fill(2); | |
663 | ||
664 | // load MC particles | |
665 | if(fReadMC){ | |
666 | ||
667 | arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName()); | |
668 | if(!arrayMC) { | |
669 | printf("AliAnalysisTaskSEDplusCorrelations::UserExec: MC particles branch not found!\n"); | |
670 | return; | |
671 | } | |
672 | ||
673 | // load MC header | |
674 | mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName()); | |
675 | if(!mcHeader) { | |
676 | printf("AliAnalysisTaskSEDplusCorrelations::UserExec: MC header branch not found!\n"); | |
677 | return; | |
678 | } | |
679 | } | |
680 | ||
681 | //HFCorrelators initialization (for this event) | |
682 | ||
683 | fCorrelator->SetAODEvent(aod); // set the event to be processedfCorrelator-> | |
684 | Bool_t correlatorON = fCorrelator->Initialize(); //define the pool for mixing | |
685 | if(!correlatorON) { | |
686 | AliInfo("AliHFCorrelator didn't initialize the pool correctly or processed a bad event"); | |
687 | return; | |
688 | } | |
689 | if(fReadMC) fCorrelator->SetMCArray(arrayMC); | |
690 | ||
691 | ||
692 | ||
693 | Int_t n3Prong = array3Prong->GetEntriesFast(); | |
8d35b368 | 694 | printf("Number of D+->Kpipi: %d and of tracks: %d\n",n3Prong,aod->GetNumberOfTracks()); |
35151011 | 695 | Int_t nOS=0; |
696 | Int_t index; | |
697 | Int_t pdgDgDplustoKpipi[3]={321,211,211}; | |
698 | Int_t nSelectedloose=0,nSelectedtight=0; | |
699 | ||
700 | ||
701 | ||
702 | for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) { | |
703 | AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong); | |
704 | fHistNEvents->Fill(7); | |
705 | ||
706 | if(fUseBit && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts)){ | |
707 | fHistNEvents->Fill(8); | |
708 | continue; | |
709 | } | |
710 | ||
711 | Int_t passTightCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod); | |
712 | ||
8d35b368 | 713 | if(!fRDCutsAnalysis->GetIsSelectedCuts()) continue; |
35151011 | 714 | |
715 | Bool_t unsetvtx=kFALSE; | |
716 | if(!d->GetOwnPrimaryVtx()){ | |
717 | d->SetOwnPrimaryVtx(vtx1); | |
718 | unsetvtx=kTRUE; | |
719 | } | |
720 | ||
721 | ||
722 | Double_t ptCand = d->Pt(); | |
723 | Int_t iPtBin = fRDCutsAnalysis->PtBin(ptCand); | |
724 | Bool_t recVtx=kFALSE; | |
725 | AliAODVertex *origownvtx=0x0; | |
726 | if(fRDCutsAnalysis->GetIsPrimaryWithoutDaughters()){ | |
727 | if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx()); | |
728 | if(fRDCutsAnalysis->RecalcOwnPrimaryVtx(d,aod))recVtx=kTRUE; | |
729 | else fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx); | |
730 | } | |
731 | ||
732 | ||
733 | ||
734 | ||
735 | Int_t labDp=-1; | |
736 | Bool_t isDplus = kFALSE; | |
737 | ||
738 | if(fReadMC){ | |
739 | labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi); | |
740 | if(labDp>=0){ | |
741 | isDplus = kTRUE; | |
742 | } | |
743 | } | |
744 | ||
745 | ||
746 | Double_t invMass=d->InvMassDplus(); | |
747 | Double_t rapid=d->YDplus(); | |
748 | fYVsPt->Fill(ptCand,rapid); | |
749 | if(passTightCuts>0.) {fYVsPtTC->Fill(ptCand,rapid);nOS++;} | |
750 | //printf("****************: %d and of tracks: %d\n",n3Prong,nOS); | |
751 | Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid); | |
752 | if(isFidAcc){ | |
753 | fPtVsMass->Fill(invMass,ptCand); | |
754 | if(passTightCuts>0) fPtVsMassTC->Fill(invMass,ptCand); | |
755 | } | |
756 | ||
757 | ||
758 | if(iPtBin>=0){ | |
759 | index=GetHistoIndex(iPtBin); | |
760 | if(isFidAcc){ | |
761 | fHistNEvents->Fill(9); | |
762 | nSelectedloose++; | |
763 | fMassHist[index]->Fill(invMass); | |
764 | ||
765 | // loop for tight cuts | |
34538691 | 766 | if(passTightCuts>0){ |
35151011 | 767 | fHistNEvents->Fill(10); |
768 | nSelectedtight++; | |
769 | fMassHistTC[index]->Fill(invMass); | |
770 | ||
771 | //Dplus info | |
772 | ||
773 | Double_t phiDplus = fCorrelator->SetCorrectPhiRange(d->Phi()); | |
774 | fCorrelator->SetTriggerParticleProperties(d->Pt(),phiDplus,d->Eta()); | |
775 | ||
776 | Int_t nIDs[3] = {-9999999}; | |
777 | nIDs[0] = ((AliAODTrack*)d->GetDaughter(0))->GetID(); | |
778 | nIDs[1] = ((AliAODTrack*)d->GetDaughter(1))->GetID(); | |
779 | nIDs[2] = ((AliAODTrack*)d->GetDaughter(2))->GetID(); | |
780 | ||
781 | Double_t ptlead = 0; | |
782 | Double_t philead = 0; | |
8d35b368 | 783 | Double_t etalead = 0; |
35151011 | 784 | Double_t refpt = 0; |
785 | ||
786 | ||
787 | ||
788 | Bool_t execPool = fCorrelator->ProcessEventPool(); | |
789 | ||
790 | // printf("*************: %d\n",execPool); | |
791 | if(fMixing && !execPool) { | |
792 | AliInfo("Mixed event analysis: pool is not ready"); | |
793 | continue; | |
794 | } | |
795 | Int_t NofEventsinPool = 1; | |
796 | if(fMixing) { | |
797 | NofEventsinPool = fCorrelator->GetNofEventsInPool(); | |
798 | } | |
799 | ||
800 | ||
801 | ||
802 | for (Int_t jMix =0; jMix < NofEventsinPool; jMix++){// loop on events in the pool; if it is SE analysis, stops at one | |
803 | ||
804 | Bool_t analyzetracks = fCorrelator->ProcessAssociatedTracks(jMix); | |
805 | if(!analyzetracks) { | |
806 | AliInfo("AliHFCorrelator::Cannot process the track array"); | |
807 | continue; | |
808 | } | |
809 | ||
810 | //start the track loop | |
811 | ||
34538691 | 812 | // Int_t NofTracks = fCorrelator->GetNofTracks(); |
813 | ||
814 | //cout<<"*******"<<NofTracks<<endl; | |
815 | ||
35151011 | 816 | for (Int_t iTrack = 0;iTrack<fCorrelator->GetNofTracks();iTrack++) { |
817 | Bool_t runcorrelation = fCorrelator->Correlate(iTrack); | |
818 | ||
819 | if(!runcorrelation) continue; | |
820 | Double_t DeltaPhi = fCorrelator->GetDeltaPhi(); | |
821 | Double_t DeltaEta = fCorrelator->GetDeltaEta(); | |
822 | ||
823 | AliReducedParticle* redpart = fCorrelator->GetAssociatedParticle(); | |
824 | Double_t phiHad=redpart->Phi(); | |
825 | Double_t ptHad=redpart->Pt(); | |
8d35b368 | 826 | Double_t etaHad=redpart->Eta(); |
35151011 | 827 | Int_t label = redpart->GetLabel(); |
828 | Int_t trackid = redpart->GetID(); | |
829 | phiHad = fCorrelator->SetCorrectPhiRange(phiHad); | |
830 | ||
831 | ||
832 | // discard the dplus daughters | |
833 | if (!fMixing){ | |
834 | if( trackid == nIDs[0] || trackid == nIDs[1] || trackid == nIDs[2]) continue; | |
835 | } | |
836 | // discard the negative id tracks | |
837 | if(trackid < 0) continue; | |
838 | ||
839 | ||
840 | FillCorrelations(d,DeltaPhi,DeltaEta,index,fSelect); | |
841 | ||
842 | // For leading particle | |
843 | ||
844 | if (ptHad > refpt) { | |
845 | refpt = ptHad; ptlead = ptHad; | |
846 | philead = d->Phi() - phiHad; | |
8d35b368 | 847 | etalead = d->Eta() - etaHad; |
35151011 | 848 | if (philead < (-1)*TMath::Pi()/2) philead += 2*TMath::Pi(); |
849 | if (philead > 3*TMath::Pi()/2) philead -= 2*TMath::Pi(); | |
850 | ||
851 | } | |
852 | ||
853 | // montecarlo | |
854 | ||
855 | if(fReadMC && isDplus) { | |
856 | ||
857 | index=GetSignalHistoIndex(iPtBin); | |
858 | ||
53454b81 | 859 | Bool_t* PartSource = fCuts->IsMCpartFromHF(label,arrayMC); // check source of associated particle (hadron/kaon/K0) |
35151011 | 860 | FillMCCorrelations(d,DeltaPhi,DeltaEta,index,PartSource,fSelect); |
861 | ||
862 | ||
863 | } // readMC | |
864 | ||
865 | }//count good tracks | |
866 | ||
867 | // For leading particle | |
868 | fMassVsdPhiHistLeadHad[index]->Fill(invMass,philead); | |
8d35b368 | 869 | fMassVsdEtaHistLeadHad[index]->Fill(invMass,philead,etalead); |
870 | ||
35151011 | 871 | fLeadPt[index]->Fill(ptlead); |
872 | ||
873 | if(fReadMC && isDplus) { | |
874 | index=GetSignalHistoIndex(iPtBin); | |
8d35b368 | 875 | fMassVsdPhiHistLeadHad[index]->Fill(invMass,philead); |
876 | fMassVsdEtaHistLeadHad[index]->Fill(invMass,philead,etalead); | |
35151011 | 877 | fLeadPt[index]->Fill(ptlead); |
878 | ||
879 | } | |
880 | ||
881 | }//jmix | |
882 | ||
34538691 | 883 | }// tc |
35151011 | 884 | }//fid |
885 | ||
886 | ||
887 | ||
888 | ||
889 | ||
890 | } | |
891 | if(recVtx)fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx); | |
892 | ||
893 | if(unsetvtx) d->UnsetOwnPrimaryVtx(); | |
894 | ||
895 | } | |
896 | ||
897 | if(fMixing){ | |
898 | Bool_t updated = fCorrelator->PoolUpdate(); | |
899 | ||
900 | if(!updated) AliInfo("Pool was not updated"); | |
901 | } | |
902 | fCounter->StoreCandidates(aod,nSelectedloose,kTRUE); | |
903 | fCounter->StoreCandidates(aod,nSelectedtight,kFALSE); | |
904 | ||
905 | ||
906 | PostData(1,fOutput); | |
907 | PostData(2,fListCuts); | |
908 | PostData(3,fCounter); | |
909 | return; | |
910 | } | |
911 | ||
912 | //________________________________________________________________________ | |
913 | void AliAnalysisTaskSEDplusCorrelations::Terminate(Option_t */*option*/) | |
914 | { | |
915 | // Terminate analysis | |
916 | // | |
917 | if(fDebug > 1) printf("AnalysisTaskSEDplusCorrelations: Terminate() \n"); | |
918 | ||
919 | fOutput = dynamic_cast<TList*> (GetOutputData(1)); | |
920 | if (!fOutput) { | |
921 | printf("ERROR: fOutput not available\n"); | |
922 | return; | |
923 | } | |
924 | fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents")); | |
925 | ||
926 | TString hisname; | |
927 | Int_t index=0; | |
928 | ||
929 | for(Int_t i=0;i<fNPtBins;i++){ | |
930 | index=GetHistoIndex(i); | |
931 | ||
932 | hisname.Form("hMassPt%dTC",i); | |
933 | fMassHistTC[index]=dynamic_cast<TH1F*>(fOutput->FindObject(hisname.Data())); | |
934 | } | |
935 | ||
936 | TCanvas *c1=new TCanvas("c1","D+ invariant mass distribution",500,500); | |
937 | c1->cd(); | |
938 | TH1F *hMassPt=(TH1F*)fOutput->FindObject("hMassPt3TC"); | |
939 | hMassPt->SetLineColor(kBlue); | |
940 | hMassPt->SetXTitle("M[GeV/c^{2}]"); | |
941 | hMassPt->Draw(); | |
942 | ||
943 | return; | |
944 | } | |
945 | ||
946 | ||
947 | //________________________________________________________________________ | |
948 | void AliAnalysisTaskSEDplusCorrelations::FillCorrelations(AliAODRecoDecayHF3Prong* d, Double_t deltaPhi, Double_t deltaEta, Int_t ind, Int_t sel) const{ | |
949 | //Filling histogams | |
950 | ||
951 | Double_t invMass=d->InvMassDplus(); | |
952 | ||
953 | ||
954 | if(sel==1){ | |
955 | fMassVsdPhiHistHad[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 956 | fMassVsdEtaHistHad[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 957 | } |
958 | if(sel==2){ | |
959 | fMassVsdPhiHistKaon[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 960 | fMassVsdEtaHistKaon[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 961 | } |
962 | if(sel==3){ | |
963 | fMassVsdPhiHistKshort[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 964 | fMassVsdEtaHistKshort[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 965 | } |
966 | ||
967 | return; | |
968 | } | |
969 | ||
970 | ||
971 | ||
972 | //________________________________________________________________________ | |
53454b81 | 973 | void AliAnalysisTaskSEDplusCorrelations::FillMCCorrelations(AliAODRecoDecayHF3Prong* d, Double_t deltaPhi, Double_t deltaEta, Int_t ind,Bool_t* mcSource, Int_t sel) const{ |
35151011 | 974 | // Filling histos with MC information |
975 | ||
976 | Double_t invMass=d->InvMassDplus(); | |
977 | ||
978 | ||
979 | if(sel==1){ | |
980 | fMassVsdPhiHistHad[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 981 | fMassVsdEtaHistHad[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 982 | |
983 | ||
984 | fMCSources->Fill(0); | |
985 | ||
53454b81 | 986 | if(mcSource[2]&&mcSource[0]){ // is from charm ->D |
35151011 | 987 | fMCSources->Fill(1); |
988 | fMCSources->Fill(2); | |
989 | } | |
53454b81 | 990 | if(mcSource[2]&&mcSource[1]){ // is from beauty -> D |
35151011 | 991 | fMCSources->Fill(1); |
992 | fMCSources->Fill(3); | |
993 | } | |
53454b81 | 994 | if(mcSource[3]&&mcSource[1]){ // is from beauty ->B |
35151011 | 995 | fMCSources->Fill(1); |
996 | fMCSources->Fill(4); | |
997 | } | |
998 | } | |
999 | ||
1000 | if(sel==2){ | |
1001 | fMassVsdPhiHistKaon[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 1002 | fMassVsdEtaHistKaon[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 1003 | fKaonOrigin->Fill(0); |
53454b81 | 1004 | if(mcSource[2]&&mcSource[0]){ // is from charm ->D |
35151011 | 1005 | fKaonOrigin->Fill(1); |
1006 | fKaonOrigin->Fill(2); | |
1007 | } | |
53454b81 | 1008 | if(mcSource[2]&&mcSource[1]){ // is from beauty -> D |
35151011 | 1009 | fKaonOrigin->Fill(1); |
1010 | fKaonOrigin->Fill(3); | |
1011 | } | |
53454b81 | 1012 | if(mcSource[3]&&mcSource[1]){ // is from beauty ->B |
35151011 | 1013 | fKaonOrigin->Fill(1); |
1014 | fKaonOrigin->Fill(4); | |
1015 | } | |
1016 | } | |
1017 | if(sel==3){ | |
1018 | fMassVsdPhiHistKshort[ind]->Fill(invMass,deltaPhi); | |
8d35b368 | 1019 | fMassVsdEtaHistKshort[ind]->Fill(invMass,deltaPhi,deltaEta); |
35151011 | 1020 | fK0Origin->Fill(0); |
53454b81 | 1021 | if(mcSource[2]&&mcSource[0]){ // is from charm ->D |
35151011 | 1022 | fK0Origin->Fill(1); |
1023 | fK0Origin->Fill(2); | |
1024 | } | |
53454b81 | 1025 | if(mcSource[2]&&mcSource[1]){ // is from beauty -> D |
35151011 | 1026 | fK0Origin->Fill(1); |
1027 | fK0Origin->Fill(3); | |
1028 | } | |
53454b81 | 1029 | if(mcSource[3]&&mcSource[1]){ // is from beauty ->B |
35151011 | 1030 | fK0Origin->Fill(1); |
1031 | fK0Origin->Fill(4); | |
1032 | } | |
1033 | ||
1034 | } | |
1035 | ||
1036 | return; | |
1037 | } | |
1038 | ||
1039 | ||
1040 | ||
1041 | ||
1042 | ||
1043 | ||
1044 | ||
1045 | ||
1046 | ||
1047 |