AliPhysics  608b256 (608b256)
AliAnalysisTaskSED0Mass.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSED0MASS_H
2 #define ALIANALYSISTASKSED0MASS_H
3 
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 /* $Id$ */
8 
17 
18 #include <TROOT.h>
19 #include <TSystem.h>
20 #include <TNtuple.h>
21 #include <TTree.h>
22 #include <TH1F.h>
23 #include <THnSparse.h>
24 
25 #include "AliAnalysisTaskSE.h"
26 #include "AliRDHFCutsD0toKpi.h"
28 #include "AliEventCuts.h"
29 
30 class AliAODEvent;
31 
33 {
34  public:
35 
37  AliAnalysisTaskSED0Mass(const char *name,AliRDHFCutsD0toKpi* cuts);
38  virtual ~AliAnalysisTaskSED0Mass();
39 
40 
42  virtual void UserCreateOutputObjects();
43  virtual void Init();
44  virtual void LocalInit() {Init();}
45  virtual void UserExec(Option_t *option);
46  virtual void Terminate(Option_t *option);
47 
49  Bool_t CheckAcc(TClonesArray* arrayMC,Int_t nProng, Int_t *labDau);
50  void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader);
51 
52  void NormIPvar(AliAODEvent *aod, AliAODRecoDecayHF2Prong *part,TClonesArray *arrMC);
54  enum{kD0,kLS};
55 
56  void SetReadMC(Bool_t readMC=kFALSE){fReadMC=readMC;}
57  void SetDoMCAcceptanceHistos(Bool_t doMCAcc=kTRUE){fStepMCAcc=doMCAcc;}
58  void SetCutOnDistr(Bool_t cutondistr=kFALSE){fCutOnDistr=cutondistr;}
59  void SetUsePid4Distr(Bool_t usepid=kTRUE){fUsePid4Distr=usepid;}
60  void SetFillOnlyD0D0bar(Int_t flagfill){fFillOnlyD0D0bar=flagfill;}
62  void SetFillPtHistos(Bool_t flag) {fFillPtHist=flag;}
63  void SetFillYHistos(Bool_t flag) {fFillYHist=flag;}
65  void SetFillSparses(Bool_t flag) {fFillSparses=flag;}
66  void SetUseRejectionMethod(Bool_t flag=kFALSE, Float_t factor=0.01) {fUseRejectionMethod=flag; fRejectionFactor=factor;}
67  void SetSystem(Int_t sys){fSys=sys; if(fSys==1) SetFillVarHists(kFALSE);}
72  void SetSelectTrueD0(Bool_t flag) { fSelectTrueD0 = flag; }
74  void SetDrawDetSignal(Bool_t flag) { fDrawDetSignal=flag; }
75  void SetPIDCheck(Bool_t flag) { fPIDCheck=flag; }
81 
82  void SetEnableCentralityCorrCutsPbPb(Bool_t flag=kFALSE, Int_t year=2018) {
84  if(year==2018){
85  fEventCuts.SetupPbPb2018();
86  fEventCuts.SetManualMode();
87  }else{
88  fEventCuts.SetupRun2PbPb();
89  }
90  }
91 
92 
93  Bool_t GetCutOnDistr() const {return fCutOnDistr;}
98  Bool_t GetFillYHistos() const {return fFillYHist;}
100  Int_t GetSystem() const {return fSys;}
105  Bool_t GetPIDCheck() const {return fPIDCheck;}
107 
108  private:
109 
112  void DrawDetSignal(AliAODRecoDecayHF2Prong *part, TList *ListDetSignal);
113 
114  void FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts, TList *listout);
115  void FillVarHists(AliAODEvent *aodev,AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout);
116  void FillCandVariables(AliAODEvent *aodev, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts);
117  AliAODVertex* GetPrimaryVtxSkipped(AliAODEvent *aodev);
119  Int_t CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
120  Float_t GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray* arrayMC, AliAODMCParticle *partD0) const ;
122 
127  TH1F *fNentries;
128  THnSparseF *fMCAccPrompt;
129  THnSparseF *fMCAccBFeed;
130  Bool_t fStepMCAcc; // flag to activate histos for StepMCAcc
131  AliRDHFCutsD0toKpi *fCuts; // Cuts - sent to output slot 4
133  AliEventCuts fEventCuts; // Event cut object for centrality correlation event cuts
134  THnSparseF *fHistMassPtImpParTC[5];
138  Bool_t fUsePid4Distr; // flag to use the particle identification to fill the signal histograms of distributions. It has effect only with fReadMC=kFALSE
155 
165  Bool_t fUseQuarkTagInKine; // flag for quark/hadron level identification of prompt and feeddown
166  Bool_t fFillSparses; // flag to activate THnSparse
167  Bool_t fUseRejectionMethod; // flag to activate the Rejection method
168  Float_t fRejectionFactor; // rejection factor to be used in the rejection method
180 
181 
183  ClassDef(AliAnalysisTaskSED0Mass,26);
184 };
186 
187 #endif
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for D0 FD (pt,y,ptB)
void SetEnableCentralityCorrCutsPbPb(Bool_t flag=kFALSE, Int_t year=2018)
Bool_t fFillSubSampleHist
flag to fill Pt and Impact Parameter Histograms
TList * fOutputMassPt
! list send on output slot 6
Bool_t fDrawDetSignal
flag to decide whether to fill "PID = x" bins in fNentrie
void SetUseSelectionBit(Bool_t flag)
double Double_t
Definition: External.C:58
Bool_t fFillYHist
flag to fill Pt and Impact Parameter Histograms
void SetDoMCAcceptanceHistos(Bool_t doMCAcc=kTRUE)
Definition: External.C:236
void FillVarHists(AliAODEvent *aodev, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout)
Double_t * fCandidateVariables
! variables to be written to the tree
Bool_t fPIDCheck
flag to activate the mass window selection for output size reduction
Int_t fAODProtection
flag to check or not the selection bit
Bool_t GetFillImpactParameterHistos() const
void SetAODMismatchProtection(Int_t opt=1)
void SetArray(Int_t type=AliAnalysisTaskSED0Mass::kD0)
TList * fDistr
! list send on output slot 2
void NormIPvar(AliAODEvent *aod, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC)
TList * fDetSignal
!Detector signal histograms (on output slot 8)
Bool_t fUseSelectionBit
event counter used for sub sample test
void SetFillOnlyD0D0bar(Int_t flagfill)
void SetUseRejectionMethod(Bool_t flag=kFALSE, Float_t factor=0.01)
void SetUseQuarkLevelTag(Bool_t opt)
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
Int_t fSys
flag to enable filling variable histos
void SetWriteVariableTree(Bool_t flag)
TList * fOutputMass
! list send on output slot 1
Bool_t CheckAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Bool_t fReadMC
can be D0 or Like Sign candidates
void SetPileupRejectionVZEROTPCcls(Bool_t flag, Bool_t rejpileup)
void SetReadMC(Bool_t readMC=kFALSE)
THnSparseF * fHistMassPtImpParTC[5]
! histograms for impact paramter studies
AliAnalysisTaskSED0Mass & operator=(const AliAnalysisTaskSED0Mass &source)
TH1F * fNentries
! histogram with number of events on output slot 3
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Bool_t fFillPtHist
flag to reject events with SDD clusters
Bool_t fFillImpParHist
flag to fill Y Histograms
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Bool_t fUseQuarkTagInKine
flag to decide whether to draw the TPC dE/dx and TOF signal before/after PID
void SetRejectSDDClusters(Bool_t flag)
Bool_t fIsRejectSDDClusters
fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE after if ...
AliEventCuts fEventCuts
flag to enable centrality correlation event cuts
void SetFillImpactParameterHistos(Bool_t flag)
Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPartCandidate) const
Float_t ComputeTopomatic(AliAODEvent *aodev, AliAODRecoDecayHF2Prong *part)
virtual void Terminate(Option_t *option)
Float_t GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partD0) const
void FillCandVariables(AliAODEvent *aodev, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts)
void SetPileupRejectionVZEROTPCout(Bool_t flag)
void DrawDetSignal(AliAODRecoDecayHF2Prong *part, TList *ListDetSignal)
void SetDrawDetSignal(Bool_t flag)
Bool_t fUsedMassWindow
flag to decide whether to write only true D0/D0bar
Double_t fLsNormalization
number of pt bins
Bool_t fUsePid4Distr
flag to decide if apply cut also on distributions: 0 no cuts, 1 looser cuts, 2 tighter/ cuts ...
THnSparseF * fhStudyImpParSingleTrackFd
! sparse with imp par residual cuts for MC
Bool_t fCutOnDistr
flag for MC array: kTRUE = read it, kFALSE = do not read it
AliAODVertex * GetPrimaryVtxSkipped(AliAODEvent *aodev)
void SetUseMassWindow(Bool_t flag)
THnSparseF * fhStudyImpParSingleTrackSign
! sparse with imp par residual cuts for MC
void FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts, TList *listout)
Int_t fIsSelectedCandidate
keeps the daughter tracks
THnSparseF * fhStudyImpParSingleTrackCand
! sparse with imp par residual cuts for Data
TList * fOutputMassY
! list send on output slot 9
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
const char Option_t
Definition: External.C:48
virtual void UserExec(Option_t *option)
TObjArray fDaughterTracks
flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only...
void SetCutOnDistr(Bool_t cutondistr=kFALSE)
bool Bool_t
Definition: External.C:53
void SetWriteProtosgnVar(Bool_t flag)
void SetUsePid4Distr(Bool_t usepid=kTRUE)
Int_t fFillOnlyD0D0bar
normalization
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for D0 prompt (pt,y,ptB)
void SetFillSubSampleHist(Bool_t flag)
Bool_t fFillVarHists
selection outcome
AliNormalizationCounter * fCounter
! AliNormalizationCounter on output slot 5
Bool_t fSelectTrueD0
flag to decide whether to write the selected candidates variables on a tree for cut optimization ...
Int_t fEventCounter
flag to fill SubSample histogram