1 #ifndef ALIV0READERV1_H
2 #define ALIV0READERV1_H
4 #include "AliAnalysisTaskSE.h"
5 #include "TClonesArray.h"
6 #include "AliKFParticle.h"
9 #include "AliAODEvent.h"
10 #include "AliESDEvent.h"
11 #include "AliKFConversionPhoton.h"
12 #include "AliConversionPhotonBase.h"
13 #include "AliConversionAODBGHandlerRP.h"
15 #include "AliKFVertex.h"
16 #include "AliAODTrack.h"
17 #include "AliESDtrack.h"
18 #include "AliVTrack.h"
20 #include "AliEventplane.h"
25 class AliAODConversionPhoton;
29 class AliV0ReaderV1 : public AliAnalysisTaskSE {
33 AliV0ReaderV1(const char *name="V0ReaderV1");
34 virtual ~AliV0ReaderV1(); //virtual destructor
35 void UserCreateOutputObjects();
37 virtual void UserExec(Option_t *option);
38 virtual void Terminate(Option_t *);
43 Bool_t CheckV0Status();
45 void ProcessMC(AliKFConversionPhoton*);
46 void ProcessMCGammasForEfficiency();
48 void SetIsHeavyIon(Bool_t heavyion){fIsHeavyIon=heavyion;if(!fIsHeavyIon){fNCentralityBins=1;}}
50 // Return Reconstructed Gammas
51 TClonesArray *GetReconstructedGammas(){return fConversionGammas;}
52 Int_t GetNReconstructedGammas(){if(fConversionGammas){return fConversionGammas->GetEntriesFast();}else{return 0;}}
54 // Process Gamma Candidates
56 Bool_t IsGammaCandidate(AliConversionPhotonBase *fPhotonCandidate);
57 Bool_t IsMCConversionGammaInAcceptance(TParticle *particle);
61 Bool_t CentralitySelection();
63 Double_t GetCentrality();
64 Bool_t SetEventPlane();
65 AliEventplane *GetEventPlane();
66 AliVTrack *GetTrack(Int_t label);
70 const AliExternalTrackParam *GetExternalTrackParam(Int_t charge);
71 const AliExternalTrackParam *GetExternalTrackParamP(){return GetExternalTrackParam(1);};
72 const AliExternalTrackParam *GetExternalTrackParamN(){return GetExternalTrackParam(-1);};
75 Bool_t GetConversionPoint(const AliExternalTrackParam *pparam,const AliExternalTrackParam *nparam,Double_t convpos[3]);
76 Bool_t GetHelixCenter(const AliExternalTrackParam *track, Double_t b,Int_t charge, Double_t center[2]);
78 Double_t GetMagneticField() const{if(fESDEvent){return fESDEvent->GetMagneticField();}if(fAODEvent){return fAODEvent->GetMagneticField();}return 0;}
81 const AliVertex *GetPrimaryVertex();
83 AliKFParticle *GetPositiveKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
84 AliKFParticle *GetNegativeKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
85 AliKFParticle *GetPositiveKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
86 AliKFParticle *GetNegativeKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
88 Int_t GetNumberOfContributorsVtx();
92 Bool_t EventIsSelected(){return fEventIsSelected;}
93 Bool_t TrackCuts(AliConversionPhotonBase *fPhotonCandidate);
94 Bool_t AcceptanceCuts(AliConversionPhotonBase *fPhotonCandidate);
95 Bool_t AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg);
96 Bool_t dEdxCuts(AliConversionPhotonBase *fPhotonCandidate);
97 Bool_t ArmenterosQtCut(AliConversionPhotonBase *fPhotonCandidate);
98 Bool_t AsymmetryCut(AliConversionPhotonBase *fPhotonCandidate);
99 Bool_t PIDProbabilityCut(AliConversionPhotonBase *fPhotonCandidate);
102 // Set Mass Zero for Gammas
103 void SetGammaMassZero(){fCurrentMotherKFCandidate->E()=fCurrentMotherKFCandidate->GetP();}
108 void SetUseAODConversionPhoton(Bool_t b){if(b){cout<<"Setting Outputformat to AliAODConversionPhoton "<<endl;}else{cout<<"Setting Outputformat to AliKFConversionPhoton "<<endl;};kUseAODConversionPhoton=b;}
110 void SetCreateAODs(Bool_t k){fCreateAOD=k;}
111 void SetDeltaAODFilename(TString s){fDeltaAODFilename=s;}
118 void SetMaxVertexZ(Double_t maxVertexZ){fMaxVertexZ=maxVertexZ;}
120 void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
122 void SetOnFlyFlag(Bool_t flag){fUseOnFlyV0Finder = flag;}
124 void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
125 void SetMinRCut(Double_t minR){fMinR=minR;}
127 void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
129 void SetEtaCutMin(Double_t etaCutMin){fEtaCutMin=etaCutMin;}
131 void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
133 void SetSinglePtCut(Double_t singleptCut){fSinglePtCut=singleptCut;}
135 void SetMaxZCut(Double_t maxZ){fMaxZ=maxZ;}
137 void SetMinClsTPCCut(Double_t minClsTPC){fMinClsTPC=minClsTPC;}
139 void SetMinClsTPCCutToF(Double_t minClsTPCToF){fMinClsTPCToF=minClsTPCToF;}
141 void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}
142 void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}
144 void SetLineCutZRSlopeMin(Double_t LineCutZRSlopeMin){fLineCutZRSlopeMin=LineCutZRSlopeMin;}
145 void SetLineCutZValueMin(Double_t LineCutZValueMin){fLineCutZValueMin=LineCutZValueMin;}
147 void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}
149 void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
151 void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
153 void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
155 void SetPIDnSigmaAboveElectronLine(Double_t nSigmaAbove){fPIDnSigmaAboveElectronLine=nSigmaAbove;}
156 void SetTofPIDnSigmaAboveElectronLine(Double_t nTofSigmaAbove){fTofPIDnSigmaAboveElectronLine=nTofSigmaAbove;} // RRnewTOF
158 void SetPIDnSigmaBelowElectronLine(Double_t nSigmaBelow){fPIDnSigmaBelowElectronLine=nSigmaBelow;}
159 void SetTofPIDnSigmaBelowElectronLine(Double_t nTofSigmaBelow){fTofPIDnSigmaBelowElectronLine=nTofSigmaBelow;} // RRnewTOF
162 * Sets the PIDnSigmaAbovePion cut value for the tracks.
164 void SetPIDnSigmaAbovePionLine(Double_t nSigmaAbovePion){fPIDnSigmaAbovePionLine=nSigmaAbovePion;}
167 * Sets the PIDnSigmaAbovePion cut value for the tracks.
169 void SetPIDnSigmaAbovePionLineHighPt(Double_t nSigmaAbovePionHighPt){fPIDnSigmaAbovePionLineHighPt=nSigmaAbovePionHighPt;}
172 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
174 void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;}
177 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
179 void SetPIDMaxPnSigmaAbovePionLine(Double_t MaxPnSigmaAbovePion){fPIDMaxPnSigmaAbovePionLine=MaxPnSigmaAbovePion;}
182 * Sets the SigmaMassCut value.
184 void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
186 void SetTRDEfficiency(Double_t eff){if(eff<=1&&eff>=0){fPIDTRDEfficiency=eff;}}
187 void SetDoTRDPID(Bool_t doTRD){fDoTRDPID=doTRD;}
189 void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
190 void SetDoTOFsigmaCut( Bool_t doTOFsigmaCut){fDoTOFsigmaCut=doTOFsigmaCut;} //RRnewTOF
191 void SetDoPhotonAsymmetryCut( Bool_t doPhotonAsymmetryCut){fDoPhotonAsymmetryCut=doPhotonAsymmetryCut;}
193 void SetMinPPhotonAsymmetryCut(Double_t minPPhotonAsymmetryCut){fMinPPhotonAsymmetryCut=minPPhotonAsymmetryCut;}
194 void SetMinPhotonAsymmetry(Double_t minPhotonAsymmetry){fMinPhotonAsymmetry=minPhotonAsymmetry;}
196 * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p
198 void SetDoKaonRejectionLowP( Bool_t doKaonRejectionLowP){fDoKaonRejectionLowP=doKaonRejectionLowP;}
200 * Sets the flag to enable/disable the cut dedx N sigma for Proton Rejection at low p
202 void SetDoProtonRejectionLowP( Bool_t doProtonRejectionLowP){fDoProtonRejectionLowP=doProtonRejectionLowP;}
205 * Sets the flag to enable/disable the cut dedx N sigma for Pion Rejection at low p
207 void SetDoPionRejectionLowP( Bool_t doPionRejectionLowP){fDoPionRejectionLowP=doPionRejectionLowP;}
210 * Sets the PIDMinPnSigmaAroundKaon cut value for the tracks.
212 void SetPIDnSigmaAtLowPAroundKaonLine(Double_t nSigmaAtLowPAroundKaon){fPIDnSigmaAtLowPAroundKaonLine =nSigmaAtLowPAroundKaon;}
215 * Sets the PIDMinPnSigmaAroundProton cut value for the tracks.
217 void SetPIDnSigmaAtLowPAroundProtonLine(Double_t nSigmaAtLowPAroundProton){fPIDnSigmaAtLowPAroundProtonLine =nSigmaAtLowPAroundProton;}
220 * Sets the PIDMinPnSigmaAroundPion cut value for the tracks.
222 void SetPIDnSigmaAtLowPAroundPionLine(Double_t nSigmaAtLowPAroundPion){fPIDnSigmaAtLowPAroundPionLine =nSigmaAtLowPAroundPion;}
225 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
227 void SetPIDMinPKaonRejectionLowP(Double_t PIDMinPKaonRejectionLowP ){fPIDMinPKaonRejectionLowP=PIDMinPKaonRejectionLowP;}
230 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
232 void SetPIDMinPProtonRejectionLowP(Double_t PIDMinPProtonRejectionLowP ){fPIDMinPProtonRejectionLowP=PIDMinPProtonRejectionLowP;}
234 * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
236 void SetPIDMinPPionRejectionLowP(Double_t PIDMinPPionRejectionLowP ){fPIDMinPPionRejectionLowP=PIDMinPPionRejectionLowP;}
239 *Set if we want to use Gamma Selection based on Qt from Armenteros
241 void SetDoQtGammaSelection(Bool_t doQtGammaSelection){fDoQtGammaSelection=doQtGammaSelection;}
242 void SetDoHighPtQtGammaSelection(Bool_t doHighPtQtGammaSelection){fDoHighPtQtGammaSelection=doHighPtQtGammaSelection;} // RRnew
244 void SetQtMax(Double_t qtMax){fQtMax=qtMax;}
245 void SetHighPtQtMax(Double_t qtMaxHighPt){fHighPtQtMax=qtMaxHighPt;} // RRnew
246 void SetPtBorderForQt(Double_t ptBorderForQt){fPtBorderForQt=ptBorderForQt;} // RRnew
248 void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
250 void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
253 TClonesArray *fConversionGammas;
254 AliESDEvent *fESDEvent;
255 AliAODEvent *fAODEvent;
258 AliKFConversionPhoton *fCurrentMotherKFCandidate;
259 AliKFParticle *fCurrentPositiveKFParticle;
260 AliKFParticle *fCurrentNegativeKFParticle;
261 Int_t *fCurrentTrackLabels;
262 Int_t fCurrentV0Index;
263 Int_t fNCentralityBins;
264 Int_t fCentralityBin;
265 Bool_t fEventIsSelected;
266 AliConversionAODBGHandlerRP *fBGHandler;
268 Double_t fCentrality;
273 Double_t fMaxVertexZ; // max z vertex cut
275 Double_t fMaxR; //r cut
276 Double_t fMinR; //r cut
277 Double_t fEtaCut; //eta cut
278 Double_t fEtaCutMin; //eta cut
279 Double_t fPtCut; // pt cut
280 Double_t fSinglePtCut; // pt cut for electron/positron
281 Double_t fMaxZ; //z cut
282 Double_t fMinClsTPC; // minimum clusters in the TPC
283 Double_t fMinClsTPCToF; // minimum clusters to findable clusters
284 Double_t fLineCutZRSlope; //linecut
285 Double_t fLineCutZValue; //linecut
286 Double_t fLineCutZRSlopeMin; //linecut
287 Double_t fLineCutZValueMin; //linecut
288 Double_t fChi2CutConversion; //chi2cut
289 Double_t fPIDProbabilityCutNegativeParticle;
290 Double_t fPIDProbabilityCutPositiveParticle;
291 Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
292 Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF
293 Double_t fPIDTRDEfficiency;
295 Double_t fPIDnSigmaAboveElectronLine; // sigma cut
296 Double_t fPIDnSigmaBelowElectronLine; // sigma cut
297 Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF
298 Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF
299 Double_t fPIDnSigmaAbovePionLine; // sigma cut
300 Double_t fPIDnSigmaAbovePionLineHighPt; // sigma cut
301 Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
302 Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
303 Double_t fDoKaonRejectionLowP; // Kaon rejection at low p
304 Double_t fDoProtonRejectionLowP; // Proton rejection at low p
305 Double_t fDoPionRejectionLowP; // Pion rejection at low p
306 Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
307 Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
308 Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
309 Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
310 Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
311 Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
312 Bool_t fDoQtGammaSelection; // Select gammas using qtMax
313 Bool_t fDoHighPtQtGammaSelection; // RRnew Select gammas using qtMax for high pT
314 Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas
315 Double_t fHighPtQtMax; // RRnew Maximum Qt for High pT from Armenteros to select Gammas
316 Double_t fPtBorderForQt; // RRnew
317 Double_t fXVertexCut; //vertex cut
318 Double_t fYVertexCut; //vertex cut
319 Double_t fZVertexCut; // vertexcut
321 Double_t fNSigmaMass; //nsigma cut
323 Bool_t fUseImprovedVertex; //flag
325 Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
327 Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
329 Bool_t fUseEtaMinCut; //flag
331 Bool_t fUseOnFlyV0Finder; //flag
333 Bool_t fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut
334 Double_t fMinPPhotonAsymmetryCut;
335 Double_t fMinPhotonAsymmetry;
337 Bool_t kUseAODConversionPhoton;
341 TString fDeltaAODFilename;
347 TH1F *hV0CurrentFinder;
348 TH2F *hV0AllArmenteros;
350 TH2F *hV0GoodArmenteros;
352 TH1F *hV0CutLikeSign;
355 TH1F *hV0CutMinNclsTPCToF;
357 TH1F *hV0CutNContributors;
360 TH1F *hV0CutdEdxElectron;
361 TH1F *hV0CutdEdxPion;
362 TH1F *hV0CutdEdxKaonLowP;
363 TH1F *hV0CutdEdxProtonLowP;
364 TH1F *hV0CutdEdxPionLowP;
365 TH1F *hV0CutdEdxTOFElectron;
366 TH1F * hV0CutdEdxTRD;
375 TH1F *hV0CutSinglePt;
381 TH1F* hV0CutAsymmetry;
383 TH2F *hMCPtResolution;
385 TH1F **hMCPtRECOTRUE;
387 TH2F *hMCPtResolutionPhi;
388 TH2F *hMCRResolutionvsR;
389 TH2F *hMCZResolutionvsZ;
391 TH2F *hGammadEdxbefore;
392 TH2F *hGammadEdxafter;
393 TH2F *hGammaConversionMapXY;
394 TH2F *hGammaConversionMapZR;
404 ClassDef(AliV0ReaderV1,1)