]>
Commit | Line | Data |
---|---|---|
645e004b | 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 | // | |
16 | // | |
17 | // Base class for DStar Analysis | |
18 | // | |
645e004b | 19 | // |
645e004b | 20 | // The D* spectra study is done in pt bins: |
645e004b | 21 | // [0,1] [1,2] [2,3] [3,5] [5,8] [8,14] |
22 | // | |
46f6e464 | 23 | // Optimized cuts used and TPC PID is on request (flag in che .C) |
24 | // Cuts option of analysis: 0 Heidelberg ; 1 Utrecht | |
25 | // Side Band and like sign background are implemented in the macro | |
26 | // | |
645e004b | 27 | //----------------------------------------------------------------------- |
28 | // | |
29 | // Author A.Grelli | |
46f6e464 | 30 | // ERC-QGP Utrecht University - a.grelli@uu.nl, |
31 | // Author Y.Wang | |
32 | // University of Heidelberg - yifei@physi.uni-heidelberg.de | |
33 | // Author C.Ivan | |
34 | // ERC-QGP Utrecht University - c.ivan@uu.nl, | |
645e004b | 35 | // |
36 | //----------------------------------------------------------------------- | |
37 | ||
38 | #include <TSystem.h> | |
39 | #include <TParticle.h> | |
40 | #include <TH1I.h> | |
41 | #include "TROOT.h" | |
42 | ||
43 | #include "AliPID.h" | |
44 | #include "AliTPCPIDResponse.h" | |
46f6e464 | 45 | //#include "AliAODPidHF.h" |
645e004b | 46 | #include "AliStack.h" |
47 | #include "AliMCEvent.h" | |
48 | #include "AliAnalysisManager.h" | |
49 | #include "AliAODMCHeader.h" | |
50 | #include "AliAODHandler.h" | |
51 | #include "AliLog.h" | |
52 | #include "AliAODVertex.h" | |
53 | #include "AliAODJet.h" | |
54 | #include "AliAODRecoDecay.h" | |
55 | #include "AliAODRecoDecayHF.h" | |
56 | #include "AliAODRecoCascadeHF.h" | |
57 | #include "AliAODRecoDecayHF2Prong.h" | |
58 | #include "AliAnalysisVertexingHF.h" | |
59 | #include "AliESDtrack.h" | |
60 | #include "AliAODMCParticle.h" | |
61 | #include "AliAnalysisTaskSEDStarSpectra.h" | |
62 | ||
63 | ClassImp(AliAnalysisTaskSEDStarSpectra) | |
64 | ||
65 | //__________________________________________________________________________ | |
66 | AliAnalysisTaskSEDStarSpectra::AliAnalysisTaskSEDStarSpectra(): | |
67 | AliAnalysisTaskSE(), | |
68 | fEvents(0), | |
46f6e464 | 69 | fAnalysis(0), |
645e004b | 70 | fVHF(0), |
46f6e464 | 71 | fVHFloose(0), |
72 | fD0Window(0), | |
73 | fPeakWindow(0), | |
645e004b | 74 | fMinITSClusters(0), |
75 | fMinITSClustersSoft(0), | |
76 | fUseMCInfo(kTRUE), | |
77 | fOutput(0), | |
46f6e464 | 78 | fOutputSpectrum(0), |
79 | fOutputAll(0), | |
80 | fOutputPID3(0), | |
81 | fOutputPID2(0), | |
82 | fOutputPID1(0), | |
645e004b | 83 | fNSigma(3), |
84 | fPID(kTRUE), | |
85 | fAODTrack(0), | |
645e004b | 86 | fCEvents(0), |
46f6e464 | 87 | fTrueDiff2(0) |
645e004b | 88 | { |
89 | // | |
90 | // Default ctor | |
91 | // | |
92 | } | |
93 | //___________________________________________________________________________ | |
94 | AliAnalysisTaskSEDStarSpectra::AliAnalysisTaskSEDStarSpectra(const Char_t* name) : | |
95 | AliAnalysisTaskSE(name), | |
96 | fEvents(0), | |
46f6e464 | 97 | fAnalysis(0), |
645e004b | 98 | fVHF(0), |
46f6e464 | 99 | fVHFloose(0), |
100 | fD0Window(0), | |
101 | fPeakWindow(0), | |
645e004b | 102 | fMinITSClusters(0), |
103 | fMinITSClustersSoft(0), | |
104 | fUseMCInfo(kTRUE), | |
105 | fOutput(0), | |
46f6e464 | 106 | fOutputSpectrum(0), |
107 | fOutputAll(0), | |
108 | fOutputPID3(0), | |
109 | fOutputPID2(0), | |
110 | fOutputPID1(0), | |
645e004b | 111 | fNSigma(3), |
112 | fPID(kTRUE), | |
113 | fAODTrack(0), | |
645e004b | 114 | fCEvents(0), |
46f6e464 | 115 | fTrueDiff2(0) |
645e004b | 116 | { |
117 | // | |
118 | // Constructor. Initialization of Inputs and Outputs | |
119 | // | |
120 | Info("AliAnalysisTaskSEDStarSpectra","Calling Constructor"); | |
121 | ||
122 | DefineOutput(1,TList::Class()); | |
46f6e464 | 123 | DefineOutput(2,TList::Class()); //Spectrum output |
124 | DefineOutput(3,TList::Class()); //3sigma PID output | |
125 | DefineOutput(4,TList::Class()); //2sigma PID output | |
126 | DefineOutput(5,TList::Class()); //1sigma PID output | |
127 | DefineOutput(6,TList::Class()); //All Entries output | |
645e004b | 128 | } |
129 | ||
130 | //___________________________________________________________________________ | |
131 | AliAnalysisTaskSEDStarSpectra& AliAnalysisTaskSEDStarSpectra::operator=(const AliAnalysisTaskSEDStarSpectra& c) | |
132 | { | |
133 | // | |
134 | // Assignment operator | |
135 | // | |
136 | if (this!=&c) { | |
137 | AliAnalysisTaskSE::operator=(c) ; | |
138 | } | |
139 | return *this; | |
140 | } | |
141 | ||
142 | //___________________________________________________________________________ | |
143 | AliAnalysisTaskSEDStarSpectra::AliAnalysisTaskSEDStarSpectra(const AliAnalysisTaskSEDStarSpectra& c) : | |
144 | AliAnalysisTaskSE(c), | |
145 | fEvents(c.fEvents), | |
46f6e464 | 146 | fAnalysis(c.fAnalysis), |
645e004b | 147 | fVHF(c.fVHF), |
46f6e464 | 148 | fVHFloose(c.fVHFloose), |
149 | fD0Window(c.fD0Window), | |
150 | fPeakWindow(c.fPeakWindow), | |
645e004b | 151 | fMinITSClusters(c.fMinITSClusters), |
152 | fMinITSClustersSoft(c.fMinITSClustersSoft), | |
153 | fUseMCInfo(c.fUseMCInfo), | |
154 | fOutput(c.fOutput), | |
46f6e464 | 155 | fOutputSpectrum(c.fOutputSpectrum), |
156 | fOutputAll(c.fOutputAll), | |
157 | fOutputPID3(c.fOutputPID3), | |
158 | fOutputPID2(c.fOutputPID2), | |
159 | fOutputPID1(c.fOutputPID1), | |
645e004b | 160 | fNSigma(c.fNSigma), |
161 | fPID(c.fPID), | |
162 | fAODTrack(c.fAODTrack), | |
645e004b | 163 | fCEvents(c.fCEvents), |
46f6e464 | 164 | fTrueDiff2(c.fTrueDiff2) |
645e004b | 165 | { |
166 | // | |
167 | // Copy Constructor | |
168 | // | |
169 | } | |
170 | ||
171 | //___________________________________________________________________________ | |
172 | AliAnalysisTaskSEDStarSpectra::~AliAnalysisTaskSEDStarSpectra() { | |
173 | // | |
174 | // destructor | |
175 | // | |
176 | Info("~AliAnalysisTaskSEDStarSpectra","Calling Destructor"); | |
177 | ||
178 | if (fOutput) { | |
179 | delete fOutput; | |
180 | fOutput = 0; | |
181 | } | |
46f6e464 | 182 | if (fOutputSpectrum) { |
183 | delete fOutputSpectrum; | |
184 | fOutputSpectrum = 0; | |
185 | } | |
186 | if (fOutputAll) { | |
187 | delete fOutputAll; | |
188 | fOutputAll = 0; | |
189 | } | |
190 | if (fOutputPID3) { | |
191 | delete fOutputPID3; | |
192 | fOutputPID3 = 0; | |
193 | } | |
194 | if (fOutputPID2) { | |
195 | delete fOutputPID2; | |
196 | fOutputPID2 = 0; | |
197 | } | |
198 | if (fOutputPID1) { | |
199 | delete fOutputPID1; | |
200 | fOutputPID1 = 0; | |
201 | } | |
645e004b | 202 | if (fVHF) { |
203 | delete fVHF; | |
204 | fVHF = 0; | |
205 | } | |
46f6e464 | 206 | if (fVHFloose) { |
207 | delete fVHFloose; | |
208 | fVHFloose = 0; | |
209 | } | |
210 | ||
645e004b | 211 | } |
212 | //_________________________________________________ | |
213 | void AliAnalysisTaskSEDStarSpectra::Init(){ | |
214 | // | |
215 | // Initialization | |
216 | // | |
217 | ||
218 | if(fDebug > 1) printf("AnalysisTaskSEDStarSpectra::Init() \n"); | |
219 | ||
46f6e464 | 220 | //gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C"); |
221 | gROOT->LoadMacro("ConfigVertexingHF.C"); | |
222 | ||
645e004b | 223 | fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()"); |
46f6e464 | 224 | fVHFloose = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()"); |
225 | fVHFloose->SetD0fromDstarCuts(0.3,999999.,1.1,0.,0.,999999.,999999.,999999.,0.); | |
226 | fVHFloose->SetDstarCuts(0.3, 0.1, 0.05, 100000000000.0, 0.5); | |
645e004b | 227 | //fVHF->PrintStatus(); |
228 | ||
229 | return; | |
230 | } | |
231 | ||
232 | //_________________________________________________ | |
233 | void AliAnalysisTaskSEDStarSpectra::UserExec(Option_t *) | |
234 | { | |
235 | // user exec | |
236 | if (!fInputEvent) { | |
237 | Error("UserExec","NO EVENT FOUND!"); | |
238 | return; | |
239 | } | |
240 | ||
241 | fCEvents->Fill(1); | |
242 | // Load the event | |
243 | fEvents++; | |
244 | AliInfo(Form("Event %d",fEvents)); | |
245 | if (fEvents%10000 ==0) AliInfo(Form("Event %d",fEvents)); | |
246 | AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent); | |
247 | TClonesArray *arrayDStartoD0pi=0; | |
46f6e464 | 248 | // Init(); |
645e004b | 249 | if(!aodEvent && AODEvent() && IsStandardAOD()) { |
250 | // In case there is an AOD handler writing a standard AOD, use the AOD | |
251 | // event in memory rather than the input (ESD) event. | |
252 | aodEvent = dynamic_cast<AliAODEvent*> (AODEvent()); | |
253 | // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root) | |
254 | // have to taken from the AOD event hold by the AliAODExtension | |
255 | AliAODHandler* aodHandler = (AliAODHandler*) | |
256 | ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
257 | if(aodHandler->GetExtensions()) { | |
258 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root"); | |
259 | AliAODEvent *aodFromExt = ext->GetAOD(); | |
260 | arrayDStartoD0pi=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar"); | |
261 | } | |
262 | } else { | |
263 | arrayDStartoD0pi=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar"); | |
264 | } | |
265 | ||
266 | // AOD primary vertex | |
267 | AliAODVertex *vtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex(); | |
268 | ||
269 | // counters for efficiencies | |
270 | Int_t icountReco = 0; | |
271 | ||
272 | //D* and D0 prongs needed to MatchToMC method | |
273 | Int_t pdgDgDStartoD0pi[2]={421,211}; | |
274 | Int_t pdgDgD0toKpi[2]={321,211}; | |
275 | ||
276 | if (!arrayDStartoD0pi){ | |
277 | AliInfo("Could not find array of HF vertices, skipping the event"); | |
278 | return; | |
279 | }else AliDebug(2, Form("Found %d vertices",arrayDStartoD0pi->GetEntriesFast())); | |
280 | ||
281 | // loop over the tracks to search for candidates soft pion | |
282 | ||
283 | for (Int_t iDStartoD0pi = 0; iDStartoD0pi<arrayDStartoD0pi->GetEntriesFast(); iDStartoD0pi++) { | |
284 | ||
285 | // D* candidates | |
286 | AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)arrayDStartoD0pi->At(iDStartoD0pi); | |
287 | ||
288 | // D0 from the reco cascade | |
289 | AliAODRecoDecayHF2Prong* theD0particle = (AliAODRecoDecayHF2Prong*)dstarD0pi->Get2Prong(); | |
290 | Bool_t unsetvtx=kFALSE; | |
291 | ||
645e004b | 292 | // needed for pointing angle |
293 | if(!theD0particle->GetOwnPrimaryVtx()) { | |
294 | theD0particle->SetOwnPrimaryVtx(vtx1); | |
295 | unsetvtx=kTRUE; | |
296 | } | |
46f6e464 | 297 | |
298 | Int_t isDStar = 0; | |
645e004b | 299 | |
300 | // mc analysis | |
301 | if(fUseMCInfo){ | |
302 | //MC array need for maching | |
303 | TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName())); | |
304 | if (!mcArray) AliError("Could not find Monte-Carlo in AOD"); | |
305 | // find associated MC particle for D* ->D0toKpi | |
306 | Int_t mcLabel = dstarD0pi->MatchToMC(413,421,pdgDgDStartoD0pi,pdgDgD0toKpi,mcArray); | |
307 | if(mcLabel>=0) isDStar = 1; | |
308 | } | |
309 | ||
310 | // soft pion | |
311 | AliAODTrack *track2 = (AliAODTrack*)dstarD0pi->GetBachelor(); | |
312 | ||
313 | //D0tokpi | |
314 | AliAODTrack *track0 = (AliAODTrack*)theD0particle->GetDaughter(0); | |
315 | AliAODTrack *track1 = (AliAODTrack*)theD0particle->GetDaughter(1); | |
316 | ||
317 | Double_t pt = dstarD0pi->Pt(); | |
318 | ||
645e004b | 319 | |
320 | // cut in acceptance for the soft pion and for the D0 daughters | |
645e004b | 321 | |
46f6e464 | 322 | Bool_t okTracks = SingleTrackSelections(theD0particle, track0, track1, track2); |
323 | if (!okTracks) continue; | |
645e004b | 324 | |
46f6e464 | 325 | // D0 pt needed for the cuts |
326 | Int_t ptbin =0; | |
327 | if (pt>0. && pt<=1.) ptbin =0; | |
328 | if (pt>1. && pt<=2.) ptbin =1; | |
329 | if (pt>2. && pt<=3.) ptbin =2; | |
330 | if (pt>3. && pt<=5.) ptbin =3; | |
331 | if (pt>5. && pt<=8.) ptbin =4; | |
332 | if (pt>8.) ptbin =5; | |
333 | ||
334 | SetSelections(pt); | |
335 | FillSpectrum(ptbin,dstarD0pi,isDStar,1,3,fVHF,fOutputPID3); | |
336 | FillSpectrum(ptbin,dstarD0pi,isDStar,1,2,fVHF,fOutputPID2); | |
337 | FillSpectrum(ptbin,dstarD0pi,isDStar,1,1,fVHF,fOutputPID1); | |
338 | FillSpectrum(ptbin,dstarD0pi,isDStar,fPID,fNSigma,fVHF,fOutputSpectrum); | |
339 | FillSpectrum(ptbin,dstarD0pi,isDStar,0,0,fVHFloose,fOutputAll); | |
340 | ||
341 | SideBandBackground(ptbin,dstarD0pi,1,3,fVHF,fOutputPID3); | |
342 | SideBandBackground(ptbin,dstarD0pi,1,2,fVHF,fOutputPID2); | |
343 | SideBandBackground(ptbin,dstarD0pi,1,1,fVHF,fOutputPID1); | |
344 | SideBandBackground(ptbin,dstarD0pi,fPID,fNSigma,fVHF,fOutputSpectrum); | |
345 | SideBandBackground(ptbin,dstarD0pi,0,0,fVHFloose,fOutputAll); | |
346 | ||
347 | WrongSignForDStar(ptbin,dstarD0pi,1,3,fVHF,fOutputPID3); | |
348 | WrongSignForDStar(ptbin,dstarD0pi,1,2,fVHF,fOutputPID2); | |
349 | WrongSignForDStar(ptbin,dstarD0pi,1,1,fVHF,fOutputPID1); | |
350 | WrongSignForDStar(ptbin,dstarD0pi,fPID,fNSigma,fVHF,fOutputSpectrum); | |
351 | WrongSignForDStar(ptbin,dstarD0pi,0,0,fVHFloose,fOutputAll); | |
352 | ||
353 | if(isDStar == 1) { | |
354 | fTrueDiff2->Fill(pt,dstarD0pi->DeltaInvMass()); | |
645e004b | 355 | } |
46f6e464 | 356 | |
645e004b | 357 | } |
358 | ||
359 | AliDebug(2, Form("Found %i Reco particles that are D*!!",icountReco)); | |
360 | ||
361 | PostData(1,fOutput); | |
46f6e464 | 362 | PostData(2,fOutputSpectrum); |
363 | PostData(3,fOutputAll); | |
364 | PostData(4,fOutputPID3); | |
365 | PostData(5,fOutputPID2); | |
366 | PostData(6,fOutputPID1); | |
367 | ||
368 | ||
645e004b | 369 | } |
370 | //________________________________________ terminate ___________________________ | |
371 | void AliAnalysisTaskSEDStarSpectra::Terminate(Option_t*) | |
372 | { | |
373 | // The Terminate() function is the last function to be called during | |
374 | // a query. It always runs on the client, it can be used to present | |
375 | // the results graphically or save the results to file. | |
376 | ||
645e004b | 377 | AliAnalysisTaskSE::Terminate(); |
378 | ||
379 | fOutput = dynamic_cast<TList*> (GetOutputData(1)); | |
380 | if (!fOutput) { | |
381 | printf("ERROR: fOutput not available\n"); | |
382 | return; | |
383 | } | |
384 | ||
645e004b | 385 | fCEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fCEvents")); |
645e004b | 386 | fTrueDiff2 = dynamic_cast<TH2F*>(fOutput->FindObject("fTrueDiff2")); |
46f6e464 | 387 | |
388 | fOutputSpectrum = dynamic_cast<TList*> (GetOutputData(2)); | |
389 | if (!fOutputSpectrum) { | |
390 | printf("ERROR: fOutputSpectrum not available\n"); | |
391 | return; | |
392 | } | |
393 | fOutputAll = dynamic_cast<TList*> (GetOutputData(3)); | |
394 | if (!fOutputAll) { | |
395 | printf("ERROR: fOutputAll not available\n"); | |
396 | return; | |
397 | } | |
398 | fOutputPID3 = dynamic_cast<TList*> (GetOutputData(4)); | |
399 | if (!fOutputPID3) { | |
400 | printf("ERROR: fOutputPID3 not available\n"); | |
401 | return; | |
402 | } | |
403 | fOutputPID2 = dynamic_cast<TList*> (GetOutputData(5)); | |
404 | if (!fOutputPID2) { | |
405 | printf("ERROR: fOutputPID2 not available\n"); | |
406 | return; | |
407 | } | |
408 | fOutputPID1 = dynamic_cast<TList*> (GetOutputData(6)); | |
409 | if (!fOutputPID1) { | |
410 | printf("ERROR: fOutputPID1 not available\n"); | |
411 | return; | |
412 | } | |
645e004b | 413 | |
414 | } | |
415 | //___________________________________________________________________________ | |
416 | void AliAnalysisTaskSEDStarSpectra::UserCreateOutputObjects() { | |
417 | // output | |
418 | Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName()); | |
419 | ||
420 | //slot #1 | |
421 | OpenFile(1); | |
422 | fOutput = new TList(); | |
423 | fOutput->SetOwner(); | |
46f6e464 | 424 | |
425 | fOutputSpectrum = new TList(); | |
426 | fOutputSpectrum->SetOwner(); | |
427 | fOutputSpectrum->SetName("listSpectrum"); | |
428 | ||
429 | fOutputPID3 = new TList(); | |
430 | fOutputPID3->SetOwner(); | |
431 | fOutputPID3->SetName("listPID3"); | |
432 | ||
433 | fOutputPID2 = new TList(); | |
434 | fOutputPID2->SetOwner(); | |
435 | fOutputPID2->SetName("listPID2"); | |
436 | ||
437 | fOutputPID1 = new TList(); | |
438 | fOutputPID1->SetOwner(); | |
439 | fOutputPID1->SetName("listPID1"); | |
440 | ||
441 | fOutputAll = new TList(); | |
442 | fOutputAll->SetOwner(); | |
443 | fOutputAll->SetName("listAll"); | |
444 | ||
645e004b | 445 | // define histograms |
46f6e464 | 446 | DefineHistograms(); |
645e004b | 447 | return; |
448 | } | |
645e004b | 449 | //___________________________________ hiostograms _______________________________________ |
46f6e464 | 450 | void AliAnalysisTaskSEDStarSpectra::DefineHistograms(){ |
645e004b | 451 | |
452 | fCEvents = new TH1F("fCEvents","conter",10,0,10); | |
453 | fCEvents->SetStats(kTRUE); | |
454 | fCEvents->GetXaxis()->SetTitle("1"); | |
455 | fCEvents->GetYaxis()->SetTitle("counts"); | |
645e004b | 456 | fOutput->Add(fCEvents); |
457 | ||
46f6e464 | 458 | fTrueDiff2 = new TH2F("DiffDstar_pt","True Reco diff vs pt",200,0,15,900,0,0.3); |
459 | fOutput->Add(fTrueDiff2); | |
645e004b | 460 | |
46f6e464 | 461 | const Int_t nhist=5; |
462 | TString nameMass=" ", nameSgn=" ", nameBkg=" "; | |
463 | ||
464 | for(Int_t i=-1;i<nhist;i++){ | |
465 | nameMass="histDeltaMass_"; | |
466 | nameMass+=i+1; | |
467 | nameSgn="histDeltaSgn_"; | |
468 | nameSgn+=i+1; | |
469 | nameBkg="histDeltaBkg_"; | |
470 | nameBkg+=i+1; | |
471 | ||
472 | if (i==-1) { | |
473 | nameMass="histDeltaMass"; | |
474 | nameSgn="histDeltaSgn"; | |
475 | nameBkg="histDeltaBkg"; | |
476 | } | |
477 | ||
478 | TH1F* spectrumMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} invariant mass; #DeltaM [GeV/c^{2}]; Entries",200,0.1,0.2); | |
479 | TH1F* spectrumSgn = new TH1F(nameSgn.Data(), "D^{*}-D^{0} Signal invariant mass - MC; #DeltaM [GeV/c^{2}]; Entries",200,0.1,0.2); | |
480 | TH1F* spectrumBkg = new TH1F(nameBkg.Data(), "D^{*}-D^{0} Background invariant mass - MC; #DeltaM [GeV/c^{2}]; Entries",200,0.1,0.2); | |
481 | ||
482 | nameMass="histD0Mass_"; | |
483 | nameMass+=i+1; | |
484 | nameSgn="histD0Sgn_"; | |
485 | nameSgn+=i+1; | |
486 | nameBkg="histD0Bkg_"; | |
487 | nameBkg+=i+1; | |
488 | ||
489 | if (i==-1) { | |
490 | nameMass="histD0Mass"; | |
491 | nameSgn="histD0Sgn"; | |
492 | nameBkg="histD0Bkg"; | |
493 | } | |
645e004b | 494 | |
46f6e464 | 495 | TH1F* spectrumD0Mass = new TH1F(nameMass.Data(),"D^{0} invariant mass; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95); |
496 | TH1F* spectrumD0Sgn = new TH1F(nameSgn.Data(), "D^{0} Signal invariant mass - MC; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95); | |
497 | TH1F* spectrumD0Bkg = new TH1F(nameBkg.Data(), "D^{0} Background invariant mass - MC; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95); | |
498 | ||
499 | nameMass="histDstarMass_"; | |
500 | nameMass+=i+1; | |
501 | nameSgn="histDstarSgn_"; | |
502 | nameSgn+=i+1; | |
503 | nameBkg="histDstarBkg_"; | |
504 | nameBkg+=i+1; | |
505 | ||
506 | if (i==-1) { | |
507 | nameMass="histDstarMass"; | |
508 | nameSgn="histDstarSgn"; | |
509 | nameBkg="histDstarBkg"; | |
510 | } | |
645e004b | 511 | |
46f6e464 | 512 | TH1F* spectrumDstarMass = new TH1F(nameMass.Data(),"D^{*} invariant mass; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1); |
513 | TH1F* spectrumDstarSgn = new TH1F(nameSgn.Data(), "D^{*} Signal invariant mass - MC; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1); | |
514 | TH1F* spectrumDstarBkg = new TH1F(nameBkg.Data(), "D^{*} Background invariant mass - MC; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1); | |
645e004b | 515 | |
46f6e464 | 516 | nameMass="histSideBandMass_"; |
517 | nameMass+=i+1; | |
518 | if (i==-1) { | |
519 | nameMass="histSideBandMass"; | |
520 | } | |
521 | ||
522 | TH1F* spectrumSideBandMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} sideband mass; M(D^{*}) [GeV/c^{2}]; Entries",200,0.1,0.2); | |
645e004b | 523 | |
46f6e464 | 524 | nameMass="histWrongSignMass_"; |
525 | nameMass+=i+1; | |
526 | if (i==-1) { | |
527 | nameMass="histWrongSignMass"; | |
528 | } | |
529 | ||
530 | TH1F* spectrumWrongSignMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} wrongsign mass; M(D^{*}) [GeV/c^{2}]; Entries",200,0.1,0.2); | |
645e004b | 531 | |
645e004b | 532 | |
46f6e464 | 533 | spectrumMass->Sumw2(); |
534 | spectrumSgn->Sumw2(); | |
535 | spectrumBkg->Sumw2(); | |
536 | ||
537 | spectrumMass->SetLineColor(6); | |
538 | spectrumSgn->SetLineColor(2); | |
539 | spectrumBkg->SetLineColor(4); | |
540 | ||
541 | spectrumMass->SetMarkerStyle(20); | |
542 | spectrumSgn->SetMarkerStyle(20); | |
543 | spectrumBkg->SetMarkerStyle(20); | |
544 | spectrumMass->SetMarkerSize(0.6); | |
545 | spectrumSgn->SetMarkerSize(0.6); | |
546 | spectrumBkg->SetMarkerSize(0.6); | |
547 | spectrumMass->SetMarkerColor(6); | |
548 | spectrumSgn->SetMarkerColor(2); | |
549 | spectrumBkg->SetMarkerColor(4); | |
550 | ||
551 | spectrumD0Mass->Sumw2(); | |
552 | spectrumD0Sgn->Sumw2(); | |
553 | spectrumD0Bkg->Sumw2(); | |
554 | ||
555 | spectrumD0Mass->SetLineColor(6); | |
556 | spectrumD0Sgn->SetLineColor(2); | |
557 | spectrumD0Bkg->SetLineColor(4); | |
558 | ||
559 | spectrumD0Mass->SetMarkerStyle(20); | |
560 | spectrumD0Sgn->SetMarkerStyle(20); | |
561 | spectrumD0Bkg->SetMarkerStyle(20); | |
562 | spectrumD0Mass->SetMarkerSize(0.6); | |
563 | spectrumD0Sgn->SetMarkerSize(0.6); | |
564 | spectrumD0Bkg->SetMarkerSize(0.6); | |
565 | spectrumD0Mass->SetMarkerColor(6); | |
566 | spectrumD0Sgn->SetMarkerColor(2); | |
567 | spectrumD0Bkg->SetMarkerColor(4); | |
568 | ||
569 | spectrumDstarMass->Sumw2(); | |
570 | spectrumDstarSgn->Sumw2(); | |
571 | spectrumDstarBkg->Sumw2(); | |
572 | ||
573 | spectrumDstarMass->SetLineColor(6); | |
574 | spectrumDstarSgn->SetLineColor(2); | |
575 | spectrumDstarBkg->SetLineColor(4); | |
576 | ||
577 | spectrumDstarMass->SetMarkerStyle(20); | |
578 | spectrumDstarSgn->SetMarkerStyle(20); | |
579 | spectrumDstarBkg->SetMarkerStyle(20); | |
580 | spectrumDstarMass->SetMarkerSize(0.6); | |
581 | spectrumDstarSgn->SetMarkerSize(0.6); | |
582 | spectrumDstarBkg->SetMarkerSize(0.6); | |
583 | spectrumDstarMass->SetMarkerColor(6); | |
584 | spectrumDstarSgn->SetMarkerColor(2); | |
585 | spectrumDstarBkg->SetMarkerColor(4); | |
586 | ||
587 | spectrumSideBandMass->Sumw2(); | |
588 | spectrumSideBandMass->SetLineColor(4); | |
589 | spectrumSideBandMass->SetMarkerStyle(20); | |
590 | spectrumSideBandMass->SetMarkerSize(0.6); | |
591 | spectrumSideBandMass->SetMarkerColor(4); | |
592 | ||
593 | spectrumWrongSignMass->Sumw2(); | |
594 | spectrumWrongSignMass->SetLineColor(4); | |
595 | spectrumWrongSignMass->SetMarkerStyle(20); | |
596 | spectrumWrongSignMass->SetMarkerSize(0.6); | |
597 | spectrumWrongSignMass->SetMarkerColor(4); | |
598 | ||
599 | TH1F* allMass = (TH1F*)spectrumMass->Clone(); | |
600 | TH1F* allSgn = (TH1F*)spectrumSgn->Clone(); | |
601 | TH1F* allBkg = (TH1F*)spectrumBkg->Clone(); | |
602 | ||
603 | TH1F* pid3Mass = (TH1F*)spectrumMass->Clone(); | |
604 | TH1F* pid3Sgn = (TH1F*)spectrumSgn->Clone(); | |
605 | TH1F* pid3Bkg = (TH1F*)spectrumBkg->Clone(); | |
606 | ||
607 | TH1F* pid2Mass = (TH1F*)spectrumMass->Clone(); | |
608 | TH1F* pid2Sgn = (TH1F*)spectrumSgn->Clone(); | |
609 | TH1F* pid2Bkg = (TH1F*)spectrumBkg->Clone(); | |
610 | ||
611 | TH1F* pid1Mass = (TH1F*)spectrumMass->Clone(); | |
612 | TH1F* pid1Sgn = (TH1F*)spectrumSgn->Clone(); | |
613 | TH1F* pid1Bkg = (TH1F*)spectrumBkg->Clone(); | |
614 | ||
615 | fOutputSpectrum->Add(spectrumMass); | |
616 | fOutputSpectrum->Add(spectrumSgn); | |
617 | fOutputSpectrum->Add(spectrumBkg); | |
618 | ||
619 | fOutputAll->Add(allMass); | |
620 | fOutputAll->Add(allSgn); | |
621 | fOutputAll->Add(allBkg); | |
622 | ||
623 | fOutputPID3->Add(pid3Mass); | |
624 | fOutputPID3->Add(pid3Sgn); | |
625 | fOutputPID3->Add(pid3Bkg); | |
626 | ||
627 | fOutputPID2->Add(pid2Mass); | |
628 | fOutputPID2->Add(pid2Sgn); | |
629 | fOutputPID2->Add(pid2Bkg); | |
630 | ||
631 | fOutputPID1->Add(pid1Mass); | |
632 | fOutputPID1->Add(pid1Sgn); | |
633 | fOutputPID1->Add(pid1Bkg); | |
634 | ||
635 | TH1F* allD0Mass = (TH1F*)spectrumD0Mass->Clone(); | |
636 | TH1F* allD0Sgn = (TH1F*)spectrumD0Sgn->Clone(); | |
637 | TH1F* allD0Bkg = (TH1F*)spectrumD0Bkg->Clone(); | |
638 | ||
639 | TH1F* pid3D0Mass = (TH1F*)spectrumD0Mass->Clone(); | |
640 | TH1F* pid3D0Sgn = (TH1F*)spectrumD0Sgn->Clone(); | |
641 | TH1F* pid3D0Bkg = (TH1F*)spectrumD0Bkg->Clone(); | |
642 | ||
643 | TH1F* pid2D0Mass = (TH1F*)spectrumD0Mass->Clone(); | |
644 | TH1F* pid2D0Sgn = (TH1F*)spectrumD0Sgn->Clone(); | |
645 | TH1F* pid2D0Bkg = (TH1F*)spectrumD0Bkg->Clone(); | |
646 | ||
647 | TH1F* pid1D0Mass = (TH1F*)spectrumD0Mass->Clone(); | |
648 | TH1F* pid1D0Sgn = (TH1F*)spectrumD0Sgn->Clone(); | |
649 | TH1F* pid1D0Bkg = (TH1F*)spectrumD0Bkg->Clone(); | |
650 | ||
651 | fOutputSpectrum->Add(spectrumD0Mass); | |
652 | fOutputSpectrum->Add(spectrumD0Sgn); | |
653 | fOutputSpectrum->Add(spectrumD0Bkg); | |
654 | ||
655 | fOutputAll->Add(allD0Mass); | |
656 | fOutputAll->Add(allD0Sgn); | |
657 | fOutputAll->Add(allD0Bkg); | |
658 | ||
659 | fOutputPID3->Add(pid3D0Mass); | |
660 | fOutputPID3->Add(pid3D0Sgn); | |
661 | fOutputPID3->Add(pid3D0Bkg); | |
662 | ||
663 | fOutputPID2->Add(pid2D0Mass); | |
664 | fOutputPID2->Add(pid2D0Sgn); | |
665 | fOutputPID2->Add(pid2D0Bkg); | |
666 | ||
667 | fOutputPID1->Add(pid1D0Mass); | |
668 | fOutputPID1->Add(pid1D0Sgn); | |
669 | fOutputPID1->Add(pid1D0Bkg); | |
645e004b | 670 | |
46f6e464 | 671 | TH1F* allDstarMass = (TH1F*)spectrumDstarMass->Clone(); |
672 | TH1F* allDstarSgn = (TH1F*)spectrumDstarSgn->Clone(); | |
673 | TH1F* allDstarBkg = (TH1F*)spectrumDstarBkg->Clone(); | |
674 | ||
675 | TH1F* pid3DstarMass = (TH1F*)spectrumDstarMass->Clone(); | |
676 | TH1F* pid3DstarSgn = (TH1F*)spectrumDstarSgn->Clone(); | |
677 | TH1F* pid3DstarBkg = (TH1F*)spectrumDstarBkg->Clone(); | |
678 | ||
679 | TH1F* pid2DstarMass = (TH1F*)spectrumDstarMass->Clone(); | |
680 | TH1F* pid2DstarSgn = (TH1F*)spectrumDstarSgn->Clone(); | |
681 | TH1F* pid2DstarBkg = (TH1F*)spectrumDstarBkg->Clone(); | |
682 | ||
683 | TH1F* pid1DstarMass = (TH1F*)spectrumDstarMass->Clone(); | |
684 | TH1F* pid1DstarSgn = (TH1F*)spectrumDstarSgn->Clone(); | |
685 | TH1F* pid1DstarBkg = (TH1F*)spectrumDstarBkg->Clone(); | |
686 | ||
687 | fOutputSpectrum->Add(spectrumDstarMass); | |
688 | fOutputSpectrum->Add(spectrumDstarSgn); | |
689 | fOutputSpectrum->Add(spectrumDstarBkg); | |
690 | ||
691 | fOutputAll->Add(allDstarMass); | |
692 | fOutputAll->Add(allDstarSgn); | |
693 | fOutputAll->Add(allDstarBkg); | |
694 | ||
695 | fOutputPID3->Add(pid3DstarMass); | |
696 | fOutputPID3->Add(pid3DstarSgn); | |
697 | fOutputPID3->Add(pid3DstarBkg); | |
698 | ||
699 | fOutputPID2->Add(pid2DstarMass); | |
700 | fOutputPID2->Add(pid2DstarSgn); | |
701 | fOutputPID2->Add(pid2DstarBkg); | |
702 | ||
703 | fOutputPID1->Add(pid1DstarMass); | |
704 | fOutputPID1->Add(pid1DstarSgn); | |
705 | fOutputPID1->Add(pid1DstarBkg); | |
706 | ||
707 | TH1F* allSideBandMass = (TH1F*)spectrumSideBandMass->Clone(); | |
708 | TH1F* pid3SideBandMass = (TH1F*)spectrumSideBandMass->Clone(); | |
709 | TH1F* pid2SideBandMass = (TH1F*)spectrumSideBandMass->Clone(); | |
710 | TH1F* pid1SideBandMass = (TH1F*)spectrumSideBandMass->Clone(); | |
711 | ||
712 | fOutputSpectrum->Add(spectrumSideBandMass); | |
713 | fOutputAll->Add(allSideBandMass); | |
714 | fOutputPID3->Add(pid3SideBandMass); | |
715 | fOutputPID2->Add(pid2SideBandMass); | |
716 | fOutputPID1->Add(pid1SideBandMass); | |
717 | ||
718 | TH1F* allWrongSignMass = (TH1F*)spectrumWrongSignMass->Clone(); | |
719 | TH1F* pid3WrongSignMass = (TH1F*)spectrumWrongSignMass->Clone(); | |
720 | TH1F* pid2WrongSignMass = (TH1F*)spectrumWrongSignMass->Clone(); | |
721 | TH1F* pid1WrongSignMass = (TH1F*)spectrumWrongSignMass->Clone(); | |
722 | ||
723 | fOutputSpectrum->Add(spectrumWrongSignMass); | |
724 | fOutputAll->Add(allWrongSignMass); | |
725 | fOutputPID3->Add(pid3WrongSignMass); | |
726 | fOutputPID2->Add(pid2WrongSignMass); | |
727 | fOutputPID1->Add(pid1WrongSignMass); | |
645e004b | 728 | |
46f6e464 | 729 | } |
645e004b | 730 | |
46f6e464 | 731 | // pt spectra |
732 | nameMass="ptMass"; | |
733 | nameSgn="ptSgn"; | |
734 | nameBkg="ptBkg"; | |
735 | ||
736 | TH1F* ptspectrumMass = new TH1F(nameMass.Data(),"D^{*} p_{T}; p_{T} [GeV]; Entries",200,0,10); | |
737 | TH1F* ptspectrumSgn = new TH1F(nameSgn.Data(), "D^{*} Signal p_{T} - MC; p_{T} [GeV]; Entries",200,0,10); | |
738 | TH1F* ptspectrumBkg = new TH1F(nameBkg.Data(), "D^{*} Background p_{T} - MC; p_{T} [GeV]; Entries",200,0,10); | |
739 | ||
740 | ptspectrumMass->Sumw2(); | |
741 | ptspectrumSgn->Sumw2(); | |
742 | ptspectrumBkg->Sumw2(); | |
743 | ||
744 | ptspectrumMass->SetLineColor(6); | |
745 | ptspectrumSgn->SetLineColor(2); | |
746 | ptspectrumBkg->SetLineColor(4); | |
747 | ||
748 | ptspectrumMass->SetMarkerStyle(20); | |
749 | ptspectrumSgn->SetMarkerStyle(20); | |
750 | ptspectrumBkg->SetMarkerStyle(20); | |
751 | ptspectrumMass->SetMarkerSize(0.6); | |
752 | ptspectrumSgn->SetMarkerSize(0.6); | |
753 | ptspectrumBkg->SetMarkerSize(0.6); | |
754 | ptspectrumMass->SetMarkerColor(6); | |
755 | ptspectrumSgn->SetMarkerColor(2); | |
756 | ptspectrumBkg->SetMarkerColor(4); | |
757 | ||
758 | TH1F* ptallMass = (TH1F*)ptspectrumMass->Clone(); | |
759 | TH1F* ptallSgn = (TH1F*)ptspectrumSgn->Clone(); | |
760 | TH1F* ptallBkg = (TH1F*)ptspectrumBkg->Clone(); | |
761 | ||
762 | TH1F* ptpid3Mass = (TH1F*)ptspectrumMass->Clone(); | |
763 | TH1F* ptpid3Sgn = (TH1F*)ptspectrumSgn->Clone(); | |
764 | TH1F* ptpid3Bkg = (TH1F*)ptspectrumBkg->Clone(); | |
765 | ||
766 | TH1F* ptpid2Mass = (TH1F*)ptspectrumMass->Clone(); | |
767 | TH1F* ptpid2Sgn = (TH1F*)ptspectrumSgn->Clone(); | |
768 | TH1F* ptpid2Bkg = (TH1F*)ptspectrumBkg->Clone(); | |
769 | ||
770 | TH1F* ptpid1Mass = (TH1F*)ptspectrumMass->Clone(); | |
771 | TH1F* ptpid1Sgn = (TH1F*)ptspectrumSgn->Clone(); | |
772 | TH1F* ptpid1Bkg = (TH1F*)ptspectrumBkg->Clone(); | |
773 | ||
774 | fOutputSpectrum->Add(ptspectrumMass); | |
775 | fOutputSpectrum->Add(ptspectrumSgn); | |
776 | fOutputSpectrum->Add(ptspectrumBkg); | |
777 | ||
778 | fOutputAll->Add(ptallMass); | |
779 | fOutputAll->Add(ptallSgn); | |
780 | fOutputAll->Add(ptallBkg); | |
781 | ||
782 | fOutputPID3->Add(ptpid3Mass); | |
783 | fOutputPID3->Add(ptpid3Sgn); | |
784 | fOutputPID3->Add(ptpid3Bkg); | |
785 | ||
786 | fOutputPID2->Add(ptpid2Mass); | |
787 | fOutputPID2->Add(ptpid2Sgn); | |
788 | fOutputPID2->Add(ptpid2Bkg); | |
789 | ||
790 | fOutputPID1->Add(ptpid1Mass); | |
791 | fOutputPID1->Add(ptpid1Sgn); | |
792 | fOutputPID1->Add(ptpid1Bkg); | |
793 | ||
794 | // eta spectra | |
795 | nameMass="etaMass"; | |
796 | nameSgn="etaSgn"; | |
797 | nameBkg="etaBkg"; | |
798 | ||
799 | TH1F* etaspectrumMass = new TH1F(nameMass.Data(),"D^{*} #eta; #eta; Entries",200,-1,1); | |
800 | TH1F* etaspectrumSgn = new TH1F(nameSgn.Data(), "D^{*} Signal #eta - MC; #eta; Entries",200,-1,1); | |
801 | TH1F* etaspectrumBkg = new TH1F(nameBkg.Data(), "D^{*} Background #eta - MC; #eta; Entries",200,-1,1); | |
802 | ||
803 | etaspectrumMass->Sumw2(); | |
804 | etaspectrumSgn->Sumw2(); | |
805 | etaspectrumBkg->Sumw2(); | |
806 | ||
807 | etaspectrumMass->SetLineColor(6); | |
808 | etaspectrumSgn->SetLineColor(2); | |
809 | etaspectrumBkg->SetLineColor(4); | |
810 | ||
811 | etaspectrumMass->SetMarkerStyle(20); | |
812 | etaspectrumSgn->SetMarkerStyle(20); | |
813 | etaspectrumBkg->SetMarkerStyle(20); | |
814 | etaspectrumMass->SetMarkerSize(0.6); | |
815 | etaspectrumSgn->SetMarkerSize(0.6); | |
816 | etaspectrumBkg->SetMarkerSize(0.6); | |
817 | etaspectrumMass->SetMarkerColor(6); | |
818 | etaspectrumSgn->SetMarkerColor(2); | |
819 | etaspectrumBkg->SetMarkerColor(4); | |
820 | ||
821 | TH1F* etaallMass = (TH1F*)etaspectrumMass->Clone(); | |
822 | TH1F* etaallSgn = (TH1F*)etaspectrumSgn->Clone(); | |
823 | TH1F* etaallBkg = (TH1F*)etaspectrumBkg->Clone(); | |
824 | ||
825 | TH1F* etapid3Mass = (TH1F*)etaspectrumMass->Clone(); | |
826 | TH1F* etapid3Sgn = (TH1F*)etaspectrumSgn->Clone(); | |
827 | TH1F* etapid3Bkg = (TH1F*)etaspectrumBkg->Clone(); | |
828 | ||
829 | TH1F* etapid2Mass = (TH1F*)etaspectrumMass->Clone(); | |
830 | TH1F* etapid2Sgn = (TH1F*)etaspectrumSgn->Clone(); | |
831 | TH1F* etapid2Bkg = (TH1F*)etaspectrumBkg->Clone(); | |
832 | ||
833 | TH1F* etapid1Mass = (TH1F*)etaspectrumMass->Clone(); | |
834 | TH1F* etapid1Sgn = (TH1F*)etaspectrumSgn->Clone(); | |
835 | TH1F* etapid1Bkg = (TH1F*)etaspectrumBkg->Clone(); | |
836 | ||
837 | fOutputSpectrum->Add(etaspectrumMass); | |
838 | fOutputSpectrum->Add(etaspectrumSgn); | |
839 | fOutputSpectrum->Add(etaspectrumBkg); | |
840 | ||
841 | fOutputAll->Add(etaallMass); | |
842 | fOutputAll->Add(etaallSgn); | |
843 | fOutputAll->Add(etaallBkg); | |
844 | ||
845 | fOutputPID3->Add(etapid3Mass); | |
846 | fOutputPID3->Add(etapid3Sgn); | |
847 | fOutputPID3->Add(etapid3Bkg); | |
848 | ||
849 | fOutputPID2->Add(etapid2Mass); | |
850 | fOutputPID2->Add(etapid2Sgn); | |
851 | fOutputPID2->Add(etapid2Bkg); | |
852 | ||
853 | fOutputPID1->Add(etapid1Mass); | |
854 | fOutputPID1->Add(etapid1Sgn); | |
855 | fOutputPID1->Add(etapid1Bkg); | |
645e004b | 856 | |
46f6e464 | 857 | return; |
858 | } | |
859 | //________________________________________________________________________ | |
860 | void AliAnalysisTaskSEDStarSpectra::FillSpectrum(Int_t ptbin, AliAODRecoCascadeHF *part, Int_t isDStar, Bool_t PIDon, Int_t nSigma, AliAnalysisVertexingHF *vhf, TList *listout){ | |
861 | // | |
862 | // Fill histos for D* spectrum | |
863 | // | |
645e004b | 864 | |
46f6e464 | 865 | if (ptbin==0) return; |
645e004b | 866 | |
46f6e464 | 867 | Double_t invmassDelta = part->DeltaInvMass(); |
868 | Double_t invmassD0 = part->InvMassD0(); | |
869 | Double_t invmassDstar = part->InvMassDstarKpipi(); | |
870 | if(part->SelectDstar(fVHFloose->GetDstarCuts(),vhf->GetD0toKpiCuts(),kTRUE)) {//selected | |
871 | if (TMath::Abs(invmassD0-1.865)>fD0Window) return; | |
872 | ||
873 | Double_t pt = part->Pt(); | |
874 | Double_t eta = part->Eta(); | |
875 | //TVector3 p3Trk0(part->PxProng(0),part->PyProng(0),part->PzProng(0)); // pi_s | |
876 | //TVector3 p3Trk1(part->PxProng(1),part->PyProng(1),part->PzProng(1)); // D0 | |
877 | //Double_t CosOpenAngle = p3Trk0.Dot(p3Trk1)/(p3Trk0.Mag()*p3Trk1.Mag()); | |
878 | ||
879 | //PID of D0 daughters | |
880 | AliAODTrack *pos = (AliAODTrack*)part->Get2Prong()->GetDaughter(0); | |
881 | AliAODTrack *neg = (AliAODTrack*)part->Get2Prong()->GetDaughter(1); | |
882 | ||
883 | if (PIDon) { | |
884 | if(fDebug > 1) printf("AnalysisTaskSEDStar::TPCPIDon \n"); | |
885 | if(fDebug > 1) printf("AnalysisTaskSEDStar::NSigmaTPC: %d\n", nSigma); | |
886 | ||
887 | if (part->Charge()>0){ | |
888 | if(!SelectPID(pos, AliPID::kPion, nSigma)) return;//pion+ | |
889 | if(!SelectPID(neg, AliPID::kKaon, nSigma)) return;//kaon- | |
890 | }else{ | |
891 | if(!SelectPID(pos, AliPID::kKaon, nSigma)) return;//kaon+ | |
892 | if(!SelectPID(neg, AliPID::kPion, nSigma)) return;//pion- | |
893 | } | |
894 | } | |
895 | ||
896 | TString fillthis=""; | |
897 | Bool_t massInRange=kFALSE; | |
898 | if (TMath::Abs(invmassDelta-0.14557)<fPeakWindow) massInRange=kTRUE; | |
899 | ||
900 | if(fUseMCInfo) { | |
901 | if(isDStar==1) { | |
902 | //AliAODMCParticle *partDstar = (AliAODMCParticle*)mcArray->At(labDstar); | |
903 | //AliAODMCParticle *partPis = (AliAODMCParticle*)mcArray->At(partDstar->GetDaughter(1)); | |
904 | //AliAODMCParticle *partD0 = (AliAODMCParticle*)mcArray->At(partDstar->GetDaughter(0)); | |
905 | //AliAODMCParticle *partD0daughter = (AliAODMCParticle*)mcArray->At(partD0->GetDaughter(0)); | |
906 | fillthis="histD0Sgn_"; | |
907 | fillthis+=ptbin; | |
908 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
909 | fillthis="histD0Sgn"; | |
910 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
911 | fillthis="histDstarSgn_"; | |
912 | fillthis+=ptbin; | |
913 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
914 | fillthis="histDstarSgn"; | |
915 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
916 | fillthis="histDeltaSgn_"; | |
917 | fillthis+=ptbin; | |
918 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
919 | fillthis="histDeltaSgn"; | |
920 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
921 | if (massInRange) { | |
922 | fillthis="ptSgn"; | |
923 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt); | |
924 | fillthis="etaSgn"; | |
925 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta); | |
926 | } | |
927 | } | |
928 | else {//background | |
929 | fillthis="histD0Bkg_"; | |
930 | fillthis+=ptbin; | |
931 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
932 | fillthis="histD0Bkg"; | |
933 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
934 | fillthis="histDstarBkg_"; | |
935 | fillthis+=ptbin; | |
936 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
937 | fillthis="histDstarBkg"; | |
938 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
939 | fillthis="histDeltaBkg_"; | |
940 | fillthis+=ptbin; | |
941 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
942 | fillthis="histDeltaBkg"; | |
943 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
944 | if (massInRange) { | |
945 | fillthis="ptBkg"; | |
946 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt); | |
947 | fillthis="etaBkg"; | |
948 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta); | |
949 | } | |
950 | } | |
951 | } | |
952 | //no MC info, just cut selection | |
953 | fillthis="histD0Mass_"; | |
954 | fillthis+=ptbin; | |
955 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
956 | fillthis="histD0Mass"; | |
957 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0); | |
958 | fillthis="histDstarMass_"; | |
959 | fillthis+=ptbin; | |
960 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
961 | fillthis="histDstarMass"; | |
962 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar); | |
963 | fillthis="histDeltaMass_"; | |
964 | fillthis+=ptbin; | |
965 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
966 | fillthis="histDeltaMass"; | |
967 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
968 | if (massInRange) { | |
969 | fillthis="ptMass"; | |
970 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt); | |
971 | fillthis="etaMass"; | |
972 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta); | |
973 | } | |
645e004b | 974 | |
46f6e464 | 975 | } //else cout<<"NOT SELECTED"<<endl; |
645e004b | 976 | |
46f6e464 | 977 | return; |
645e004b | 978 | } |
979 | //______________________________ side band background for D*___________________________________ | |
46f6e464 | 980 | void AliAnalysisTaskSEDStarSpectra::SideBandBackground(Int_t ptbin, AliAODRecoCascadeHF *part, Bool_t PIDon, Int_t nSigma, AliAnalysisVertexingHF *vhf, TList *listout){ |
645e004b | 981 | |
982 | // D* side band background method. Two side bands, in M(Kpi) are taken at ~6 sigmas | |
983 | // (expected detector resolution) on the left and right frm the D0 mass. Each band | |
984 | // has a width of ~5 sigmas. Two band needed for opening angle considerations | |
645e004b | 985 | |
46f6e464 | 986 | if (ptbin==0) return; |
987 | ||
988 | Double_t invmassDelta = part->DeltaInvMass(); | |
989 | Double_t invmassD0 = part->InvMassD0(); | |
990 | ||
991 | if(part->SelectDstar(fVHFloose->GetDstarCuts(),vhf->GetD0toKpiCuts(),kTRUE)) {//selected | |
992 | if(TMath::Abs(invmassD0-1.865)>2*fD0Window && TMath::Abs(invmassD0-1.865)<4*fD0Window){ | |
993 | ||
994 | //PID of D0 daughters | |
995 | AliAODTrack *pos = (AliAODTrack*)part->Get2Prong()->GetDaughter(0); | |
996 | AliAODTrack *neg = (AliAODTrack*)part->Get2Prong()->GetDaughter(1); | |
997 | ||
998 | if (PIDon) { | |
999 | if(fDebug > 1) printf("AnalysisTaskSEDStar::TPCPIDon \n"); | |
1000 | if(fDebug > 1) printf("AnalysisTaskSEDStar::NSigmaTPC: %d\n", nSigma); | |
1001 | ||
1002 | if (part->Charge()>0){ | |
1003 | if(!SelectPID(pos, AliPID::kPion, nSigma)) return;//pion+ | |
1004 | if(!SelectPID(neg, AliPID::kKaon, nSigma)) return;//kaon- | |
1005 | }else{ | |
1006 | if(!SelectPID(pos, AliPID::kKaon, nSigma)) return;//kaon+ | |
1007 | if(!SelectPID(neg, AliPID::kPion, nSigma)) return;//pion- | |
1008 | } | |
1009 | } | |
1010 | ||
1011 | TString fillthis=""; | |
1012 | fillthis="histSideBandMass_"; | |
1013 | fillthis+=ptbin; | |
1014 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
1015 | fillthis="histSideBandMass"; | |
1016 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta); | |
1017 | ||
645e004b | 1018 | } |
645e004b | 1019 | } |
1020 | } | |
1021 | ||
1022 | //________________________________________________________________________________________________________________ | |
46f6e464 | 1023 | void AliAnalysisTaskSEDStarSpectra::WrongSignForDStar(Int_t ptbin, AliAODRecoCascadeHF *part, Bool_t PIDon, Int_t nSigma, AliAnalysisVertexingHF *vhf, TList *listout){ |
645e004b | 1024 | // |
1025 | // assign the wrong charge to the soft pion to create background | |
1026 | // | |
645e004b | 1027 | |
46f6e464 | 1028 | if (ptbin==0) return; |
1029 | ||
1030 | AliAODRecoDecayHF2Prong* theD0particle = (AliAODRecoDecayHF2Prong*)part->Get2Prong(); | |
1031 | Int_t okD0WrongSign,okD0barWrongSign; | |
1032 | Double_t wrongMassD0=0.,wrongMassDstar=0.; | |
1033 | theD0particle->SelectD0(vhf->GetD0toKpiCuts(),okD0WrongSign,okD0barWrongSign); | |
1034 | ||
9a83c91e | 1035 | if(part->Charge()>0) { |
1036 | okD0WrongSign = 0; | |
1037 | } else { | |
1038 | okD0barWrongSign = 0; | |
1039 | } | |
46f6e464 | 1040 | //wrong D0 inv mass |
1041 | if(okD0WrongSign==1){ | |
1042 | wrongMassD0 = theD0particle->InvMassD0(); | |
1043 | }else if(okD0WrongSign==0){ | |
1044 | wrongMassD0 = theD0particle->InvMassD0bar(); | |
645e004b | 1045 | } |
46f6e464 | 1046 | |
1047 | if(part->SelectDstar(fVHFloose->GetDstarCuts(),vhf->GetD0toKpiCuts(),kTRUE)) {//selected | |
1048 | if(TMath::Abs(wrongMassD0-1.865)<0.036){ | |
1049 | ||
1050 | //PID of D0 daughters | |
1051 | AliAODTrack *pos = (AliAODTrack*)part->Get2Prong()->GetDaughter(0); | |
1052 | AliAODTrack *neg = (AliAODTrack*)part->Get2Prong()->GetDaughter(1); | |
1053 | ||
1054 | if (PIDon) { | |
1055 | if(fDebug > 1) printf("AnalysisTaskSEDStar::TPCPIDon \n"); | |
1056 | if(fDebug > 1) printf("AnalysisTaskSEDStar::NSigmaTPC: %d\n", nSigma); | |
1057 | ||
1058 | if (part->Charge()>0){ | |
1059 | if(!SelectPID(pos, AliPID::kPion, nSigma)) return;//pion+ | |
1060 | if(!SelectPID(neg, AliPID::kKaon, nSigma)) return;//kaon- | |
1061 | }else{ | |
1062 | if(!SelectPID(pos, AliPID::kKaon, nSigma)) return;//kaon+ | |
1063 | if(!SelectPID(neg, AliPID::kPion, nSigma)) return;//pion- | |
1064 | } | |
1065 | } | |
1066 | ||
1067 | // wrong D* inv mass | |
1068 | Double_t px[3],py[3],pz[3]; | |
1069 | UInt_t pdg[3]={321,211,211}; | |
1070 | pdg[0] = (part->Charge()>0 ? 321 : 211); // positive daughter of D0 | |
1071 | px[0] = theD0particle->PxProng(0); | |
1072 | py[0] = theD0particle->PyProng(0); | |
1073 | pz[0] = theD0particle->PzProng(0); | |
1074 | pdg[1] = (part->Charge()>0 ? 211 : 321); // negative daughter of D0 | |
1075 | px[1] = theD0particle->PxProng(1); | |
1076 | py[1] = theD0particle->PyProng(1); | |
1077 | pz[1] = theD0particle->PzProng(1); | |
1078 | pdg[2] = 211; // soft pion | |
1079 | px[2] = part->PxProng(0); | |
1080 | py[2] = part->PyProng(0); | |
1081 | pz[2] = part->PzProng(0); | |
1082 | ||
1083 | Short_t dummycharge=0; | |
1084 | Double_t dummyd0[3]={0,0,0}; | |
1085 | AliAODRecoDecay *rd = new AliAODRecoDecay(0x0,3,dummycharge,px,py,pz,dummyd0); | |
1086 | ||
1087 | wrongMassDstar = rd->InvMass(3,pdg); | |
1088 | ||
1089 | delete rd; rd=NULL; | |
1090 | ||
1091 | TString fillthis=""; | |
1092 | fillthis="histWrongSignMass_"; | |
1093 | fillthis+=ptbin; | |
1094 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(wrongMassDstar-wrongMassD0); | |
1095 | fillthis="histWrongSignMass"; | |
1096 | ((TH1F*)(listout->FindObject(fillthis)))->Fill(wrongMassDstar-wrongMassD0); | |
1097 | ||
1098 | } | |
645e004b | 1099 | } |
46f6e464 | 1100 | } |
1101 | //_____________________________________________SINGLE TRACK PRE-SELECTION___________________________________________ | |
1102 | Bool_t AliAnalysisTaskSEDStarSpectra::SingleTrackSelections(AliAODRecoDecayHF2Prong* theD0particle, AliAODTrack *track0, AliAODTrack *track1, AliAODTrack *track2){ | |
1103 | ||
1104 | // Preselection on D0 daughters and the soft pion | |
1105 | ||
1106 | // reft in ITS for soft pion | |
1107 | //if((!(track2->GetStatus()&AliESDtrack::kITSrefit))) continue; | |
1108 | ||
1109 | // cut in acceptance for the soft pion and for the D0 daughters | |
1110 | Bool_t acceptanceProng0 = (TMath::Abs(theD0particle->EtaProng(0))<= 0.9 && theD0particle->PtProng(0) >= 0.1); | |
1111 | Bool_t acceptanceProng1 = (TMath::Abs(theD0particle->EtaProng(1))<= 0.9 && theD0particle->PtProng(1) >= 0.1); | |
1112 | // soft pion acceptance ... is it fine 0.9????? | |
1113 | Bool_t acceptanceProng2 = (TMath::Abs(track2->Eta())<= 1.0 && track2->Pt() >= 0.05); | |
1114 | ||
1115 | if (!(acceptanceProng0 && acceptanceProng1 && acceptanceProng2)) return kFALSE; | |
1116 | AliDebug(2,"D* reco daughters in acceptance"); | |
1117 | ||
1118 | // cut on the min n. of clusters in ITS for the D0 and soft pion | |
1119 | Int_t ncls0=0,ncls1=0,ncls2=0; | |
1120 | for(Int_t l=0;l<6;l++) { | |
1121 | if(TESTBIT(track0->GetITSClusterMap(),l)) ncls0++; | |
1122 | if(TESTBIT(track1->GetITSClusterMap(),l)) ncls1++; | |
1123 | if(TESTBIT(track2->GetITSClusterMap(),l)) ncls2++; | |
645e004b | 1124 | } |
46f6e464 | 1125 | // see AddTask for soft pion and D0 prongs ITS clusters request |
1126 | if (!(ncls0 >= fMinITSClusters && ncls1 >= fMinITSClusters && ncls2>=fMinITSClustersSoft)) return kFALSE; | |
645e004b | 1127 | |
46f6e464 | 1128 | return kTRUE; |
645e004b | 1129 | } |
645e004b | 1130 | |
46f6e464 | 1131 | //_____________________________________________________________________________________________ |
1132 | Bool_t AliAnalysisTaskSEDStarSpectra::SetSelections(Double_t pt){ | |
1133 | ||
645e004b | 1134 | //cuts[0] = inv. mass half width [GeV] |
1135 | //cuts[1] = dca [cm] | |
1136 | //cuts[2] = cosThetaStar | |
1137 | //cuts[3] = pTK [GeV/c] | |
1138 | //cuts[4] = pTPi [GeV/c] | |
1139 | //cuts[5] = d0K [cm] upper limit! | |
1140 | //cuts[6] = d0Pi [cm] upper limit! | |
1141 | //cuts[7] = d0d0 [cm^2] | |
1142 | //cuts[8] = cosThetaPoint | |
1143 | ||
46f6e464 | 1144 | if (fAnalysis==0){ |
1145 | if(pt<=1.){ | |
1146 | fVHF->SetD0toKpiCuts(0.450,0.02,0.7,0.8,0.8,0.1,0.1,0.000002,0.9); | |
1147 | fD0Window=0.018; | |
1148 | fPeakWindow=0.0018; | |
1149 | } | |
1150 | else if(pt >1. && pt <=2.){ | |
1151 | fVHF->SetD0toKpiCuts(0.450,0.03,0.7,0.8,0.8,0.1,0.1,-0.00002,0.9); | |
1152 | fD0Window=0.020; | |
1153 | fPeakWindow=0.0018; | |
1154 | //fVHF->SetDstarCuts(0.3, 0.0018, 0.05, 100000000000.0, 0.5); | |
1155 | } | |
1156 | else if(pt >2. && pt <=3.){ | |
1157 | fVHF->SetD0toKpiCuts(0.450,0.03,0.7,0.8,0.8,0.1,0.1,-0.00002,0.9); | |
1158 | fD0Window=0.020; | |
1159 | fPeakWindow=0.0018; | |
1160 | //fVHF->SetDstarCuts(0.3, 0.0018, 0.05, 100000000000.0, 0.5); | |
1161 | } | |
1162 | else if(pt >3. && pt <=5.){ | |
1163 | fVHF->SetD0toKpiCuts(0.450,0.03,0.7,0.9,0.9,0.1,0.1,0.000002,0.8); | |
1164 | fD0Window=0.022; | |
1165 | fPeakWindow=0.0016; | |
1166 | //fVHF->SetDstarCuts(0.3, 0.0016, 0.05, 100000000000.0, 0.5); | |
1167 | } | |
1168 | else if(pt >5.){ | |
1169 | fVHF->SetD0toKpiCuts(0.450,0.03,0.7,1.0,1.0,0.1,0.1,0.000002,0.8); | |
1170 | fD0Window=0.026; | |
1171 | fPeakWindow=0.0014; | |
1172 | //fVHF->SetDstarCuts(0.3, 0.0014, 0.05, 100000000000.0, 0.5); | |
1173 | } | |
1174 | } | |
1175 | ||
1176 | if(fAnalysis==1){ | |
1177 | if(pt<=1.){ | |
1178 | fVHF->SetD0toKpiCuts(0.450,0.04,0.8,0.21,0.21,0.021,0.021,-0.0002,0.9); | |
1179 | fD0Window=0.024; | |
1180 | fPeakWindow=0.0018; | |
1181 | } | |
1182 | else if(pt >1. && pt <=2.){ | |
1183 | fVHF->SetD0toKpiCuts(0.450,0.02,0.7,0.8,0.8,0.021,0.021,-0.0002,0.9); | |
1184 | fD0Window=0.024; | |
1185 | fPeakWindow=0.0018; | |
1186 | } | |
1187 | else if(pt >2. && pt <=3.){ | |
1188 | fVHF->SetD0toKpiCuts(0.450,0.04,0.8,0.8,0.8,0.035,0.042,-0.000085,0.9); | |
1189 | fD0Window=0.024; | |
1190 | fPeakWindow=0.0018; | |
1191 | } | |
1192 | else if(pt >3. && pt <=5.){ | |
1193 | fVHF->SetD0toKpiCuts(0.450,0.016,0.8,1.2,1.2,0.042,0.056,-0.000085,0.9); | |
1194 | fD0Window=0.024; | |
1195 | fPeakWindow=0.0016; | |
1196 | } | |
1197 | else if(pt >5.){ | |
1198 | fVHF->SetD0toKpiCuts(0.450,0.08,1.0,1.2,1.2,0.07,0.07,0.0001,0.9); | |
1199 | fD0Window=0.024; | |
1200 | fPeakWindow=0.0014; | |
1201 | } | |
645e004b | 1202 | } |
645e004b | 1203 | return kTRUE; |
1204 | } | |
46f6e464 | 1205 | |
645e004b | 1206 | //_____________________________ pid _______________________________________- |
46f6e464 | 1207 | Bool_t AliAnalysisTaskSEDStarSpectra::SelectPID(AliAODTrack *track, AliPID::EParticleType type, Double_t nsig){//type(0-4): {e,mu,pi,K,p} |
1208 | // | |
1209 | // Method to extract the PID for the pion/kaon. The particle type for PID can be set by user | |
1210 | // At the moment only TPC PID. | |
1211 | // | |
1212 | ||
645e004b | 1213 | //TPC |
46f6e464 | 1214 | |
1215 | Bool_t isParticle=kTRUE; | |
1216 | if ((track->GetStatus()&AliESDtrack::kTPCpid )==0) return isParticle; | |
645e004b | 1217 | AliAODPid *pid = track->GetDetPid(); |
1218 | static AliTPCPIDResponse theTPCpid; | |
46f6e464 | 1219 | Double_t nsigma = theTPCpid.GetNumberOfSigmas(track->P(),pid->GetTPCsignal(),track->GetTPCClusterMap().CountBits(), type); |
1220 | if (TMath::Abs(nsigma)>nsig) isParticle=kFALSE; | |
1221 | /* //using new AliAODPidHF class | |
1222 | if ((track->GetStatus()&AliESDtrack::kTPCpid )==0) return kTRUE; | |
1223 | AliAODPidHF *pidHF = new AliAODPidHF(); | |
1224 | pidHF->SetSigma(nsig); | |
1225 | if (type == AliPID::kPion) return pidHF->IsPionRaw(track,"TPC"); | |
1226 | if (type == AliPID::kKaon) return pidHF->IsKaonRaw(track,"TPC"); | |
1227 | return kFALSE; | |
1228 | */ | |
645e004b | 1229 | //ITS |
1230 | // | |
1231 | // | |
1232 | // | |
46f6e464 | 1233 | //TOF |
1234 | // | |
1235 | // | |
1236 | return isParticle; | |
645e004b | 1237 | } |
1238 |