AliPhysics  9b6b435 (9b6b435)
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  if(cut>0 && cut<1) fApplyCutCosThetaStar=kTRUE;
67  else fApplyCutCosThetaStar=kFALSE;
68  fCutCosThetaStar=cut;
69  }
71  fPhiMassCut=cut;
72  }
75  }
78  }
79  void SetPIDHF(AliAODPidHF* pid){
80  if(fPidHF) delete fPidHF;
81  fPidHF=new AliAODPidHF(*pid);
82  }
83  void SetRDHFCuts(AliRDHFCuts* cuts){
84  fAnalysisCuts=cuts;
85  }
86  void SetFilterMask(UInt_t mask=16){fFilterMask=mask;}
87  void SetAnalysisLevel(Int_t level){fFullAnalysis=level;}
89  fNRotations=n;
91  fMaxAngleForRot=phimax;
92  }
94  fNRotations3=n;
96  fMaxAngleForRot3=phimax;
97  }
99  void SetMaxPt(Double_t maxPt){fMaxPt=maxPt;}
101  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
102  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
103  void SetMultiplicityRange(Double_t mmin=-0.5, Double_t mmax=199.5){
104  fMinMultiplicity=mmin;
105  fMaxMultiplicity=mmax;
106  }
107 
108  void SetPIDstrategy(Int_t strat){fPIDstrategy=strat;}
109  void SetMaxPforIDPion(Double_t maxpIdPion){fmaxPforIDPion=maxpIdPion;}
110  void SetMaxPforIDKaon(Double_t maxpIdKaon){fmaxPforIDKaon=maxpIdKaon;}
112  void SetBayesThres(Double_t thresKaon, Double_t thresPion){
113  fBayesThresKaon=thresKaon;
114  fBayesThresPion=thresPion;
115  }
116 
117  Bool_t IsTrackSelected(AliAODTrack* track);
118  Bool_t IsKaon(AliAODTrack* track);
119  Bool_t IsPion(AliAODTrack* track);
120  Bool_t SelectAODTrack(AliAODTrack *track, AliESDtrackCuts *cuts);
121 
122  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);
123  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);
124  void FillMEHistos(Int_t pdgD,Int_t nProngs, AliAODRecoDecay* tmpRD, Double_t* px, Double_t* py, Double_t* pz, UInt_t *pdgdau);
125  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);
126  void FillGenHistos(TClonesArray* arrayMC, Bool_t isEvSel);
127  Bool_t CheckAcceptance(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
128  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
129  void ResetPool(Int_t poolIndex);
130  void DoMixingWithPools(Int_t poolIndex);
131  void DoMixingWithCuts();
132  Bool_t CanBeMixed(Double_t zv1, Double_t zv2, Double_t mult1, Double_t mult2);
136 
137 private:
138 
141  Double_t ComputeInvMassKK(AliAODTrack* tr1, AliAODTrack* tr2) const;
142  Double_t ComputeInvMassKK(TLorentzVector* tr1, TLorentzVector* tr2) const;
143  Double_t CosPiKPhiRFrame(TLorentzVector* dauK1, TLorentzVector* dauK2, TLorentzVector* daupi) const;
144  Double_t CosPiDsLabFrame(TLorentzVector* dauK1, TLorentzVector* dauK2, TLorentzVector* daupi) const;
145 
147  TH1F *fHistNEvents;
151  TH3F* fHistTrackEtaMultZv; // track distribution vs. era z vertex and mult
174  TH1F *fNSelected;
175  TH1F *fNormRotated;
176  TH1F *fDeltaMass;
184  AliESDtrackCuts* fTrackCutsAll;
185  AliESDtrackCuts* fTrackCutsPion;
186  AliESDtrackCuts* fTrackCutsKaon;
190  Double_t fCutCos3PiKPhiRFrame; // cut on the Ds decay angles
191  Double_t fCutCosPiDsLabFrame; // cut on the Ds decay angles
194 
201 
208 
210 
215 
223 
230  Double_t* fzVertPoolLims; //[fNzVertPoolsLimSize] limits of the pools in zVertex
233  Double_t* fMultPoolLims; //[fNMultPoolsLimSize] limits of the pools in multiplicity
236  TObjString* fEventInfo;
243 
245  ClassDef(AliAnalysisTaskCombinHF,15);
246 };
248 
249 #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
cos(theta*) cut
Bool_t fApplyCutCosThetaStar
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)
void SetCutOnCosThetaStar(Double_t cut)
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 fCutCosThetaStar
flag to control cos(theta*) cut
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