AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSEDStarSpectra.cxx
Go to the documentation of this file.
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  * appeuear 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 /* $Id$ */
17 
18 //
19 //
20 // Base class for DStar Analysis
21 //
22 //
23 // The D* spectra study is done in pt bins:
24 // [0,0.5] [0.5,1] [1,2] [2,3] [3,4] [4,5] [5,6] [6,7] [7,8],
25 // [8,10],[10,12], [12,16], [16,20] and [20,24]
26 //
27 // Cuts arew centralized in AliRDHFCutsDStartoKpipi
28 // Side Band and like sign background are implemented in the macro
29 //
30 //-----------------------------------------------------------------------
31 //
32 // Author A.Grelli
33 // ERC-QGP Utrecht University - a.grelli@uu.nl,
34 // Author Y.Wang
35 // University of Heidelberg - yifei@physi.uni-heidelberg.de
36 // Author C.Ivan
37 // ERC-QGP Utrecht University - c.ivan@uu.nl,
38 //
39 //-----------------------------------------------------------------------
40 
41 #include <TSystem.h>
42 #include <TParticle.h>
43 #include <TH1I.h>
44 #include "TROOT.h"
45 #include <TDatabasePDG.h>
46 #include <AliAnalysisDataSlot.h>
47 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliAODVertex.h"
56 #include "AliAODRecoDecay.h"
57 #include "AliAODRecoDecayHF.h"
58 #include "AliAODRecoCascadeHF.h"
60 #include "AliAnalysisVertexingHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODMCParticle.h"
64 #include "AliAODEvent.h"
66 
70 
71 //__________________________________________________________________________
73  AliAnalysisTaskSE(),
74  fEvents(0),
75  fAnalysis(0),
76  fD0Window(0),
77  fPeakWindow(0),
78  fUseMCInfo(kFALSE),
79  fDoSearch(kFALSE),
80  fOutput(0),
81  fOutputAll(0),
82  fOutputPID(0),
83  fNSigma(3),
84  fCuts(0),
85  fCEvents(0),
86  fTrueDiff2(0),
87  fDeltaMassD1(0),
88  fCounter(0),
89  fDoImpParDstar(kFALSE),
90  fNImpParBins(400),
91  fLowerImpPar(-2000.),
92  fHigherImpPar(2000.),
93  fDoDStarVsY(kFALSE)
94 {
95  //
97  //
98  for(Int_t i=0;i<5;i++) fHistMassPtImpParTCDs[i]=0;
99 }
100 //___________________________________________________________________________
102  AliAnalysisTaskSE(name),
103  fEvents(0),
104  fAnalysis(0),
105  fD0Window(0),
106  fPeakWindow(0),
107  fUseMCInfo(kFALSE),
108  fDoSearch(kFALSE),
109  fOutput(0),
110  fOutputAll(0),
111  fOutputPID(0),
112  fNSigma(3),
113  fCuts(0),
114  fCEvents(0),
115  fTrueDiff2(0),
116  fDeltaMassD1(0),
117  fCounter(0),
118  fDoImpParDstar(kFALSE),
119  fNImpParBins(400),
120  fLowerImpPar(-2000.),
121  fHigherImpPar(2000.),
122  fDoDStarVsY(kFALSE)
123 {
124  //
126  //
127  Info("AliAnalysisTaskSEDStarSpectra","Calling Constructor");
128 
129  fCuts=cuts;
130  for(Int_t i=0;i<5;i++) fHistMassPtImpParTCDs[i]=0;
131 
132  DefineOutput(1,TList::Class()); //conters
133  DefineOutput(2,TList::Class()); //All Entries output
134  DefineOutput(3,TList::Class()); //3sigma PID output
135  DefineOutput(4,AliRDHFCutsDStartoKpipi::Class()); //My private output
136  DefineOutput(5,AliNormalizationCounter::Class()); // normalization
137 }
138 
139 //___________________________________________________________________________
141  //
143  //
144  Info("~AliAnalysisTaskSEDStarSpectra","Calling Destructor");
145 
146  delete fOutput;
147  delete fOutputAll;
148  delete fOutputPID;
149  delete fCuts;
150  delete fCEvents;
151  delete fDeltaMassD1;
152  for(Int_t i=0; i<5; i++){
153  delete fHistMassPtImpParTCDs[i];
154  }
155 }
156 //_________________________________________________
158  //
160  //
161 
162  if(fDebug > 1) printf("AnalysisTaskSEDStarSpectra::Init() \n");
164  // Post the data
165  PostData(4,copyfCuts);
166 
167  return;
168 }
169 
170 //_________________________________________________
172 {
174  if (!fInputEvent) {
175  Error("UserExec","NO EVENT FOUND!");
176  return;
177  }
178 
179  fEvents++;
180 
181  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
182  TClonesArray *arrayDStartoD0pi=0;
183 
184  fCEvents->Fill(1);
185 
186  if(!aodEvent && AODEvent() && IsStandardAOD()) {
187  // In case there is an AOD handler writing a standard AOD, use the AOD
188  // event in memory rather than the input (ESD) event.
189  aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
190  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
191  // have to taken from the AOD event hold by the AliAODExtension
192  AliAODHandler* aodHandler = (AliAODHandler*)
193  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
194  if(aodHandler->GetExtensions()) {
195  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
196  AliAODEvent *aodFromExt = ext->GetAOD();
197  arrayDStartoD0pi=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
198  }
199  } else {
200  arrayDStartoD0pi=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
201  }
202 
203  // fix for temporary bug in ESDfilter
204  // the AODs with null vertex pointer didn't pass the PhysSel
205  if(!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField())<0.001) return;
206  fCEvents->Fill(2);
207 
208  fCounter->StoreEvent(aodEvent,fCuts,fUseMCInfo);
209 
210  // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD
211  TString trigclass=aodEvent->GetFiredTriggerClasses();
212  if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD")||trigclass.Contains("C0SMH-B-NOPF-ALL")) fCEvents->Fill(5);
213 
214  if(!fCuts->IsEventSelected(aodEvent)) {
215  if(fCuts->GetWhyRejection()==6) // rejected for Z vertex
216  fCEvents->Fill(6);
217  return;
218  }
219 
220  Bool_t isEvSel=fCuts->IsEventSelected(aodEvent);
221  fCEvents->Fill(3);
222  if(!isEvSel) return;
223 
224  // Load the event
225  // AliInfo(Form("Event %d",fEvents));
226  //if (fEvents%10000 ==0) AliInfo(Form("Event %d",fEvents));
227 
228  // counters for efficiencies
229  Int_t icountReco = 0;
230 
231  //D* and D0 prongs needed to MatchToMC method
232  Int_t pdgDgDStartoD0pi[2]={421,211};
233  Int_t pdgDgD0toKpi[2]={321,211};
234 
235  // AOD primary vertex
236  AliAODVertex *vtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
237  if(!vtx1) return;
238  if(vtx1->GetNContributors()<1) return;
239  fCEvents->Fill(4);
240 
241  if (!arrayDStartoD0pi){
242  AliInfo("Could not find array of HF vertices, skipping the event");
243  return;
244  }else AliDebug(2, Form("Found %d vertices",arrayDStartoD0pi->GetEntriesFast()));
245 
246  Int_t nSelectedAna =0;
247  Int_t nSelectedProd =0;
248 
249  // loop over the tracks to search for candidates soft pion
250  for (Int_t iDStartoD0pi = 0; iDStartoD0pi<arrayDStartoD0pi->GetEntriesFast(); iDStartoD0pi++) {
251 
252  // D* candidates and D0 from D*
253  AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)arrayDStartoD0pi->At(iDStartoD0pi);
254  if(!dstarD0pi->GetSecondaryVtx()) continue;
255  AliAODRecoDecayHF2Prong* theD0particle = (AliAODRecoDecayHF2Prong*)dstarD0pi->Get2Prong();
256  if (!theD0particle) continue;
257 
258  Int_t isDStar = 0;
259  TClonesArray *mcArray = 0;
260  AliAODMCHeader *mcHeader=0;
261 
262  Bool_t isPrimary=kTRUE;
263  Float_t pdgCode=-2;
264  Float_t trueImpParXY=0.;
265 
266  // mc analysis
267  if(fUseMCInfo){
268  //MC array need for maching
269  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
270  if (!mcArray) {
271  AliError("Could not find Monte-Carlo in AOD");
272  return;
273  }
274  // load MC header
275  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
276  if(!mcHeader) {
277  printf("AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
278  return;
279  }
280  // find associated MC particle for D* ->D0toKpi
281  Int_t mcLabel = dstarD0pi->MatchToMC(413,421,pdgDgDStartoD0pi,pdgDgD0toKpi,mcArray);
282  if(mcLabel>=0){
283 
284  AliAODMCParticle *partDSt = (AliAODMCParticle*)mcArray->At(mcLabel);
285  Int_t checkOrigin = CheckOrigin(mcArray,partDSt);
286  if(checkOrigin==5) isPrimary=kFALSE;
287  AliAODMCParticle *dg0 = (AliAODMCParticle*)mcArray->At(partDSt->GetDaughter(0));
288  // AliAODMCParticle *dg01 = (AliAODMCParticle*)mcArray->At(dg0->GetDaughter(0));
289  pdgCode=TMath::Abs(partDSt->GetPdgCode());
290  if(!isPrimary){
291  trueImpParXY=GetTrueImpactParameterD0(mcHeader,mcArray,dg0)*1000.;
292  }
293  isDStar = 1;
294  }else{
295  pdgCode=-1;
296  }
297  }
298 
299  if(pdgCode==-1) AliDebug(2,"No particle assigned! check\n");
300 
301  Int_t ptbin=fCuts->PtBin(dstarD0pi->Pt());
302 
303  // quality selction on tracks and region of interest
304  Int_t isTkSelected = fCuts->IsSelected(dstarD0pi,AliRDHFCuts::kTracks); // quality cuts on tracks
305  if(!isTkSelected) continue;
306 
307  if(!fCuts->IsInFiducialAcceptance(dstarD0pi->Pt(),dstarD0pi->YDstar())) continue;
308 
309 
310  //histos for impact par studies - D0!!!
311  Double_t ptCand = dstarD0pi->Get2Prong()->Pt();
312  Double_t invMass=dstarD0pi->InvMassD0();
313  Double_t impparXY=dstarD0pi->Get2Prong()->ImpParXY()*10000.;
314 
315  Double_t arrayForSparse[3]={invMass,ptCand,impparXY};
316  Double_t arrayForSparseTrue[3]={invMass,ptCand,trueImpParXY};
317 
318  // set the D0 search window bin by bin - useful to calculate side band bkg
319  if (ptbin==0){
320  if(fAnalysis==1){
321  fD0Window=0.035;
322  fPeakWindow=0.03;
323  }else{
324  fD0Window=0.020;
325  fPeakWindow=0.0018;
326  }
327  }
328  if (ptbin==1){
329  if(fAnalysis==1){
330  fD0Window=0.035;
331  fPeakWindow=0.03;
332  }else{
333  fD0Window=0.020;
334  fPeakWindow=0.0018;
335  }
336  }
337  if (ptbin==2){
338  if(fAnalysis==1){
339  fD0Window=0.035;
340  fPeakWindow=0.03;
341  }else{
342  fD0Window=0.020;
343  fPeakWindow=0.0018;
344  }
345  }
346  if (ptbin==3){
347  if(fAnalysis==1){
348  fD0Window=0.035;
349  fPeakWindow=0.03;
350  }else{
351  fD0Window=0.022;
352  fPeakWindow=0.0016;
353  }
354  }
355  if (ptbin==4){
356  if(fAnalysis==1){
357  fD0Window=0.035;
358  fPeakWindow=0.03;
359  }else{
360  fD0Window=0.026;
361  fPeakWindow=0.0014;
362  }
363  }
364  if (ptbin==5){
365  if(fAnalysis==1){
366  fD0Window=0.045;
367  fPeakWindow=0.03;
368  }else{
369  fD0Window=0.026;
370  fPeakWindow=0.0014;
371  }
372  }
373  if (ptbin==6){
374  if(fAnalysis==1){
375  fD0Window=0.045;
376  fPeakWindow=0.03;
377  }else{
378  fD0Window=0.026;
379  fPeakWindow=0.006;
380  }
381  }
382  if (ptbin==7){
383  if(fAnalysis==1){
384  fD0Window=0.055;
385  fPeakWindow=0.03;
386  }else{
387  fD0Window=0.026;
388  fPeakWindow=0.006;
389  }
390  }
391  if (ptbin>7){
392  if(fAnalysis==1){
393  fD0Window=0.074;
394  fPeakWindow=0.03;
395  }else{
396  fD0Window=0.026;
397  fPeakWindow=0.006;
398  }
399  }
400 
401  nSelectedProd++;
402  nSelectedAna++;
403 
404  // check that we are close to signal in the DeltaM - here to save time for PbPb
405  Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();
406  Double_t mPDGDstar=TDatabasePDG::Instance()->GetParticle(413)->Mass();
407  Double_t invmassDelta = dstarD0pi->DeltaInvMass();
408 
409  if (TMath::Abs(invmassDelta-(mPDGDstar-mPDGD0))>fPeakWindow) continue;
410  Int_t isSelected=fCuts->IsSelected(dstarD0pi,AliRDHFCuts::kCandidate,aodEvent); //selected
411 
412  // after cuts
413  if(fDoImpParDstar && isSelected){
414  fHistMassPtImpParTCDs[0]->Fill(arrayForSparse);
415  if(isPrimary) fHistMassPtImpParTCDs[1]->Fill(arrayForSparse);
416  else{
417  fHistMassPtImpParTCDs[2]->Fill(arrayForSparse);
418  fHistMassPtImpParTCDs[3]->Fill(arrayForSparseTrue);
419  }
420  }
421 
422  if (fDoDStarVsY && isSelected){
423  ((TH3F*) (fOutputPID->FindObject("deltamassVsyVsPt")))->Fill(dstarD0pi->DeltaInvMass(),dstarD0pi->YDstar(),dstarD0pi->Pt() );
424  }
425 
426 
427  // fill PID
428  FillSpectrum(dstarD0pi,isDStar,fCuts,isSelected,fOutputPID);
429  SideBandBackground(dstarD0pi,fCuts,isSelected, fOutputPID);
430  //WrongSignForDStar(dstarD0pi,fCuts,fOutputPID);
431 
432  //swich off the PID selection
433  fCuts->SetUsePID(kFALSE);
434  Int_t isSelectedNoPID=fCuts->IsSelected(dstarD0pi,AliRDHFCuts::kCandidate, aodEvent); //selected
435  fCuts->SetUsePID(kTRUE);
436 
437  FillSpectrum(dstarD0pi,isDStar,fCuts,isSelectedNoPID,fOutputAll);
438  // SideBandBackground(dstarD0pi,fCuts,isSelectedNoPID, fOutputAll);
439 
440  // rare D search ------
441  if(fDoSearch){
442  TLorentzVector lorentzTrack1(0,0,0,0); // lorentz 4 vector
443  TLorentzVector lorentzTrack2(0,0,0,0); // lorentz 4 vector
444 
445  for (Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
446 
447  AliAODTrack* aodTrack = dynamic_cast<AliAODTrack*>(aodEvent->GetTrack(i));
448  if(!aodTrack) AliFatal("Not a standard AOD");
449 
450  if(dstarD0pi->Charge() == aodTrack->Charge()) continue;
451  if((!(aodTrack->GetStatus()&AliESDtrack::kITSrefit)|| (!(aodTrack->GetStatus()&AliESDtrack::kTPCrefit)))) continue;
452  if (TMath::Abs(invmassDelta-(mPDGDstar-mPDGD0))>0.02) continue;
453 
454  //build the D1 mass
455  Double_t mass = TDatabasePDG::Instance()->GetParticle(211)->Mass();
456 
457  lorentzTrack1.SetPxPyPzE( dstarD0pi->Px(),dstarD0pi->Py(), dstarD0pi->Pz(), dstarD0pi->E(413) );
458  lorentzTrack2.SetPxPyPzE( aodTrack->Px(),aodTrack->Py(), aodTrack->Pz(),aodTrack->E(mass) );
459 
460  //D1 mass
461  Double_t d1mass = ((lorentzTrack1+lorentzTrack2).M());
462  //mass difference - at 0.4117 and 0.4566
463  fDeltaMassD1->Fill(d1mass-dstarD0pi->InvMassDstarKpipi());
464  }
465  }
466 
467  if(isDStar == 1) {
468  fTrueDiff2->Fill(dstarD0pi->Pt(),dstarD0pi->DeltaInvMass());
469  }
470 
471  }
472 
473  fCounter->StoreCandidates(aodEvent,nSelectedProd,kTRUE);
474  fCounter->StoreCandidates(aodEvent,nSelectedAna,kFALSE);
475 
476  AliDebug(2, Form("Found %i Reco particles that are D*!!",icountReco));
477 
478  PostData(1,fOutput);
479  PostData(2,fOutputAll);
480  PostData(3,fOutputPID);
481  PostData(5,fCounter);
482 
483 }
484 //________________________________________ terminate ___________________________
486 {
490 
491  //Info("Terminate","");
492  AliAnalysisTaskSE::Terminate();
493 
494  fOutput = dynamic_cast<TList*> (GetOutputData(1));
495  if (!fOutput) {
496  printf("ERROR: fOutput not available\n");
497  return;
498  }
499 
500  fCEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fCEvents"));
501  fDeltaMassD1 = dynamic_cast<TH1F*>(fOutput->FindObject("fDeltaMassD1"));
502  fTrueDiff2 = dynamic_cast<TH2F*>(fOutput->FindObject("fTrueDiff2"));
503 
504  fOutputAll = dynamic_cast<TList*> (GetOutputData(1));
505  if (!fOutputAll) {
506  printf("ERROR: fOutputAll not available\n");
507  return;
508  }
509  fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
510  if (!fOutputPID) {
511  printf("ERROR: fOutputPID not available\n");
512  return;
513  }
514 
515 
516  return;
517 }
518 //___________________________________________________________________________
521  Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
522 
523  //slot #1
524  //OpenFile(1);
525  fOutput = new TList();
526  fOutput->SetOwner();
527  fOutput->SetName("chist0");
528 
529  fOutputAll = new TList();
530  fOutputAll->SetOwner();
531  fOutputAll->SetName("listAll");
532 
533  fOutputPID = new TList();
534  fOutputPID->SetOwner();
535  fOutputPID->SetName("listPID");
536 
537  // define histograms
539 
540  //Counter for Normalization
541  fCounter = new AliNormalizationCounter(Form("%s",GetOutputSlot(5)->GetContainer()->GetName()));
542  fCounter->Init();
543 
545 
546  PostData(1,fOutput);
547  PostData(2,fOutputAll);
548  PostData(3,fOutputPID);
549 
550  return;
551 }
552 //___________________________________ hiostograms _______________________________________
555 
556  fCEvents = new TH1F("fCEvents","conter",11,0,11);
557  fCEvents->SetStats(kTRUE);
558  fCEvents->GetXaxis()->SetTitle("1");
559  fCEvents->GetYaxis()->SetTitle("counts");
560  fOutput->Add(fCEvents);
561 
562  fTrueDiff2 = new TH2F("DiffDstar_pt","True Reco diff vs pt",200,0,15,900,0,0.3);
563  fOutput->Add(fTrueDiff2);
564 
565  fDeltaMassD1 = new TH1F("DeltaMassD1","delta mass d1",600,0,0.8);
566  fOutput->Add(fDeltaMassD1);
567 
568  const Int_t nhist=14;
569  TString nameMass=" ", nameSgn=" ", nameBkg=" ";
570 
571  for(Int_t i=-2;i<nhist;i++){
572  nameMass="histDeltaMass_";
573  nameMass+=i+1;
574  nameSgn="histDeltaSgn_";
575  nameSgn+=i+1;
576  nameBkg="histDeltaBkg_";
577  nameBkg+=i+1;
578 
579  if (i==-2) {
580  nameMass="histDeltaMass";
581  nameSgn="histDeltaSgn";
582  nameBkg="histDeltaBkg";
583  }
584 
585  TH1F* spectrumMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} invariant mass; #DeltaM [GeV/c^{2}]; Entries",700,0.13,0.2);
586  TH1F* spectrumSgn = new TH1F(nameSgn.Data(), "D^{*}-D^{0} Signal invariant mass - MC; #DeltaM [GeV/c^{2}]; Entries",700,0.13,0.2);
587  TH1F* spectrumBkg = new TH1F(nameBkg.Data(), "D^{*}-D^{0} Background invariant mass - MC; #DeltaM [GeV/c^{2}]; Entries",700,0.13,0.2);
588 
589  nameMass="histD0Mass_";
590  nameMass+=i+1;
591  nameSgn="histD0Sgn_";
592  nameSgn+=i+1;
593  nameBkg="histD0Bkg_";
594  nameBkg+=i+1;
595 
596  if (i==-2) {
597  nameMass="histD0Mass";
598  nameSgn="histD0Sgn";
599  nameBkg="histD0Bkg";
600  }
601 
602  TH1F* spectrumD0Mass = new TH1F(nameMass.Data(),"D^{0} invariant mass; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95);
603  TH1F* spectrumD0Sgn = new TH1F(nameSgn.Data(), "D^{0} Signal invariant mass - MC; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95);
604  TH1F* spectrumD0Bkg = new TH1F(nameBkg.Data(), "D^{0} Background invariant mass - MC; M(D^{0}) [GeV/c^{2}]; Entries",200,1.75,1.95);
605 
606  nameMass="histDstarMass_";
607  nameMass+=i+1;
608  nameSgn="histDstarSgn_";
609  nameSgn+=i+1;
610  nameBkg="histDstarBkg_";
611  nameBkg+=i+1;
612 
613  if (i==-2) {
614  nameMass="histDstarMass";
615  nameSgn="histDstarSgn";
616  nameBkg="histDstarBkg";
617  }
618 
619  TH1F* spectrumDstarMass = new TH1F(nameMass.Data(),"D^{*} invariant mass; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1);
620  TH1F* spectrumDstarSgn = new TH1F(nameSgn.Data(), "D^{*} Signal invariant mass - MC; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1);
621  TH1F* spectrumDstarBkg = new TH1F(nameBkg.Data(), "D^{*} Background invariant mass - MC; M(D^{*}) [GeV/c^{2}]; Entries",200,1.9,2.1);
622 
623  nameMass="histSideBandMass_";
624  nameMass+=i+1;
625  if (i==-2) {
626  nameMass="histSideBandMass";
627  }
628 
629  TH1F* spectrumSideBandMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} sideband mass; M(D^{*}) [GeV/c^{2}]; Entries",200,0.1,0.2);
630 
631  nameMass="histWrongSignMass_";
632  nameMass+=i+1;
633  if (i==-2) {
634  nameMass="histWrongSignMass";
635  }
636 
637  TH1F* spectrumWrongSignMass = new TH1F(nameMass.Data(),"D^{*}-D^{0} wrongsign mass; M(D^{*}) [GeV/c^{2}]; Entries",200,0.1,0.2);
638 
639 
640  spectrumMass->Sumw2();
641  spectrumSgn->Sumw2();
642  spectrumBkg->Sumw2();
643 
644  spectrumMass->SetLineColor(6);
645  spectrumSgn->SetLineColor(2);
646  spectrumBkg->SetLineColor(4);
647 
648  spectrumMass->SetMarkerStyle(20);
649  spectrumSgn->SetMarkerStyle(20);
650  spectrumBkg->SetMarkerStyle(20);
651  spectrumMass->SetMarkerSize(0.6);
652  spectrumSgn->SetMarkerSize(0.6);
653  spectrumBkg->SetMarkerSize(0.6);
654  spectrumMass->SetMarkerColor(6);
655  spectrumSgn->SetMarkerColor(2);
656  spectrumBkg->SetMarkerColor(4);
657 
658  spectrumD0Mass->Sumw2();
659  spectrumD0Sgn->Sumw2();
660  spectrumD0Bkg->Sumw2();
661 
662  spectrumD0Mass->SetLineColor(6);
663  spectrumD0Sgn->SetLineColor(2);
664  spectrumD0Bkg->SetLineColor(4);
665 
666  spectrumD0Mass->SetMarkerStyle(20);
667  spectrumD0Sgn->SetMarkerStyle(20);
668  spectrumD0Bkg->SetMarkerStyle(20);
669  spectrumD0Mass->SetMarkerSize(0.6);
670  spectrumD0Sgn->SetMarkerSize(0.6);
671  spectrumD0Bkg->SetMarkerSize(0.6);
672  spectrumD0Mass->SetMarkerColor(6);
673  spectrumD0Sgn->SetMarkerColor(2);
674  spectrumD0Bkg->SetMarkerColor(4);
675 
676  spectrumDstarMass->Sumw2();
677  spectrumDstarSgn->Sumw2();
678  spectrumDstarBkg->Sumw2();
679 
680  spectrumDstarMass->SetLineColor(6);
681  spectrumDstarSgn->SetLineColor(2);
682  spectrumDstarBkg->SetLineColor(4);
683 
684  spectrumDstarMass->SetMarkerStyle(20);
685  spectrumDstarSgn->SetMarkerStyle(20);
686  spectrumDstarBkg->SetMarkerStyle(20);
687  spectrumDstarMass->SetMarkerSize(0.6);
688  spectrumDstarSgn->SetMarkerSize(0.6);
689  spectrumDstarBkg->SetMarkerSize(0.6);
690  spectrumDstarMass->SetMarkerColor(6);
691  spectrumDstarSgn->SetMarkerColor(2);
692  spectrumDstarBkg->SetMarkerColor(4);
693 
694  spectrumSideBandMass->Sumw2();
695  spectrumSideBandMass->SetLineColor(4);
696  spectrumSideBandMass->SetMarkerStyle(20);
697  spectrumSideBandMass->SetMarkerSize(0.6);
698  spectrumSideBandMass->SetMarkerColor(4);
699 
700  spectrumWrongSignMass->Sumw2();
701  spectrumWrongSignMass->SetLineColor(4);
702  spectrumWrongSignMass->SetMarkerStyle(20);
703  spectrumWrongSignMass->SetMarkerSize(0.6);
704  spectrumWrongSignMass->SetMarkerColor(4);
705 
706  TH1F* allMass = (TH1F*)spectrumMass->Clone();
707  TH1F* allSgn = (TH1F*)spectrumSgn->Clone();
708  TH1F* allBkg = (TH1F*)spectrumBkg->Clone();
709 
710  TH1F* pidMass = (TH1F*)spectrumMass->Clone();
711  TH1F* pidSgn = (TH1F*)spectrumSgn->Clone();
712  TH1F* pidBkg = (TH1F*)spectrumBkg->Clone();
713 
714  fOutputAll->Add(allMass);
715  fOutputAll->Add(allSgn);
716  fOutputAll->Add(allBkg);
717 
718  fOutputPID->Add(pidMass);
719  fOutputPID->Add(pidSgn);
720  fOutputPID->Add(pidBkg);
721 
722  TH1F* allD0Mass = (TH1F*)spectrumD0Mass->Clone();
723  TH1F* allD0Sgn = (TH1F*)spectrumD0Sgn->Clone();
724  TH1F* allD0Bkg = (TH1F*)spectrumD0Bkg->Clone();
725 
726  TH1F* pidD0Mass = (TH1F*)spectrumD0Mass->Clone();
727  TH1F* pidD0Sgn = (TH1F*)spectrumD0Sgn->Clone();
728  TH1F* pidD0Bkg = (TH1F*)spectrumD0Bkg->Clone();
729 
730  fOutputAll->Add(allD0Mass);
731  fOutputAll->Add(allD0Sgn);
732  fOutputAll->Add(allD0Bkg);
733 
734  fOutputPID->Add(pidD0Mass);
735  fOutputPID->Add(pidD0Sgn);
736  fOutputPID->Add(pidD0Bkg);
737 
738  TH1F* allDstarMass = (TH1F*)spectrumDstarMass->Clone();
739  TH1F* allDstarSgn = (TH1F*)spectrumDstarSgn->Clone();
740  TH1F* allDstarBkg = (TH1F*)spectrumDstarBkg->Clone();
741 
742  TH1F* pidDstarMass = (TH1F*)spectrumDstarMass->Clone();
743  TH1F* pidDstarSgn = (TH1F*)spectrumDstarSgn->Clone();
744  TH1F* pidDstarBkg = (TH1F*)spectrumDstarBkg->Clone();
745 
746  fOutputAll->Add(allDstarMass);
747  fOutputAll->Add(allDstarSgn);
748  fOutputAll->Add(allDstarBkg);
749 
750  fOutputPID->Add(pidDstarMass);
751  fOutputPID->Add(pidDstarSgn);
752  fOutputPID->Add(pidDstarBkg);
753 
754  TH1F* allSideBandMass = (TH1F*)spectrumSideBandMass->Clone();
755  TH1F* pidSideBandMass = (TH1F*)spectrumSideBandMass->Clone();
756 
757  fOutputAll->Add(allSideBandMass);
758  fOutputPID->Add(pidSideBandMass);
759 
760  TH1F* allWrongSignMass = (TH1F*)spectrumWrongSignMass->Clone();
761  TH1F* pidWrongSignMass = (TH1F*)spectrumWrongSignMass->Clone();
762 
763  fOutputAll->Add(allWrongSignMass);
764  fOutputPID->Add(pidWrongSignMass);
765 
766  }
767 
768  // pt spectra
769  nameMass="ptMass";
770  nameSgn="ptSgn";
771  nameBkg="ptBkg";
772 
773  TH1F* ptspectrumMass = new TH1F(nameMass.Data(),"D^{*} p_{T}; p_{T} [GeV]; Entries",200,0,10);
774  TH1F* ptspectrumSgn = new TH1F(nameSgn.Data(), "D^{*} Signal p_{T} - MC; p_{T} [GeV]; Entries",200,0,10);
775  TH1F* ptspectrumBkg = new TH1F(nameBkg.Data(), "D^{*} Background p_{T} - MC; p_{T} [GeV]; Entries",200,0,10);
776 
777  ptspectrumMass->Sumw2();
778  ptspectrumSgn->Sumw2();
779  ptspectrumBkg->Sumw2();
780 
781  ptspectrumMass->SetLineColor(6);
782  ptspectrumSgn->SetLineColor(2);
783  ptspectrumBkg->SetLineColor(4);
784 
785  ptspectrumMass->SetMarkerStyle(20);
786  ptspectrumSgn->SetMarkerStyle(20);
787  ptspectrumBkg->SetMarkerStyle(20);
788  ptspectrumMass->SetMarkerSize(0.6);
789  ptspectrumSgn->SetMarkerSize(0.6);
790  ptspectrumBkg->SetMarkerSize(0.6);
791  ptspectrumMass->SetMarkerColor(6);
792  ptspectrumSgn->SetMarkerColor(2);
793  ptspectrumBkg->SetMarkerColor(4);
794 
795  TH1F* ptallMass = (TH1F*)ptspectrumMass->Clone();
796  TH1F* ptallSgn = (TH1F*)ptspectrumSgn->Clone();
797  TH1F* ptallBkg = (TH1F*)ptspectrumBkg->Clone();
798 
799  TH1F* ptpidMass = (TH1F*)ptspectrumMass->Clone();
800  TH1F* ptpidSgn = (TH1F*)ptspectrumSgn->Clone();
801  TH1F* ptpidBkg = (TH1F*)ptspectrumBkg->Clone();
802 
803  fOutputAll->Add(ptallMass);
804  fOutputAll->Add(ptallSgn);
805  fOutputAll->Add(ptallBkg);
806 
807  fOutputPID->Add(ptpidMass);
808  fOutputPID->Add(ptpidSgn);
809  fOutputPID->Add(ptpidBkg);
810 
811  // eta spectra
812  nameMass="etaMass";
813  nameSgn="etaSgn";
814  nameBkg="etaBkg";
815 
816  TH1F* etaspectrumMass = new TH1F(nameMass.Data(),"D^{*} #eta; #eta; Entries",200,-1,1);
817  TH1F* etaspectrumSgn = new TH1F(nameSgn.Data(), "D^{*} Signal #eta - MC; #eta; Entries",200,-1,1);
818  TH1F* etaspectrumBkg = new TH1F(nameBkg.Data(), "D^{*} Background #eta - MC; #eta; Entries",200,-1,1);
819 
820  etaspectrumMass->Sumw2();
821  etaspectrumSgn->Sumw2();
822  etaspectrumBkg->Sumw2();
823 
824  etaspectrumMass->SetLineColor(6);
825  etaspectrumSgn->SetLineColor(2);
826  etaspectrumBkg->SetLineColor(4);
827 
828  etaspectrumMass->SetMarkerStyle(20);
829  etaspectrumSgn->SetMarkerStyle(20);
830  etaspectrumBkg->SetMarkerStyle(20);
831  etaspectrumMass->SetMarkerSize(0.6);
832  etaspectrumSgn->SetMarkerSize(0.6);
833  etaspectrumBkg->SetMarkerSize(0.6);
834  etaspectrumMass->SetMarkerColor(6);
835  etaspectrumSgn->SetMarkerColor(2);
836  etaspectrumBkg->SetMarkerColor(4);
837 
838  TH1F* etaallMass = (TH1F*)etaspectrumMass->Clone();
839  TH1F* etaallSgn = (TH1F*)etaspectrumSgn->Clone();
840  TH1F* etaallBkg = (TH1F*)etaspectrumBkg->Clone();
841 
842  TH1F* etapidMass = (TH1F*)etaspectrumMass->Clone();
843  TH1F* etapidSgn = (TH1F*)etaspectrumSgn->Clone();
844  TH1F* etapidBkg = (TH1F*)etaspectrumBkg->Clone();
845 
846  fOutputAll->Add(etaallMass);
847  fOutputAll->Add(etaallSgn);
848  fOutputAll->Add(etaallBkg);
849 
850  fOutputPID->Add(etapidMass);
851  fOutputPID->Add(etapidSgn);
852  fOutputPID->Add(etapidBkg);
853 
854  if (fDoDStarVsY){
855  TH3F* deltamassVsyVsPtPID = new TH3F("deltamassVsyVsPt", "delta mass Vs y Vs pT; #DeltaM [GeV/c^{2}]; y; p_{T} [GeV/c]", 700,0.13,0.2, 40, -1, 1, 36, 0., 36.);
856  fOutputPID->Add(deltamassVsyVsPtPID);
857  }
858  return;
859 }
860 //________________________________________________________________________
861 void AliAnalysisTaskSEDStarSpectra::FillSpectrum(AliAODRecoCascadeHF *part, Int_t isDStar, AliRDHFCutsDStartoKpipi *cuts,Int_t isSel, TList *listout){
862  //
864  //
865 
866  if(!isSel) return;
867 
868  // D0 window
869  Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();
870  Double_t invmassD0 = part->InvMassD0();
871  if (TMath::Abs(invmassD0-mPDGD0)>fD0Window) return;
872 
873 
874  Int_t ptbin=cuts->PtBin(part->Pt());
875  Double_t pt = part->Pt();
876  Double_t eta = part->Eta();
877 
878  Double_t invmassDelta = part->DeltaInvMass();
879  Double_t invmassDstar = part->InvMassDstarKpipi();
880 
881  TString fillthis="";
882  Bool_t massInRange=kFALSE;
883 
884  Double_t mPDGDstar=TDatabasePDG::Instance()->GetParticle(413)->Mass();
885 
886  // delta M(Kpipi)-M(Kpi)
887  if (TMath::Abs(invmassDelta-(mPDGDstar-mPDGD0))<fPeakWindow) massInRange=kTRUE;
888 
889  if(fUseMCInfo) {
890  if(isDStar==1) {
891  fillthis="histD0Sgn_";
892  fillthis+=ptbin;
893  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
894  fillthis="histD0Sgn";
895  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
896  fillthis="histDstarSgn_";
897  fillthis+=ptbin;
898  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
899  fillthis="histDstarSgn";
900  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
901  fillthis="histDeltaSgn_";
902  fillthis+=ptbin;
903  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
904  fillthis="histDeltaSgn";
905  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
906  if (massInRange) {
907  fillthis="ptSgn";
908  ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt);
909  fillthis="etaSgn";
910  ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta);
911  }
912  }
913  else {//background
914  fillthis="histD0Bkg_";
915  fillthis+=ptbin;
916  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
917  fillthis="histD0Bkg";
918  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
919  fillthis="histDstarBkg_";
920  fillthis+=ptbin;
921  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
922  fillthis="histDstarBkg";
923  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
924  fillthis="histDeltaBkg_";
925  fillthis+=ptbin;
926  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
927  fillthis="histDeltaBkg";
928  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
929  if (massInRange) {
930  fillthis="ptBkg";
931  ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt);
932  fillthis="etaBkg";
933  ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta);
934  }
935  }
936  }
937  //no MC info, just cut selection
938  fillthis="histD0Mass_";
939  fillthis+=ptbin;
940  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
941  fillthis="histD0Mass";
942  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0);
943  fillthis="histDstarMass_";
944  fillthis+=ptbin;
945  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
946  fillthis="histDstarMass";
947  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDstar);
948  fillthis="histDeltaMass_";
949  fillthis+=ptbin;
950  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
951  fillthis="histDeltaMass";
952  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
953 
954  if (massInRange) {
955  fillthis="ptMass";
956  ((TH1F*)(listout->FindObject(fillthis)))->Fill(pt);
957  fillthis="etaMass";
958  ((TH1F*)(listout->FindObject(fillthis)))->Fill(eta);
959  }
960 
961  return;
962 }
963 //______________________________ side band background for D*___________________________________
965 
969 
970  if(!isSel) return;
971 
972  Int_t ptbin=cuts->PtBin(part->Pt());
973 
974  // select the side bands intervall
975  Double_t invmassD0 = part->InvMassD0();
976  if(TMath::Abs(invmassD0-1.865)>4*fD0Window && TMath::Abs(invmassD0-1.865)<8*fD0Window){
977 
978  // for pt and eta
979  Double_t invmassDelta = part->DeltaInvMass();
980 
981  TString fillthis="";
982  fillthis="histSideBandMass_";
983  fillthis+=ptbin;
984  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
985  fillthis="histSideBandMass";
986  ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassDelta);
987 
988  }
989 }
990 //________________________________________________________________________________________________________________
992  //
994  //
995  Int_t ptbin=cuts->PtBin(part->Pt());
996 
997  Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();
998  Double_t invmassD0 = part->InvMassD0();
999  if (TMath::Abs(invmassD0-mPDGD0)>fD0Window) return;
1000 
1001  AliAODRecoDecayHF2Prong* theD0particle = (AliAODRecoDecayHF2Prong*)part->Get2Prong();
1002 
1003  Int_t okD0WrongSign;
1004  Double_t wrongMassD0=0.;
1005 
1006  Int_t isSelected=cuts->IsSelected(part,AliRDHFCuts::kCandidate); //selected
1007  if (!isSelected){
1008  return;
1009  }
1010 
1011  okD0WrongSign = 1;
1012 
1013  //if is D*+ than assume D0bar
1014  if(part->Charge()>0 && (isSelected ==1)) {
1015  okD0WrongSign = 0;
1016  }
1017 
1018  // assign the wrong mass in case the cuts return both D0 and D0bar
1019  if(part->Charge()>0 && (isSelected ==3)) {
1020  okD0WrongSign = 0;
1021  }
1022 
1023  //wrong D0 inv mass
1024  if(okD0WrongSign!=0){
1025  wrongMassD0 = theD0particle->InvMassD0();
1026  }else if(okD0WrongSign==0){
1027  wrongMassD0 = theD0particle->InvMassD0bar();
1028  }
1029 
1030  if(TMath::Abs(wrongMassD0-1.865)<fD0Window){
1031 
1032  // wrong D* inv mass
1033  Double_t e[3];
1034  if (part->Charge()>0){
1035  e[0]=theD0particle->EProng(0,321);
1036  e[1]=theD0particle->EProng(1,211);
1037  }else{
1038  e[0]=theD0particle->EProng(0,211);
1039  e[1]=theD0particle->EProng(1,321);
1040  }
1041  e[2]=part->EProng(0,211);
1042 
1043  Double_t esum = e[0]+e[1]+e[2];
1044  Double_t pds = part->P();
1045 
1046  Double_t wrongMassDstar = TMath::Sqrt(esum*esum-pds*pds);
1047 
1048  TString fillthis="";
1049  fillthis="histWrongSignMass_";
1050  fillthis+=ptbin;
1051  ((TH1F*)(listout->FindObject(fillthis)))->Fill(wrongMassDstar-wrongMassD0);
1052  fillthis="histWrongSignMass";
1053  ((TH1F*)(listout->FindObject(fillthis)))->Fill(wrongMassDstar-wrongMassD0);
1054 
1055  }
1056 }
1057 
1058 //-------------------------------------------------------------------------------
1059 Int_t AliAnalysisTaskSEDStarSpectra::CheckOrigin(TClonesArray* arrayMC, const AliAODMCParticle *mcPartCandidate) const {
1060  //
1061  // checking whether the mother of the particles come from a charm or a bottom quark
1062  //
1063 
1064  Int_t pdgGranma = 0;
1065  Int_t mother = 0;
1066  mother = mcPartCandidate->GetMother();
1067  Int_t istep = 0;
1068  Int_t abspdgGranma =0;
1069  Bool_t isFromB=kFALSE;
1070  while (mother >0 ){
1071  istep++;
1072  AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
1073  if (mcGranma){
1074  pdgGranma = mcGranma->GetPdgCode();
1075  abspdgGranma = TMath::Abs(pdgGranma);
1076  if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
1077  isFromB=kTRUE;
1078  }
1079  mother = mcGranma->GetMother();
1080  }else{
1081  AliError("Failed casting the mother particle!");
1082  break;
1083  }
1084  }
1085 
1086  if(isFromB) return 5;
1087  else return 4;
1088 }
1089 //-------------------------------------------------------------------------------------
1090 Float_t AliAnalysisTaskSEDStarSpectra::GetTrueImpactParameterD0(const AliAODMCHeader *mcHeader, TClonesArray* arrayMC, const AliAODMCParticle *partDp) const {
1092 
1093  Double_t vtxTrue[3];
1094  mcHeader->GetVertex(vtxTrue);
1095  Double_t origD[3];
1096  partDp->XvYvZv(origD);
1097  Short_t charge=partDp->Charge();
1098  Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1099  Int_t labelFirstDau = partDp->GetDaughter(0);
1100 
1101  Int_t nDau=partDp->GetNDaughters();
1102 
1103  Int_t theDau=0;
1104  if(nDau==2){
1105  for(Int_t iDau=0; iDau<2; iDau++){
1106  Int_t ind = labelFirstDau+iDau;
1107  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind));
1108  if(!part){
1109  AliError("Daughter particle not found in MC array");
1110  return 99999.;
1111  }
1112  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1113  if(pdgCode==211 || pdgCode==321){
1114  pXdauTrue[theDau]=part->Px();
1115  pYdauTrue[theDau]=part->Py();
1116  pZdauTrue[theDau]=part->Pz();
1117  ++theDau;
1118  }
1119  }
1120  }
1121  if(theDau!=2){
1122  AliError("Wrong number of decay prongs");
1123  return 99999.;
1124  }
1125 
1126  Double_t d0dummy[3]={0.,0.,0.};
1127  AliAODRecoDecayHF aodD0MC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1128  return aodD0MC.ImpParXY();
1129 
1130 }
1131 //______________________________________________________-
1134 
1135  Int_t nbins[3]={400,200,fNImpParBins};
1136  Double_t xmin[3]={1.75,0.,fLowerImpPar};
1137  Double_t xmax[3]={1.98,20.,fHigherImpPar};
1138 
1139  fHistMassPtImpParTCDs[0]=new THnSparseF("hMassPtImpParAll",
1140  "Mass vs. pt vs.imppar - All",
1141  3,nbins,xmin,xmax);
1142  fHistMassPtImpParTCDs[1]=new THnSparseF("hMassPtImpParPrompt",
1143  "Mass vs. pt vs.imppar - promptD",
1144  3,nbins,xmin,xmax);
1145  fHistMassPtImpParTCDs[2]=new THnSparseF("hMassPtImpParBfeed",
1146  "Mass vs. pt vs.imppar - DfromB",
1147  3,nbins,xmin,xmax);
1148  fHistMassPtImpParTCDs[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1149  "Mass vs. pt vs.true imppar -DfromB",
1150  3,nbins,xmin,xmax);
1151  fHistMassPtImpParTCDs[4]=new THnSparseF("hMassPtImpParBkg",
1152  "Mass vs. pt vs.imppar - backgr.",
1153  3,nbins,xmin,xmax);
1154 
1155  for(Int_t i=0; i<5;i++){
1156  fOutput->Add(fHistMassPtImpParTCDs[i]);
1157  }
1158 }
1159 
Int_t charge
TH1F * fCEvents
Cuts - sent to output slot 3.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Double_t DeltaInvMass() const
Float_t fHigherImpPar
lower limit in impact parameter (um)
Double_t YDstar() const
Int_t CheckOrigin(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate) const
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
Float_t fLowerImpPar
nunber of bins in impact parameter histos
void FillSpectrum(AliAODRecoCascadeHF *part, Int_t isDStar, AliRDHFCutsDStartoKpipi *cuts, Int_t isSel, TList *listout)
histos
AliRDHFCutsDStartoKpipi * fCuts
n sigma for kaon PID
Double_t mass
Double_t ImpParXY() const
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:293
Bool_t fDoDStarVsY
higher limit in impact parameter (um)
Float_t GetTrueImpactParameterD0(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDp) const
AliNormalizationCounter * fCounter
!Counter for normalization slot 4
virtual void UserCreateOutputObjects()
Implementation of interface methods.
virtual void UserExec(Option_t *option)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod)
virtual void Terminate(Option_t *option)
void SideBandBackground(AliAODRecoCascadeHF *part, AliRDHFCutsDStartoKpipi *cuts, Int_t isSel, TList *listout)
Background simulation.
Double_t fPeakWindow
select width on D0Mass
void WrongSignForDStar(AliAODRecoCascadeHF *part, AliRDHFCutsDStartoKpipi *cuts, TList *listout)
Bool_t IsEventSelected(AliVEvent *event)
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:204
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
THnSparseF * fHistMassPtImpParTCDs[5]
flag to enable D* vs y
Double_t InvMassD0() const
Double_t InvMassDstarKpipi() const
const Int_t nbins
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
AliAODRecoDecayHF2Prong * Get2Prong() const
Int_t PtBin(Double_t pt) const
Bool_t fUseMCInfo
select width on DstarMass