]>
Commit | Line | Data |
---|---|---|
35e49ca5 | 1 | // |
2 | // Class AliRsnCutRange | |
3 | // | |
4 | // General implementation of cuts which check a value inside a range. | |
5 | // This range can be defined by two integers or two doubles. | |
6 | // A user-friendly enumeration allows to define what is checked. | |
7 | // | |
8 | // authors: Martin Vala (martin.vala@cern.ch) | |
9 | // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
10 | // | |
11 | ||
12 | #ifndef ALIRSNCUTTRACKQUALITY_H | |
13 | #define ALIRSNCUTTRACKQUALITY_H | |
14 | ||
15 | #include <TMath.h> | |
16 | #include <TString.h> | |
17 | ||
18 | #include "AliRsnCut.h" | |
19 | ||
20 | class AliESDtrack; | |
21 | class AliAODTrack; | |
22 | ||
2a1c7696 | 23 | class AliRsnCutTrackQuality : public AliRsnCut { |
24 | public: | |
25 | ||
26 | AliRsnCutTrackQuality(const char *name = "AliRsncutTrackQuality"); | |
61f275d1 | 27 | AliRsnCutTrackQuality(const AliRsnCutTrackQuality ©); |
28 | AliRsnCutTrackQuality &operator=(const AliRsnCutTrackQuality ©); | |
2a1c7696 | 29 | virtual ~AliRsnCutTrackQuality() { } |
30 | ||
31 | void DisableAll(); | |
32 | ||
33 | void AddStatusFlag(ULong_t f, Bool_t on) {if (on) fFlagsOn = fFlagsOn | f; else fFlagsOff = fFlagsOff | f;} | |
34 | void SetStatusFlags(ULong_t f, Bool_t on) {if (on) fFlagsOn = f; else fFlagsOff = f;} | |
35 | void SetPtRange(Double_t a, Double_t b) {fPt[0] = TMath::Min(a, b); fPt[1] = TMath::Max(a, b);} | |
36 | void SetEtaRange(Double_t a, Double_t b) {fEta[0] = TMath::Min(a, b); fEta[1] = TMath::Max(a, b);} | |
37 | ||
38 | void SetDCARPtFormula(const char *formula) {fDCARptFormula = formula; fDCARfixed = kFALSE;} | |
39 | void SetDCARmax(Double_t value) {fDCARmax = value; fDCARptFormula = ""; fDCARfixed = kTRUE;} | |
40 | void SetDCAZPtFormula(const char *formula) {fDCAZptFormula = formula; fDCAZfixed = kFALSE;} | |
41 | void SetDCAZmax(Double_t value) {fDCAZmax = value; fDCAZptFormula = ""; fDCAZfixed = kTRUE;} | |
42 | ||
43 | void SetSPDminNClusters(Int_t value) {fSPDminNClusters = value;} | |
44 | void SetITSminNClusters(Int_t value) {fITSminNClusters = value;} | |
45 | void SetITSmaxChi2(Double_t value) {fITSmaxChi2 = value;} | |
46 | ||
47 | void SetTPCminNClusters(Int_t value) {fTPCminNClusters = value;} | |
48 | void SetTPCmaxChi2(Double_t value) {fTPCmaxChi2 = value;} | |
49 | ||
50 | void SetRejectKinkDaughters(Bool_t yn = kTRUE) {fRejectKinkDaughters = yn;} | |
61f275d1 | 51 | |
f34f960b | 52 | void SetAODTestFilterBit(Int_t value) {fAODTestFilterBit = value;} |
61f275d1 | 53 | |
e5ebff7e | 54 | void SetDefaults2010(); |
2a1c7696 | 55 | |
56 | virtual Bool_t IsSelected(TObject *obj); | |
57 | virtual void Print(const Option_t *option = "") const; | |
58 | ||
59 | protected: | |
60 | ||
f34f960b | 61 | Bool_t CheckESD(AliESDtrack *track); |
62 | Bool_t CheckAOD(AliAODTrack *track); | |
61f275d1 | 63 | const char *Binary(UInt_t number); |
2a1c7696 | 64 | |
65 | ULong_t fFlagsOn; // status flags which must be ON (used AliESDtrack ones, connected with '|') | |
66 | ULong_t fFlagsOff; // status flags which must be OFF (used AliESDtrack ones, connected with '|') | |
67 | Double_t fPt[2]; // pt range | |
68 | Double_t fEta[2]; // eta range | |
69 | Bool_t fRejectKinkDaughters; // switch to kTRUE if daughters of kinks must be rejected | |
70 | ||
71 | Bool_t fDCARfixed; // flag to switch between fixed and pt-dependent DCA cut | |
72 | TString fDCARptFormula; // expression to compute transverse DCA sigma w.r. to pt | |
73 | Double_t fDCARmax; // maximum value for transverse DCA | |
74 | ||
75 | Bool_t fDCAZfixed; // flag to switch between fixed and pt-dependent DCA cut | |
76 | TString fDCAZptFormula; // expression to compute longitudinal DCA sigma w.r. to pt | |
77 | Double_t fDCAZmax; // maximum value for longitudinal DCA | |
78 | ||
79 | Int_t fSPDminNClusters; // minimum number of required clusters in SPD | |
80 | Int_t fITSminNClusters; // minimum number of required clusters in ITS | |
81 | Double_t fITSmaxChi2; // maximum chi2 / number of clusters in ITS | |
82 | ||
83 | Int_t fTPCminNClusters; // minimum number of required clusters in TPC | |
84 | Double_t fTPCmaxChi2; // maximum chi2 / number of clusters in TPC | |
f34f960b | 85 | Int_t fAODTestFilterBit; // test filter bit for AOD tracks |
2a1c7696 | 86 | |
87 | ClassDef(AliRsnCutTrackQuality, 1) | |
35e49ca5 | 88 | }; |
89 | ||
f34f960b | 90 | //__________________________________________________________________________________________________ |
61f275d1 | 91 | inline const char *AliRsnCutTrackQuality::Binary(UInt_t number) |
f34f960b | 92 | { |
93 | // | |
94 | // Convert an integer in binary | |
95 | // | |
96 | ||
61f275d1 | 97 | static char b[50]; |
98 | b[0] = '\0'; | |
f34f960b | 99 | |
61f275d1 | 100 | UInt_t z; |
101 | for (z = 512; z > 0; z >>= 1) | |
102 | strncat(b, ((number & z) == z) ? "1" : "0", 1); | |
f34f960b | 103 | |
61f275d1 | 104 | return b; |
f34f960b | 105 | } |
106 | ||
e5ebff7e | 107 | //__________________________________________________________________________________________________ |
108 | inline void AliRsnCutTrackQuality::SetDefaults2010() | |
109 | { | |
110 | // | |
111 | // Default settings for cuts used in 2010 | |
112 | // | |
113 | ||
114 | AddStatusFlag(AliESDtrack::kTPCin , kTRUE); | |
115 | AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE); | |
116 | AddStatusFlag(AliESDtrack::kITSrefit, kTRUE); | |
117 | SetPtRange(0.15, 1E+20); | |
118 | SetEtaRange(-0.8, 0.8); | |
119 | SetDCARPtFormula("0.0182+0.0350/pt^1.01"); | |
120 | SetDCAZmax(2.0); | |
121 | SetSPDminNClusters(1); | |
122 | SetITSminNClusters(0); | |
123 | SetITSmaxChi2(1E+20); | |
124 | SetTPCminNClusters(70); | |
125 | SetTPCmaxChi2(4.0); | |
126 | SetRejectKinkDaughters(); | |
127 | SetAODTestFilterBit(5); | |
128 | } | |
129 | ||
35e49ca5 | 130 | #endif |