]>
Commit | Line | Data |
---|---|---|
7f3c7cc6 | 1 | #ifndef _ALIANALYSISTASKGAMMACONVDALITZ_H_ |
2 | #define _ALIANALYSISTASKGAMMACONVDALITZ_H_ | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | // Analysis task for pi0->e+e-gamma (Dalitz decay) | |
8 | ||
9 | #include "AliAnalysisTaskSE.h" | |
10 | ||
11 | class AliESDInputHandler; | |
12 | class AliMCEventHandler; | |
13 | class AliESDEvent; | |
14 | class AliESDtrack; | |
15 | class AliESDtrackCuts; | |
16 | class AliESDpidCuts; | |
17 | class AliV0Reader; | |
18 | class AliGammaConversionHistograms; | |
19 | ||
20 | class AliAnalysisTaskGammaConvDalitz: public AliAnalysisTaskSE | |
21 | { | |
22 | public: | |
23 | ||
24 | AliAnalysisTaskGammaConvDalitz(); | |
25 | AliAnalysisTaskGammaConvDalitz( const char* name ); | |
26 | virtual ~AliAnalysisTaskGammaConvDalitz(); | |
27 | ||
28 | virtual void UserExec(Option_t *option); | |
29 | virtual void UserCreateOutputObjects(); | |
30 | virtual void ConnectInputData(Option_t *); | |
31 | virtual void Terminate(Option_t *option); | |
32 | ||
33 | enum TrackSelectionCriteria { kITSsaTrack=0, kGlobalTrack=1, kITSsaGlobalTrack=2 }; | |
34 | ||
35 | void SetRunStandalone( Bool_t flag=kFALSE ) { fStandalone = flag; } | |
36 | void SetComputeBackground( Bool_t flag=kTRUE ) { fComputeBkg = flag; } | |
37 | void SetUseBayesPID( Bool_t flag=kTRUE ) { fUseBayesPID = flag; } | |
38 | void SetUseESDtrackIndexCut( Bool_t flag=kTRUE) { fUseTrackIndexCut = flag; } | |
39 | void SetUsePsiPairCut(Bool_t flag=kTRUE) { fUsePsiPairCut = flag; } | |
40 | void SetUseMassCut(Bool_t flag=kTRUE) { fUseMassCut = flag; } | |
41 | void SetUseGammaCut(Bool_t flag=kTRUE) { fUseGammaCut = flag; } | |
42 | void SetUseAliKF(Bool_t flag=kFALSE) { fUseAliKF = flag; } | |
43 | void SetTrackSelectionCriteria(AliAnalysisTaskGammaConvDalitz::TrackSelectionCriteria sel=kGlobalTrack) { fTrkSelectionCriteria = sel; } | |
44 | ||
45 | void SetPsiPairCut(Double_t psi=0.45, Double_t phiMin=0., Double_t phiMax=0.12, Bool_t readMagFieldSgn=kTRUE){fPsiPairCut = psi; fDeltaPhiCutMin = phiMin; fDeltaPhiCutMax = phiMax; fReadMagFieldSign = readMagFieldSgn;} | |
46 | void SetMassCut(Double_t min, Double_t max) {fMassCutMin = min; fMassCutMax = max; } | |
47 | ||
48 | void SetNSigmasElecTPC( Double_t min, Double_t max) { fNSigmaBelowElecTPCbethe = min; fNSigmaAboveElecTPCbethe = max; } | |
49 | void SetNSigmasPionTPC( Double_t max ) { fNSigmaAbovePionTPCbethe = max; } | |
50 | void SetNSigmasKaonTPC( Double_t max ) { fNSigmaAboveKaonTPCbethe = max; } | |
51 | void SetNSigmasProtonTPC( Double_t max ) { fNSigmaAboveProtonTPCbethe = max; } | |
52 | ||
53 | void SetV0Reader( AliV0Reader* reader ) { fV0Reader = reader; } | |
54 | void SetDoMC(Bool_t flag) { fDoMC = flag; } | |
55 | void SetBGHandler( AliGammaConversionBGHandler* BG ) { fBGEventHandler = BG; } | |
56 | ||
57 | void AdoptHistograms( AliGammaConversionHistograms* histograms ) { fHistograms = histograms; } | |
58 | void AdoptITSsaTrackCuts( AliESDtrackCuts* esdCuts = 0 ); | |
59 | void AdoptESDtrackCuts( AliESDtrackCuts* esdCuts = 0 ); | |
60 | void AdoptESDpidCuts( AliESDpidCuts* esdPIDCuts = 0 ); | |
61 | ||
62 | private: | |
63 | ||
64 | void ProcessMCData(); | |
65 | void CreateListOfDalitzPairCandidates(); | |
66 | void ProcessGammaElectronsForDalitzAnalysis(); | |
67 | ||
68 | void ESDtrackIndexCut(vector<Int_t>& pos, vector<Int_t>& neg, const TClonesArray* gamma); | |
69 | void PsiPairCut(vector<Int_t>& pos, vector<Int_t>& neg); | |
70 | void MassCut(vector<Int_t>& pos, vector<Int_t>& neg); | |
71 | void CleanArray(vector<Int_t>& x, const vector<Bool_t>& tag); | |
72 | ||
73 | TClonesArray* IndexToAliKFParticle(const vector<Int_t>& v, Int_t PDG); | |
74 | TClonesArray* FindElectronFromPi0Dalitz(const vector<Int_t>& candidates, const Int_t PDG); | |
75 | TClonesArray* FindGammaFromPi0Dalitz(const TClonesArray* candidates, const vector<Int_t>& pos, const vector<Int_t>& neg); | |
76 | TClonesArray* FindGamma(const TClonesArray* candidates, const vector<Int_t>& pos, const vector<Int_t>& neg); | |
77 | TClonesArray* FindDalitzPair(const TClonesArray* pos, const TClonesArray* neg); | |
78 | TClonesArray* FindDalitzPair(const vector<Int_t>& pos, const vector<Int_t>& neg); | |
79 | TClonesArray* FindPi0Dalitz(const TClonesArray* pos, const TClonesArray* neg, const TClonesArray* gamma); | |
80 | TClonesArray* FindPi0Dalitz(const vector<Int_t>& pos, const vector<Int_t>& neg, const TClonesArray* gamma, const vector<Int_t>& posGam, const vector<Int_t>& negGam); | |
81 | ||
82 | void SetGammaPoolMaxSize(UInt_t maxSize=10) { fPoolMaxSize = maxSize; } | |
83 | void UpdateGammaPool(const TClonesArray* gamma); | |
84 | void UpdateElectronPool(TClonesArray* elec); | |
85 | TClonesArray* GammasFromBGHandler() const; | |
86 | TClonesArray* ElectronFromBGHandler() const; | |
87 | ||
88 | Bool_t IsPi0DalitzDaughter( Int_t label ) const; | |
89 | Bool_t IsDalitzPair( Int_t labelPos, Int_t labelNeg ) const; | |
90 | Bool_t IsFromGammaConversion( Int_t labelPos, Int_t labelNeg ) const; | |
91 | Bool_t IsFromGammaConversion( Double_t psiPair, Double_t deltaPhi ) const; | |
92 | Bool_t HaveSameMother( Int_t label1, Int_t label2 ) const; | |
93 | ||
94 | Double_t GetPsiPair( AliKFParticle* pos, AliKFParticle* neg ) const; | |
95 | Double_t GetPsiPair( const TLorentzVector* pos, const TLorentzVector* neg ) const; | |
96 | Double_t GetPsiPair( const AliESDtrack* trackPos, const AliESDtrack* trackNeg ) const; | |
97 | ||
98 | Int_t GetMonteCarloPid(const AliESDtrack* t) const; | |
99 | Int_t GetBayesPid(const AliESDtrack* t, Int_t trackType ) const; | |
100 | Int_t GetNSigmaPid(const AliESDtrack* t, Int_t trackType ) const; | |
101 | ||
102 | void GetGammaCandidates(TClonesArray*& gamma, vector<Int_t>& posIndex, vector<Int_t>& negIndex); | |
103 | void AngleEposEnegGammaCut( const vector<Int_t>& xPosIndex, const vector<Int_t>& yNegIndex, const TClonesArray* zGamma, TClonesArray*& gamma, vector<Int_t>& posIndex, vector<Int_t>& negIndex); | |
104 | void FillPsiPair(const TClonesArray* pos, const TClonesArray* neg, const TString& hName); | |
105 | void FillAngle(const TClonesArray* x, const TClonesArray* y, const TString& hName); | |
106 | Double_t Rapidity(const TParticle* p) const; | |
107 | void FillPidTable(const TParticle* p, Int_t pid); | |
108 | ||
109 | ||
110 | // protected: | |
111 | private: | |
112 | ||
113 | AliStack* fStack; //! MC particle stack | |
114 | AliMCEvent* fMCEvent; //! for CF pointer to the MC Event | |
115 | ||
116 | AliESDEvent* fESDEvent; //! ESD event | |
117 | ||
118 | vector<Int_t> fEposCandidateIndex; //! track indexes of e+ candidates | |
119 | vector<Int_t> fEnegCandidateIndex; //! track indexes of e- candidates | |
120 | vector<Int_t> fGammaCandidatePosIndex; //! track indexes for gamma candidates positive track | |
121 | vector<Int_t> fGammaCandidateNegIndex; //! track indexes for gamma candidates negative track | |
122 | ||
123 | TClonesArray* fGammaCandidates; //! AliKFParticle gamma candidates | |
124 | TClonesArray* fGammaPool; //! AliKFParticle gamma pool of previous events | |
125 | Int_t fPoolMaxSize; // size of the gamma pool | |
126 | Int_t fGamPoolPos; // Posisiton of last added gamma in the pool | |
127 | ||
128 | AliGammaConversionBGHandler* fBGEventHandler; // Background event handler | |
129 | ||
130 | TList* fOutputContainer; // Histogram container | |
131 | AliMCEventHandler* fMCTruth; // for CF pointer to MCTruth | |
132 | AliV0Reader* fV0Reader; // The V0 reader object | |
133 | AliESDpid* fESDpid; // for dEdx cut based on nSigma to a particle line | |
134 | AliESDtrackCuts* fESDtrackCuts; // ESD global track cuts | |
135 | AliESDtrackCuts* fITSsaTrackCuts; // ITS standalone ESD track cuts | |
136 | AliESDpidCuts* fESDpidCuts; // ESD PID cuts | |
137 | AliGammaConversionHistograms* fHistograms; // histogram container | |
138 | ||
139 | Bool_t fStandalone; // Run the task as standalone for the V0reader | |
140 | Bool_t fDoMC; // process montecarlo simulation | |
141 | Bool_t fComputeBkg; // Compute combinatorial background | |
142 | Bool_t fUseBayesPID; // use bayesian pid | |
143 | Bool_t fUseTrackIndexCut; // use esd track index cut | |
144 | Bool_t fUsePsiPairCut; // use psi pair cut | |
145 | Bool_t fUseMassCut; // use mass cut | |
146 | Bool_t fUseGammaCut; // use e+e- plane angle gamma cut | |
147 | Bool_t fReadMagFieldSign; // Read the magnetic field sign from the ESD for Psi pair cut | |
148 | Bool_t fUseAliKF; // Use AliKFParticle to reconstruct the pi0 instead of TLorentzVector class | |
149 | ||
150 | Int_t fMagFieldSign; // Magnetic field sign | |
151 | const Double_t fElectronMass; // Electron mass | |
152 | Double_t fPsiPairCut; // Psi pair cut value | |
153 | Double_t fDeltaPhiCutMin; // Delta_Phi minimum cut value | |
154 | Double_t fDeltaPhiCutMax; // Delta_Phi maximum cut value | |
155 | Double_t fMassCutMin; // Minimum value of e+e- mass (GeV/c2) | |
156 | Double_t fMassCutMax; // Maximum value of e+e- mass (GeV/c2) | |
157 | Double_t fNSigmaBelowElecTPCbethe; // Number of sigmas below the electron BB in the TPC | |
158 | Double_t fNSigmaAboveElecTPCbethe; // Number of sigmas above the electron BB in the TPC | |
159 | Double_t fNSigmaAbovePionTPCbethe; // Number of sigmas above the Pion BB in the TPC | |
160 | Double_t fNSigmaAboveKaonTPCbethe; // Number of sigmas above the Kaon BB in the TPC | |
161 | Double_t fNSigmaAboveProtonTPCbethe; // Number of sigmas above the Proton BB in the TPC | |
162 | ||
163 | TrackSelectionCriteria fTrkSelectionCriteria; // Selected criteria for track cuts | |
164 | ||
165 | private: | |
166 | ||
167 | AliAnalysisTaskGammaConvDalitz( const AliAnalysisTaskGammaConvDalitz& ); // Not implemented | |
168 | AliAnalysisTaskGammaConvDalitz& operator=( const AliAnalysisTaskGammaConvDalitz& ); // Not implemented | |
169 | ||
170 | ClassDef( AliAnalysisTaskGammaConvDalitz, 2 ); | |
171 | }; | |
172 | ||
173 | #endif // _ALIANALYSISTASKGAMMACONVDALITZ_H_ |