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