1 #ifndef ALIANALYSISTASKSED0CORRELATIONS_H
2 #define ALIANALYSISTASKSED0CORRELATIONS_H
4 /* Copyright(c) 1998-2012, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 //*************************************************************************
10 // Class AliAnalysisTaskSED0Correlations
11 // AliAnalysisTaskSE for D0 candidates (2Prongs) and hadrons correlations
13 // C.Bianchin, chiara.bianchin@pd.infn.it
14 // F.Colamaria, fabio.colamaria@ba.infn.it
15 //*************************************************************************
22 #include <THnSparse.h>
24 #include "AliAnalysisTaskSE.h"
25 #include "AliRDHFCutsD0toKpi.h"
26 #include "AliHFAssociatedTrackCuts.h"
27 #include "AliHFCorrelator.h"
28 #include "AliNormalizationCounter.h"
32 class AliAnalysisTaskSED0Correlations : public AliAnalysisTaskSE
36 AliAnalysisTaskSED0Correlations();
37 AliAnalysisTaskSED0Correlations(const char *name,AliRDHFCutsD0toKpi* cutsD0, AliHFAssociatedTrackCuts* cutsTrk);
38 virtual ~AliAnalysisTaskSED0Correlations();
40 // Implementation of interface methods
41 virtual void UserCreateOutputObjects();
43 virtual void LocalInit() {Init();}
44 virtual void UserExec(Option_t *option);
45 virtual void Terminate(Option_t *option);
47 void SetReadMC(Bool_t readMC=kFALSE){fReadMC=readMC;}
48 void SetFillOnlyD0D0bar(Int_t flagfill){fFillOnlyD0D0bar=flagfill;}
49 void SetSystem(Int_t sys){fSys=sys;}
50 void SetRejectSDDClusters(Bool_t flag) {fIsRejectSDDClusters=flag; }
51 void SetFillGlobalPlots(Bool_t fill=kTRUE){fFillGlobal=fill;}
53 Int_t GetReadMC() const {return fReadMC;}
54 Int_t GetFillOnlyD0D0bar() const {return fFillOnlyD0D0bar;}
55 Int_t GetSystem() const {return fSys;}
56 Bool_t GetRejectSDDClusters() const {return fIsRejectSDDClusters;}
57 Bool_t GetFillGlobalPlots() const {return fFillGlobal;}
59 //correlations setters/printers
60 void SetNPtBinsCorr(Int_t nbins) {fNPtBinsCorr = nbins;}
61 void SetPtBinsLimsCorr(Double_t* ptlims) {for(int i=0;i<=fNPtBinsCorr;i++) {fBinLimsCorr.push_back(ptlims[i]);}}
62 void SetPtBinsLimsCorr(Float_t* ptlims) {for(int i=0;i<=fNPtBinsCorr;i++) {fBinLimsCorr.push_back((Double_t)ptlims[i]);}}
63 void SetPtTreshLow(Double_t* pttreshlow) {for(int i=0;i<fNPtBinsCorr;i++) {fPtThreshLow.push_back(pttreshlow[i]);}}
64 void SetPtTreshUp(Double_t* pttreshup) {for(int i=0;i<fNPtBinsCorr;i++) {fPtThreshUp.push_back(pttreshup[i]);}}
65 void PrintBinsAndLimits();
66 Int_t PtBinCorr(Double_t pt) const;
67 void SetEvMixing(Bool_t mix) {fMixing=mix;}
69 enum PartType {kTrack,kKCharg,kK0};
70 enum FillType {kSE, kME}; //for single event or event mixing histos fill
74 AliAnalysisTaskSED0Correlations(const AliAnalysisTaskSED0Correlations &source);
75 AliAnalysisTaskSED0Correlations& operator=(const AliAnalysisTaskSED0Correlations& source);
76 void FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout);
77 Int_t CheckD0Origin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
79 void CreateCorrelationsObjs();
80 void CalculateCorrelations(AliAODRecoDecayHF2Prong* d, Int_t labD0=-1, TClonesArray* mcArray=0x0);
81 void FillSparsePlots(TClonesArray* arrayMC, AliAODRecoDecayHF2Prong *d, Int_t origD0, Int_t PdgD0, AliReducedParticle* track, Int_t type);
82 Int_t CheckTrackOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const;
83 Bool_t SelectV0(AliAODv0* v0, AliAODVertex *vtx, Int_t option, Int_t idArrayV0[][2]) const;
85 Int_t fNPtBinsCorr; // number of pt bins per correlations
86 vector<Double_t> fBinLimsCorr; // limits of pt bins per correlations
87 vector<Double_t> fPtThreshLow; // pT treshold of hadrons - low
88 vector<Double_t> fPtThreshUp; // pT treshold of hadrons - up
90 Int_t fEvents; // EventCounter
91 Bool_t fAlreadyFilled; // D0 in an event already analyzed (for track distribution plots)
92 TList *fOutputMass; //!list send on output slot 1
93 TList *fOutputCorr; //!list of correlation histos, output slot 5
94 TList *fOutputStudy; //!list of histos with MC distributions, output slot 6
95 TH1F *fNentries; //!histogram with number of events on output slot 2
96 AliRDHFCutsD0toKpi *fCutsD0; // Cuts for D0, output 3
97 AliHFAssociatedTrackCuts *fCutsTracks;// Cuts for tracks and K0, output 7
98 AliHFCorrelator* fCorrelatorTr; // Correlator for tracks
99 AliHFCorrelator* fCorrelatorKc; // Correlator for charged K
100 AliHFCorrelator* fCorrelatorK0; // Correlator for K0
101 Bool_t fReadMC; // flag for MC array: kTRUE = read it, kFALSE = do not read it
102 Bool_t fMixing; // flag to enable also event mixing
103 AliNormalizationCounter *fCounter; //!AliNormalizationCounter on output slot 4
104 Int_t fNPtBins; // Number of pt bins
105 Int_t fFillOnlyD0D0bar; // flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only, 2 = fill with D0bar only)
106 Int_t fIsSelectedCandidate; // selection outcome
107 Int_t fSys; // fSys=0 -> p-p; fSys=1 ->PbPb
108 Bool_t fIsRejectSDDClusters; // flag to reject events with SDD clusters
109 Bool_t fFillGlobal; // flag to fill global plots (in loops on tracks and V0 for each event)
111 ClassDef(AliAnalysisTaskSED0Correlations,2); // AliAnalysisTaskSE for D0->Kpi