fixing psi in MC from the header
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterSigmaStar2010PP.cxx
CommitLineData
bd74a0e6 1//
2// All cuts for single pions in Sigma* analysis 2010,
3// based on track quality and particle identification
4// with TPC and TOF.
5// Author: Massimo Venaruzzo.
6//
7//
8
9#include <Riostream.h>
10
11#include "AliPID.h"
12#include "AliPIDResponse.h"
13#include "AliRsnCutDaughterSigmaStar2010PP.h"
14
15ClassImp(AliRsnCutDaughterSigmaStar2010PP)
16
17//__________________________________________________________________________________________________
18AliRsnCutDaughterSigmaStar2010PP::AliRsnCutDaughterSigmaStar2010PP(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.SetDCARmax(0.05);
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//__________________________________________________________________________________________________
43Bool_t AliRsnCutDaughterSigmaStar2010PP::IsSelected(TObject *obj)
44{
45//
46// Global check
47//
48
49 // coherence check
50 if (!TargetOK(obj)) return kFALSE;
61f275d1 51
bd74a0e6 52 // check track
53 AliVTrack *track = fDaughter->Ref2Vtrack();
54 if (!track) {
55 if (!fDaughter->GetRef()) AliWarning("NULL ref");
56 return kFALSE;
57 }
61f275d1 58
bd74a0e6 59 // check flags
60 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
61 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
62 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
61f275d1 63
bd74a0e6 64 // quality
65 if (!fCutQuality.IsSelected(obj)) return kFALSE;
61f275d1 66
bd74a0e6 67 // check initialization of PID object
68 AliPIDResponse *pid = fEvent->GetPIDResponse();
69 if (!pid) {
70 AliFatal("NULL PID response");
71 return kFALSE;
72 }
61f275d1 73
bd74a0e6 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 = TMath::Abs(pid->NumberOfSigmasTOF(track, fPID));
81 //*Double_t maxTPC = 1E20;
82 //Double_t maxTOF = 1E20;
61f275d1 83
bd74a0e6 84 // applies the cut differently depending on the PID and the momentum
85 //if (isTOF) {
61f275d1 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);
bd74a0e6 91 //} else {
61f275d1 92
bd74a0e6 93 //For the moment TOF is not used - PID ONLY WITH TPC - 3 sigmas in the whole range
61f275d1 94
95 // TPC:
96 // below 350 MeV: 5sigma
97 // between 350 and 500 MeV: 3sigma
98 // pions above 500 MeV: 2sigma
99 // kaons between 500 and 700 MeV: 2sigma
100 // kaons above 700 MeV: rejected
101 /*if (pTPC <= 0.35)
102 maxTPC = 5.0;
103 else if (pTPC <= 0.5)
104 maxTPC = 3.0;
105 else if (pTPC > 0.5 && fPID == AliPID::kPion)
106 maxTPC = 2.0;
107 else if (pTPC > 0.5 && pTPC <= 0.7 && fPID == AliPID::kKaon)
108 maxTPC = 2.0;
109 else
110 return kFALSE;*/
111 //* maxTPC = 3.0;
112 //*return (nsTPC <= maxTPC);
113
bd74a0e6 114 AliDebugClass(2, "Good Pion (hallelujah)");
115 return kTRUE;
61f275d1 116}