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