AliPhysics  vAN-20151014 (f894c76)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskCombinHF.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKCOMBINHF_H
2 #define ALIANALYSISTASKCOMBINHF_H
3 
4 /* Copyright(c) 1998-2018, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 /* $Id: $ */
8 
15 
16 #include <TH1F.h>
17 #include <TH3F.h>
18 #include <TObjString.h>
19 #include <THnSparse.h>
20 #include "AliAnalysisTaskSE.h"
21 #include "AliAODTrack.h"
23 #include "AliRDHFCuts.h"
24 
25 class AliAnalysisTaskCombinHF : public AliAnalysisTaskSE
26 {
27 public:
28 
30  AliAnalysisTaskCombinHF(Int_t meson, AliRDHFCuts* analysiscuts);
31  virtual ~AliAnalysisTaskCombinHF();
32 
33  virtual void UserCreateOutputObjects();
34  virtual void Init(){};
35  virtual void LocalInit() {Init();}
36  virtual void UserExec(Option_t *option);
37  virtual void Terminate(Option_t *option);
38  virtual void FinishTaskOutput();
39 
40  void SetReadMC(Bool_t read){fReadMC=read;}
41 
42  void SetEventMixingWithCuts(Double_t maxDeltaVz, Double_t maxDeltaMult){
43  fDoEventMixing=2; fMaxzVertDistForMix=maxDeltaVz; fMaxMultDiffForMix=maxDeltaMult;
44  }
48 
49  void ConfigureZVertPools(Int_t nPools, Double_t* zVertLimits);
50  void ConfigureMultiplicityPools(Int_t nPools, Double_t* multLimits);
54  void SetGoUpToQuark(Bool_t opt){fGoUpToQuark=opt;}
55  void SetKeepNegIDtracks(Bool_t nid){fKeepNegID=nid;}//set it to kTRUE only if you know what you are doing
56  void SetTrackCuts(AliESDtrackCuts* cuts){
57  if(fTrackCutsAll) delete fTrackCutsAll;
58  fTrackCutsAll=new AliESDtrackCuts(*cuts);
59  }
60  void SetPionTrackCuts(AliESDtrackCuts* cuts){
61  if(fTrackCutsPion) delete fTrackCutsPion;
62  fTrackCutsPion=new AliESDtrackCuts(*cuts);
63  }
64  void SetKaonTrackCuts(AliESDtrackCuts* cuts){
65  if(fTrackCutsKaon) delete fTrackCutsKaon;
66  fTrackCutsKaon=new AliESDtrackCuts(*cuts);
67  }
68  void SetCutOnKKInvMass(Double_t cut){
69  fPhiMassCut=cut;
70  }
71  void SetPIDHF(AliAODPidHF* pid){
72  if(fPidHF) delete fPidHF;
73  fPidHF=new AliAODPidHF(*pid);
74  }
75  void SetRDHFCuts(AliRDHFCuts* cuts){
76  fAnalysisCuts=cuts;
77  }
78  void SetFilterMask(UInt_t mask=16){fFilterMask=mask;}
79  void SetAnalysisLevel(Int_t level){fFullAnalysis=level;}
80  void ConfigureRotation(Int_t n, Double_t phimin, Double_t phimax){
81  fNRotations=n;
83  fMaxAngleForRot=phimax;
84  }
85  void ConfigureRotation3rdProng(Int_t n, Double_t phimin, Double_t phimax){
86  fNRotations3=n;
88  fMaxAngleForRot3=phimax;
89  }
91  void SetMaxPt(Double_t maxPt){fMaxPt=maxPt;}
92  void SetPtBinWidth(Double_t binw){fPtBinWidth=binw;}
93  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
94  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
95  void SetMultiplicityRange(Double_t mmin=-0.5, Double_t mmax=199.5){
96  fMinMultiplicity=mmin;
97  fMaxMultiplicity=mmax;
98  }
99 
100  void SetPIDstrategy(Int_t strat){fPIDstrategy=strat;}
101  void SetMaxPforIDPion(Double_t maxpIdPion){fmaxPforIDPion=maxpIdPion;}
102  void SetMaxPforIDKaon(Double_t maxpIdKaon){fmaxPforIDKaon=maxpIdKaon;}
103  void SetPIDselCaseZero(Int_t strat){fPIDselCaseZero=strat;}
104  void SetBayesThres(Double_t thresKaon, Double_t thresPion){
105  fBayesThresKaon=thresKaon;
106  fBayesThresPion=thresPion;
107  }
108 
109  Bool_t IsTrackSelected(AliAODTrack* track);
110  Bool_t IsKaon(AliAODTrack* track);
111  Bool_t IsPion(AliAODTrack* track);
112  Bool_t SelectAODTrack(AliAODTrack *track, AliESDtrackCuts *cuts);
113 
114  Bool_t FillHistos(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau, TClonesArray *arrayMC, Int_t* dgLabels);
115  void FillLSHistos(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau, Int_t charge);
116  void FillMEHistos(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau);
117  void FillMEHistosLS(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau, Int_t charge);
118  void FillGenHistos(TClonesArray* arrayMC, Bool_t isEvSel);
119  Bool_t CheckAcceptance(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
120  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
121  void ResetPool(Int_t poolIndex);
122  void DoMixingWithPools(Int_t poolIndex);
123  void DoMixingWithCuts();
124  Bool_t CanBeMixed(Double_t zv1, Double_t zv2, Double_t mult1, Double_t mult2);
128 
129 private:
130 
133  Double_t ComputeInvMassKK(AliAODTrack* tr1, AliAODTrack* tr2) const;
134 
135  TList *fOutput;
136  TH1F *fHistNEvents;
140  TH3F* fHistTrackEtaMultZv; // track distribution vs. era z vertex and mult
151  TH3F *fMassVsPtVsY;
158  TH1F *fNSelected;
159  TH1F *fNormRotated;
160  TH1F *fDeltaMass;
167  UInt_t fFilterMask;
168  AliESDtrackCuts* fTrackCutsAll;
169  AliESDtrackCuts* fTrackCutsPion;
170  AliESDtrackCuts* fTrackCutsKaon;
171  Double_t fPhiMassCut;
174 
175  Double_t fMinMass;
176  Double_t fMaxMass;
177  Double_t fMaxPt;
178  Double_t fPtBinWidth;
179  Double_t fEtaAccCut;
180  Double_t fPtAccCut;
181 
182  Int_t fNRotations;
183  Double_t fMinAngleForRot;
184  Double_t fMaxAngleForRot;
185  Int_t fNRotations3;
186  Double_t fMinAngleForRot3;
187  Double_t fMaxAngleForRot3;
188 
190 
191  Int_t fMeson;
192  Bool_t fReadMC;
194  Bool_t fGoUpToQuark;
196 
197  Int_t fPIDstrategy;
198  Double_t fmaxPforIDPion;
199  Double_t fmaxPforIDKaon;
200  Bool_t fKeepNegID;
202  Double_t fBayesThresKaon;
203  Double_t fBayesThresPion;
204 
209  Int_t fNzVertPools;
211  Double_t* fzVertPoolLims;
212  Int_t fNMultPools;
214  Double_t* fMultPoolLims;
215  Int_t fNOfPools;
216  TTree** fEventBuffer;
217  TObjString* fEventInfo;
218  Double_t fVtxZ;
219  Double_t fMultiplicity;
220  Double_t fMinMultiplicity;
221  Double_t fMaxMultiplicity;
222  TObjArray* fKaonTracks;
223  TObjArray* fPionTracks;
224 
226  ClassDef(AliAnalysisTaskCombinHF,12);
227 };
229 
230 #endif
Int_t charge
Double_t fEtaAccCut
width of pt bin (GeV/c)
Bool_t FillHistos(Int_t pdgD, Int_t nProngs, AliAODRecoDecay *tmpRD, Double_t *px, Double_t *py, Double_t *pz, UInt_t *pdgdau, TClonesArray *arrayMC, Int_t *dgLabels)
Bool_t IsTrackSelected(AliAODTrack *track)
Int_t fNMultPools
[fNzVertPoolsLimSize] limits of the pools in zVertex
void SetMultiplicityRange(Double_t mmin=-0.5, Double_t mmax=199.5)
Double_t fMaxzVertDistForMix
maximum number of events to be used in event mixing
void FillMEHistosLS(Int_t pdgD, Int_t nProngs, AliAODRecoDecay *tmpRD, Double_t *px, Double_t *py, Double_t *pz, UInt_t *pdgdau, Int_t charge)
Int_t fNzVertPoolsLimSize
number of pools in z vertex for event mixing
TH3F * fMassVsPtVsYMELSpp
! hist. of Y vs. Pt vs. Mass (mixedevents)
Bool_t IsKaon(AliAODTrack *track)
void SetRDHFCuts(AliRDHFCuts *cuts)
void SetPionTrackCuts(AliESDtrackCuts *cuts)
Bool_t CheckAcceptance(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
TH1F * fHistTrackStatus
!hist. of status of tracks
void SetTrackCuts(AliESDtrackCuts *cuts)
AliNormalizationCounter * fCounter
maximum angle for track rotation (3rd prong)
TH3F * fPtVsYVsMultGenAccEvSel
! hist. of Y vs. Pt vs. Mult generated (D in acc, sel ev.)
Bool_t IsPion(AliAODTrack *track)
Int_t fNMultPoolsLimSize
number of pools in multiplicity for event mixing
void FillMEHistos(Int_t pdgD, Int_t nProngs, AliAODRecoDecay *tmpRD, Double_t *px, Double_t *py, Double_t *pz, UInt_t *pdgdau)
void ConfigureMultiplicityPools(Int_t nPools, Double_t *multLimits)
Double_t fMaxMultiplicity
lower limit for multiplcities in MC histos
TH1F * fNSelected
! hist. of n. of selected D+
TList * fOutput
! list send on output slot 0
Bool_t fReadMC
mesonSpecies (see enum)
TH3F * fMassVsPtVsY
! hist. of Y vs. Pt vs. Mass (all cand)
TH2F * fHistEventMultZvEvSel
!hist. of evnt Mult vs. Zv for selected ev
Double_t fMinAngleForRot
number of rotations
Double_t fPtAccCut
eta limits for acceptance step
TH3F * fPtVsYVsMultGen
! hist. of Y vs. Pt vs. Mult generated (all D)
Double_t fPtBinWidth
maximum pT value for inv. mass histograms
void SetKaonTrackCuts(AliESDtrackCuts *cuts)
void ConfigureZVertPools(Int_t nPools, Double_t *zVertLimits)
Bool_t fKeepNegID
flag for upper p limit for id band for kaon
TTree ** fEventBuffer
number of pools
Double_t fBayesThresPion
threshold for kaon identification via Bayesian PID
Double_t fMaxPt
maximum value of invariant mass
TH3F * fPtVsYVsMultReco
! hist. of Y vs. Pt vs. Mult generated (Reco D)
Int_t fNRotations3
maximum angle for track rotation
void FillGenHistos(TClonesArray *arrayMC, Bool_t isEvSel)
TH2F * fHistEventMultZv
!hist. of evnt Mult vs. Zv for all events
TH3F * fPtVsYVsMultGenLimAcc
! hist. of Y vs. Pt vs. Mult generated (|y|<0.5)
void SetMassWindow(Double_t minMass, Double_t maxMass)
void SetBayesThres(Double_t thresKaon, Double_t thresPion)
Bool_t CanBeMixed(Double_t zv1, Double_t zv2, Double_t mult1, Double_t mult2)
Double_t fPhiMassCut
kaon track selection
AliAODPidHF * fPidHF
cut on the KK inv mass for phi selection
AliAnalysisTaskCombinHF & operator=(const AliAnalysisTaskCombinHF &source)
Int_t fPIDselCaseZero
flag to keep also track with negative ID (default kFALSE, change it only if you know what you are doi...
void SetPtBinWidth(Double_t binw)
TH1F * fHistNEvents
!hist. for No. of events
TH1F * fNormRotated
! hist. rotated/selected D+
TH3F * fMassVsPtVsYLSmm
! hist. of Y vs. Pt vs. Mass (like sign –)
void SetPIDHF(AliAODPidHF *pid)
Double_t fMaxAngleForRot
minimum angle for track rotation
Int_t GetPoolIndex(Double_t zvert, Double_t mult)
Double_t fMinAngleForRot3
number of rotations (3rd prong)
AliESDtrackCuts * fTrackCutsAll
FilterMask.
AliRDHFCuts * fAnalysisCuts
PID configuration.
void ConfigureRotation(Int_t n, Double_t phimin, Double_t phimax)
void SetMaxPt(Double_t maxPt)
THnSparse * fDeltaMassFullAnalysis
! hist. mass difference after rotations with more details
Int_t fNzVertPools
cut on multiplicity difference for event mixing with cuts
TH3F * fMassVsPtVsYSig
! hist. of Y vs. Pt vs. Mass (signal)
Int_t fFullAnalysis
flag for definition of c,b origin
void SetNumberOfEventsForMixing(Int_t minn)
Double_t * fzVertPoolLims
number of pools in z vertex for event mixing +1
void SetMaxPforIDPion(Double_t maxpIdPion)
void FillLSHistos(Int_t pdgD, Int_t nProngs, AliAODRecoDecay *tmpRD, Double_t *px, Double_t *py, Double_t *pz, UInt_t *pdgdau, Int_t charge)
void SetEventMixingWithCuts(Double_t maxDeltaVz, Double_t maxDeltaMult)
virtual void UserExec(Option_t *option)
virtual void Terminate(Option_t *option)
Double_t ComputeInvMassKK(AliAODTrack *tr1, AliAODTrack *tr2) const
Double_t fMinMultiplicity
multiplicity
Double_t fMinMass
Cuts for candidates.
Int_t fPIDstrategy
flag to set analysis level (0 is the fastest)
Double_t fVtxZ
unique event Id for event mixing checks
AliESDtrackCuts * fTrackCutsKaon
pion track selection
void SetPtAccCut(Double_t ptcut)
Bool_t fGoUpToQuark
flag to select prompt (1), feeddown (2) or all (3)
Bool_t SelectAODTrack(AliAODTrack *track, AliESDtrackCuts *cuts)
TH1F * fHistCheckDecChanAcc
!hist. of decay channel of D meson in acc.
void SetAnalysisLevel(Int_t level)
Int_t fDoEventMixing
threshold for pion identification via Bayesian PID
TH3F * fPtVsYVsMultGenAcc
! hist. of Y vs. Pt vs. Mult generated (D in acc)
TH3F * fMassVsPtVsYME
! hist. of Y vs. Pt vs. Mass (mixedevents)
void SetEtaAccCut(Double_t etacut)
TH3F * fPtVsYVsMultGenLargeAcc
! hist. of Y vs. Pt vs. Mult generated (|y|<0.9)
Double_t fmaxPforIDKaon
flag for upper p limit for id band for pion
TH2F * fEventsPerPool
! hist with number of events per pool
TH3F * fMassVsPtVsYBkg
! hist. of Y vs. Pt vs. Mass (background)
Double_t minMass
TH2F * fMixingsPerPool
! hist with number of mixings per pool
TH3F * fMassVsPtVsYLSpp
! hist. of Y vs. Pt vs. Mass (like sign ++)
void SetMaxPforIDKaon(Double_t maxpIdKaon)
void ConfigureRotation3rdProng(Int_t n, Double_t phimin, Double_t phimax)
Int_t fNumberOfEventsForMixing
flag for event mixing
TObjArray * fPionTracks
array of kaon-compatible tracks (TLorentzVectors)
void DoMixingWithPools(Int_t poolIndex)
Int_t fNRotations
pt limits for acceptance step
void SetFilterMask(UInt_t mask=16)
TH1F * fHistCheckOriginSel
!hist. of origin (c/b) of D meson
Double_t fBayesThresKaon
flag to change PID strategy
TH1F * fDeltaMass
! hist. mass difference after rotations
TObjArray * fKaonTracks
upper limit for multiplcities in MC histos
Double_t maxMass
Int_t fPromptFeeddown
flag for access to MC
void SetCutOnKKInvMass(Double_t cut)
Int_t fNOfPools
[fNMultPoolsLimSize] limits of the pools in multiplicity
Double_t fMaxMultDiffForMix
cut on zvertex distance for event mixing with cuts
Double_t fMaxMass
minimum value of invariant mass
TString meson
TH3F * fMassVsPtVsYMELSmm
! hist. of Y vs. Pt vs. Mass (mixedevents)
TH1F * fHistCheckDecChan
!hist. of decay channel of D meson
Double_t fmaxPforIDPion
knSigma, kBayesianMaxProb, kBayesianThres
TH3F * fMassVsPtVsYRefl
! hist. of Y vs. Pt vs. Mass (reflections)
Double_t * fMultPoolLims
number of pools in multiplicity for event mixing +1
Double_t fMaxAngleForRot3
minimum angle for track rotation (3rd prong)
const Double_t phimin
TH3F * fMassVsPtVsYRot
! hist. of Y vs. Pt vs. Mass (rotations)
TH1F * fHistCheckOrigin
!hist. of origin (c/b) of D meson