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