]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAnalysisTaskSECharmFraction.h
fix to the proper NSD
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSECharmFraction.h
CommitLineData
624c07ab 1#ifndef ALIANALYSISTASKSECHARMFRACTION_H
2#define ALIANALYSISTASKSECHARMFRACTION_H
3
4/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
27de2dfb 7/* $Id$ */
8
624c07ab 9//*************************************************************************
10// Class AliAnalysisTaskSECharmFraction
11// AliAnalysisTask for the extraction of the fraction of prompt charm
12// using the charm hadron impact parameter to the primary vertex
ac4c229c 13//
14//
d39e8f99 15// Author: Andrea Rossi andrea.rossi@pd.infn.it
624c07ab 16//*************************************************************************
17
18class TH1F;
19class TH2F;
20class AliAODDEvent;
21class AliAODMCHeader;
22class AliAODRecoDecayHF2Prong;
23class AliAODRecoDecayHF;
24class AliAODMCParticle;
ac4c229c 25class AliAnalysisVertexingHF;
e047b348 26class AliRDHFCutsD0toKpi;
624c07ab 27#include "AliAnalysisTaskSE.h"
28
29class AliAnalysisTaskSECharmFraction : public AliAnalysisTaskSE {
30 public:
31 AliAnalysisTaskSECharmFraction();
32 AliAnalysisTaskSECharmFraction(const char *name);
e047b348 33 AliAnalysisTaskSECharmFraction(const char *name,AliRDHFCutsD0toKpi *cutsA,AliRDHFCutsD0toKpi *cutsB);
34
624c07ab 35 virtual ~AliAnalysisTaskSECharmFraction();
e047b348 36
624c07ab 37 // Implementation of interface methods
38 virtual void UserCreateOutputObjects();
39 virtual void Init();
40 virtual void LocalInit() {Init();}
41 virtual void UserExec(Option_t *option);
42 virtual void Terminate(Option_t *option);
bf74e6db 43 void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
cc3209fb 44 void SetSplitMassD0D0bar(Bool_t splitD0D0bar=kTRUE){fsplitMassD0D0bar=splitD0D0bar;}
45 Bool_t GetIsSplitMassD0D0bar(){return fsplitMassD0D0bar;}
e047b348 46 void SetUsePID(Bool_t pid){fusePID=pid;}
47 void SetAnalyzeLikeSign(Bool_t likesign=kFALSE){fLikeSign=likesign;}
48 void SetNMaxTrForVtx(const Int_t ntrMaxforVtx){fNtrMaxforVtx=ntrMaxforVtx;}
49 Int_t GetNMaxTrForVtx(){return fNtrMaxforVtx;}
50 void SetPtBins(Int_t nbins,const Float_t *ptbins);
c387e585 51 void SetSignalInvMassCut(const Double_t signalInvMassCut=0.027){fsignalInvMassCut=signalInvMassCut;}
52 void SetLargeInvMassCut(const Double_t largeInvMassCut=2.){flargeInvMassCut=largeInvMassCut;}
53 void SetSideBandInvMassCut(const Double_t sidebandInvMassCut=0.054){// default value ~ 2x3 times inv mass resol.: a factor 2 is applied w.r.t. 3sigma, should be safe enough to exclude most of the reflections
624c07ab 54 fsidebandInvMassCut=sidebandInvMassCut;
55 }
c387e585 56 void SetSideBandInvMassWindow(const Double_t sidebandInvMassWindow=0.108){//~ 6 times inv. mass resol.
624c07ab 57 fsidebandInvMassWindow=sidebandInvMassWindow;
ac4c229c 58 }
e047b348 59 void SetAcceptanceCut(const Double_t eta=0.8,const Double_t nITSpoints=5.,const Double_t nSPDpoints=2.){fAcceptanceCuts[0]=eta;fAcceptanceCuts[1]=nITSpoints;fAcceptanceCuts[2]=nSPDpoints;}
ac4c229c 60 void SetStandardMassSelection();
624c07ab 61 Int_t SetStandardCuts(Double_t pt,Double_t invMassCut);
e047b348 62 Int_t SetStandardCuts(Float_t *&ptbinlimits);
624c07ab 63 void CheckInvMassD0(AliAODRecoDecayHF2Prong *d,Double_t &invMassD0,Double_t &invMassD0bar,Bool_t &isPeakD0,Bool_t &isPeakD0bar,Bool_t &isSideBandD0,Bool_t &isSideBandD0bar);
d39e8f99 64 void SetAnalysisLevel(Int_t level){fFastAnalysis=level;}
65 Int_t GetAnalysisLevel(){return fFastAnalysis;}
ac4c229c 66 AliAODRecoDecayHF *GetD0toKPiSignalType(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx);
67 AliAODRecoDecayHF* ConstructFakeTrueSecVtx(const AliAODMCParticle *b1,const AliAODMCParticle *b2,const AliAODMCParticle *mum,Double_t *primaryVtxTrue);
68 void SetUseMC(Bool_t useMC){fUseMC=useMC;}
e047b348 69 Bool_t SpecialSelD0(AliAODRecoDecayHF2Prong *d,Int_t &nusedforVtx);
70 AliAODVertex* GetPrimaryVtxSkipped(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *d);
71
72 /* ######### THE FOLLOWING IS FOR FURTHER IMPLEMENATION ############
73 Int_t GetPtBin(Double_t pt)const;
74 void SetD0Cuts(Int_t ptbin,Double_t &*d0cutsLoose,Double_t &*d0cutsTight);
75
76 // void InvMassSelection();
77
78 void SetCheckMC(Bool_t checkMC){fcheckMC=checkMC;}
79 void SetCheckMC_D0(Bool_t check_D0){fcheckMCD0=check_D0;}
80 void SetCheckMC_2prongs(Bool_t check2prongs){fcheckMC2prongs=check2prongs;}
81 void SetCheckMC_prompt(Bool_t checkprompt){fcheckMCprompt=checkprompt;}
82 void SetCheckMC_fromB(Bool_t checkfromB){fcheckMCfromB=checkfromB;}
83 void SetCheckMC_fromDstar(Bool_t skipD0star){fSkipD0star=skipD0star;}
84 void SetUseCuts(Bool_t usecuts){fD0usecuts=usecuts;}
85 void SetSideBands(Double_t sideband){fSideBands=sideband;}
86 void SetStudyPureBackground(Bool_t back){fStudyPureBackground=back;}
624c07ab 87 */
e047b348 88 AliRDHFCutsD0toKpi* GetLooseCut(){
89 return fCutsLoose;
90 }
91 AliRDHFCutsD0toKpi* GetTightCut(){
92 return fCutsTight;
93 }
94 /* void SetCutFunction(Int_t (*setcuts)(AliAnalysisTaskSECharmFraction*,Double_t,Double_t)){
95 fSetCuts=setcuts;
96 fStandCuts=kFALSE;
97 }
98 */
99 // Int_t SetCuts(AliAnalysisTaskSECharmFraction *alchfr,Double_t pt,Double_t invMassCut);
100
624c07ab 101 private:
d39e8f99 102 Bool_t FillHistos(AliAODRecoDecayHF2Prong *d,TList *&list,Int_t ptbin,Int_t okD0,Int_t okD0bar,Double_t invMassD0,Double_t invMassD0bar,Bool_t isPeakD0,Bool_t isPeakD0bar,Bool_t isSideBandD0,Bool_t isSideBandD0bar,Double_t massmumtrue,AliAODRecoDecayHF *aodDMC,Double_t *vtxTrue);
e047b348 103 void FillHistoMCproperties(TClonesArray *arrayMC);
104
105 AliRDHFCutsD0toKpi *fCutsLoose; // Loose cuts object
106 AliRDHFCutsD0toKpi *fCutsTight; // Vertexer heavy flavour
d39e8f99 107 Int_t fFastAnalysis; // Level of analysis speed: default is 1, switch it to 2 to fill the THnSparse
bf74e6db 108 Bool_t fReadMC; // Flag To switch on/off access to MC
cc3209fb 109 Bool_t fsplitMassD0D0bar; // Flag to use two shistos for D0 and D0bar invariant masses
e047b348 110 Bool_t fLikeSign; // Flag to analyse Like Sign array
111 Bool_t fusePID; // Flag to use PID
624c07ab 112 Double_t fmD0PDG; // MC D0 mass
113 Int_t fnbins; // Number of pt bins
e047b348 114 Float_t *fptbins; //[fnbins] ptbins
115 Int_t fNtrMaxforVtx; // N Max acceptable tracks used for vertex (0,1,2)
116 Double_t fptAll; //!Sum of pt of the reco tracks
117 Double_t fptAllSq; //!Sum of the square of the pt of the reco tracks
118 Double_t fptMax[3]; //!Three largest track pt in the event
c387e585 119 Double_t fAcceptanceCuts[3]; // array with acceptance cuts
624c07ab 120 Double_t fsignalInvMassCut; // invariant mass cut to define signal region
121 Double_t flargeInvMassCut; // invariant mass cut to accept all inv mass window
122 Double_t fsidebandInvMassCut; // invariant mass cut to define side band region lower limit
123 Double_t fsidebandInvMassWindow; // invariant mass cut to define side band region width
124 Bool_t fUseMC; // flag to use or not MC info
ac4c229c 125 TH1F *fNentries; //!histo for #AOD analysed, container 1
126 TH1F *fSignalType; //!histo for the type of MC signal , container 2
127 TH1F *fSignalTypeLsCuts; //!histo for the type of MC signal with loose cuts , container 3
128 TH1F *fSignalTypeTghCuts; //!histo for the type of MC signal with tight cuts, container 4
e047b348 129 TList *flistMCproperties; //!TLists for MC properties of D0 w.r.t. B mesons and c quarks cntainer 5
130 TList *flistNoCutsSignal; //!TList for signal (D prompt) with nocuts, container 6
131 TList *flistNoCutsBack; //!TList for background with nocuts, container 7
132 TList *flistNoCutsFromB; //!TList for D from B or D from Dstar from Bwith nocuts, container 8
133 TList *flistNoCutsFromDstar; //!TList for D from Dstar with nocuts, container 9
134 TList *flistNoCutsOther; //!TList for others with nocuts, container 10
135 TList *flistLsCutsSignal; //!TList for signal (D prompt) with loose cuts, container 11
136 TList *flistLsCutsBack; //!TList for background with loose cuts, container 12
137 TList *flistLsCutsFromB; //!TList for D from B or D from Dstar from B with loose cuts, container 13
138 TList *flistLsCutsFromDstar; //!TList for D from Dstar with loose cuts, container 14
139 TList *flistLsCutsOther; //!TList for others with loose cuts, container 15
140 TList *flistTghCutsSignal; //!TList for signal (D prompt) with tight cuts, container 16
141 TList *flistTghCutsBack; //!TList for backgrnd with tight cuts, container 17
142 TList *flistTghCutsFromB; //!TList for D from B or D from Dstar from Bwith tight cuts, container 18
143 TList *flistTghCutsFromDstar; //!TList for D from Dstar Dstar with tight cuts, container 19
144 TList *flistTghCutsOther; //!TList for others with tight cuts, container 20
624c07ab 145 /* Bool_t fD0usecuts; // Switch on the use of the cuts TO BE IMPLEMENTED
146 Bool_t fcheckMC; // Switch on MC check: minimum check is same mother TO BE IMPLEMENTED
147 Bool_t fcheckMCD0; // check the mother is a D0 TO BE IMPLEMENTED
148 Bool_t fcheckMC2prongs; // check the decay is in two prongs TO BE IMPLEMENTED
149 Bool_t fcheckMCprompt; // check the D0 comes from a c quark TO BE IMPLEMENTED
150 Bool_t fcheckMCfromB; // check the D0 comes from a b quark TO BE IMPLEMENTED
151 Bool_t fSkipD0star; // skip if D0 comes from a D* TO BE IMPLEMENTED
152 Bool_t fStudyd0fromBTrue; // Flag for analyze true impact par of D0 from B TO BE IMPLEMENTED
153 Bool_t fStudyPureBackground; // Flag to study the background (reverse the selection on the signal) TO BE IMPLEMENTED
154 Double_t fSideBands; //Side bands selection (see cxx) TO BE IMPLEMENTED
155 */
156 AliAnalysisTaskSECharmFraction(const AliAnalysisTaskSECharmFraction&); // not implemented
157 AliAnalysisTaskSECharmFraction& operator=(const AliAnalysisTaskSECharmFraction&); // not implemented
158
159 ClassDef(AliAnalysisTaskSECharmFraction,1); // analysis task for prompt charm fraction
160};
161
162#endif