]>
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 ALIRSNCUTPIDTOF_H | |
13 | #define ALIRSNCUTPIDTOF_H | |
14 | ||
15 | #include "AliPID.h" | |
80e49c8b | 16 | |
17 | #include "AliVTrack.h" | |
18 | #include "AliESDtrack.h" | |
35e49ca5 | 19 | #include "AliESDpid.h" |
80e49c8b | 20 | #include "AliAODTrack.h" |
35e49ca5 | 21 | #include "AliAODpidUtil.h" |
22 | ||
80e49c8b | 23 | #include "AliRsnDaughter.h" |
35e49ca5 | 24 | #include "AliRsnCut.h" |
25 | ||
2a1c7696 | 26 | class AliRsnCutPIDTOF : public AliRsnCut { |
27 | public: | |
28 | ||
29 | AliRsnCutPIDTOF(const char *name = "cutTOF", | |
30 | EPARTYPE particle = AliPID::kKaon, | |
31 | Double_t nSigmaMin = -3., | |
32 | Double_t nSigmaMax = 3., | |
33 | Bool_t rejectUnmatched = kFALSE); | |
34 | ||
35 | AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy); | |
36 | AliRsnCutPIDTOF& operator=(const AliRsnCutPIDTOF& copy); | |
37 | virtual ~AliRsnCutPIDTOF() { } | |
38 | ||
39 | AliESDpid* ESDpid() {return &fESDpid;} | |
40 | AliAODpidUtil* AODpid() {return &fAODpid;} | |
41 | ||
42 | void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;} | |
43 | void SetNSigmaRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max;} | |
44 | void SetRefType(EPARTYPE type) {fRefType = type; fRefMass = AliPID::ParticleMass(type);} | |
45 | ||
46 | Bool_t IsMatched(AliVTrack *vtrack); | |
47 | virtual Bool_t IsSelected(TObject *object); | |
48 | virtual void Print(const Option_t *option = "") const; | |
49 | ||
50 | private: | |
51 | ||
52 | void Initialize(); | |
53 | ||
54 | Bool_t fInitialized; // a mono-usage flag which initializes the ESD pid object | |
55 | Bool_t fRejectUnmatched; // decide if non TOF matched tracks pass the cut or not | |
56 | EPARTYPE fRefType; // particle type for which PID is checked | |
57 | Double_t fRefMass; // reference mass used for computations | |
58 | AliESDpid fESDpid; // PID utility for ESD | |
59 | AliAODpidUtil fAODpid; // PID utility for AOD | |
60 | ||
61 | ClassDef(AliRsnCutPIDTOF, 1) | |
35e49ca5 | 62 | }; |
63 | ||
80e49c8b | 64 | inline Bool_t AliRsnCutPIDTOF::IsMatched(AliVTrack *vtrack) |
65 | { | |
66 | // | |
67 | // Checks if the track has the status flags required for an ITS standalone track | |
68 | // | |
69 | ||
2a1c7696 | 70 | if (!vtrack) { |
71 | AliWarning("NULL argument: impossible to check status"); | |
72 | return kFALSE; | |
73 | } | |
80e49c8b | 74 | |
2a1c7696 | 75 | Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0); |
76 | Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0); | |
80e49c8b | 77 | |
2a1c7696 | 78 | // if flags are not set, track is not matched |
79 | if (!isTOFout || !isTIME) return kFALSE; | |
80e49c8b | 80 | |
2a1c7696 | 81 | // do an additional check on integrated length for ESD tracks |
82 | AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(vtrack); | |
83 | if (esdTrack) if (esdTrack->GetIntegratedLength() < 350.) return kFALSE; | |
80e49c8b | 84 | |
2a1c7696 | 85 | // if we are here, flags are OK and length also |
86 | return kTRUE; | |
80e49c8b | 87 | } |
88 | ||
35e49ca5 | 89 | #endif |