]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx
For backward compatibility changed the method AliVTrack::GetIntegratedTimes(double...
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterKStar2010PP.cxx
1 //
2 // All cuts for single pions in phi 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 "AliRsnCutDaughterKStar2010PP.h"
14
15 ClassImp(AliRsnCutDaughterKStar2010PP)
16
17 //__________________________________________________________________________________________________
18 AliRsnCutDaughterKStar2010PP::AliRsnCutDaughterKStar2010PP(const char *name, AliPID::EParticleType pid) :
19    AliRsnCut(name, AliRsnTarget::kDaughter),
20    fNoPID(kFALSE),
21    fPID(pid),
22    fCutQuality(Form("%sQuality", name))
23 {
24 //
25 // Constructor
26 // Initialize track quality cuts to 2010 defaults
27 //
28
29    fCutQuality.SetPtRange(0.15, 1E+20);
30    fCutQuality.SetEtaRange(-0.8, 0.8);
31    fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
32    fCutQuality.SetDCAZmax(2.0);
33    fCutQuality.SetSPDminNClusters(1);
34    fCutQuality.SetITSminNClusters(0);
35    fCutQuality.SetITSmaxChi2(1E+20);
36    fCutQuality.SetTPCminNClusters(70);
37    fCutQuality.SetTPCmaxChi2(4.0);
38    fCutQuality.SetRejectKinkDaughters();
39    fCutQuality.SetAODTestFilterBit(5);
40 }
41
42 //__________________________________________________________________________________________________
43 Bool_t AliRsnCutDaughterKStar2010PP::IsSelected(TObject *obj)
44 {
45 //
46 // Global check
47 //
48
49    // coherence check
50    if (!TargetOK(obj)) return kFALSE;
51
52    // check track
53    AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef());
54    if (!track) return kFALSE;
55
56    // check flags
57    if ((track->GetStatus() & AliESDtrack::kTPCin   ) == 0) return kFALSE;
58    if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
59    if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
60
61    // quality
62    if (!fCutQuality.IsSelected(obj)) return kFALSE;
63
64    // if no PID is required, accept
65    if (fNoPID) return kTRUE;
66
67    // check initialization of PID object
68    AliPIDResponse *pid = fEvent->GetPIDResponse();
69    if (!pid) {
70       AliFatal("NULL PID response");
71       return kFALSE;
72    }
73
74    // check if TOF is matched
75    // and computes all values used in the PID cut
76    Bool_t   isTOF  = MatchTOF(track);
77    Double_t pTPC   = track->GetTPCmomentum();
78    Double_t p      = track->P();
79    Double_t nsTPC  = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
80    Double_t nsTOF  = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20;
81    Double_t maxTPC = 1E20;
82    Double_t maxTOF = 1E20;
83
84    // applies the cut differently depending on the PID and the momentum
85    if (isTOF) {
86       // TPC: 5sigma cut for all
87       if (nsTPC > 5.0) return kFALSE;
88       // TOF: 3sigma below 1.5 GeV, 2sigma above
89       if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
90       return (nsTOF <= maxTOF);
91    } else {
92       // TPC:
93       // all   below   350         MeV: 5sigma
94       // all   between 350 and 500 MeV: 3sigma
95       // pions above   500         MeV: 2sigma
96       // kaons between 500 and 700 MeV: 2sigma
97       // kaons above   700         MeV: rejected
98       if (pTPC <= 0.35)
99          maxTPC = 5.0;
100       else if (pTPC > 0.35 && pTPC <= 0.5)
101          maxTPC = 3.0;
102       else {
103          if (fPID == AliPID::kPion)
104             maxTPC = 2.0;
105          else if (fPID == AliPID::kKaon) {
106             if (pTPC <= 0.7)
107                maxTPC = 2.0;
108             else
109                return kFALSE;
110          }
111       }
112       return (nsTPC <= maxTPC);
113    }
114 }