]>
Commit | Line | Data |
---|---|---|
344100c4 | 1 | #ifndef ALICONVERSIONPHOTONCUTS_H |
2 | #define ALICONVERSIONPHOTONCUTS_H | |
3 | ||
4 | // Class handling all kinds of selection cuts for Gamma Conversion analysis | |
5 | // Authors: Friederike Bock | |
6 | ||
7 | #include "AliAODpidUtil.h" | |
8 | #include "AliConversionPhotonBase.h" | |
9 | #include "AliAODConversionMother.h" | |
10 | #include "AliAODTrack.h" | |
11 | #include "AliESDtrack.h" | |
12 | #include "AliVTrack.h" | |
13 | #include "AliAODTrack.h" | |
14 | #include "AliStack.h" | |
15 | #include "AliAnalysisCuts.h" | |
16 | #include "TH1F.h" | |
17 | #include "TF1.h" | |
18 | #include "AliAnalysisUtils.h" | |
19 | #include "AliAnalysisManager.h" | |
20 | ||
21 | class AliESDEvent; | |
22 | class AliAODEvent; | |
23 | class AliConversionPhotonBase; | |
24 | class AliPIDResponse; | |
25 | class AliKFVertex; | |
26 | class TH1F; | |
27 | class TH2F; | |
28 | class TF1; | |
29 | class AliAnalysisCuts; | |
30 | class iostream; | |
31 | class TList; | |
32 | class AliAnalysisManager; | |
33 | class AliAODMCParticle; | |
34 | ||
35 | using namespace std; | |
36 | ||
37 | class AliConversionPhotonCuts : public AliAnalysisCuts { | |
38 | ||
39 | public: | |
40 | ||
41 | ||
42 | enum cutIds { | |
43 | kv0FinderType, | |
44 | ketaCut, | |
45 | kRCut, | |
46 | ksinglePtCut, | |
47 | kclsTPCCut, | |
48 | kededxSigmaCut, | |
49 | kpidedxSigmaCut, | |
50 | kpiMomdedxSigmaCut, | |
51 | kpiMaxMomdedxSigmaCut, | |
52 | kLowPRejectionSigmaCut, | |
53 | kTOFelectronPID, | |
54 | kQtMaxCut, | |
55 | kchi2GammaCut, | |
56 | kPsiPair, | |
57 | kdoPhotonAsymmetryCut, | |
58 | kCosPAngle, | |
59 | kElecShare, | |
60 | kToCloseV0s, | |
61 | kDcaRPrimVtx, | |
62 | kDcaZPrimVtx, | |
63 | kInPlaneOutOfPlane, | |
64 | kNCuts | |
65 | }; | |
66 | ||
67 | enum photonCuts { | |
68 | kPhotonIn=0, | |
69 | kOnFly, | |
70 | kNoTracks, | |
71 | kTrackCuts, | |
72 | kdEdxCuts, | |
73 | kConvPointFail, | |
74 | kPhotonCuts, | |
75 | kEventPlane, | |
76 | kPhotonOut | |
77 | }; | |
78 | ||
79 | ||
80 | Bool_t SetCutIds(TString cutString); | |
81 | Int_t fCuts[kNCuts]; | |
82 | Bool_t SetCut(cutIds cutID, Int_t cut); | |
83 | Bool_t UpdateCutString(); | |
84 | ||
85 | static const char * fgkCutNames[kNCuts]; | |
86 | ||
87 | Double_t GetCosineOfPointingAngle(const AliConversionPhotonBase * photon, AliVEvent * event) const; | |
88 | Bool_t InitializeCutsFromCutString(const TString analysisCutSelection); | |
89 | void FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0); | |
90 | void SetPreSelectionCutFlag(Bool_t preSelFlag){fPreSelCut = preSelFlag;} | |
91 | ||
92 | AliConversionPhotonCuts(const char *name="V0Cuts", const char * title="V0 Cuts"); | |
93 | AliConversionPhotonCuts(const AliConversionPhotonCuts&); | |
94 | AliConversionPhotonCuts& operator=(const AliConversionPhotonCuts&); | |
95 | ||
96 | virtual ~AliConversionPhotonCuts(); //virtual destructor | |
97 | ||
98 | static AliConversionPhotonCuts * GetStandardCuts2010PbPb(); | |
99 | static AliConversionPhotonCuts * GetStandardCuts2010pp(); | |
100 | ||
101 | void InitAODpidUtil(Int_t type); | |
102 | Bool_t InitPIDResponse(); | |
103 | void SetPIDResponse(AliPIDResponse * pidResponse) {fPIDResponse = pidResponse;} | |
104 | AliPIDResponse * GetPIDResponse() { return fPIDResponse;} | |
105 | ||
106 | ||
107 | virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;} | |
108 | virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;} | |
109 | ||
110 | TString GetCutNumber(); | |
111 | ||
112 | // Cut Selection | |
113 | Bool_t PhotonIsSelected(AliConversionPhotonBase * photon, AliVEvent * event); | |
114 | Bool_t PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma=kTRUE); | |
115 | Bool_t PhotonIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray,Bool_t checkForConvertedGamma=kTRUE); | |
116 | Bool_t ElectronIsSelectedMC(TParticle *particle,AliStack *fMCStack); | |
117 | Bool_t TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack); | |
118 | Bool_t MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal=kTRUE); | |
119 | Bool_t MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Bool_t bMCDaughtersInAcceptance=kFALSE); | |
120 | ||
121 | void PrintCuts(); | |
122 | void PrintCutsWithValues(); | |
123 | ||
124 | void InitCutHistograms(TString name="",Bool_t preCut = kTRUE); | |
125 | void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};} | |
126 | TList *GetCutHistograms(){return fHistograms;} | |
127 | void FillPhotonCutIndex(Int_t photoncut){if(hCutIndex)hCutIndex->Fill(photoncut);} | |
128 | void FillV0EtaBeforedEdxCuts(Float_t v0Eta){if(hEtaDistV0s)hEtaDistV0s->Fill(v0Eta);} | |
129 | void FillV0EtaAfterdEdxCuts(Float_t v0Eta){if(hEtaDistV0sAfterdEdxCuts)hEtaDistV0sAfterdEdxCuts->Fill(v0Eta);} | |
130 | ||
131 | static AliVTrack * GetTrack(AliVEvent * event, Int_t label); | |
132 | static AliESDtrack *GetESDTrack(AliESDEvent * event, Int_t label); | |
133 | ||
134 | ///Cut functions | |
135 | Bool_t SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex); | |
136 | Bool_t SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex); | |
137 | Bool_t AcceptanceCuts(AliConversionPhotonBase *photon); | |
138 | Bool_t AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg); | |
139 | Bool_t dEdxCuts(AliVTrack * track); | |
140 | Bool_t ArmenterosQtCut(AliConversionPhotonBase *photon); | |
141 | Bool_t AsymmetryCut(AliConversionPhotonBase *photon,AliVEvent *event); | |
142 | Bool_t PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event); | |
143 | Bool_t SelectV0Finder(Bool_t onfly){ | |
144 | if(onfly == fUseOnFlyV0Finder) return kTRUE; | |
145 | else return kFALSE; | |
146 | } | |
147 | Bool_t PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event); | |
148 | Bool_t CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event); | |
149 | Bool_t PsiPairCut(const AliConversionPhotonBase * photon) const; | |
150 | Bool_t CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const; | |
151 | Bool_t RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s); | |
152 | Bool_t RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0); | |
153 | ||
154 | UChar_t DeterminePhotonQualityAOD(AliAODConversionPhoton*, AliVEvent*); | |
155 | Bool_t InPlaneOutOfPlaneCut(Double_t photonPhi, Double_t eventPlaneAngle = -100, Bool_t fill = kTRUE); | |
156 | Int_t GetInPlaneOutOfPlaneCut(){return fInPlaneOutOfPlane;} | |
157 | ||
158 | // Set Individual Cuts | |
159 | Bool_t SetRCut(Int_t RCut); | |
160 | Bool_t SetV0Finder(Int_t v0FinderType); | |
161 | Bool_t SetChi2GammaCut(Int_t chi2GammaCut); | |
162 | Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut); | |
163 | Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut); | |
164 | Bool_t SetSinglePtCut(Int_t singlePtCut); | |
165 | Bool_t SetTPCClusterCut(Int_t clsTPCCut); | |
166 | Bool_t SetEtaCut(Int_t etaCut); | |
167 | Bool_t SetMinMomPiondEdxCut(Int_t piMinMomdedxSigmaCut); | |
168 | Bool_t SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut); | |
169 | Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut); | |
170 | Bool_t SetQtMaxCut(Int_t QtMaxCut); | |
171 | Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID); | |
172 | Bool_t SetTRDElectronCut(Int_t TRDElectronCut); | |
173 | Bool_t SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut); | |
174 | Bool_t SetCosPAngleCut(Int_t cosCut); | |
175 | Bool_t SetPsiPairCut(Int_t psiCut); | |
176 | Bool_t SetSharedElectronCut(Int_t sharedElec); | |
177 | Bool_t SetToCloseV0sCut(Int_t toClose); | |
178 | Bool_t SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx); | |
179 | Bool_t SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx); | |
180 | Bool_t SetInPlaneOutOfPlane(Int_t inOutPlane); | |
181 | void SetIsHeavyIon(Int_t isHeavyIon){fIsHeavyIon=isHeavyIon;} | |
182 | Int_t GetFirstTPCRow(Double_t radius); | |
183 | ||
184 | // Request Flags | |
185 | Bool_t UseElecSharingCut(){return fDoSharedElecCut;} | |
186 | Bool_t UseToCloseV0sCut(){return fDoToCloseV0sCut;} | |
187 | Double_t GetEtaCut(){return fEtaCut;} | |
188 | ||
189 | protected: | |
190 | TList *fHistograms; // | |
191 | AliPIDResponse *fPIDResponse; // | |
192 | ||
193 | //cuts | |
194 | Double_t fMaxR; // r cut | |
195 | Double_t fMinR; // r cut | |
196 | Double_t fEtaCut; // eta cut | |
197 | Double_t fEtaCutMin; // eta cut | |
198 | Double_t fPtCut; // pt cut | |
199 | Double_t fSinglePtCut; // pt cut for electron/positron | |
200 | Double_t fMaxZ; // z cut | |
201 | Double_t fMinClsTPC; // minimum clusters in the TPC | |
202 | Double_t fMinClsTPCToF; // minimum clusters to findable clusters | |
203 | Double_t fLineCutZRSlope; // linecut | |
204 | Double_t fLineCutZValue; // linecut | |
205 | Double_t fLineCutZRSlopeMin; // linecut | |
206 | Double_t fLineCutZValueMin; // linecut | |
207 | Double_t fChi2CutConversion; // chi2cut | |
208 | Double_t fPIDProbabilityCutNegativeParticle; // | |
209 | Double_t fPIDProbabilityCutPositiveParticle; // | |
210 | Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas | |
211 | Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF | |
212 | Double_t fPIDTRDEfficiency; // required electron efficiency for TRD PID | |
213 | Bool_t fDoTRDPID; // flag to use TRD pid | |
214 | Double_t fPIDnSigmaAboveElectronLine; // sigma cut | |
215 | Double_t fPIDnSigmaBelowElectronLine; // sigma cut | |
216 | Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF | |
217 | Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF | |
218 | Double_t fPIDnSigmaAbovePionLine; // sigma cut | |
219 | Double_t fPIDnSigmaAbovePionLineHighPt; // sigma cut | |
220 | Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut | |
221 | Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut | |
222 | Double_t fDoKaonRejectionLowP; // Kaon rejection at low p | |
223 | Double_t fDoProtonRejectionLowP; // Proton rejection at low p | |
224 | Double_t fDoPionRejectionLowP; // Pion rejection at low p | |
225 | Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut | |
226 | Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut | |
227 | Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut | |
228 | Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection | |
229 | Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection | |
230 | Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection | |
231 | Bool_t fDoQtGammaSelection; // Select gammas using qtMax | |
232 | Bool_t fDo2DQt; // Select gammas using ellipse cut | |
233 | Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas | |
234 | Double_t fNSigmaMass; // nsigma cut | |
235 | Bool_t fUseEtaMinCut; // flag | |
236 | Bool_t fUseOnFlyV0Finder; // flag | |
237 | Bool_t fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut | |
238 | Double_t fMinPPhotonAsymmetryCut; // Min Momentum for Asymmetry Cut | |
239 | Double_t fMinPhotonAsymmetry; // Asymmetry Cut | |
240 | Bool_t fUseCorrectedTPCClsInfo; // flag to use corrected tpc cl info | |
241 | Bool_t fUseTOFpid; // flag to use tof pid | |
242 | Float_t fOpeningAngle; // min opening angle for meson | |
243 | Float_t fPsiPairCut; // | |
244 | Bool_t fDo2DPsiPairChi2; // | |
245 | Float_t fCosPAngleCut; // | |
246 | Bool_t fDoToCloseV0sCut; // | |
247 | Double_t fminV0Dist; // | |
248 | Bool_t fDoSharedElecCut; // | |
249 | Bool_t fDoPhotonQualitySelectionCut; // | |
250 | Int_t fPhotonQualityCut; // | |
251 | TRandom3 fRandom; // | |
252 | Int_t fElectronArraySize; // Size of electron array | |
253 | Int_t *fElectronLabelArray; //[fElectronArraySize] | |
254 | Double_t fDCAZPrimVtxCut; // cut value for the maximum distance in Z between the photon & the primary vertex [cm] | |
255 | Double_t fDCARPrimVtxCut; // cut value for the maximum distance in R between the photon & the primary vertex [cm] | |
256 | Int_t fInPlaneOutOfPlane; // In-Plane Out-Of Plane Analysis | |
257 | Float_t fConversionPointXArray; // Array with conversion Point x | |
258 | Float_t fConversionPointYArray; // Array with conversion Point y | |
259 | Float_t fConversionPointZArray; // Array with conversion Point z | |
260 | TObjString *fCutString; // cut number used for analysis | |
261 | Int_t fIsHeavyIon; // flag for pp (0), PbPb (1), pPb (2) | |
262 | ||
263 | // Histograms | |
264 | TH1F *hEtaDistV0s; // eta-distribution of all V0s after Finder selection | |
265 | TH1F *hEtaDistV0sAfterdEdxCuts; // eta-distribution of all V0s after Finder selection after dEdx cuts | |
266 | TH1F *hdEdxCuts; // bookkeeping for dEdx cuts | |
267 | TH2F *hTPCdEdxbefore; // TPC dEdx before cuts | |
268 | TH2F *hTPCdEdxafter; // TPC dEdx after cuts | |
269 | TH2F *hTPCdEdxSigbefore; // TPC Sigma dEdx before cuts | |
270 | TH2F *hTPCdEdxSigafter; // TPC Sigm dEdx after cuts | |
271 | TH2F *hTOFbefore; // TOF before cuts | |
272 | TH2F *hTOFSigbefore; // TOF Sigma before cuts | |
273 | TH2F *hTOFSigafter; // TOF Sigma after cuts | |
274 | TH2F *hPsiPairDeltaPhiafter; // TOF Sigma after cuts | |
275 | TH1F *hTrackCuts; // bookkeeping for track cuts | |
276 | TH1F *hPhotonCuts; // bookkeeping for photon specific cuts | |
277 | TH1F *hInvMassbefore; // e+e- inv mass distribution before cuts | |
278 | TH2F *hArmenterosbefore; // armenteros podolanski plot before cuts | |
279 | TH1F *hInvMassafter; // e+e- inv mass distribution after cuts | |
280 | TH2F *hArmenterosafter; // armenteros podolanski plot after cuts | |
281 | TH1F *hAcceptanceCuts; // bookkeeping for acceptance cuts | |
282 | TH1F *hCutIndex; // bookkeeping for cuts | |
283 | TH1F *hEventPlanePhi; // EventPlaneAngle Minus Photon Angle | |
284 | Bool_t fPreSelCut; // Flag for preselection cut used in V0Reader | |
285 | ||
286 | private: | |
287 | ||
288 | ClassDef(AliConversionPhotonCuts,1) | |
289 | }; | |
290 | ||
291 | ||
292 | inline void AliConversionPhotonCuts::InitAODpidUtil(Int_t type) { | |
293 | if (!fPIDResponse) fPIDResponse = new AliAODpidUtil(); | |
294 | Double_t alephParameters[5]; | |
295 | // simulation | |
296 | alephParameters[0] = 2.15898e+00/50.; | |
297 | alephParameters[1] = 1.75295e+01; | |
298 | alephParameters[2] = 3.40030e-09; | |
299 | alephParameters[3] = 1.96178e+00; | |
300 | alephParameters[4] = 3.91720e+00; | |
301 | fPIDResponse->GetTOFResponse().SetTimeResolution(80.); | |
302 | ||
303 | // data | |
304 | if (type==1){ | |
305 | alephParameters[0] = 0.0283086/0.97; | |
306 | alephParameters[1] = 2.63394e+01; | |
307 | alephParameters[2] = 5.04114e-11; | |
308 | alephParameters[3] = 2.12543e+00; | |
309 | alephParameters[4] = 4.88663e+00; | |
310 | fPIDResponse->GetTOFResponse().SetTimeResolution(130.); | |
311 | fPIDResponse->GetTPCResponse().SetMip(50.); | |
312 | } | |
313 | ||
314 | fPIDResponse->GetTPCResponse().SetBetheBlochParameters( | |
315 | alephParameters[0],alephParameters[1],alephParameters[2], | |
316 | alephParameters[3],alephParameters[4]); | |
317 | ||
318 | fPIDResponse->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04); | |
319 | } | |
320 | ||
321 | #endif |