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