]>
Commit | Line | Data |
---|---|---|
49061176 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2009, 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 | ||
27de2dfb | 16 | /* $Id$ */ |
17 | ||
49061176 | 18 | ///////////////////////////////////////////////////////////// |
19 | // | |
20 | // AliAnalysisTaskSE for D0 candidates invariant mass histogram | |
a41f6fad | 21 | // and comparison with the MC truth and cut variables distributions. |
49061176 | 22 | // |
23 | // Authors: A.Dainese, andrea.dainese@lnl.infn.it | |
feb73eca | 24 | // Chiara Bianchin, chiara.bianchin@pd.infn.it (invariant mass) |
25 | // Carmelo Di Giglio, carmelo.digiglio@ba.infn.it (like sign) | |
49061176 | 26 | ///////////////////////////////////////////////////////////// |
27 | ||
28 | #include <Riostream.h> | |
29 | #include <TClonesArray.h> | |
527f330b | 30 | #include <TCanvas.h> |
49061176 | 31 | #include <TNtuple.h> |
90c70b48 | 32 | #include <TTree.h> |
49061176 | 33 | #include <TList.h> |
34 | #include <TH1F.h> | |
a41f6fad | 35 | #include <TH2F.h> |
36 | #include <TDatabasePDG.h> | |
49061176 | 37 | |
5b2e5fae | 38 | #include <AliAnalysisDataSlot.h> |
39 | #include <AliAnalysisDataContainer.h> | |
b557eb43 | 40 | #include "AliAnalysisManager.h" |
34137226 | 41 | #include "AliESDtrack.h" |
4e61a020 | 42 | #include "AliVertexerTracks.h" |
b557eb43 | 43 | #include "AliAODHandler.h" |
49061176 | 44 | #include "AliAODEvent.h" |
45 | #include "AliAODVertex.h" | |
46 | #include "AliAODTrack.h" | |
47 | #include "AliAODMCHeader.h" | |
48 | #include "AliAODMCParticle.h" | |
49 | #include "AliAODRecoDecayHF2Prong.h" | |
50 | #include "AliAODRecoCascadeHF.h" | |
51 | #include "AliAnalysisVertexingHF.h" | |
52 | #include "AliAnalysisTaskSE.h" | |
53 | #include "AliAnalysisTaskSED0Mass.h" | |
a96083b9 | 54 | #include "AliNormalizationCounter.h" |
b557eb43 | 55 | |
c64cb1f6 | 56 | using std::cout; |
57 | using std::endl; | |
58 | ||
49061176 | 59 | ClassImp(AliAnalysisTaskSED0Mass) |
60 | ||
61 | ||
62 | //________________________________________________________________________ | |
63 | AliAnalysisTaskSED0Mass::AliAnalysisTaskSED0Mass(): | |
64 | AliAnalysisTaskSE(), | |
a220990f | 65 | fOutputMass(0), |
90c70b48 | 66 | fOutputMassPt(0), |
a220990f | 67 | fDistr(0), |
68 | fNentries(0), | |
69 | fCuts(0), | |
70 | fArray(0), | |
71 | fReadMC(0), | |
72 | fCutOnDistr(0), | |
73 | fUsePid4Distr(0), | |
74 | fCounter(0), | |
75 | fNPtBins(1), | |
76 | fLsNormalization(1.), | |
77 | fFillOnlyD0D0bar(0), | |
78 | fDaughterTracks(), | |
79 | fIsSelectedCandidate(0), | |
80 | fFillVarHists(kTRUE), | |
2b35ac47 | 81 | fSys(0), |
90c70b48 | 82 | fIsRejectSDDClusters(0), |
83 | fFillPtHist(kTRUE), | |
84 | fFillImpParHist(kFALSE), | |
85 | fWriteVariableTree(kFALSE), | |
86 | fVariablesTree(0), | |
87 | fCandidateVariables() | |
49061176 | 88 | { |
89 | // Default constructor | |
5da7eaa9 | 90 | for(Int_t ih=0; ih<5; ih++) fHistMassPtImpParTC[ih]=0x0; |
90c70b48 | 91 | |
49061176 | 92 | } |
93 | ||
94 | //________________________________________________________________________ | |
ea0d8716 | 95 | AliAnalysisTaskSED0Mass::AliAnalysisTaskSED0Mass(const char *name,AliRDHFCutsD0toKpi* cuts): |
a220990f | 96 | AliAnalysisTaskSE(name), |
90c70b48 | 97 | fOutputMass(0), |
98 | fOutputMassPt(0), | |
a220990f | 99 | fDistr(0), |
100 | fNentries(0), | |
101 | fCuts(0), | |
102 | fArray(0), | |
103 | fReadMC(0), | |
104 | fCutOnDistr(0), | |
105 | fUsePid4Distr(0), | |
106 | fCounter(0), | |
107 | fNPtBins(1), | |
108 | fLsNormalization(1.), | |
109 | fFillOnlyD0D0bar(0), | |
110 | fDaughterTracks(), | |
111 | fIsSelectedCandidate(0), | |
112 | fFillVarHists(kTRUE), | |
2b35ac47 | 113 | fSys(0), |
90c70b48 | 114 | fIsRejectSDDClusters(0), |
115 | fFillPtHist(kTRUE), | |
116 | fFillImpParHist(kFALSE), | |
19f6b9ff | 117 | fUseSelectionBit(kTRUE), |
90c70b48 | 118 | fWriteVariableTree(kFALSE), |
119 | fVariablesTree(0), | |
120 | fCandidateVariables() | |
49061176 | 121 | { |
122 | // Default constructor | |
87020237 | 123 | |
124 | fNPtBins=cuts->GetNPtBins(); | |
4b4a1d25 | 125 | |
ea0d8716 | 126 | fCuts=cuts; |
5da7eaa9 | 127 | for(Int_t ih=0; ih<5; ih++) fHistMassPtImpParTC[ih]=0x0; |
ea0d8716 | 128 | |
129 | // Output slot #1 writes into a TList container (mass with cuts) | |
49061176 | 130 | DefineOutput(1,TList::Class()); //My private output |
ea0d8716 | 131 | // Output slot #2 writes into a TList container (distributions) |
90c70b48 | 132 | DefineOutput(2,TList::Class()); //My private output |
ea0d8716 | 133 | // Output slot #3 writes into a TH1F container (number of events) |
a4ae02cd | 134 | DefineOutput(3,TH1F::Class()); //My private output |
700e80e0 | 135 | // Output slot #4 writes into a TList container (cuts) |
136 | DefineOutput(4,AliRDHFCutsD0toKpi::Class()); //My private output | |
137 | // Output slot #5 writes Normalization Counter | |
138 | DefineOutput(5,AliNormalizationCounter::Class()); | |
90c70b48 | 139 | // Output slot #6 stores the mass vs pt and impact parameter distributions |
140 | DefineOutput(6,TList::Class()); //My private output | |
141 | // Output slot #7 keeps a tree of the candidate variables after track selection | |
142 | DefineOutput(7,TTree::Class()); //My private outpu | |
49061176 | 143 | } |
144 | ||
145 | //________________________________________________________________________ | |
146 | AliAnalysisTaskSED0Mass::~AliAnalysisTaskSED0Mass() | |
147 | { | |
a8ce111e | 148 | if (fOutputMass) { |
ea0d8716 | 149 | delete fOutputMass; |
150 | fOutputMass = 0; | |
a4ae02cd | 151 | } |
90c70b48 | 152 | if (fOutputMassPt) { |
153 | delete fOutputMassPt; | |
154 | fOutputMassPt = 0; | |
155 | } | |
a41f6fad | 156 | if (fDistr) { |
157 | delete fDistr; | |
158 | fDistr = 0; | |
159 | } | |
ea0d8716 | 160 | if (fCuts) { |
161 | delete fCuts; | |
162 | fCuts = 0; | |
49061176 | 163 | } |
90c70b48 | 164 | for(Int_t i=0; i<5; i++){ |
165 | if(fHistMassPtImpParTC[i]) delete fHistMassPtImpParTC[i]; | |
166 | } | |
46c96ce5 | 167 | if (fNentries){ |
168 | delete fNentries; | |
169 | fNentries = 0; | |
170 | } | |
a96083b9 | 171 | if(fCounter){ |
172 | delete fCounter; | |
173 | fCounter=0; | |
174 | } | |
90c70b48 | 175 | if(fVariablesTree){ |
176 | delete fVariablesTree; | |
177 | fVariablesTree = 0; | |
178 | } | |
ea0d8716 | 179 | |
49061176 | 180 | } |
181 | ||
182 | //________________________________________________________________________ | |
183 | void AliAnalysisTaskSED0Mass::Init() | |
184 | { | |
185 | // Initialization | |
186 | ||
187 | if(fDebug > 1) printf("AnalysisTaskSED0Mass::Init() \n"); | |
188 | ||
ea0d8716 | 189 | |
ea0d8716 | 190 | AliRDHFCutsD0toKpi* copyfCuts=new AliRDHFCutsD0toKpi(*fCuts); |
700e80e0 | 191 | const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName(); |
4e61a020 | 192 | copyfCuts->SetName(nameoutput); |
ea0d8716 | 193 | // Post the data |
700e80e0 | 194 | PostData(4,copyfCuts); |
4e61a020 | 195 | |
49061176 | 196 | |
49061176 | 197 | return; |
198 | } | |
199 | ||
200 | //________________________________________________________________________ | |
201 | void AliAnalysisTaskSED0Mass::UserCreateOutputObjects() | |
202 | { | |
203 | ||
204 | // Create the output container | |
205 | // | |
206 | if(fDebug > 1) printf("AnalysisTaskSED0Mass::UserCreateOutputObjects() \n"); | |
207 | ||
208 | // Several histograms are more conveniently managed in a TList | |
ea0d8716 | 209 | fOutputMass = new TList(); |
210 | fOutputMass->SetOwner(); | |
211 | fOutputMass->SetName("listMass"); | |
49061176 | 212 | |
90c70b48 | 213 | fOutputMassPt = new TList(); |
214 | fOutputMassPt->SetOwner(); | |
215 | fOutputMassPt->SetName("listMassPt"); | |
216 | ||
a41f6fad | 217 | fDistr = new TList(); |
218 | fDistr->SetOwner(); | |
219 | fDistr->SetName("distributionslist"); | |
220 | ||
0108fa62 | 221 | TString nameMass=" ",nameSgn27=" ",nameSgn=" ", nameBkg=" ", nameRfl=" ",nameMassNocutsS =" ",nameMassNocutsB =" ", namedistr=" "; |
90c70b48 | 222 | TString nameMassPt="", nameSgnPt="", nameBkgPt="", nameRflPt=""; |
223 | Int_t nbins2dPt=60; Float_t binInPt=0., binFinPt=30.; | |
49061176 | 224 | |
ea0d8716 | 225 | for(Int_t i=0;i<fCuts->GetNPtBins();i++){ |
b272aebf | 226 | |
7646d6da | 227 | nameMass="histMass_"; |
ea0d8716 | 228 | nameMass+=i; |
9de8c723 | 229 | nameSgn27="histSgn27_"; |
ea0d8716 | 230 | nameSgn27+=i; |
7646d6da | 231 | nameSgn="histSgn_"; |
ea0d8716 | 232 | nameSgn+=i; |
7646d6da | 233 | nameBkg="histBkg_"; |
ea0d8716 | 234 | nameBkg+=i; |
a4ae02cd | 235 | nameRfl="histRfl_"; |
ea0d8716 | 236 | nameRfl+=i; |
0108fa62 | 237 | nameMassNocutsS="hMassS_"; |
ea0d8716 | 238 | nameMassNocutsS+=i; |
0108fa62 | 239 | nameMassNocutsB="hMassB_"; |
ea0d8716 | 240 | nameMassNocutsB+=i; |
7646d6da | 241 | |
b272aebf | 242 | //histograms of cut variable distributions |
a8ce111e | 243 | if(fFillVarHists){ |
a220990f | 244 | if(fReadMC){ |
245 | // dca | |
246 | namedistr="hdcaS_"; | |
247 | namedistr+=i; | |
248 | TH1F *hdcaS = new TH1F(namedistr.Data(), "DCA distribution;dca [cm]",200,0.,0.1); | |
249 | // impact parameter | |
250 | namedistr="hd0piS_"; | |
251 | namedistr+=i; | |
252 | TH1F *hd0piS = new TH1F(namedistr.Data(), "Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1); | |
b272aebf | 253 | |
a220990f | 254 | namedistr="hd0KS_"; |
255 | namedistr+=i; | |
256 | TH1F *hd0KS = new TH1F(namedistr.Data(), "Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1); | |
257 | namedistr="hd0d0S_"; | |
258 | namedistr+=i; | |
259 | TH1F *hd0d0S = new TH1F(namedistr.Data(), "d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001); | |
260 | ||
261 | //decay lenght | |
262 | namedistr="hdeclS_"; | |
263 | namedistr+=i; | |
264 | TH1F *hdeclengthS = new TH1F(namedistr.Data(), "Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015); | |
b272aebf | 265 | |
a220990f | 266 | namedistr="hnormdeclS_"; |
267 | namedistr+=i; | |
268 | TH1F *hnormdeclengthS = new TH1F(namedistr.Data(), "Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.); | |
269 | ||
270 | namedistr="hdeclxyS_"; | |
271 | namedistr+=i; | |
272 | TH1F* hdeclxyS=new TH1F(namedistr.Data(),"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15); | |
273 | namedistr="hnormdeclxyS_"; | |
274 | namedistr+=i; | |
275 | TH1F* hnormdeclxyS=new TH1F(namedistr.Data(),"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.); | |
276 | ||
277 | namedistr="hdeclxyd0d0S_"; | |
278 | namedistr+=i; | |
279 | TH2F* hdeclxyd0d0S=new TH2F(namedistr.Data(),"Correlation decay Length XY - d_{0}#times d_{0};Decay Length XY [cm];d_{0}#times d_{0}[cm^{2}]",200,0,0.15,200,-0.001,0.001); | |
280 | ||
281 | namedistr="hnormdeclxyd0d0S_"; | |
282 | namedistr+=i; | |
283 | TH2F* hnormdeclxyd0d0S=new TH2F(namedistr.Data(),"Correlation normalized decay Length XY - d_{0}#times d_{0};Decay Length XY/Err;d_{0}#times d_{0}[cm^{2}]",200,0,6,200,-0.001,0.001); | |
284 | ||
285 | // costhetapoint | |
286 | namedistr="hcosthetapointS_"; | |
287 | namedistr+=i; | |
288 | TH1F *hcosthetapointS = new TH1F(namedistr.Data(), "cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.); | |
289 | ||
290 | namedistr="hcosthetapointxyS_"; | |
291 | namedistr+=i; | |
292 | TH1F *hcosthetapointxyS = new TH1F(namedistr.Data(), "cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.); | |
b272aebf | 293 | |
a220990f | 294 | TH1F* tmpMS = new TH1F(nameMassNocutsS.Data(),"D^{0} invariant mass; M [GeV]; Entries",300,1.5648,2.1648); //range (MD0-300MeV, mD0 + 300MeV) |
295 | tmpMS->Sumw2(); | |
296 | ||
297 | ||
298 | fDistr->Add(hdcaS); | |
299 | ||
300 | fDistr->Add(hd0piS); | |
301 | fDistr->Add(hd0KS); | |
302 | ||
303 | fDistr->Add(hd0d0S); | |
304 | ||
305 | fDistr->Add(hcosthetapointS); | |
306 | ||
307 | fDistr->Add(hcosthetapointxyS); | |
308 | ||
309 | fDistr->Add(hdeclengthS); | |
310 | ||
311 | fDistr->Add(hnormdeclengthS); | |
312 | ||
313 | fDistr->Add(hdeclxyS); | |
314 | ||
315 | fDistr->Add(hnormdeclxyS); | |
316 | ||
317 | fDistr->Add(hdeclxyd0d0S); | |
318 | fDistr->Add(hnormdeclxyd0d0S); | |
319 | ||
320 | fDistr->Add(tmpMS); | |
321 | } | |
b272aebf | 322 | |
a8ce111e | 323 | // dca |
a8ce111e | 324 | namedistr="hdcaB_"; |
325 | namedistr+=i; | |
326 | TH1F *hdcaB = new TH1F(namedistr.Data(), "DCA distribution;dca [cm]",200,0.,0.1); | |
b272aebf | 327 | |
a8ce111e | 328 | // impact parameter |
a8ce111e | 329 | namedistr="hd0B_"; |
330 | namedistr+=i; | |
331 | TH1F *hd0B = new TH1F(namedistr.Data(), "Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1); | |
332 | ||
a8ce111e | 333 | namedistr="hd0d0B_"; |
334 | namedistr+=i; | |
335 | TH1F *hd0d0B = new TH1F(namedistr.Data(), "d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001); | |
9af24f46 | 336 | |
a8ce111e | 337 | //decay lenght |
a220990f | 338 | namedistr="hdeclB_"; |
9af24f46 | 339 | namedistr+=i; |
a220990f | 340 | TH1F *hdeclengthB = new TH1F(namedistr.Data(), "Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015); |
9af24f46 | 341 | |
a220990f | 342 | namedistr="hnormdeclB_"; |
9af24f46 | 343 | namedistr+=i; |
a220990f | 344 | TH1F *hnormdeclengthB = new TH1F(namedistr.Data(), "Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.); |
a8ce111e | 345 | |
a220990f | 346 | namedistr="hdeclxyB_"; |
9af24f46 | 347 | namedistr+=i; |
a220990f | 348 | TH1F* hdeclxyB=new TH1F(namedistr.Data(),"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15); |
349 | namedistr="hnormdeclxyB_"; | |
350 | namedistr+=i; | |
351 | TH1F* hnormdeclxyB=new TH1F(namedistr.Data(),"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.); | |
9af24f46 | 352 | |
a220990f | 353 | namedistr="hdeclxyd0d0B_"; |
9af24f46 | 354 | namedistr+=i; |
a220990f | 355 | TH2F* hdeclxyd0d0B=new TH2F(namedistr.Data(),"Correlation decay Length XY - d_{0}#times d_{0};Decay Length XY [cm];d_{0}#times d_{0}[cm^{2}]",200,0,0.15,200,-0.001,0.001); |
9af24f46 | 356 | |
a220990f | 357 | namedistr="hnormdeclxyd0d0B_"; |
a8ce111e | 358 | namedistr+=i; |
a220990f | 359 | TH2F* hnormdeclxyd0d0B=new TH2F(namedistr.Data(),"Correlation normalized decay Length XY - d_{0}#times d_{0};Decay Length XY/Err;d_{0}#times d_{0}[cm^{2}]",200,0,6,200,-0.001,0.001); |
360 | ||
361 | // costhetapoint | |
a8ce111e | 362 | namedistr="hcosthetapointB_"; |
9af24f46 | 363 | namedistr+=i; |
a8ce111e | 364 | TH1F *hcosthetapointB = new TH1F(namedistr.Data(), "cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.); |
9af24f46 | 365 | |
a220990f | 366 | namedistr="hcosthetapointxyB_"; |
a8ce111e | 367 | namedistr+=i; |
a220990f | 368 | TH1F *hcosthetapointxyB = new TH1F(namedistr.Data(), "cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.); |
369 | ||
370 | TH1F* tmpMB = new TH1F(nameMassNocutsB.Data(),"D^{0} invariant mass; M [GeV]; Entries",300,1.5648,2.1648); //range (MD0-300MeV, mD0 + 300MeV) | |
371 | tmpMB->Sumw2(); | |
9af24f46 | 372 | |
a8ce111e | 373 | |
a8ce111e | 374 | |
a8ce111e | 375 | fDistr->Add(hdcaB); |
376 | ||
a8ce111e | 377 | fDistr->Add(hd0B); |
378 | ||
a8ce111e | 379 | fDistr->Add(hd0d0B); |
380 | ||
a8ce111e | 381 | fDistr->Add(hcosthetapointB); |
382 | ||
a220990f | 383 | fDistr->Add(hcosthetapointxyB); |
a8ce111e | 384 | |
a8ce111e | 385 | fDistr->Add(hdeclengthB); |
386 | ||
a8ce111e | 387 | fDistr->Add(hnormdeclengthB); |
388 | ||
a8ce111e | 389 | fDistr->Add(hdeclxyB); |
390 | ||
a8ce111e | 391 | fDistr->Add(hnormdeclxyB); |
392 | ||
a220990f | 393 | fDistr->Add(hdeclxyd0d0B); |
394 | fDistr->Add(hnormdeclxyd0d0B); | |
395 | ||
396 | fDistr->Add(tmpMB); | |
397 | ||
a8ce111e | 398 | //histograms filled only when the secondary vertex is recalculated w/o the daughter tracks (as requested in the cut object) |
399 | ||
400 | if(fCuts->GetIsPrimaryWithoutDaughters()){ | |
a220990f | 401 | if(fReadMC){ |
402 | namedistr="hd0vpiS_"; | |
403 | namedistr+=i; | |
404 | TH1F *hd0vpiS = new TH1F(namedistr.Data(), "Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1); | |
405 | ||
406 | namedistr="hd0vKS_"; | |
407 | namedistr+=i; | |
408 | TH1F *hd0vKS = new TH1F(namedistr.Data(), "Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1); | |
409 | ||
410 | namedistr="hd0d0vS_"; | |
411 | namedistr+=i; | |
412 | TH1F *hd0d0vS = new TH1F(namedistr.Data(), "d_{0}#timesd_{0} distribution (vtx w/o these tracks);d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001); | |
413 | ||
414 | namedistr="hdeclvS_"; | |
415 | namedistr+=i; | |
416 | TH1F *hdeclengthvS = new TH1F(namedistr.Data(), "Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6); | |
417 | ||
418 | namedistr="hnormdeclvS_"; | |
419 | namedistr+=i; | |
420 | TH1F *hnormdeclengthvS = new TH1F(namedistr.Data(), "Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.); | |
421 | ||
422 | fDistr->Add(hd0vpiS); | |
423 | fDistr->Add(hd0vKS); | |
424 | fDistr->Add(hd0d0vS); | |
425 | fDistr->Add(hdeclengthvS); | |
426 | fDistr->Add(hnormdeclengthvS); | |
427 | ||
428 | } | |
429 | ||
a8ce111e | 430 | namedistr="hd0vmoresB_"; |
431 | namedistr+=i; | |
432 | TH1F *hd0vmoresB = new TH1F(namedistr.Data(), "Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1); | |
433 | ||
434 | namedistr="hd0d0vmoresB_"; | |
435 | namedistr+=i; | |
436 | TH1F *hd0d0vmoresB = new TH1F(namedistr.Data(), "Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001); | |
437 | ||
438 | ||
a8ce111e | 439 | namedistr="hd0vB_"; |
440 | namedistr+=i; | |
441 | TH1F *hd0vB = new TH1F(namedistr.Data(), "Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1); | |
442 | ||
443 | namedistr="hd0vp0B_"; | |
444 | namedistr+=i; | |
445 | TH1F *hd0vp0B = new TH1F(namedistr.Data(), "Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1); | |
446 | ||
447 | namedistr="hd0vp1B_"; | |
448 | namedistr+=i; | |
449 | TH1F *hd0vp1B = new TH1F(namedistr.Data(), "Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1); | |
450 | ||
a8ce111e | 451 | namedistr="hd0d0vB_"; |
452 | namedistr+=i; | |
453 | TH1F *hd0d0vB = new TH1F(namedistr.Data(), "d_{0}#timesd_{0} distribution (vtx w/o these tracks);d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001); | |
9af24f46 | 454 | |
a8ce111e | 455 | namedistr="hdeclvB_"; |
456 | namedistr+=i; | |
457 | TH1F *hdeclengthvB = new TH1F(namedistr.Data(), "Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6); | |
9af24f46 | 458 | |
a8ce111e | 459 | namedistr="hnormdeclvB_"; |
460 | namedistr+=i; | |
461 | TH1F *hnormdeclengthvB = new TH1F(namedistr.Data(), "Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.); | |
9af24f46 | 462 | |
a8ce111e | 463 | fDistr->Add(hd0vB); |
464 | fDistr->Add(hd0vp0B); | |
465 | fDistr->Add(hd0vp1B); | |
466 | fDistr->Add(hd0vmoresB); | |
9af24f46 | 467 | |
a8ce111e | 468 | fDistr->Add(hd0d0vB); |
469 | fDistr->Add(hd0d0vmoresB); | |
9af24f46 | 470 | |
a8ce111e | 471 | fDistr->Add(hdeclengthvB); |
9af24f46 | 472 | |
a8ce111e | 473 | fDistr->Add(hnormdeclengthvB); |
474 | } | |
b272aebf | 475 | |
a8ce111e | 476 | |
477 | } | |
478 | //histograms of invariant mass distributions | |
a4ae02cd | 479 | |
0108fa62 | 480 | |
a220990f | 481 | //MC signal |
482 | if(fReadMC){ | |
483 | TH1F* tmpSt = new TH1F(nameSgn.Data(), "D^{0} invariant mass - MC; M [GeV]; Entries",200,1.5648,2.1648); | |
a4ae02cd | 484 | |
a220990f | 485 | TH1F *tmpSl=(TH1F*)tmpSt->Clone(); |
486 | tmpSt->Sumw2(); | |
487 | tmpSl->Sumw2(); | |
a4ae02cd | 488 | |
a220990f | 489 | //Reflection: histo filled with D0Mass which pass the cut (also) as D0bar and with D0bar which pass (also) the cut as D0 |
490 | TH1F* tmpRt = new TH1F(nameRfl.Data(), "Reflected signal invariant mass - MC; M [GeV]; Entries",200,1.5648,2.1648); | |
491 | //TH1F *tmpRl=(TH1F*)tmpRt->Clone(); | |
492 | TH1F* tmpBt = new TH1F(nameBkg.Data(), "Background invariant mass - MC; M [GeV]; Entries",200,1.5648,2.1648); | |
493 | //TH1F *tmpBl=(TH1F*)tmpBt->Clone(); | |
494 | tmpBt->Sumw2(); | |
495 | //tmpBl->Sumw2(); | |
496 | tmpRt->Sumw2(); | |
497 | //tmpRl->Sumw2(); | |
a4ae02cd | 498 | |
a220990f | 499 | fOutputMass->Add(tmpSt); |
500 | fOutputMass->Add(tmpRt); | |
501 | fOutputMass->Add(tmpBt); | |
502 | ||
503 | } | |
ea0d8716 | 504 | |
a8ce111e | 505 | //mass |
506 | TH1F* tmpMt = new TH1F(nameMass.Data(),"D^{0} invariant mass; M [GeV]; Entries",200,1.5648,2.1648); | |
a220990f | 507 | //TH1F *tmpMl=(TH1F*)tmpMt->Clone(); |
a8ce111e | 508 | tmpMt->Sumw2(); |
a220990f | 509 | //tmpMl->Sumw2(); |
a8ce111e | 510 | //distribution w/o cuts large range |
511 | // TH1F* tmpMS = new TH1F(nameMassNocutsS.Data(),"D^{0} invariant mass; M [GeV]; Entries",300,0.7,3.); | |
512 | ||
513 | fOutputMass->Add(tmpMt); | |
514 | ||
515 | if(fSys==0){ //histograms filled only in pp to save time in PbPb | |
516 | if(fFillVarHists){ | |
a8ce111e | 517 | |
a220990f | 518 | if(fReadMC){ |
519 | // pT | |
520 | namedistr="hptpiS_"; | |
521 | namedistr+=i; | |
522 | TH1F *hptpiS = new TH1F(namedistr.Data(), "P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.); | |
523 | ||
524 | namedistr="hptKS_"; | |
525 | namedistr+=i; | |
526 | TH1F *hptKS = new TH1F(namedistr.Data(), "P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.); | |
527 | ||
528 | // costhetastar | |
529 | namedistr="hcosthetastarS_"; | |
530 | namedistr+=i; | |
531 | TH1F *hcosthetastarS = new TH1F(namedistr.Data(), "cos#theta* distribution;cos#theta*",200,-1.,1.); | |
532 | ||
533 | //pT no mass cut | |
534 | ||
535 | namedistr="hptpiSnoMcut_"; | |
536 | namedistr+=i; | |
537 | TH1F *hptpiSnoMcut = new TH1F(namedistr.Data(), "P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.); | |
538 | ||
539 | namedistr="hptKSnoMcut_"; | |
540 | namedistr+=i; | |
541 | TH1F *hptKSnoMcut = new TH1F(namedistr.Data(), "P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.); | |
542 | ||
543 | fDistr->Add(hptpiS); | |
544 | fDistr->Add(hptKS); | |
545 | fDistr->Add(hcosthetastarS); | |
546 | ||
547 | fDistr->Add(hptpiSnoMcut); | |
548 | fDistr->Add(hptKSnoMcut); | |
549 | ||
550 | // costhetapoint vs d0 or d0d0 | |
551 | namedistr="hcosthpointd0S_"; | |
552 | namedistr+=i; | |
553 | TH2F *hcosthpointd0S= new TH2F(namedistr.Data(),"Correlation cos#theta_{Point}-d_{0};cos#theta_{Point};d_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001); | |
554 | namedistr="hcosthpointd0d0S_"; | |
555 | namedistr+=i; | |
556 | TH2F *hcosthpointd0d0S= new TH2F(namedistr.Data(),"Correlation cos#theta_{Point}-d_{0}#timesd_{0};cos#theta_{Point};d_{0}#timesd_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001); | |
557 | ||
558 | fDistr->Add(hcosthpointd0S); | |
559 | fDistr->Add(hcosthpointd0d0S); | |
560 | ||
561 | //to compare with AliAnalysisTaskCharmFraction | |
562 | TH1F* tmpS27t = new TH1F(nameSgn27.Data(),"D^{0} invariant mass in M(D^{0}) +/- 27 MeV - MC; M [GeV]; Entries",200,1.5648,2.1648); | |
563 | TH1F *tmpS27l=(TH1F*)tmpS27t->Clone(); | |
564 | tmpS27t->Sumw2(); | |
565 | tmpS27l->Sumw2(); | |
566 | ||
567 | fOutputMass->Add(tmpS27t); | |
568 | fOutputMass->Add(tmpS27l); | |
569 | ||
570 | } | |
571 | ||
572 | // pT | |
573 | namedistr="hptB_"; | |
a8ce111e | 574 | namedistr+=i; |
a220990f | 575 | TH1F *hptB = new TH1F(namedistr.Data(), "P_{T} distribution;p_{T} [GeV/c]",200,0.,8.); |
a8ce111e | 576 | |
a220990f | 577 | // costhetastar |
578 | namedistr="hcosthetastarB_"; | |
a8ce111e | 579 | namedistr+=i; |
a220990f | 580 | TH1F *hcosthetastarB = new TH1F(namedistr.Data(), "cos#theta* distribution;cos#theta*",200,-1.,1.); |
a8ce111e | 581 | |
a220990f | 582 | //pT no mass cut |
a8ce111e | 583 | namedistr="hptB1prongnoMcut_"; |
584 | namedistr+=i; | |
585 | TH1F *hptB1pnoMcut = new TH1F(namedistr.Data(), "P_{T} distribution;p_{T} [GeV/c]",200,0.,8.); | |
586 | ||
587 | namedistr="hptB2prongsnoMcut_"; | |
588 | namedistr+=i; | |
589 | TH1F *hptB2pnoMcut = new TH1F(namedistr.Data(), "P_{T} distribution;p_{T} [GeV/c]",200,0.,8.); | |
590 | ||
a220990f | 591 | fDistr->Add(hptB); |
592 | fDistr->Add(hcosthetastarB); | |
593 | ||
a8ce111e | 594 | fDistr->Add(hptB1pnoMcut); |
595 | fDistr->Add(hptB2pnoMcut); | |
596 | ||
597 | //impact parameter of negative/positive track | |
598 | namedistr="hd0p0B_"; | |
599 | namedistr+=i; | |
600 | TH1F *hd0p0B = new TH1F(namedistr.Data(), "Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1); | |
601 | ||
602 | namedistr="hd0p1B_"; | |
603 | namedistr+=i; | |
604 | TH1F *hd0p1B = new TH1F(namedistr.Data(), "Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1); | |
605 | ||
606 | //impact parameter corrected for strangeness | |
607 | namedistr="hd0moresB_"; | |
608 | namedistr+=i; | |
609 | TH1F *hd0moresB = new TH1F(namedistr.Data(), "Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1); | |
0108fa62 | 610 | |
a8ce111e | 611 | namedistr="hd0d0moresB_"; |
612 | namedistr+=i; | |
613 | TH1F *hd0d0moresB = new TH1F(namedistr.Data(), "Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001); | |
614 | ||
615 | ||
616 | namedistr="hcosthetapointmoresB_"; | |
617 | namedistr+=i; | |
618 | TH1F *hcosthetapointmoresB = new TH1F(namedistr.Data(), "cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.); | |
619 | ||
620 | // costhetapoint vs d0 or d0d0 | |
a8ce111e | 621 | namedistr="hcosthpointd0B_"; |
622 | namedistr+=i; | |
623 | TH2F *hcosthpointd0B= new TH2F(namedistr.Data(),"Correlation cos#theta_{Point}-d_{0};cos#theta_{Point};d_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001); | |
624 | ||
a8ce111e | 625 | namedistr="hcosthpointd0d0B_"; |
626 | namedistr+=i; | |
627 | TH2F *hcosthpointd0d0B= new TH2F(namedistr.Data(),"Correlation cos#theta_{Point}-d_{0}#timesd_{0};cos#theta_{Point};d_{0}#timesd_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001); | |
628 | ||
629 | fDistr->Add(hd0p0B); | |
630 | fDistr->Add(hd0p1B); | |
631 | ||
632 | fDistr->Add(hd0moresB); | |
633 | fDistr->Add(hd0d0moresB); | |
634 | fDistr->Add(hcosthetapointmoresB); | |
635 | ||
a220990f | 636 | |
a8ce111e | 637 | fDistr->Add(hcosthpointd0B); |
638 | ||
a220990f | 639 | |
a8ce111e | 640 | fDistr->Add(hcosthpointd0d0B); |
641 | } | |
34137226 | 642 | |
a8ce111e | 643 | } //end pp histo |
7646d6da | 644 | } |
a4ae02cd | 645 | |
a8ce111e | 646 | |
647 | //for Like sign analysis | |
648 | ||
9af24f46 | 649 | if(fArray==1){ |
650 | namedistr="hpospair"; | |
82487ae7 | 651 | TH1F* hpospair=new TH1F(namedistr.Data(),"Number of positive pairs",fCuts->GetNPtBins(),-0.5,fCuts->GetNPtBins()-0.5); |
9af24f46 | 652 | namedistr="hnegpair"; |
82487ae7 | 653 | TH1F* hnegpair=new TH1F(namedistr.Data(),"Number of negative pairs",fCuts->GetNPtBins(),-0.5,fCuts->GetNPtBins()-0.5); |
818c1271 | 654 | fOutputMass->Add(hpospair); |
655 | fOutputMass->Add(hnegpair); | |
9af24f46 | 656 | } |
449b1302 | 657 | |
90c70b48 | 658 | |
659 | // 2D Pt distributions and impact parameter histograms | |
660 | if(fFillPtHist) { | |
661 | ||
662 | nameMassPt="histMassPt"; | |
663 | nameSgnPt="histSgnPt"; | |
664 | nameBkgPt="histBkgPt"; | |
665 | nameRflPt="histRflPt"; | |
666 | ||
667 | //MC signal | |
668 | if(fReadMC){ | |
669 | TH2F* tmpStPt = new TH2F(nameSgnPt.Data(), "D^{0} invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",200,1.5648,2.16484,nbins2dPt,binInPt,binFinPt); | |
670 | TH2F *tmpSlPt=(TH2F*)tmpStPt->Clone(); | |
671 | tmpStPt->Sumw2(); | |
672 | tmpSlPt->Sumw2(); | |
673 | ||
674 | //Reflection: histo filled with D0MassV1 which pass the cut (also) as D0bar and with D0bar which pass (also) the cut as D0 | |
675 | TH2F* tmpRtPt = new TH2F(nameRflPt.Data(), "Reflected signal invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",200,1.5648,2.1648,nbins2dPt,binInPt,binFinPt); | |
676 | TH2F* tmpBtPt = new TH2F(nameBkgPt.Data(), "Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",200,1.5648,2.1648,nbins2dPt,binInPt,binFinPt); | |
677 | tmpBtPt->Sumw2(); | |
678 | tmpRtPt->Sumw2(); | |
679 | ||
680 | fOutputMassPt->Add(tmpStPt); | |
681 | fOutputMassPt->Add(tmpRtPt); | |
682 | fOutputMassPt->Add(tmpBtPt); | |
683 | ||
684 | // cout<<endl<<endl<<"***************************************"<<endl; | |
685 | // cout << " created and added to the list "<< nameSgnPt.Data() <<" "<< tmpStPt << | |
686 | // ", "<<nameRflPt.Data() <<" " << tmpRtPt<<", "<<nameBkgPt.Data()<< " " << tmpBtPt <<endl; | |
687 | // cout<<"***************************************"<<endl<<endl; | |
688 | } | |
689 | ||
690 | TH2F* tmpMtPt = new TH2F(nameMassPt.Data(),"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",200,1.5648,2.1648,nbins2dPt,binInPt,binFinPt); | |
691 | tmpMtPt->Sumw2(); | |
692 | ||
693 | fOutputMassPt->Add(tmpMtPt); | |
694 | } | |
695 | ||
696 | if(fFillImpParHist) CreateImpactParameterHistos(); | |
697 | ||
5b2e5fae | 698 | const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName(); |
4e61a020 | 699 | |
90c70b48 | 700 | fNentries=new TH1F(nameoutput, "Integral(1,2) = number of AODs *** Integral(2,3) = number of candidates selected with cuts *** Integral(3,4) = number of D0 selected with cuts *** Integral(4,5) = events with good vertex *** Integral(5,6) = pt out of bounds", 18,-0.5,17.5); |
34137226 | 701 | |
702 | fNentries->GetXaxis()->SetBinLabel(1,"nEventsAnal"); | |
4e61a020 | 703 | fNentries->GetXaxis()->SetBinLabel(2,"nCandSel(Cuts)"); |
818c1271 | 704 | if(fReadMC) fNentries->GetXaxis()->SetBinLabel(3,"nD0Selected"); |
705 | else fNentries->GetXaxis()->SetBinLabel(3,"Dstar<-D0"); | |
6b3e3c78 | 706 | fNentries->GetXaxis()->SetBinLabel(4,"nEventsGoodVtxS"); |
700e80e0 | 707 | fNentries->GetXaxis()->SetBinLabel(5,"ptbin = -1"); |
708 | fNentries->GetXaxis()->SetBinLabel(6,"no daughter"); | |
a8ce111e | 709 | if(fSys==0) fNentries->GetXaxis()->SetBinLabel(7,"nCandSel(Tr)"); |
710 | if(fFillVarHists){ | |
711 | fNentries->GetXaxis()->SetBinLabel(8,"PID=0"); | |
712 | fNentries->GetXaxis()->SetBinLabel(9,"PID=1"); | |
713 | fNentries->GetXaxis()->SetBinLabel(10,"PID=2"); | |
714 | fNentries->GetXaxis()->SetBinLabel(11,"PID=3"); | |
715 | } | |
716 | if(fReadMC && fSys==0){ | |
717 | fNentries->GetXaxis()->SetBinLabel(12,"K"); | |
718 | fNentries->GetXaxis()->SetBinLabel(13,"Lambda"); | |
719 | } | |
700e80e0 | 720 | fNentries->GetXaxis()->SetBinLabel(14,"Pile-up Rej"); |
a3aa1279 | 721 | fNentries->GetXaxis()->SetBinLabel(15,"N. of 0SMH"); |
a220990f | 722 | if(fSys==1) fNentries->GetXaxis()->SetBinLabel(16,"Nev in centr"); |
2b35ac47 | 723 | if(fIsRejectSDDClusters) fNentries->GetXaxis()->SetBinLabel(17,"SDD-Cls Rej"); |
90c70b48 | 724 | fNentries->GetXaxis()->SetBinLabel(18,"Phys.Sel.Rej"); |
34137226 | 725 | fNentries->GetXaxis()->SetNdivisions(1,kFALSE); |
a4ae02cd | 726 | |
700e80e0 | 727 | fCounter = new AliNormalizationCounter(Form("%s",GetOutputSlot(5)->GetContainer()->GetName())); |
38802708 | 728 | fCounter->Init(); |
a96083b9 | 729 | |
90c70b48 | 730 | // |
731 | // Output slot 7 : tree of the candidate variables after track selection | |
732 | // | |
733 | nameoutput = GetOutputSlot(7)->GetContainer()->GetName(); | |
734 | fVariablesTree = new TTree(nameoutput,"Candidates variables tree"); | |
735 | Int_t nVar = 15; | |
736 | fCandidateVariables = new Double_t [nVar]; | |
737 | TString * fCandidateVariableNames = new TString[nVar]; | |
738 | fCandidateVariableNames[0]="massD0"; fCandidateVariableNames[1]="massD0bar"; fCandidateVariableNames[2]="pt"; | |
739 | fCandidateVariableNames[3]="dca"; fCandidateVariableNames[4]="costhsD0"; fCandidateVariableNames[5]="costhsD0bar"; | |
740 | fCandidateVariableNames[6]="ptk"; fCandidateVariableNames[7]="ptpi"; | |
741 | fCandidateVariableNames[8]="d0k"; fCandidateVariableNames[9]="d0pi"; fCandidateVariableNames[10]="d0xd0"; | |
742 | fCandidateVariableNames[11]="costhp"; fCandidateVariableNames[12]="costhpxy"; | |
743 | fCandidateVariableNames[13]="lxy"; fCandidateVariableNames[14]="specialcuts"; | |
744 | for(Int_t ivar=0; ivar<nVar; ivar++){ | |
745 | fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/d",fCandidateVariableNames[ivar].Data())); | |
746 | } | |
747 | ||
40445ada | 748 | // Post the data |
ea0d8716 | 749 | PostData(1,fOutputMass); |
90c70b48 | 750 | PostData(2,fDistr); |
40445ada | 751 | PostData(3,fNentries); |
700e80e0 | 752 | PostData(5,fCounter); |
90c70b48 | 753 | PostData(6,fOutputMassPt); |
754 | PostData(7,fVariablesTree); | |
755 | ||
49061176 | 756 | return; |
757 | } | |
758 | ||
759 | //________________________________________________________________________ | |
760 | void AliAnalysisTaskSED0Mass::UserExec(Option_t */*option*/) | |
761 | { | |
762 | // Execute analysis for current event: | |
763 | // heavy flavor candidates association to MC truth | |
a4ae02cd | 764 | //cout<<"I'm in UserExec"<<endl; |
ea0d8716 | 765 | |
766 | ||
a220990f | 767 | //cuts order |
768 | // printf(" |M-MD0| [GeV] < %f\n",fD0toKpiCuts[0]); | |
769 | // printf(" dca [cm] < %f\n",fD0toKpiCuts[1]); | |
770 | // printf(" cosThetaStar < %f\n",fD0toKpiCuts[2]); | |
771 | // printf(" pTK [GeV/c] > %f\n",fD0toKpiCuts[3]); | |
772 | // printf(" pTpi [GeV/c] > %f\n",fD0toKpiCuts[4]); | |
773 | // printf(" |d0K| [cm] < %f\n",fD0toKpiCuts[5]); | |
774 | // printf(" |d0pi| [cm] < %f\n",fD0toKpiCuts[6]); | |
775 | // printf(" d0d0 [cm^2] < %f\n",fD0toKpiCuts[7]); | |
776 | // printf(" cosThetaPoint > %f\n",fD0toKpiCuts[8]); | |
ea0d8716 | 777 | |
778 | ||
49061176 | 779 | AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent()); |
feb73eca | 780 | |
b557eb43 | 781 | TString bname; |
feb73eca | 782 | if(fArray==0){ //D0 candidates |
b557eb43 | 783 | // load D0->Kpi candidates |
feb73eca | 784 | //cout<<"D0 candidates"<<endl; |
b557eb43 | 785 | bname="D0toKpi"; |
feb73eca | 786 | } else { //LikeSign candidates |
feb73eca | 787 | // load like sign candidates |
b557eb43 | 788 | //cout<<"LS candidates"<<endl; |
789 | bname="LikeSign2Prong"; | |
790 | } | |
791 | ||
792 | TClonesArray *inputArray=0; | |
34137226 | 793 | |
b557eb43 | 794 | if(!aod && AODEvent() && IsStandardAOD()) { |
795 | // In case there is an AOD handler writing a standard AOD, use the AOD | |
796 | // event in memory rather than the input (ESD) event. | |
797 | aod = dynamic_cast<AliAODEvent*> (AODEvent()); | |
798 | // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root) | |
799 | // have to taken from the AOD event hold by the AliAODExtension | |
800 | AliAODHandler* aodHandler = (AliAODHandler*) | |
801 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
34137226 | 802 | |
b557eb43 | 803 | if(aodHandler->GetExtensions()) { |
804 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root"); | |
34137226 | 805 | AliAODEvent* aodFromExt = ext->GetAOD(); |
b557eb43 | 806 | inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data()); |
feb73eca | 807 | } |
dc222f77 | 808 | } else if(aod) { |
b557eb43 | 809 | inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data()); |
810 | } | |
feb73eca | 811 | |
b557eb43 | 812 | |
dc222f77 | 813 | if(!inputArray || !aod) { |
b557eb43 | 814 | printf("AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n"); |
815 | return; | |
49061176 | 816 | } |
817 | ||
6b3e3c78 | 818 | // fix for temporary bug in ESDfilter |
7c23877d | 819 | // the AODs with null vertex pointer didn't pass the PhysSel |
5806c290 | 820 | if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) return; |
821 | ||
7c23877d | 822 | |
ce39f0ac | 823 | TClonesArray *mcArray = 0; |
824 | AliAODMCHeader *mcHeader = 0; | |
825 | ||
826 | if(fReadMC) { | |
827 | // load MC particles | |
828 | mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName()); | |
829 | if(!mcArray) { | |
830 | printf("AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n"); | |
831 | return; | |
832 | } | |
40445ada | 833 | |
ce39f0ac | 834 | // load MC header |
835 | mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName()); | |
836 | if(!mcHeader) { | |
837 | printf("AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n"); | |
838 | return; | |
839 | } | |
49061176 | 840 | } |
841 | ||
b557eb43 | 842 | //printf("VERTEX Z %f %f\n",vtx1->GetZ(),mcHeader->GetVtxZ()); |
40445ada | 843 | |
a4ae02cd | 844 | //histogram filled with 1 for every AOD |
34137226 | 845 | fNentries->Fill(0); |
1879baec | 846 | fCounter->StoreEvent(aod,fCuts,fReadMC); |
847 | //fCounter->StoreEvent(aod,fReadMC); | |
a3aa1279 | 848 | |
849 | // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL | |
850 | TString trigclass=aod->GetFiredTriggerClasses(); | |
851 | if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNentries->Fill(14); | |
852 | ||
d52f7b50 | 853 | if(!fCuts->IsEventSelected(aod)) { |
854 | if(fCuts->GetWhyRejection()==1) // rejected for pileup | |
700e80e0 | 855 | fNentries->Fill(13); |
a220990f | 856 | if(fSys==1 && (fCuts->GetWhyRejection()==2 || fCuts->GetWhyRejection()==3)) fNentries->Fill(15); |
90c70b48 | 857 | if(fCuts->GetWhyRejection()==7) fNentries->Fill(17); |
d52f7b50 | 858 | return; |
859 | } | |
2b35ac47 | 860 | |
861 | // Check the Nb of SDD clusters | |
862 | if (fIsRejectSDDClusters) { | |
863 | Bool_t skipEvent = kFALSE; | |
864 | Int_t ntracks = 0; | |
865 | if (aod) ntracks = aod->GetNTracks(); | |
866 | for(Int_t itrack=0; itrack<ntracks; itrack++) { // loop on tacks | |
867 | // ... get the track | |
868 | AliAODTrack * track = aod->GetTrack(itrack); | |
869 | if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){ | |
870 | skipEvent=kTRUE; | |
871 | fNentries->Fill(16); | |
872 | break; | |
873 | } | |
874 | } | |
875 | if (skipEvent) return; | |
876 | } | |
40445ada | 877 | |
878 | // AOD primary vertex | |
879 | AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex(); | |
b272aebf | 880 | |
40445ada | 881 | Bool_t isGoodVtx=kFALSE; |
b272aebf | 882 | |
a220990f | 883 | //vtx1->Print(); |
40445ada | 884 | TString primTitle = vtx1->GetTitle(); |
885 | if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) { | |
886 | isGoodVtx=kTRUE; | |
887 | fNentries->Fill(3); | |
888 | } | |
889 | ||
75638da0 | 890 | // loop over candidates |
891 | Int_t nInD0toKpi = inputArray->GetEntriesFast(); | |
4e61a020 | 892 | if(fDebug>2) printf("Number of D0->Kpi: %d\n",nInD0toKpi); |
75638da0 | 893 | |
6b3e3c78 | 894 | // FILE *f=fopen("4display.txt","a"); |
895 | // fprintf(f,"Number of D0->Kpi: %d\n",nInD0toKpi); | |
a96083b9 | 896 | Int_t nSelectedloose=0,nSelectedtight=0; |
75638da0 | 897 | for (Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) { |
75638da0 | 898 | AliAODRecoDecayHF2Prong *d = (AliAODRecoDecayHF2Prong*)inputArray->UncheckedAt(iD0toKpi); |
818c1271 | 899 | |
19f6b9ff | 900 | if(fUseSelectionBit && d->GetSelectionMap()) if(!d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)){ |
90c70b48 | 901 | fNentries->Fill(2); |
818c1271 | 902 | continue; //skip the D0 from Dstar |
903 | } | |
a220990f | 904 | |
600faffe | 905 | // Bool_t unsetvtx=kFALSE; |
906 | // if(!d->GetOwnPrimaryVtx()) { | |
907 | // d->SetOwnPrimaryVtx(vtx1); // needed to compute all variables | |
908 | // unsetvtx=kTRUE; | |
909 | // } | |
ea0d8716 | 910 | |
4e61a020 | 911 | |
4e61a020 | 912 | if ( fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(421)) ) { |
a96083b9 | 913 | nSelectedloose++; |
d7688946 | 914 | nSelectedtight++; |
a8ce111e | 915 | if(fSys==0){ |
916 | if(fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod))fNentries->Fill(6); | |
917 | } | |
6b3e3c78 | 918 | Int_t ptbin=fCuts->PtBin(d->Pt()); |
700e80e0 | 919 | if(ptbin==-1) {fNentries->Fill(4); continue;} //out of bounds |
90c70b48 | 920 | fIsSelectedCandidate=fCuts->IsSelected(d,AliRDHFCuts::kAll,aod); //selected |
d7688946 | 921 | if(fFillVarHists) { |
a8ce111e | 922 | //if(!fCutOnDistr || (fCutOnDistr && fIsSelectedCandidate)) { |
a220990f | 923 | fDaughterTracks.AddAt((AliAODTrack*)d->GetDaughter(0),0); |
924 | fDaughterTracks.AddAt((AliAODTrack*)d->GetDaughter(1),1); | |
925 | //check daughters | |
926 | if(!fDaughterTracks.UncheckedAt(0) || !fDaughterTracks.UncheckedAt(1)) { | |
927 | AliDebug(1,"at least one daughter not found!"); | |
928 | fNentries->Fill(5); | |
929 | fDaughterTracks.Clear(); | |
930 | continue; | |
931 | } | |
932 | //} | |
d7688946 | 933 | FillVarHists(aod,d,mcArray,fCuts,fDistr); |
934 | } | |
a8ce111e | 935 | |
90c70b48 | 936 | FillMassHists(d,mcArray,mcHeader,fCuts,fOutputMass); |
75638da0 | 937 | } |
ea0d8716 | 938 | |
d7688946 | 939 | fDaughterTracks.Clear(); |
600faffe | 940 | //if(unsetvtx) d->UnsetOwnPrimaryVtx(); |
75638da0 | 941 | } //end for prongs |
a96083b9 | 942 | fCounter->StoreCandidates(aod,nSelectedloose,kTRUE); |
943 | fCounter->StoreCandidates(aod,nSelectedtight,kFALSE); | |
40445ada | 944 | // Post the data |
ea0d8716 | 945 | PostData(1,fOutputMass); |
90c70b48 | 946 | PostData(2,fDistr); |
40445ada | 947 | PostData(3,fNentries); |
700e80e0 | 948 | PostData(5,fCounter); |
90c70b48 | 949 | PostData(6,fOutputMassPt); |
950 | PostData(7,fVariablesTree); | |
951 | ||
40445ada | 952 | return; |
953 | } | |
b272aebf | 954 | |
40445ada | 955 | //____________________________________________________________________________ |
4e61a020 | 956 | void AliAnalysisTaskSED0Mass::FillVarHists(AliAODEvent* aod,AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout){ |
40445ada | 957 | // |
958 | // function used in UserExec to fill variable histograms: | |
959 | // | |
b272aebf | 960 | |
b272aebf | 961 | |
40445ada | 962 | Int_t pdgDgD0toKpi[2]={321,211}; |
963 | Int_t lab=-9999; | |
964 | if(fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi); //return MC particle label if the array corresponds to a D0, -1 if not (cf. AliAODRecoDecay.cxx) | |
965 | //Double_t pt = d->Pt(); //mother pt | |
a8ce111e | 966 | Int_t isSelectedPID=3; |
967 | if(!fReadMC || (fReadMC && fUsePid4Distr)) isSelectedPID=cuts->IsSelectedPID(part); //0 rejected,1 D0,2 Dobar, 3 both | |
700e80e0 | 968 | if (isSelectedPID==0)fNentries->Fill(7); |
969 | if (isSelectedPID==1)fNentries->Fill(8); | |
970 | if (isSelectedPID==2)fNentries->Fill(9); | |
971 | if (isSelectedPID==3)fNentries->Fill(10); | |
a220990f | 972 | //fNentries->Fill(8+isSelectedPID); |
3cc4604b | 973 | |
a8ce111e | 974 | if(fCutOnDistr && !fIsSelectedCandidate) return; |
d7688946 | 975 | //printf("\nif no cuts or cuts passed\n"); |
976 | ||
977 | ||
978 | //add distr here | |
979 | UInt_t pdgs[2]; | |
980 | ||
981 | Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
982 | pdgs[0]=211; | |
983 | pdgs[1]=321; | |
984 | Double_t minvD0 = part->InvMassD0(); | |
985 | pdgs[1]=211; | |
986 | pdgs[0]=321; | |
987 | Double_t minvD0bar = part->InvMassD0bar(); | |
988 | //cout<<"inside mass cut"<<endl; | |
0108fa62 | 989 | |
4e61a020 | 990 | Double_t invmasscut=0.03; |
991 | ||
90c70b48 | 992 | TString fillthispi="",fillthisK="",fillthis="", fillthispt=""; |
b272aebf | 993 | |
ea0d8716 | 994 | Int_t ptbin=cuts->PtBin(part->Pt()); |
90c70b48 | 995 | Double_t pt = part->Pt(); |
6b3e3c78 | 996 | |
4e61a020 | 997 | Double_t dz1[2],dz2[2],covar1[3],covar2[3];//,d0xd0proper,errd0xd0proper; |
998 | dz1[0]=-99; dz2[0]=-99; | |
9af24f46 | 999 | Double_t d0[2]; |
1000 | Double_t decl[2]={-99,-99}; | |
1001 | Bool_t recalcvtx=kFALSE; | |
1002 | ||
d7688946 | 1003 | |
1004 | ||
9af24f46 | 1005 | if(fCuts->GetIsPrimaryWithoutDaughters()){ |
1006 | recalcvtx=kTRUE; | |
1007 | //recalculate vertex | |
1008 | AliAODVertex *vtxProp=0x0; | |
d7688946 | 1009 | vtxProp=GetPrimaryVtxSkipped(aod); |
9af24f46 | 1010 | if(vtxProp) { |
1011 | part->SetOwnPrimaryVtx(vtxProp); | |
1012 | //Bool_t unsetvtx=kTRUE; | |
1013 | //Calculate d0 for daughter tracks with Vtx Skipped | |
d7688946 | 1014 | AliESDtrack *esdtrack1=new AliESDtrack((AliVTrack*)fDaughterTracks.UncheckedAt(0)); |
1015 | AliESDtrack *esdtrack2=new AliESDtrack((AliVTrack*)fDaughterTracks.UncheckedAt(1)); | |
9af24f46 | 1016 | esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1); |
1017 | esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2); | |
1018 | delete vtxProp; vtxProp=NULL; | |
1019 | delete esdtrack1; | |
1020 | delete esdtrack2; | |
1021 | } | |
1022 | ||
1023 | d0[0]=dz1[0]; | |
1024 | d0[1]=dz2[0]; | |
1025 | ||
a8ce111e | 1026 | decl[0]=part->DecayLength2(); |
1027 | decl[1]=part->NormalizedDecayLength2(); | |
9af24f46 | 1028 | part->UnsetOwnPrimaryVtx(); |
1029 | ||
4e61a020 | 1030 | } |
1031 | ||
d7688946 | 1032 | Double_t cosThetaStarD0 = 99; |
1033 | Double_t cosThetaStarD0bar = 99; | |
1034 | Double_t cosPointingAngle = 99; | |
a8ce111e | 1035 | Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1; |
1036 | Double_t decayLength2 = -1, decayLengthxy=-1; | |
d7688946 | 1037 | Double_t ptProng[2]={-99,-99}; |
a8ce111e | 1038 | Double_t d0Prong[2]={-99,-99}; |
d7688946 | 1039 | |
0108fa62 | 1040 | |
a220990f | 1041 | //disable the PID |
1042 | if(!fUsePid4Distr) isSelectedPID=0; | |
1043 | if((lab>=0 && fReadMC) || (!fReadMC && isSelectedPID)){ //signal (from MC or PID) | |
9af24f46 | 1044 | |
a220990f | 1045 | //check pdg of the prongs |
1046 | AliAODTrack *prong0=(AliAODTrack*)fDaughterTracks.UncheckedAt(0); | |
1047 | AliAODTrack *prong1=(AliAODTrack*)fDaughterTracks.UncheckedAt(1); | |
6b3e3c78 | 1048 | |
a220990f | 1049 | if(!prong0 || !prong1) { |
1050 | return; | |
1051 | } | |
1052 | Int_t labprong[2]; | |
1053 | if(fReadMC){ | |
1054 | labprong[0]=prong0->GetLabel(); | |
1055 | labprong[1]=prong1->GetLabel(); | |
1056 | } | |
1057 | AliAODMCParticle *mcprong=0; | |
1058 | Int_t pdgProng[2]={0,0}; | |
1059 | ||
1060 | for (Int_t iprong=0;iprong<2;iprong++){ | |
1061 | if(fReadMC && labprong[iprong]>=0) { | |
1062 | mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]); | |
1063 | pdgProng[iprong]=mcprong->GetPdgCode(); | |
0108fa62 | 1064 | } |
a220990f | 1065 | } |
6b3e3c78 | 1066 | |
a220990f | 1067 | if(fSys==0){ |
1068 | //no mass cut ditributions: ptbis | |
40445ada | 1069 | |
a220990f | 1070 | fillthispi="hptpiSnoMcut_"; |
1071 | fillthispi+=ptbin; | |
a8ce111e | 1072 | |
a220990f | 1073 | fillthisK="hptKSnoMcut_"; |
1074 | fillthisK+=ptbin; | |
a8ce111e | 1075 | |
a220990f | 1076 | if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321) |
1077 | || (isSelectedPID==1 || isSelectedPID==3)){ | |
1078 | ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt()); | |
1079 | ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt()); | |
1080 | } | |
a8ce111e | 1081 | |
a220990f | 1082 | if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211) |
1083 | || (isSelectedPID==2 || isSelectedPID==3)){ | |
1084 | ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt()); | |
1085 | ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt()); | |
a8ce111e | 1086 | } |
a220990f | 1087 | } |
a8ce111e | 1088 | |
a220990f | 1089 | //no mass cut ditributions: mass |
1090 | fillthis="hMassS_"; | |
1091 | fillthis+=ptbin; | |
90c70b48 | 1092 | fillthispt="histSgnPt"; |
40445ada | 1093 | |
a220990f | 1094 | if ((fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421) |
1095 | || (!fReadMC && (isSelectedPID==1 || isSelectedPID==3))){//D0 | |
1096 | ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0); | |
90c70b48 | 1097 | if(fFillPtHist && fReadMC) ((TH2F*)fOutputMassPt->FindObject(fillthispt))->Fill(minvD0,pt); |
a220990f | 1098 | } |
1099 | else { //D0bar | |
90c70b48 | 1100 | if(fReadMC || (!fReadMC && isSelectedPID > 1)){ |
40445ada | 1101 | ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar); |
90c70b48 | 1102 | if(fFillPtHist && fReadMC) ((TH2F*)fOutputMassPt->FindObject(fillthispt))->Fill(minvD0bar,pt); |
1103 | } | |
a220990f | 1104 | } |
4e61a020 | 1105 | |
a220990f | 1106 | //apply cut on invariant mass on the pair |
1107 | if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){ | |
d7688946 | 1108 | |
a220990f | 1109 | cosThetaStarD0 = part->CosThetaStarD0(); |
1110 | cosThetaStarD0bar = part->CosThetaStarD0bar(); | |
1111 | cosPointingAngle = part->CosPointingAngle(); | |
1112 | normalizedDecayLength2 = part->NormalizedDecayLength2(); | |
1113 | decayLength2 = part->DecayLength2(); | |
1114 | decayLengthxy = part->DecayLengthXY(); | |
1115 | normalizedDecayLengthxy=decayLengthxy/part->DecayLengthXYError(); | |
a8ce111e | 1116 | |
a220990f | 1117 | ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt(); |
a220990f | 1118 | d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1); |
a8ce111e | 1119 | |
a220990f | 1120 | if(fArray==1) cout<<"LS signal: ERROR"<<endl; |
1121 | for (Int_t iprong=0; iprong<2; iprong++){ | |
1122 | AliAODTrack *prong=(AliAODTrack*)fDaughterTracks.UncheckedAt(iprong); | |
1123 | if (fReadMC) labprong[iprong]=prong->GetLabel(); | |
40445ada | 1124 | |
a220990f | 1125 | //cout<<"prong name = "<<prong->GetName()<<" label = "<<prong->GetLabel()<<endl; |
1126 | Int_t pdgprong=0; | |
1127 | if(fReadMC && labprong[iprong]>=0) { | |
1128 | mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]); | |
1129 | pdgprong=mcprong->GetPdgCode(); | |
1130 | } | |
6b3e3c78 | 1131 | |
a220990f | 1132 | Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE}; |
6b3e3c78 | 1133 | |
a220990f | 1134 | if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) { |
1135 | //cout<<"pi"<<endl; | |
1136 | ||
1137 | if(fSys==0){ | |
40445ada | 1138 | fillthispi="hptpiS_"; |
1139 | fillthispi+=ptbin; | |
d7688946 | 1140 | ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]); |
a220990f | 1141 | } |
1142 | fillthispi="hd0piS_"; | |
1143 | fillthispi+=ptbin; | |
1144 | ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]); | |
1145 | if(recalcvtx) { | |
4e61a020 | 1146 | |
a220990f | 1147 | fillthispi="hd0vpiS_"; |
1148 | fillthispi+=ptbin; | |
1149 | ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]); | |
b272aebf | 1150 | } |
a220990f | 1151 | |
1152 | } | |
40445ada | 1153 | |
a220990f | 1154 | if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) { |
1155 | //cout<<"kappa"<<endl; | |
1156 | if(fSys==0){ | |
40445ada | 1157 | fillthisK="hptKS_"; |
1158 | fillthisK+=ptbin; | |
d7688946 | 1159 | ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]); |
a220990f | 1160 | } |
1161 | fillthisK="hd0KS_"; | |
1162 | fillthisK+=ptbin; | |
1163 | ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]); | |
1164 | if (recalcvtx){ | |
1165 | fillthisK="hd0vKS_"; | |
40445ada | 1166 | fillthisK+=ptbin; |
a220990f | 1167 | ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]); |
b272aebf | 1168 | } |
a220990f | 1169 | } |
b272aebf | 1170 | |
a220990f | 1171 | if(fSys==0){ |
1172 | fillthis="hcosthpointd0S_"; | |
1173 | fillthis+=ptbin; | |
1174 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]); | |
1175 | } | |
1176 | } //end loop on prongs | |
b272aebf | 1177 | |
a220990f | 1178 | fillthis="hdcaS_"; |
1179 | fillthis+=ptbin; | |
1180 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA()); | |
4e61a020 | 1181 | |
a220990f | 1182 | fillthis="hcosthetapointS_"; |
1183 | fillthis+=ptbin; | |
1184 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle); | |
4e61a020 | 1185 | |
a220990f | 1186 | fillthis="hcosthetapointxyS_"; |
1187 | fillthis+=ptbin; | |
1188 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->CosPointingAngleXY()); | |
a8ce111e | 1189 | |
4e61a020 | 1190 | |
a220990f | 1191 | fillthis="hd0d0S_"; |
1192 | fillthis+=ptbin; | |
1193 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->Prodd0d0()); | |
4e61a020 | 1194 | |
a220990f | 1195 | fillthis="hdeclS_"; |
1196 | fillthis+=ptbin; | |
1197 | ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2); | |
a8ce111e | 1198 | |
a220990f | 1199 | fillthis="hnormdeclS_"; |
1200 | fillthis+=ptbin; | |
1201 | ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2); | |
1202 | ||
1203 | fillthis="hdeclxyS_"; | |
1204 | fillthis+=ptbin; | |
1205 | ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy); | |
1206 | ||
1207 | fillthis="hnormdeclxyS_"; | |
1208 | fillthis+=ptbin; | |
1209 | ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy); | |
1210 | ||
1211 | fillthis="hdeclxyd0d0S_"; | |
1212 | fillthis+=ptbin; | |
1213 | ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]); | |
1214 | ||
1215 | fillthis="hnormdeclxyd0d0S_"; | |
1216 | fillthis+=ptbin; | |
1217 | ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]); | |
a8ce111e | 1218 | |
a220990f | 1219 | if(recalcvtx) { |
1220 | fillthis="hdeclvS_"; | |
a8ce111e | 1221 | fillthis+=ptbin; |
a220990f | 1222 | ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]); |
a2121012 | 1223 | |
a220990f | 1224 | fillthis="hnormdeclvS_"; |
1225 | fillthis+=ptbin; | |
1226 | ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]); | |
a2121012 | 1227 | |
a220990f | 1228 | fillthis="hd0d0vS_"; |
1229 | fillthis+=ptbin; | |
1230 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]); | |
1231 | } | |
a8ce111e | 1232 | |
a220990f | 1233 | if(fSys==0){ |
1234 | fillthis="hcosthetastarS_"; | |
1235 | fillthis+=ptbin; | |
1236 | if ((fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0); | |
1237 | else { | |
1238 | if (fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar); | |
1239 | if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0); | |
a8ce111e | 1240 | } |
1241 | ||
a220990f | 1242 | fillthis="hcosthpointd0d0S_"; |
1243 | fillthis+=ptbin; | |
1244 | ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->Prodd0d0()); | |
1245 | } | |
a8ce111e | 1246 | |
a220990f | 1247 | } //end mass cut |
4e61a020 | 1248 | |
a220990f | 1249 | } else{ //Background or LS |
1250 | //if(!fReadMC){ | |
1251 | //cout<<"is background"<<endl; | |
40445ada | 1252 | |
a220990f | 1253 | //no mass cut distributions: mass, ptbis |
1254 | fillthis="hMassB_"; | |
1255 | fillthis+=ptbin; | |
90c70b48 | 1256 | fillthispt="histBkgPt"; |
a8ce111e | 1257 | |
90c70b48 | 1258 | if (!fCutOnDistr || (fCutOnDistr && (fIsSelectedCandidate==1 || fIsSelectedCandidate==3))) { |
1259 | ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0); | |
1260 | if(fFillPtHist && fReadMC) ((TH2F*)fOutputMassPt->FindObject(fillthispt))->Fill(minvD0,pt); | |
1261 | } | |
1262 | if (!fCutOnDistr || (fCutOnDistr && fIsSelectedCandidate>1)) { | |
1263 | ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar); | |
1264 | if(fFillPtHist && fReadMC) ((TH2F*)fOutputMassPt->FindObject(fillthispt))->Fill(minvD0bar,pt); | |
1265 | } | |
a220990f | 1266 | if(fSys==0){ |
1267 | fillthis="hptB1prongnoMcut_"; | |
1268 | fillthis+=ptbin; | |
40445ada | 1269 | |
a220990f | 1270 | ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)fDaughterTracks.UncheckedAt(0))->Pt()); |
40445ada | 1271 | |
a220990f | 1272 | fillthis="hptB2prongsnoMcut_"; |
1273 | fillthis+=ptbin; | |
1274 | ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)fDaughterTracks.UncheckedAt(0))->Pt()); | |
818c1271 | 1275 | ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)fDaughterTracks.UncheckedAt(0))->Pt()); |
a220990f | 1276 | } |
1277 | //apply cut on invariant mass on the pair | |
1278 | if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){ | |
1279 | if(fSys==0){ | |
818c1271 | 1280 | ptProng[0]=((AliAODTrack*)fDaughterTracks.UncheckedAt(0))->Pt(); ptProng[1]=((AliAODTrack*)fDaughterTracks.UncheckedAt(0))->Pt(); |
d7688946 | 1281 | cosThetaStarD0 = part->CosThetaStarD0(); |
1282 | cosThetaStarD0bar = part->CosThetaStarD0bar(); | |
a220990f | 1283 | } |
1284 | ||
1285 | cosPointingAngle = part->CosPointingAngle(); | |
1286 | normalizedDecayLength2 = part->NormalizedDecayLength2(); | |
1287 | decayLength2 = part->DecayLength2(); | |
1288 | decayLengthxy = part->DecayLengthXY(); | |
1289 | normalizedDecayLengthxy=decayLengthxy/part->DecayLengthXYError(); | |
1290 | d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1); | |
1291 | ||
1292 | ||
1293 | AliAODTrack *prongg=(AliAODTrack*)fDaughterTracks.UncheckedAt(0); | |
1294 | if(!prongg) { | |
1295 | if(fDebug>2) cout<<"No daughter found"; | |
1296 | return; | |
1297 | } | |
1298 | else{ | |
1299 | if(fArray==1){ | |
1300 | if(prongg->Charge()==1) { | |
1301 | //fTotPosPairs[ptbin]++; | |
600faffe | 1302 | ((TH1F*)fOutputMass->FindObject("hpospair"))->Fill(ptbin); |
a220990f | 1303 | } else { |
1304 | //fTotNegPairs[ptbin]++; | |
600faffe | 1305 | ((TH1F*)fOutputMass->FindObject("hnegpair"))->Fill(ptbin); |
449b1302 | 1306 | } |
0108fa62 | 1307 | } |
a220990f | 1308 | } |
40445ada | 1309 | |
a220990f | 1310 | fillthis="hd0B_"; |
1311 | fillthis+=ptbin; | |
1312 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]); | |
1313 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]); | |
0108fa62 | 1314 | |
a220990f | 1315 | if(fReadMC){ |
1316 | Int_t pdgMother[2]={0,0}; | |
1317 | Double_t factor[2]={1,1}; | |
4e61a020 | 1318 | |
a220990f | 1319 | for(Int_t iprong=0;iprong<2;iprong++){ |
1320 | AliAODTrack *prong=(AliAODTrack*)fDaughterTracks.UncheckedAt(iprong); | |
1321 | lab=prong->GetLabel(); | |
1322 | if(lab>=0){ | |
1323 | AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab); | |
1324 | if(mcprong){ | |
1325 | Int_t labmom=mcprong->GetMother(); | |
1326 | if(labmom>=0){ | |
1327 | AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom); | |
1328 | if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode(); | |
6b3e3c78 | 1329 | } |
1330 | } | |
a220990f | 1331 | } |
6b3e3c78 | 1332 | |
a220990f | 1333 | if(fSys==0){ |
a8ce111e | 1334 | |
a220990f | 1335 | fillthis="hd0moresB_"; |
1336 | fillthis+=ptbin; | |
6b3e3c78 | 1337 | |
a220990f | 1338 | if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){ //K^0_S, K^0_L, K^+- |
1339 | if(ptProng[iprong]<=1)factor[iprong]=1./.7; | |
1340 | else factor[iprong]=1./.6; | |
1341 | fNentries->Fill(11); | |
1342 | } | |
6b3e3c78 | 1343 | |
a220990f | 1344 | if(TMath::Abs(pdgMother[iprong])==3122) { //Lambda |
1345 | factor[iprong]=1./0.25; | |
1346 | fNentries->Fill(12); | |
1347 | } | |
1348 | fillthis="hd0moresB_"; | |
1349 | fillthis+=ptbin; | |
6b3e3c78 | 1350 | |
a220990f | 1351 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]); |
6b3e3c78 | 1352 | |
a220990f | 1353 | if(recalcvtx){ |
1354 | fillthis="hd0vmoresB_"; | |
1355 | fillthis+=ptbin; | |
1356 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]); | |
9af24f46 | 1357 | } |
a220990f | 1358 | } |
1359 | } //loop on prongs | |
6b3e3c78 | 1360 | |
a220990f | 1361 | if(fSys==0){ |
6b3e3c78 | 1362 | fillthis="hd0d0moresB_"; |
1363 | fillthis+=ptbin; | |
1364 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->Prodd0d0(),factor[0]*factor[1]); | |
1365 | ||
a8ce111e | 1366 | fillthis="hcosthetapointmoresB_"; |
1367 | fillthis+=ptbin; | |
1368 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]); | |
1369 | ||
9af24f46 | 1370 | if(recalcvtx){ |
1371 | fillthis="hd0d0vmoresB_"; | |
1372 | fillthis+=ptbin; | |
1373 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]); | |
1374 | } | |
a220990f | 1375 | } |
1376 | } //readMC | |
ce39f0ac | 1377 | |
a220990f | 1378 | if(fSys==0){ |
1379 | //normalise pt distr to half afterwards | |
1380 | fillthis="hptB_"; | |
40445ada | 1381 | fillthis+=ptbin; |
a220990f | 1382 | ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]); |
1383 | ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]); | |
34137226 | 1384 | |
40445ada | 1385 | fillthis="hcosthetastarB_"; |
1386 | fillthis+=ptbin; | |
d7688946 | 1387 | if (!fCutOnDistr || (fCutOnDistr && (fIsSelectedCandidate==1 || fIsSelectedCandidate==3)))((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0); |
1388 | if (!fCutOnDistr || (fCutOnDistr && fIsSelectedCandidate>1))((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar); | |
40445ada | 1389 | |
a220990f | 1390 | |
1391 | fillthis="hd0p0B_"; | |
40445ada | 1392 | fillthis+=ptbin; |
a220990f | 1393 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]); |
1394 | fillthis="hd0p1B_"; | |
1395 | fillthis+=ptbin; | |
1396 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]); | |
1397 | ||
1398 | fillthis="hcosthpointd0d0B_"; | |
1399 | fillthis+=ptbin; | |
1400 | ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->Prodd0d0()); | |
1401 | ||
1402 | fillthis="hcosthpointd0B_"; | |
1403 | fillthis+=ptbin; | |
1404 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]); | |
1405 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]); | |
1406 | ||
40445ada | 1407 | |
9af24f46 | 1408 | if(recalcvtx){ |
a220990f | 1409 | |
1410 | fillthis="hd0vp0B_"; | |
1411 | fillthis+=ptbin; | |
1412 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]); | |
1413 | fillthis="hd0vp1B_"; | |
1414 | fillthis+=ptbin; | |
1415 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]); | |
1416 | ||
1417 | fillthis="hd0vB_"; | |
a2121012 | 1418 | fillthis+=ptbin; |
a220990f | 1419 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]); |
1420 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]); | |
1421 | ||
a2121012 | 1422 | } |
1423 | ||
a220990f | 1424 | } |
40445ada | 1425 | |
a220990f | 1426 | fillthis="hdcaB_"; |
1427 | fillthis+=ptbin; | |
1428 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA()); | |
a2121012 | 1429 | |
a220990f | 1430 | fillthis="hd0d0B_"; |
1431 | fillthis+=ptbin; | |
1432 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]); | |
a8ce111e | 1433 | |
a220990f | 1434 | if(recalcvtx){ |
1435 | fillthis="hd0d0vB_"; | |
a8ce111e | 1436 | fillthis+=ptbin; |
a220990f | 1437 | ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]); |
1438 | } | |
a8ce111e | 1439 | |
a220990f | 1440 | fillthis="hcosthetapointB_"; |
1441 | fillthis+=ptbin; | |
1442 | ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle); | |
a2121012 | 1443 | |
a220990f | 1444 | fillthis="hcosthetapointxyB_"; |
1445 | fillthis+=ptbin; | |
1446 | ((TH1F*)listout->FindObject(fillthis))->Fill(part->CosPointingAngleXY()); | |
9af24f46 | 1447 | |
a220990f | 1448 | fillthis="hdeclB_"; |
1449 | fillthis+=ptbin; | |
1450 | ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2); | |
a2121012 | 1451 | |
a220990f | 1452 | fillthis="hnormdeclB_"; |
1453 | fillthis+=ptbin; | |
1454 | ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2); | |
9af24f46 | 1455 | |
a220990f | 1456 | fillthis="hdeclxyB_"; |
1457 | fillthis+=ptbin; | |
1458 | ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy); | |
a8ce111e | 1459 | |
a220990f | 1460 | fillthis="hnormdeclxyB_"; |
1461 | fillthis+=ptbin; | |
1462 | ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy); | |
1463 | ||
1464 | fillthis="hdeclxyd0d0B_"; | |
1465 | fillthis+=ptbin; | |
1466 | ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]); | |
1467 | ||
1468 | fillthis="hnormdeclxyd0d0B_"; | |
1469 | fillthis+=ptbin; | |
1470 | ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]); | |
1471 | ||
1472 | if(recalcvtx) { | |
1473 | ||
1474 | fillthis="hdeclvB_"; | |
1475 | fillthis+=ptbin; | |
1476 | ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]); | |
1477 | ||
1478 | fillthis="hnormdeclvB_"; | |
1479 | fillthis+=ptbin; | |
1480 | ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]); | |
1481 | ||
1482 | ||
1483 | } | |
1484 | }//mass cut | |
1485 | }//else (background) | |
d7688946 | 1486 | |
49061176 | 1487 | return; |
1488 | } | |
ea0d8716 | 1489 | |
90c70b48 | 1490 | //____________________________________________________________________________ |
1491 | void AliAnalysisTaskSED0Mass::FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi* cuts, TList *listout){ | |
49061176 | 1492 | // |
40445ada | 1493 | // function used in UserExec to fill mass histograms: |
49061176 | 1494 | // |
9de8c723 | 1495 | |
1496 | ||
a8ce111e | 1497 | Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass(); |
9de8c723 | 1498 | |
d7688946 | 1499 | //cout<<"is selected = "<<fIsSelectedCandidate<<endl; |
feb73eca | 1500 | |
90c70b48 | 1501 | // Fill candidate variable Tree (track selection, no candidate selection) |
1502 | if( fWriteVariableTree && !part->HasBadDaughters() | |
1503 | && fCuts->AreDaughtersSelected(part) && fCuts->IsSelectedPID(part) ){ | |
1504 | fCandidateVariables[0] = part->InvMassD0(); | |
1505 | fCandidateVariables[1] = part->InvMassD0bar(); | |
1506 | fCandidateVariables[2] = part->Pt(); | |
1507 | fCandidateVariables[3] = part->GetDCA(); | |
1508 | Double_t ctsD0=0. ,ctsD0bar=0.; part->CosThetaStarD0(ctsD0,ctsD0bar); | |
1509 | fCandidateVariables[4] = ctsD0; | |
1510 | fCandidateVariables[5] = ctsD0bar; | |
1511 | fCandidateVariables[6] = part->Pt2Prong(0); | |
1512 | fCandidateVariables[7] = part->Pt2Prong(1); | |
1513 | fCandidateVariables[8] = part->Getd0Prong(0); | |
1514 | fCandidateVariables[9] = part->Getd0Prong(1); | |
1515 | fCandidateVariables[10] = part->Prodd0d0(); | |
1516 | fCandidateVariables[11] = part->CosPointingAngle(); | |
1517 | fCandidateVariables[12] = part->CosPointingAngleXY(); | |
1518 | fCandidateVariables[13] = part->NormalizedDecayLengthXY(); | |
1519 | fCandidateVariables[14] = fCuts->IsSelectedSpecialCuts(part); | |
1520 | fVariablesTree->Fill(); | |
1521 | } | |
1522 | ||
ea0d8716 | 1523 | //cout<<"check cuts = "<<endl; |
1524 | //cuts->PrintAll(); | |
d7688946 | 1525 | if (!fIsSelectedCandidate){ |
ea0d8716 | 1526 | //cout<<"Not Selected"<<endl; |
6b3e3c78 | 1527 | //cout<<"Rejected because "<<cuts->GetWhy()<<endl; |
ea0d8716 | 1528 | return; |
1529 | } | |
9de8c723 | 1530 | |
6b3e3c78 | 1531 | |
4e61a020 | 1532 | if(fDebug>2) cout<<"Candidate selected"<<endl; |
a41f6fad | 1533 | |
ea0d8716 | 1534 | Double_t invmassD0 = part->InvMassD0(), invmassD0bar = part->InvMassD0bar(); |
1535 | //printf("SELECTED\n"); | |
1536 | Int_t ptbin=cuts->PtBin(part->Pt()); | |
90c70b48 | 1537 | Double_t pt = part->Pt(); |
1538 | ||
1539 | Double_t impparXY=part->ImpParXY()*10000.; | |
1540 | Double_t trueImpParXY=0.; | |
1541 | Double_t arrayForSparse[3]={invmassD0,pt,impparXY}; | |
1542 | Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY}; | |
1543 | ||
9de8c723 | 1544 | |
818c1271 | 1545 | // AliAODTrack *prong=(AliAODTrack*)fDaughterTracks.UncheckedAt(0); |
1546 | // if(!prong) { | |
1547 | // AliDebug(2,"No daughter found"); | |
1548 | // return; | |
1549 | // } | |
1550 | // else{ | |
a8ce111e | 1551 | // if(prong->Charge()==1) { |
1552 | // ((TH1F*)fDistr->FindObject("hpospair"))->Fill(fCuts->GetNPtBins()+ptbin); | |
1553 | // //fTotPosPairs[ptbin]++; | |
1554 | // } else { | |
1555 | // ((TH1F*)fDistr->FindObject("hnegpair"))->Fill(fCuts->GetNPtBins()+ptbin); | |
1556 | // //fTotNegPairs[ptbin]++; | |
1557 | // } | |
818c1271 | 1558 | // } |
700e80e0 | 1559 | |
9af24f46 | 1560 | // for(Int_t it=0;it<2;it++){ |
1561 | ||
1562 | // //request on spd points to be addes | |
1563 | // if(/*nSPD==2 && */part->Pt() > 5. && (TMath::Abs(invmassD0-mPDG)<0.01 || TMath::Abs(invmassD0bar-mPDG)<0.01)){ | |
1564 | // FILE *f=fopen("4display.txt","a"); | |
1565 | // fprintf(f,"pt: %f \n Rapidity: %f \t Period Number: %x \t Run Number: %d \t BunchCrossNumb: %d \t OrbitNumber: %d\n",part->Pt(),part->Y(421),aod->GetPeriodNumber(),aod->GetRunNumber(),aod->GetBunchCrossNumber(),aod->GetOrbitNumber()); | |
1566 | // fclose(f); | |
1567 | // //printf("PrimVtx NContributors: %d \n Prongs Rel Angle: %f \n \n",ncont,relangle); | |
1568 | // } | |
1569 | // } | |
6b3e3c78 | 1570 | |
90c70b48 | 1571 | TString fillthis="", fillthispt="", fillthismasspt=""; |
ea0d8716 | 1572 | Int_t pdgDgD0toKpi[2]={321,211}; |
1573 | Int_t labD0=-1; | |
90c70b48 | 1574 | Bool_t isPrimary=kTRUE; |
ea0d8716 | 1575 | if (fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi); //return MC particle label if the array corresponds to a D0, -1 if not (cf. AliAODRecoDecay.cxx) |
1576 | ||
1577 | //count candidates selected by cuts | |
1578 | fNentries->Fill(1); | |
1579 | //count true D0 selected by cuts | |
1580 | if (fReadMC && labD0>=0) fNentries->Fill(2); | |
ea0d8716 | 1581 | |
d7688946 | 1582 | if ((fIsSelectedCandidate==1 || fIsSelectedCandidate==3) && fFillOnlyD0D0bar<2) { //D0 |
90c70b48 | 1583 | |
1584 | arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY; | |
1585 | ||
a220990f | 1586 | if(fReadMC){ |
1587 | if(labD0>=0) { | |
1588 | if(fArray==1) cout<<"LS signal ERROR"<<endl; | |
1589 | ||
1590 | AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0); | |
1591 | Int_t pdgD0 = partD0->GetPdgCode(); | |
2b35ac47 | 1592 | // cout<<"pdg = "<<pdgD0<<endl; |
90c70b48 | 1593 | |
1594 | if(CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE; | |
1595 | if(!isPrimary) | |
1596 | trueImpParXY=GetTrueImpactParameter(mcHeader,arrMC,partD0)*10000.; | |
1597 | arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY; | |
1598 | ||
a220990f | 1599 | if (pdgD0==421){ //D0 |
2b35ac47 | 1600 | // cout<<"Fill S with D0"<<endl; |
a220990f | 1601 | fillthis="histSgn_"; |
1602 | fillthis+=ptbin; | |
1603 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
90c70b48 | 1604 | |
1605 | if(fFillPtHist){ | |
1606 | fillthismasspt="histSgnPt"; | |
1607 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt); | |
1608 | } | |
1609 | if(fFillImpParHist){ | |
1610 | if(isPrimary) fHistMassPtImpParTC[1]->Fill(arrayForSparse); | |
1611 | else { | |
1612 | fHistMassPtImpParTC[2]->Fill(arrayForSparse); | |
1613 | fHistMassPtImpParTC[3]->Fill(arrayForSparseTrue); | |
1614 | } | |
1615 | } | |
1616 | ||
a220990f | 1617 | if(fSys==0){ |
2b35ac47 | 1618 | if(TMath::Abs(invmassD0 - mPDG) < 0.027 && fFillVarHists){ |
a220990f | 1619 | fillthis="histSgn27_"; |
1620 | fillthis+=ptbin; | |
1621 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
1622 | } | |
1623 | } | |
1624 | } else{ //it was a D0bar | |
1625 | fillthis="histRfl_"; | |
a8ce111e | 1626 | fillthis+=ptbin; |
1627 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
90c70b48 | 1628 | |
1629 | if(fFillPtHist){ | |
1630 | fillthismasspt="histRflPt"; | |
1631 | // cout << " Filling "<<fillthismasspt<<" D0bar"<<endl; | |
1632 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt); | |
1633 | } | |
1634 | ||
a8ce111e | 1635 | } |
a220990f | 1636 | } else {//background |
1637 | fillthis="histBkg_"; | |
a4ae02cd | 1638 | fillthis+=ptbin; |
1639 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
90c70b48 | 1640 | |
1641 | if(fFillPtHist){ | |
1642 | fillthismasspt="histBkgPt"; | |
1643 | // cout << " Filling "<<fillthismasspt<<" D0bar"<<endl; | |
1644 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt); | |
1645 | } | |
1646 | if(fFillImpParHist) fHistMassPtImpParTC[4]->Fill(arrayForSparse); | |
1647 | ||
a4ae02cd | 1648 | } |
a220990f | 1649 | |
1650 | }else{ | |
1651 | fillthis="histMass_"; | |
a4ae02cd | 1652 | fillthis+=ptbin; |
2b35ac47 | 1653 | // cout<<"Filling "<<fillthis<<endl; |
a220990f | 1654 | |
2b35ac47 | 1655 | // printf("Fill mass with D0"); |
ea0d8716 | 1656 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); |
90c70b48 | 1657 | |
1658 | if(fFillPtHist){ | |
1659 | fillthismasspt="histMassPt"; | |
1660 | // cout<<"Filling "<<fillthismasspt<<endl; | |
1661 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt); | |
1662 | } | |
1663 | if(fFillImpParHist) { | |
1664 | // cout << "Filling fHistMassPtImpParTC[0]"<<endl; | |
1665 | fHistMassPtImpParTC[0]->Fill(arrayForSparse); | |
1666 | } | |
1667 | ||
ea0d8716 | 1668 | } |
a220990f | 1669 | |
ea0d8716 | 1670 | } |
d7688946 | 1671 | if (fIsSelectedCandidate>1 && (fFillOnlyD0D0bar==0 || fFillOnlyD0D0bar==2)) { //D0bar |
90c70b48 | 1672 | |
1673 | arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY; | |
1674 | ||
a220990f | 1675 | if(fReadMC){ |
1676 | if(labD0>=0) { | |
1677 | if(fArray==1) cout<<"LS signal ERROR"<<endl; | |
1678 | AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0); | |
1679 | Int_t pdgD0 = partD0->GetPdgCode(); | |
2b35ac47 | 1680 | // cout<<" pdg = "<<pdgD0<<endl; |
90c70b48 | 1681 | |
1682 | if(CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE; | |
1683 | if(!isPrimary) | |
1684 | trueImpParXY=GetTrueImpactParameter(mcHeader,arrMC,partD0)*10000.; | |
1685 | arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY; | |
1686 | ||
a220990f | 1687 | if (pdgD0==-421){ //D0bar |
1688 | fillthis="histSgn_"; | |
1689 | fillthis+=ptbin; | |
1690 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar); | |
1691 | // if (TMath::Abs(invmassD0bar - mPDG) < 0.027){ | |
1692 | // fillthis="histSgn27_"; | |
1693 | // fillthis+=ptbin; | |
1694 | // ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar); | |
1695 | // } | |
9de8c723 | 1696 | |
90c70b48 | 1697 | if(fFillPtHist){ |
1698 | fillthismasspt="histSgnPt"; | |
1699 | // cout<<" Filling "<< fillthismasspt << endl; | |
1700 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt); | |
1701 | } | |
1702 | if(fFillImpParHist){ | |
1703 | // cout << " Filling impact parameter thnsparse"<<endl; | |
1704 | if(isPrimary) fHistMassPtImpParTC[1]->Fill(arrayForSparse); | |
1705 | else { | |
1706 | fHistMassPtImpParTC[2]->Fill(arrayForSparse); | |
1707 | fHistMassPtImpParTC[3]->Fill(arrayForSparseTrue); | |
1708 | } | |
1709 | } | |
a4ae02cd | 1710 | |
a220990f | 1711 | } else{ |
1712 | fillthis="histRfl_"; | |
1713 | fillthis+=ptbin; | |
1714 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar); | |
90c70b48 | 1715 | if(fFillPtHist){ |
1716 | fillthismasspt="histRflPt"; | |
1717 | // cout << " Filling "<<fillthismasspt<<endl; | |
1718 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt); | |
1719 | } | |
a220990f | 1720 | } |
1721 | } else {//background or LS | |
1722 | fillthis="histBkg_"; | |
a4ae02cd | 1723 | fillthis+=ptbin; |
1724 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar); | |
90c70b48 | 1725 | |
1726 | if(fFillPtHist){ | |
1727 | fillthismasspt="histBkgPt"; | |
1728 | // cout<<" Filling "<< fillthismasspt << endl; | |
1729 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt); | |
1730 | } | |
1731 | if(fFillImpParHist) fHistMassPtImpParTC[4]->Fill(arrayForSparse); | |
1732 | ||
a4ae02cd | 1733 | } |
a220990f | 1734 | }else{ |
1735 | fillthis="histMass_"; | |
ea0d8716 | 1736 | fillthis+=ptbin; |
2b35ac47 | 1737 | // printf("Fill mass with D0bar"); |
a220990f | 1738 | ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar); |
1739 | ||
90c70b48 | 1740 | if(fFillPtHist){ |
1741 | fillthismasspt="histMassPt"; | |
1742 | // cout<<" Filling "<< fillthismasspt << endl; | |
1743 | ((TH2F*)(fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt); | |
1744 | } | |
1745 | if(fFillImpParHist) fHistMassPtImpParTC[0]->Fill(arrayForSparse); | |
1746 | ||
a4ae02cd | 1747 | } |
ea0d8716 | 1748 | } |
a4ae02cd | 1749 | |
40445ada | 1750 | return; |
49061176 | 1751 | } |
4e61a020 | 1752 | |
1753 | //__________________________________________________________________________ | |
d7688946 | 1754 | AliAODVertex* AliAnalysisTaskSED0Mass::GetPrimaryVtxSkipped(AliAODEvent *aodev){ |
4e61a020 | 1755 | //Calculate the primary vertex w/o the daughter tracks of the candidate |
1756 | ||
4e61a020 | 1757 | Int_t skipped[2]; |
1758 | Int_t nTrksToSkip=2; | |
d7688946 | 1759 | AliAODTrack *dgTrack = (AliAODTrack*)fDaughterTracks.UncheckedAt(0); |
4e61a020 | 1760 | if(!dgTrack){ |
1761 | AliDebug(2,"no daughter found!"); | |
1762 | return 0x0; | |
1763 | } | |
1764 | skipped[0]=dgTrack->GetID(); | |
d7688946 | 1765 | dgTrack = (AliAODTrack*)fDaughterTracks.UncheckedAt(1); |
4e61a020 | 1766 | if(!dgTrack){ |
1767 | AliDebug(2,"no daughter found!"); | |
1768 | return 0x0; | |
1769 | } | |
1770 | skipped[1]=dgTrack->GetID(); | |
1771 | ||
6b3e3c78 | 1772 | AliESDVertex *vertexESD=0x0; |
1773 | AliAODVertex *vertexAOD=0x0; | |
1774 | AliVertexerTracks *vertexer = new AliVertexerTracks(aodev->GetMagneticField()); | |
1775 | ||
4e61a020 | 1776 | // |
1777 | vertexer->SetSkipTracks(nTrksToSkip,skipped); | |
4e61a020 | 1778 | vertexer->SetMinClusters(4); |
a2121012 | 1779 | vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev); |
4e61a020 | 1780 | if(!vertexESD) return vertexAOD; |
1781 | if(vertexESD->GetNContributors()<=0) { | |
1782 | AliDebug(2,"vertexing failed"); | |
1783 | delete vertexESD; vertexESD=NULL; | |
1784 | return vertexAOD; | |
1785 | } | |
1786 | ||
1787 | delete vertexer; vertexer=NULL; | |
1788 | ||
1789 | ||
1790 | // convert to AliAODVertex | |
1791 | Double_t pos[3],cov[6],chi2perNDF; | |
1792 | vertexESD->GetXYZ(pos); // position | |
1793 | vertexESD->GetCovMatrix(cov); //covariance matrix | |
1794 | chi2perNDF = vertexESD->GetChi2toNDF(); | |
1795 | delete vertexESD; vertexESD=NULL; | |
1796 | ||
1797 | vertexAOD = new AliAODVertex(pos,cov,chi2perNDF); | |
1798 | return vertexAOD; | |
1799 | ||
1800 | } | |
1801 | ||
1802 | ||
49061176 | 1803 | //________________________________________________________________________ |
1804 | void AliAnalysisTaskSED0Mass::Terminate(Option_t */*option*/) | |
1805 | { | |
1806 | // Terminate analysis | |
1807 | // | |
1808 | if(fDebug > 1) printf("AnalysisTaskSED0Mass: Terminate() \n"); | |
1809 | ||
6321ee46 | 1810 | |
ea0d8716 | 1811 | fOutputMass = dynamic_cast<TList*> (GetOutputData(1)); |
1812 | if (!fOutputMass) { | |
1813 | printf("ERROR: fOutputMass not available\n"); | |
a4ae02cd | 1814 | return; |
1815 | } | |
90c70b48 | 1816 | fOutputMassPt = dynamic_cast<TList*> (GetOutputData(6)); |
1817 | if ((fFillPtHist || fFillImpParHist) && !fOutputMassPt) { | |
1818 | printf("ERROR: fOutputMass not available\n"); | |
1819 | return; | |
1820 | } | |
1821 | ||
a8ce111e | 1822 | if(fFillVarHists){ |
1823 | fDistr = dynamic_cast<TList*> (GetOutputData(2)); | |
1824 | if (!fDistr) { | |
1825 | printf("ERROR: fDistr not available\n"); | |
1826 | return; | |
1827 | } | |
a41f6fad | 1828 | } |
a8ce111e | 1829 | |
40445ada | 1830 | fNentries = dynamic_cast<TH1F*>(GetOutputData(3)); |
5b2e5fae | 1831 | |
40445ada | 1832 | if(!fNentries){ |
1833 | printf("ERROR: fNEntries not available\n"); | |
1834 | return; | |
1835 | } | |
700e80e0 | 1836 | fCuts = dynamic_cast<AliRDHFCutsD0toKpi*>(GetOutputData(4)); |
1837 | if(!fCuts){ | |
1838 | printf("ERROR: fCuts not available\n"); | |
34137226 | 1839 | return; |
1840 | } | |
700e80e0 | 1841 | fCounter = dynamic_cast<AliNormalizationCounter*>(GetOutputData(5)); |
a96083b9 | 1842 | if (!fCounter) { |
1843 | printf("ERROR: fCounter not available\n"); | |
1844 | return; | |
1845 | } | |
700e80e0 | 1846 | Int_t nptbins=fCuts->GetNPtBins(); |
1847 | for(Int_t ipt=0;ipt<nptbins;ipt++){ | |
4e61a020 | 1848 | |
a8ce111e | 1849 | if(fArray==1 && fFillVarHists){ |
84f75f2e | 1850 | fLsNormalization = 2.*TMath::Sqrt(((TH1F*)fOutputMass->FindObject("hpospair"))->Integral(nptbins+ipt+1,nptbins+ipt+2)*((TH1F*)fOutputMass->FindObject("hnegpair"))->Integral(nptbins+ipt+1,nptbins+ipt+2)); //after cuts |
feb73eca | 1851 | |
1852 | ||
ea0d8716 | 1853 | if(fLsNormalization>1e-6) { |
9de8c723 | 1854 | |
feb73eca | 1855 | TString massName="histMass_"; |
ea0d8716 | 1856 | massName+=ipt; |
1857 | ((TH1F*)fOutputMass->FindObject(massName))->Scale((1/fLsNormalization)*((TH1F*)fOutputMass->FindObject(massName))->GetEntries()); | |
1858 | ||
feb73eca | 1859 | } |
40445ada | 1860 | |
feb73eca | 1861 | |
84f75f2e | 1862 | fLsNormalization = 2.*TMath::Sqrt(((TH1F*)fOutputMass->FindObject("hpospair"))->Integral(ipt+1,ipt+2)*((TH1F*)fOutputMass->FindObject("hnegpair"))->Integral(ipt+1,ipt+2)); |
700e80e0 | 1863 | //fLsNormalization = 2.*TMath::Sqrt(fTotPosPairs[4]*fTotNegPairs[4]); |
40445ada | 1864 | |
ea0d8716 | 1865 | if(fLsNormalization>1e-6) { |
40445ada | 1866 | |
1867 | TString nameDistr="hptB_"; | |
ea0d8716 | 1868 | nameDistr+=ipt; |
40445ada | 1869 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
1870 | nameDistr="hdcaB_"; | |
ea0d8716 | 1871 | nameDistr+=ipt; |
40445ada | 1872 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
1873 | nameDistr="hcosthetastarB_"; | |
ea0d8716 | 1874 | nameDistr+=ipt; |
40445ada | 1875 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
1876 | nameDistr="hd0B_"; | |
ea0d8716 | 1877 | nameDistr+=ipt; |
40445ada | 1878 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
1879 | nameDistr="hd0d0B_"; | |
ea0d8716 | 1880 | nameDistr+=ipt; |
40445ada | 1881 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
1882 | nameDistr="hcosthetapointB_"; | |
ea0d8716 | 1883 | nameDistr+=ipt; |
40445ada | 1884 | ((TH1F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH1F*)fDistr->FindObject(nameDistr))->GetEntries()); |
a220990f | 1885 | if(fSys==0){ |
1886 | nameDistr="hcosthpointd0d0B_"; | |
1887 | nameDistr+=ipt; | |
1888 | ((TH2F*)fDistr->FindObject(nameDistr))->Scale((1/fLsNormalization)*((TH2F*)fDistr->FindObject(nameDistr))->GetEntries()); | |
1889 | } | |
40445ada | 1890 | } |
feb73eca | 1891 | } |
1892 | } | |
4e61a020 | 1893 | TString cvname,cstname; |
527f330b | 1894 | |
1895 | if (fArray==0){ | |
1896 | cvname="D0invmass"; | |
4e61a020 | 1897 | cstname="cstat0"; |
1898 | } else { | |
1899 | cvname="LSinvmass"; | |
1900 | cstname="cstat1"; | |
1901 | } | |
527f330b | 1902 | |
34137226 | 1903 | TCanvas *cMass=new TCanvas(cvname,cvname); |
1904 | cMass->cd(); | |
ea0d8716 | 1905 | ((TH1F*)fOutputMass->FindObject("histMass_3"))->Draw(); |
527f330b | 1906 | |
4e61a020 | 1907 | TCanvas* cStat=new TCanvas(cstname,Form("Stat%s",fArray ? "LS" : "D0")); |
34137226 | 1908 | cStat->cd(); |
1909 | cStat->SetGridy(); | |
1910 | fNentries->Draw("htext0"); | |
527f330b | 1911 | |
4e61a020 | 1912 | // TCanvas *ccheck=new TCanvas(Form("cc%d",fArray),Form("cc%d",fArray)); |
1913 | // ccheck->cd(); | |
1914 | ||
49061176 | 1915 | return; |
1916 | } | |
1917 | ||
90c70b48 | 1918 | |
1919 | //________________________________________________________________________ | |
1920 | void AliAnalysisTaskSED0Mass::CreateImpactParameterHistos(){ | |
1921 | // Histos for impact paramter study | |
1922 | ||
1923 | Int_t nmassbins=200; | |
1924 | Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648; | |
1925 | Int_t fNImpParBins=400; | |
1926 | Double_t fLowerImpPar=-2000., fHigherImpPar=2000.; | |
1927 | Int_t nbins[3]={nmassbins,200,fNImpParBins}; | |
1928 | Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar}; | |
1929 | Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar}; | |
1930 | ||
1931 | ||
1932 | fHistMassPtImpParTC[0]=new THnSparseF("hMassPtImpParAll", | |
1933 | "Mass vs. pt vs.imppar - All", | |
1934 | 3,nbins,xmin,xmax); | |
1935 | fHistMassPtImpParTC[1]=new THnSparseF("hMassPtImpParPrompt", | |
1936 | "Mass vs. pt vs.imppar - promptD", | |
1937 | 3,nbins,xmin,xmax); | |
1938 | fHistMassPtImpParTC[2]=new THnSparseF("hMassPtImpParBfeed", | |
1939 | "Mass vs. pt vs.imppar - DfromB", | |
1940 | 3,nbins,xmin,xmax); | |
1941 | fHistMassPtImpParTC[3]=new THnSparseF("hMassPtImpParTrueBfeed", | |
1942 | "Mass vs. pt vs.true imppar -DfromB", | |
1943 | 3,nbins,xmin,xmax); | |
1944 | fHistMassPtImpParTC[4]=new THnSparseF("hMassPtImpParBkg", | |
1945 | "Mass vs. pt vs.imppar - backgr.", | |
1946 | 3,nbins,xmin,xmax); | |
1947 | ||
1948 | for(Int_t i=0; i<5;i++){ | |
1949 | fOutputMassPt->Add(fHistMassPtImpParTC[i]); | |
1950 | } | |
1951 | } | |
1952 | ||
1953 | //_________________________________________________________________________________________________ | |
1954 | Float_t AliAnalysisTaskSED0Mass::GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray* arrayMC, AliAODMCParticle *partD0) const { | |
1955 | // true impact parameter calculation | |
1956 | ||
1957 | printf(" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n"); | |
1958 | ||
1959 | Double_t vtxTrue[3]; | |
1960 | mcHeader->GetVertex(vtxTrue); | |
1961 | Double_t origD[3]; | |
1962 | partD0->XvYvZv(origD); | |
1963 | Short_t charge=partD0->Charge(); | |
1964 | Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2]; | |
1965 | for(Int_t iDau=0; iDau<2; iDau++){ | |
1966 | pXdauTrue[iDau]=0.; | |
1967 | pYdauTrue[iDau]=0.; | |
1968 | pZdauTrue[iDau]=0.; | |
1969 | } | |
1970 | ||
1971 | // Int_t nDau=partD0->GetNDaughters(); | |
1972 | Int_t labelFirstDau = partD0->GetDaughter(0); | |
1973 | ||
1974 | for(Int_t iDau=0; iDau<2; iDau++){ | |
1975 | Int_t ind = labelFirstDau+iDau; | |
1976 | AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind)); | |
1977 | if(!part) continue; | |
1978 | Int_t pdgCode = TMath::Abs( part->GetPdgCode() ); | |
1979 | if(!part){ | |
1980 | AliError("Daughter particle not found in MC array"); | |
1981 | return 99999.; | |
1982 | } | |
1983 | if(pdgCode==211 || pdgCode==321){ | |
1984 | pXdauTrue[iDau]=part->Px(); | |
1985 | pYdauTrue[iDau]=part->Py(); | |
1986 | pZdauTrue[iDau]=part->Pz(); | |
1987 | } | |
1988 | } | |
1989 | ||
1990 | Double_t d0dummy[2]={0.,0.}; | |
1991 | AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy); | |
1992 | return aodDzeroMC.ImpParXY(); | |
1993 | ||
1994 | } | |
1995 | ||
1996 | //_________________________________________________________________________________________________ | |
1997 | Int_t AliAnalysisTaskSED0Mass::CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const { | |
1998 | // | |
1999 | // checking whether the mother of the particles come from a charm or a bottom quark | |
2000 | // | |
2001 | printf(" AliAnalysisTaskSED0MassV1::CheckOrigin() \n"); | |
2002 | ||
2003 | Int_t pdgGranma = 0; | |
2004 | Int_t mother = 0; | |
2005 | mother = mcPartCandidate->GetMother(); | |
2006 | Int_t istep = 0; | |
2007 | Int_t abspdgGranma =0; | |
2008 | Bool_t isFromB=kFALSE; | |
2009 | Bool_t isQuarkFound=kFALSE; | |
2010 | while (mother >0 ){ | |
2011 | istep++; | |
2012 | AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother)); | |
2013 | if (mcGranma){ | |
2014 | pdgGranma = mcGranma->GetPdgCode(); | |
2015 | abspdgGranma = TMath::Abs(pdgGranma); | |
2016 | if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){ | |
2017 | isFromB=kTRUE; | |
2018 | } | |
2019 | if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE; | |
2020 | mother = mcGranma->GetMother(); | |
2021 | }else{ | |
2022 | AliError("Failed casting the mother particle!"); | |
2023 | break; | |
2024 | } | |
2025 | } | |
2026 | ||
2027 | if(isFromB) return 5; | |
2028 | else return 4; | |
2029 | } |