AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEDStarCharmFraction.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSEDSTARCHARMFRACTION_H
2 #define ALIANALYSISTASKSEDSTARCHARMFRACTION_H
3 
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 //*************************************************************************
8 // Class AliAnalysisTaskSEDStarCharmFraction
9 // AliAnalysisTask for the extraction of the fraction of prompt charm for D*
10 // using the charm hadron impact parameter to the primary vertex
11 //
12 // Author: Jasper van der Maarel <J.vanderMaarel@uu.nl>
13 //*************************************************************************
14 
15 class TH1D;
18 class TList;
20 class TClonesArray;
21 class AliAODMCParticle;
22 class AliAODEvent;
23 class AliAODVertex;
24 
25 #include "AliAnalysisTaskSE.h"
26 
28  public:
31 
33 
34  // Implementation of interface methods
35  virtual void UserCreateOutputObjects();
36  virtual void Init();
37  virtual void LocalInit() {Init();}
38  virtual void UserExec(Option_t *option);
39  virtual void Terminate(Option_t *option);
40 
41  void SetReadMC(Bool_t readMC = kTRUE) { fReadMC = readMC; }
42  Bool_t GetReadMC() { return fReadMC; }
43  void SetSkipHijing(Bool_t skipHijing = kTRUE) { fSkipHijing = skipHijing; }
45  void SetSingleSideband(Bool_t singleSideband = kTRUE) { fSingleSideband = singleSideband; }
47  void SetPeakCut(Double_t *peakCut) { for (Int_t i=0;i<fNPtBins;i++) { fPeakCut[i] = peakCut[i]; } }
48  Double_t *GetPeakCut() { return fPeakCut; }
49  void SetSidebandCut(Double_t *sidebandCut) { for (Int_t i=0;i<fNPtBins;i++) { fSidebandCut[i] = sidebandCut[i]; } }
51  void SetSidebandWindow(Double_t *sidebandWindow) { for (Int_t i=0;i<fNPtBins;i++) { fSidebandWindow[i] = sidebandWindow[i]; } }
55  void SetImpParCut(Double_t impParCut) { fImpParCut = TMath::Abs(impParCut); }
57 
58  private:
60  AliNormalizationCounter *fCounter; // Counter for normalization
61  Bool_t fReadMC; // Flag to switch on/off the access of MC
62  Bool_t fSkipHijing; // Flag to switch on/off the skipping of D from Hijing
63  Bool_t fSingleSideband; // Flag to switch on/off single sideband instead of double sideband
64  Double_t fImpParCut; // Lower value for impact parameter cut
65  Double_t fPDGMDStarD0; // Difference between masses of D* and D0 from PDG
66  Int_t fNPtBins; // Number of pt bins
67  TH1D *fNEvents; // Event count histogram
68  TTree *fTreeCandidate; // Tree for D* candidates
69  TList *fListCandidate; // List for D* candidates
70  TList *fListSignal; // List for D* signal (MC)
71  TList *fListSignalPrompt; // List for prompt D* (MC)
72  TList *fListSignalFromB; // List for D* from B (MC)
73  TList *fListBackground; // List for D* background (MC)
74 
75  Double_t fPeakCut[30]; // Max distance from delta inv mass for peak region
76  Double_t fSidebandCut[30]; // Sideband region starts at this distance from peak
77  Double_t fSidebandWindow[30]; // Size of sideband region
78 
79  Bool_t fIsSideband; // Candidate is in sideband
80  Bool_t fIsPeak; // Candidate is in peak region
81  Bool_t fIsSignal; // Candidate is actual D* (from MC)
82  Bool_t fIsSignalPrompt; // Candidate is actual prompt D* (from MC)
83  Bool_t fIsSignalFromB; // Candidate is actual D* from B (from MC)
84  Bool_t fIsBackground; // Candidate is fake (from MC)
85 
86  AliAODVertex *fNewPrimVtx; // Newly determined primary vertex without D* daughters
87  AliAODVertex *fDStarVtx; // D* vertex
88  Double_t fMagneticField; // Magnetic field strength in current event
89  Double_t *fPtForTree; // Use this to fill pT branch
90  Double_t *fInvMassForTree; // Use this to fill invariant mass branch
91  Double_t *fImpParForTree; // Use this to fill impact parameter branch
92  Short_t *fTypeForTree; // Use this to fill the type branch (0=other, 1=peak, 2=SB left, 3=SB right)
93  Short_t *fSignalTypeForTree; // Use this to fill the signal type branch (data: -1, MC: 0=background, 1=signal prompt, 2=signal non-prompt)
94 
95  void SetUpList(TList *list); // Fill a TList with histograms
96  void CheckInvMassDStar(AliAODRecoCascadeHF *cand); // Check if D* candidate falls within peak or sideband region
97  Bool_t IsFromB(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate); // Check if the MC particle comes from a B
98  Bool_t IsFromHijing(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate); // Check if the MC particle is from Hijing
99  Bool_t CalculateImpactParameter(AliAODTrack *track, Double_t &d0, Double_t &d0Err); // Calculate impact parameter for a track
100  Double_t CalculateImpactParameterDStar(AliAODRecoCascadeHF *cand); // Calculate impact parameter of the D*
101  void FillHistograms(AliAODRecoCascadeHF *cand); // Fill histograms for a D* candidate
102  void FillHistogram(const char *name, Double_t value); // Fill a specific histogram in multiple lists
103  void FillRegionHistogram(const char *name, Double_t value); // Fill a specific histogram in multiple lists, in the approprate regions (all, peak region, sideband region)
104  void FillTrueImpactParameter(AliAODMCHeader *headerMC, TClonesArray *arrayMC, AliAODRecoCascadeHF* cand); // Fill histogram with true impact parameter distribution for D from B
105  AliAODVertex *RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod, AliAODRecoCascadeHF *cand); // Determine primary vertex without D* daughters
106  AliAODVertex *ReconstructDStarVtx(AliAODRecoCascadeHF *cand); //Determine the D* vertex
107 
110 
111  ClassDef(AliAnalysisTaskSEDStarCharmFraction, 1); // Analysis task for D* prompt charm fraction
112 };
113 
114 #endif
Bool_t IsFromHijing(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate)
double Double_t
Definition: External.C:58
void FillRegionHistogram(const char *name, Double_t value)
Bool_t CalculateImpactParameter(AliAODTrack *track, Double_t &d0, Double_t &d0Err)
TList * list
void FillHistogram(const char *name, Double_t value)
Double_t CalculateImpactParameterDStar(AliAODRecoCascadeHF *cand)
int Int_t
Definition: External.C:63
AliAnalysisTaskSEDStarCharmFraction & operator=(const AliAnalysisTaskSEDStarCharmFraction &)
Definition: External.C:212
AliAODVertex * RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod, AliAODRecoCascadeHF *cand)
void SetSingleSideband(Bool_t singleSideband=kTRUE)
short Short_t
Definition: External.C:23
AliAODVertex * ReconstructDStarVtx(AliAODRecoCascadeHF *cand)
ClassDef(AliAnalysisTaskSEDStarCharmFraction, 1)
const char Option_t
Definition: External.C:48
Bool_t IsFromB(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate)
bool Bool_t
Definition: External.C:53
void FillTrueImpactParameter(AliAODMCHeader *headerMC, TClonesArray *arrayMC, AliAODRecoCascadeHF *cand)