1 #ifndef ALICONVERSIONCUTS_H
2 #define ALICONVERSIONCUTS_H
4 // Class handling all kinds of selection cuts for Gamma Conversion analysis
5 // Authors: Svein Lindal, Daniel Lohner *
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"
15 #include "AliAnalysisCuts.h"
20 class AliConversionPhotonBase;
25 class AliAnalysisCuts;
28 class AliAnalysisManager;
32 class AliConversionCuts : public AliAnalysisCuts {
53 kpiMaxMomdedxSigmaCut,
54 kLowPRejectionSigmaCut,
59 kdoPhotonAsymmetryCut,
78 Bool_t SetCutIds(TString cutString);
80 Bool_t SetCut(cutIds cutID, Int_t cut);
81 Bool_t UpdateCutString();
84 static const char * fgkCutNames[kNCuts];
86 Double_t GetCosineOfPointingAngle(const AliConversionPhotonBase * photon, AliVEvent * event) const;
89 Bool_t InitializeCutsFromCutString(const TString analysisCutSelection);
90 void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) {fOfflineTriggerMask = offlineTriggerMask;}
91 void FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0);
92 void SetAcceptedHeader(TList *HeaderList){fHeaderList = HeaderList;}
93 TString *GetFoundHeader(){return fGeneratorNames;}
95 Int_t GetEventQuality(){return fEventQuality;}
96 Bool_t GetIsFromPileup(){return fRemovePileUp;}
98 AliConversionCuts(const char *name="V0Cuts", const char * title="V0 Cuts");
99 AliConversionCuts(const AliConversionCuts&);
100 AliConversionCuts& operator=(const AliConversionCuts&);
102 virtual ~AliConversionCuts(); //virtual destructor
104 static AliConversionCuts * GetStandardCuts2010PbPb();
105 static AliConversionCuts * GetStandardCuts2010pp();
107 virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;}
108 virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
110 TString GetCutNumber();
112 void GetCentralityRange(Double_t range[2]){range[0]=10*fCentralityMin;range[1]=10*fCentralityMax;};
115 Bool_t EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent);
116 Int_t IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon);
117 Bool_t PhotonIsSelected(AliConversionPhotonBase * photon, AliVEvent * event);
118 Bool_t PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma=kTRUE);
119 Bool_t ElectronIsSelectedMC(TParticle *particle,AliStack *fMCStack);
120 Bool_t TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack);
121 Bool_t MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal=kTRUE);
122 Bool_t MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Bool_t bMCDaughtersInAcceptance=kFALSE);
124 void InitAODpidUtil(Int_t type);
125 Bool_t InitPIDResponse();
127 void SetPIDResponse(AliPIDResponse * pidResponse) {fPIDResponse = pidResponse;}
128 AliPIDResponse * GetPIDResponse() { return fPIDResponse;}
132 void InitCutHistograms(TString name="",Bool_t preCut = kTRUE);
133 void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};}
134 TList *GetCutHistograms(){return fHistograms;}
135 void FillPhotonCutIndex(Int_t photoncut){if(hCutIndex)hCutIndex->Fill(photoncut);}
137 static AliVTrack * GetTrack(AliVEvent * event, Int_t label);
138 static AliESDtrack *GetESDTrack(AliESDEvent * event, Int_t label);
141 Bool_t SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex);
142 Bool_t SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex);
143 Bool_t AcceptanceCuts(AliConversionPhotonBase *photon);
144 Bool_t AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg);
145 Bool_t dEdxCuts(AliVTrack * track);
146 Bool_t ArmenterosQtCut(AliConversionPhotonBase *photon);
147 Bool_t AsymmetryCut(AliConversionPhotonBase *photon,AliVEvent *event);
148 Bool_t PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event);
149 Bool_t SelectV0Finder(Bool_t onfly){
150 if(onfly == fUseOnFlyV0Finder) return kTRUE;
153 Bool_t PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event);
154 Bool_t CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event);
155 Bool_t PsiPairCut(const AliConversionPhotonBase * photon) const;
156 Bool_t CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const;
157 Bool_t RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s);
158 Bool_t RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0);
159 Int_t IsParticleFromBGEvent(Int_t index, AliStack *MCStack);
160 void GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliMCEvent *MCEvent);
163 Bool_t IsCentralitySelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent = NULL);
164 Double_t GetCentrality(AliVEvent *event);
165 Int_t GetNumberOfContributorsVtx(AliVEvent *event);
166 Bool_t VertexZCut(AliVEvent *fInputEvent);
167 Bool_t IsTriggerSelected();
168 Bool_t HasV0AND(){return fHasV0AND;}
169 Bool_t IsSDDFired(){return fIsSDDFired;}
170 Int_t IsSpecialTrigger(){return fSpecialTrigger;}
172 // Set Individual Cuts
173 Bool_t SetRCut(Int_t RCut);
174 Bool_t SetV0Finder(Int_t v0FinderType);
175 Bool_t SetChi2GammaCut(Int_t chi2GammaCut);
176 Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut);
177 Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut);
178 Bool_t SetSinglePtCut(Int_t singlePtCut);
179 Bool_t SetTPCClusterCut(Int_t clsTPCCut);
180 Bool_t SetEtaCut(Int_t etaCut);
181 Bool_t SetMinMomPiondEdxCut(Int_t piMinMomdedxSigmaCut);
182 Bool_t SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut);
183 Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut);
184 Bool_t SetQtMaxCut(Int_t QtMaxCut);
185 Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID);
186 Bool_t SetTRDElectronCut(Int_t TRDElectronCut);
187 Bool_t SetCentralityMin(Int_t useCentrality);
188 Bool_t SetIsHeavyIon(Int_t isHeavyIon);
189 Bool_t SetCentralityMax(Int_t centralityBin);
190 Bool_t SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut);
191 Bool_t SetRemovePileUp(Int_t removePileUp);
192 Bool_t SetMultiplicityMethod(Int_t multiplicityMethod);
193 Int_t SetSelectSpecialTrigger(Int_t selectSpecialTrigger);
194 Bool_t SetCosPAngleCut(Int_t cosCut);
195 Bool_t SetPsiPairCut(Int_t psiCut);
196 Bool_t SetSharedElectronCut(Int_t sharedElec);
197 Bool_t SetToCloseV0sCut(Int_t toClose);
198 Bool_t SetRejectExtraSignalsCut(Int_t extraSignal);
201 Bool_t IsHeavyIon(){return fIsHeavyIon;}
202 Int_t GetFirstTPCRow(Double_t radius);
203 Float_t GetWeightForMeson(TString period, Int_t index, AliStack *MCStack);
205 Bool_t UseElecSharingCut(){return fDoSharedElecCut;}
206 Bool_t UseToCloseV0sCut(){return fDoToCloseV0sCut;}
207 Int_t GetMultiplicityMethod(){return fMultiplicityMethod;}
208 Double_t GetEtaCut(){return fEtaCut;}
209 Int_t GetSignalRejection(){return fRejectExtraSignals;}
210 Int_t GetNAcceptedHeaders(){return fnHeaders; }
211 TString * GetAcceptedHeaderNames(){return fGeneratorNames;}
212 Int_t * GetAcceptedHeaderStart(){return fNotRejectedStart;}
213 Int_t * GetAcceptedHeaderEnd(){return fNotRejectedEnd;}
214 TList* GetAcceptedHeader(){return fHeaderList;}
219 AliPIDResponse *fPIDResponse;
222 Int_t fEventQuality; // EventQuality
224 Double_t fMaxR; //r cut
225 Double_t fMinR; //r cut
226 Double_t fEtaCut; //eta cut
227 Double_t fEtaCutMin; //eta cut
228 Double_t fPtCut; // pt cut
229 Double_t fSinglePtCut; // pt cut for electron/positron
230 Double_t fMaxZ; //z cut
231 Double_t fMinClsTPC; // minimum clusters in the TPC
232 Double_t fMinClsTPCToF; // minimum clusters to findable clusters
233 Double_t fLineCutZRSlope; //linecut
234 Double_t fLineCutZValue; //linecut
235 Double_t fLineCutZRSlopeMin; //linecut
236 Double_t fLineCutZValueMin; //linecut
237 Double_t fChi2CutConversion; //chi2cut
238 Double_t fPIDProbabilityCutNegativeParticle;
239 Double_t fPIDProbabilityCutPositiveParticle;
240 Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
241 Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF
242 Double_t fPIDTRDEfficiency; // required electron efficiency for TRD PID
243 Bool_t fDoTRDPID; // flag to use TRD pid
244 Double_t fPIDnSigmaAboveElectronLine; // sigma cut
245 Double_t fPIDnSigmaBelowElectronLine; // sigma cut
246 Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF
247 Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF
248 Double_t fPIDnSigmaAbovePionLine; // sigma cut
249 Double_t fPIDnSigmaAbovePionLineHighPt; // sigma cut
250 Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
251 Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
252 Double_t fDoKaonRejectionLowP; // Kaon rejection at low p
253 Double_t fDoProtonRejectionLowP; // Proton rejection at low p
254 Double_t fDoPionRejectionLowP; // Pion rejection at low p
255 Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
256 Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
257 Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
258 Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
259 Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
260 Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
261 Bool_t fDoQtGammaSelection; // Select gammas using qtMax
262 Bool_t fDoHighPtQtGammaSelection; // RRnew Select gammas using qtMax for high pT
263 Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas
264 Double_t fHighPtQtMax; // RRnew Maximum Qt for High pT from Armenteros to select Gammas
265 Double_t fPtBorderForQt; // RRnew
266 Double_t fXVertexCut; //vertex cut
267 Double_t fYVertexCut; //vertex cut
268 Double_t fZVertexCut; // vertexcut
269 Double_t fNSigmaMass; //nsigma cut
270 Bool_t fUseEtaMinCut; //flag
271 Bool_t fUseOnFlyV0Finder; //flag
272 Bool_t fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut
273 Double_t fMinPPhotonAsymmetryCut; // Min Momentum for Asymmetry Cut
274 Double_t fMinPhotonAsymmetry; // Asymmetry Cut
275 Bool_t fIsHeavyIon; // flag for heavy ion
276 Int_t fDetectorCentrality; // centrality detecotor V0M or CL1
277 Int_t fModCentralityClass; // allows to select smaller centrality classes
278 Double_t fMaxVertexZ; // max z offset of vertex
279 Int_t fCentralityMin; // centrality selection lower bin value
280 Int_t fCentralityMax; // centrality selection upper bin value
281 Bool_t fUseCorrectedTPCClsInfo; // flag to use corrected tpc cl info
282 Bool_t fUseTOFpid; // flag to use tof pid
283 Int_t fMultiplicityMethod; // selected multiplicity method
284 Int_t fSpecialTrigger; // flag
285 Bool_t fRemovePileUp; //flag
286 Float_t fOpeningAngle; // min opening angle for meson
288 Float_t fCosPAngleCut;
289 Bool_t fDoToCloseV0sCut; //
290 Int_t fRejectExtraSignals;//
291 Double_t fminV0Dist; //
292 Bool_t fDoSharedElecCut; //
293 UInt_t fOfflineTriggerMask; // Task processes collision candidates only
294 Bool_t fHasV0AND; // V0AND Offline Trigger
295 Bool_t fIsSDDFired; // SDD FIRED to select with SDD events
297 Int_t fElectronArraySize; // Size of electron array
298 Int_t *fElectronLabelArray; //[fElectronArraySize]
299 Float_t fConversionPointXArray; // Array with conversion Point x
300 Float_t fConversionPointYArray; // Array with conversion Point y
301 Float_t fConversionPointZArray; // Array with conversion Point z
302 Int_t fnHeaders; // Number of Headers
303 Int_t *fNotRejectedStart; //[fnHeaders]
304 Int_t *fNotRejectedEnd; //[fnHeaders]
305 TString *fGeneratorNames; //[fnHeaders]
310 TObjString *fCutString; // cut number used for analysis
311 TH1F *hdEdxCuts; // bookkeeping for dEdx cuts
312 TH2F *hTPCdEdxbefore; // TPC dEdx before cuts
313 TH2F *hTPCdEdxafter; // TPC dEdx after cuts
314 TH2F *hTPCdEdxSigbefore; // TPC Sigma dEdx before cuts
315 TH2F *hTPCdEdxSigafter; // TPC Sigm dEdx after cuts
316 TH2F *hTOFbefore; // TOF before cuts
317 TH2F *hTOFSigbefore; // TOF Sigma before cuts
318 TH2F *hTOFSigafter; // TOF Sigma after cuts
319 TH1F *hTrackCuts; // bookkeeping for track cuts
320 TH1F *hPhotonCuts; // bookkeeping for photon specific cuts
321 TH1F *hInvMassbefore; // e+e- inv mass distribution before cuts
322 TH2F *hArmenterosbefore; // armenteros podolanski plot before cuts
323 TH1F *hInvMassafter; // e+e- inv mass distribution after cuts
324 TH2F *hArmenterosafter; // armenteros podolanski plot after cuts
325 TH1F *hAcceptanceCuts; // bookkeeping for acceptance cuts
326 TH1F *hCutIndex; // bookkeeping for cuts
327 TH1F *hV0EventCuts; // bookkeeping for event selection cuts
328 TH1F *hCentrality; // centrality distribution for selected events
329 TH1F *hVertexZ; // vertex z distribution for selected events
330 TH1F *hTriggerClass; //fired offline trigger class
331 TH1F *hTriggerClassSelected; //selected fired offline trigger class
334 ClassDef(AliConversionCuts,3)
338 inline void AliConversionCuts::InitAODpidUtil(Int_t type) {
339 if (!fPIDResponse) fPIDResponse = new AliAODpidUtil();
340 Double_t alephParameters[5];
342 alephParameters[0] = 2.15898e+00/50.;
343 alephParameters[1] = 1.75295e+01;
344 alephParameters[2] = 3.40030e-09;
345 alephParameters[3] = 1.96178e+00;
346 alephParameters[4] = 3.91720e+00;
347 fPIDResponse->GetTOFResponse().SetTimeResolution(80.);
351 alephParameters[0] = 0.0283086/0.97;
352 alephParameters[1] = 2.63394e+01;
353 alephParameters[2] = 5.04114e-11;
354 alephParameters[3] = 2.12543e+00;
355 alephParameters[4] = 4.88663e+00;
356 fPIDResponse->GetTOFResponse().SetTimeResolution(130.);
357 fPIDResponse->GetTPCResponse().SetMip(50.);
360 fPIDResponse->GetTPCResponse().SetBetheBlochParameters(
361 alephParameters[0],alephParameters[1],alephParameters[2],
362 alephParameters[3],alephParameters[4]);
364 fPIDResponse->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04);