Added new cuts for (TPC pid & TOF match) and (TPC pid & TOF veto) for K* pA analysis
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterLStar2010.cxx
CommitLineData
667cb951 1//
2// All cuts for single protons and kaons in Lambda(1520) analysis 2010,
3// based on track quality and particle identification
4// with TPC and TOF.
5// Author: Serguey Kiselev.
6//
7//
8
9#include <Riostream.h>
10
11#include "AliPID.h"
12#include "AliPIDResponse.h"
13#include "AliRsnCutDaughterLStar2010.h"
14
15ClassImp(AliRsnCutDaughterLStar2010)
16
17//__________________________________________________________________________________________________
18AliRsnCutDaughterLStar2010::AliRsnCutDaughterLStar2010(const char *name, AliPID::EParticleType pid) :
19 AliRsnCut(name, AliRsnTarget::kDaughter),
20 fPID(pid),
21 fCutQuality(Form("%sQuality", name))
22{
23//
24// Constructor
25// Initialize track quality cuts to 2010 defaults
26//
27
28 fCutQuality.SetPtRange(0.15, 1E+20);
29 fCutQuality.SetEtaRange(-0.8, 0.8);
30 fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
31 fCutQuality.SetDCAZmax(2.0);
32 fCutQuality.SetSPDminNClusters(1);
33 fCutQuality.SetITSminNClusters(0);
34 fCutQuality.SetITSmaxChi2(1E+20);
35 fCutQuality.SetTPCminNClusters(70);
36 fCutQuality.SetTPCmaxChi2(4.0);
37 fCutQuality.SetRejectKinkDaughters();
38 fCutQuality.SetAODTestFilterBit(5);
39}
40
41//__________________________________________________________________________________________________
42Bool_t AliRsnCutDaughterLStar2010::IsSelected(TObject *obj)
43{
44//
45// Global check
46//
47
48 // coherence check
49 if (!TargetOK(obj)) return kFALSE;
61f275d1 50
667cb951 51 // check track
52 AliVTrack *track = fDaughter->Ref2Vtrack();
53 if (!track) {
54 if (!fDaughter->GetRef()) AliWarning("NULL ref");
55 return kFALSE;
56 }
61f275d1 57
667cb951 58 // check flags
59 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
60 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
61 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
61f275d1 62
667cb951 63 // quality
64 if (!fCutQuality.IsSelected(obj)) return kFALSE;
61f275d1 65
667cb951 66 // check initialization of PID object
67 AliPIDResponse *pid = fEvent->GetPIDResponse();
68 if (!pid) {
69 AliFatal("NULL PID response");
70 return kFALSE;
71 }
61f275d1 72
667cb951 73 // check if TOF is matched
74 // and computes all values used in the PID cut
75 Bool_t isTOF = MatchTOF(track);
76 Double_t pTPC = track->GetTPCmomentum();
77 Double_t p = track->P();
78 Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
79 Double_t nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, fPID));
80 Double_t maxTPC = 1E20;
81 Double_t maxTOF = 1E20;
61f275d1 82
667cb951 83 // applies the cut differently depending on the PID and the momentum
84 if (isTOF) {
85 // TPC: 5sigma cut for all
86 if (nsTPC > 5.0) return kFALSE;
87 // TOF: 3sigma below 1.5 GeV, 2sigma above
88 if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
89 return (nsTOF <= maxTOF);
90 } else {
61f275d1 91 // TPC:
667cb951 92 // below 350 MeV: 5sigma
93 // between 350 and 500 MeV: 3sigma
94 // pions above 500 MeV: 2sigma
95 // kaons between 500 and 700 MeV: 2sigma
96 // kaons above 700 MeV: rejected
97 // protons above 1200 MeV: rejected
61f275d1 98 if (pTPC <= 0.35)
667cb951 99 maxTPC = 5.0;
100 else if (pTPC <= 0.5)
101 maxTPC = 3.0;
102 else if (pTPC > 0.5 && pTPC <= 0.7 && fPID == AliPID::kKaon)
103 maxTPC = 2.0;
104 else if (pTPC > 0.5 && pTPC <= 1.2 && fPID == AliPID::kProton)
105 maxTPC = 2.0;
106 else
107 return kFALSE;
108 return (nsTPC <= maxTPC);
109 }
110}