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