AliPhysics  41af4b0 (41af4b0)
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 
26 {
27 public:
28 
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);
52  void SetKeepNegIDtracks(Bool_t nid){fKeepNegID=nid;}//set it to kTRUE only if you know what you are doing
53  void SetTrackCuts(AliESDtrackCuts* cuts){
54  if(fTrackCutsAll) delete fTrackCutsAll;
55  fTrackCutsAll=new AliESDtrackCuts(*cuts);
56  }
57  void SetPionTrackCuts(AliESDtrackCuts* cuts){
58  if(fTrackCutsPion) delete fTrackCutsPion;
59  fTrackCutsPion=new AliESDtrackCuts(*cuts);
60  }
61  void SetKaonTrackCuts(AliESDtrackCuts* cuts){
62  if(fTrackCutsKaon) delete fTrackCutsKaon;
63  fTrackCutsKaon=new AliESDtrackCuts(*cuts);
64  }
66  fPhiMassCut=cut;
67  }
70  }
73  }
74  void SetPIDHF(AliAODPidHF* pid){
75  if(fPidHF) delete fPidHF;
76  fPidHF=new AliAODPidHF(*pid);
77  }
78  void SetRDHFCuts(AliRDHFCuts* cuts){
79  fAnalysisCuts=cuts;
80  }
81  void SetFilterMask(UInt_t mask=16){fFilterMask=mask;}
82  void SetAnalysisLevel(Int_t level){fFullAnalysis=level;}
84  fNRotations=n;
86  fMaxAngleForRot=phimax;
87  }
89  fNRotations3=n;
91  fMaxAngleForRot3=phimax;
92  }
94  void SetMaxPt(Double_t maxPt){fMaxPt=maxPt;}
96  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
97  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
98  void SetMultiplicityRange(Double_t mmin=-0.5, Double_t mmax=199.5){
99  fMinMultiplicity=mmin;
100  fMaxMultiplicity=mmax;
101  }
102 
103  void SetPIDstrategy(Int_t strat){fPIDstrategy=strat;}
104  void SetMaxPforIDPion(Double_t maxpIdPion){fmaxPforIDPion=maxpIdPion;}
105  void SetMaxPforIDKaon(Double_t maxpIdKaon){fmaxPforIDKaon=maxpIdKaon;}
107  void SetBayesThres(Double_t thresKaon, Double_t thresPion){
108  fBayesThresKaon=thresKaon;
109  fBayesThresPion=thresPion;
110  }
111 
112  Bool_t IsTrackSelected(AliAODTrack* track);
113  Bool_t IsKaon(AliAODTrack* track);
114  Bool_t IsPion(AliAODTrack* track);
115  Bool_t SelectAODTrack(AliAODTrack *track, AliESDtrackCuts *cuts);
116 
117  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);
118  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);
119  void FillMEHistos(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau);
120  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);
121  void FillGenHistos(TClonesArray* arrayMC, Bool_t isEvSel);
122  Bool_t CheckAcceptance(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
123  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
124  void ResetPool(Int_t poolIndex);
125  void DoMixingWithPools(Int_t poolIndex);
126  void DoMixingWithCuts();
127  Bool_t CanBeMixed(Double_t zv1, Double_t zv2, Double_t mult1, Double_t mult2);
131 
132 private:
133 
136  Double_t ComputeInvMassKK(AliAODTrack* tr1, AliAODTrack* tr2) const;
137  Double_t ComputeInvMassKK(TLorentzVector* tr1, TLorentzVector* tr2) const;
138  Double_t CosPiKPhiRFrame(TLorentzVector* dauK1, TLorentzVector* dauK2, TLorentzVector* daupi) const;
139  Double_t CosPiDsLabFrame(TLorentzVector* dauK1, TLorentzVector* dauK2, TLorentzVector* daupi) const;
140 
142  TH1F *fHistNEvents;
146  TH3F* fHistTrackEtaMultZv; // track distribution vs. era z vertex and mult
169  TH1F *fNSelected;
170  TH1F *fNormRotated;
171  TH1F *fDeltaMass;
179  AliESDtrackCuts* fTrackCutsAll;
180  AliESDtrackCuts* fTrackCutsPion;
181  AliESDtrackCuts* fTrackCutsKaon;
183  Double_t fCutCos3PiKPhiRFrame; // cut on the Ds decay angles
184  Double_t fCutCosPiDsLabFrame; // cut on the Ds decay angles
187 
194 
201 
203 
208 
216 
223  Double_t* fzVertPoolLims; //[fNzVertPoolsLimSize] limits of the pools in zVertex
226  Double_t* fMultPoolLims; //[fNMultPoolsLimSize] limits of the pools in multiplicity
229  TObjString* fEventInfo;
236 
238  ClassDef(AliAnalysisTaskCombinHF,14);
239 };
241 
242 #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)
void SetMultiplicityRange(Double_t mmin=-0.5, Double_t mmax=199.5)
double Double_t
Definition: External.C:58
Definition: External.C:260
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)
Definition: External.C:236
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)
Bool_t IsPion(AliAODTrack *track)
Int_t fNMultPoolsLimSize
number of pools in multiplicity for event mixing
Double_t fCutCos3PiKPhiRFrame
cut on the KK inv mass for phi selection
void FillMEHistos(Int_t pdgD, Int_t nProngs, AliAODRecoDecay *tmpRD, Double_t *px, Double_t *py, Double_t *pz, UInt_t *pdgdau)
TH3F * fPtVsYVsMultGenLargeAccPrompt
! hist. of Y vs. Pt vs. Mult generated (|y|<0.9)
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
TH3F * fPtVsYVsMultGenPrompt
! hist. of Y vs. Pt vs. Mult generated (all D)
TH3F * fPtVsYVsMultGenLimAccPrompt
! hist. of Y vs. Pt vs. Mult generated (|y|<0.5)
TH3F * fPtVsYVsMultRecoFeeddw
! hist. of Y vs. Pt vs. Mult generated (Reco D)
Double_t fPtAccCut
eta limits for acceptance step
TH3F * fPtVsYVsMultRecoPrompt
! hist. of Y vs. Pt vs. Mult generated (Reco D)
void SetCutCosPiDsLabFrame(Double_t cut)
TH3F * fPtVsYVsMultGenLargeAccFeeddw
! hist. of Y vs. Pt vs. Mult generated (|y|<0.9)
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
Int_t fNRotations3
maximum angle for track rotation
void FillGenHistos(TClonesArray *arrayMC, Bool_t isEvSel)
Double_t CosPiDsLabFrame(TLorentzVector *dauK1, TLorentzVector *dauK2, TLorentzVector *daupi) const
TH2F * fHistEventMultZv
!hist. of evnt Mult vs. Zv for all events
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
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 –)
int Int_t
Definition: External.C:63
void SetPIDHF(AliAODPidHF *pid)
Double_t CosPiKPhiRFrame(TLorentzVector *dauK1, TLorentzVector *dauK2, TLorentzVector *daupi) const
unsigned int UInt_t
Definition: External.C:33
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.
TH3F * fPtVsYVsMultGenAccEvSelFeeddw
! hist. of Y vs. Pt vs. Mult generated (D in acc, sel ev.)
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
TH3F * fPtVsYVsMultGenAccEvSelPrompt
! hist. of Y vs. Pt vs. Mult generated (D in acc, sel ev.)
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)
TH3F * fPtVsYVsMultGenAccFeeddw
! hist. of Y vs. Pt vs. Mult generated (D in acc)
void SetEventMixingWithCuts(Double_t maxDeltaVz, Double_t maxDeltaMult)
virtual void UserExec(Option_t *option)
virtual void Terminate(Option_t *option)
TH3F * fPtVsYVsMultGenFeeddw
! hist. of Y vs. Pt vs. Mult generated (all D)
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 for access to MC
Bool_t SelectAODTrack(AliAODTrack *track, AliESDtrackCuts *cuts)
TH3F * fPtVsYVsMultGenLimAccFeeddw
! hist. of Y vs. Pt vs. Mult generated (|y|<0.5)
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 * fMassVsPtVsYME
! hist. of Y vs. Pt vs. Mass (mixedevents)
void SetEtaAccCut(Double_t etacut)
Double_t fmaxPforIDKaon
flag for upper p limit for id band for pion
TH3F * fPtVsYVsMultGenAccPrompt
! hist. of Y vs. Pt vs. Mult generated (D in acc)
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
void SetCutOnCos3PiKPhiRFrame(Double_t cut)
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
const char Option_t
Definition: External.C:48
void SetFilterMask(UInt_t mask=16)
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
bool Bool_t
Definition: External.C:53
void SetCutOnKKInvMass(Double_t cut)
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