]>
Commit | Line | Data |
---|---|---|
9cdd5474 | 1 | #include "AliRsnCutTOFMatch.h" |
2 | ||
3 | ClassImp(AliRsnCutTOFMatch) | |
4 | ||
5 | AliRsnCutTOFMatch::AliRsnCutTOFMatch() : | |
e6952ec7 | 6 | AliRsnCut("cut", AliRsnTarget::kDaughter) |
9cdd5474 | 7 | { |
e6952ec7 | 8 | //Default constructor |
9cdd5474 | 9 | } |
10 | ||
11 | //_________________________________________________________________________________________________ | |
12 | AliRsnCutTOFMatch::AliRsnCutTOFMatch(const char *name) : | |
e6952ec7 | 13 | AliRsnCut(name, AliRsnTarget::kDaughter) |
9cdd5474 | 14 | { |
e6952ec7 | 15 | //main constructor |
9cdd5474 | 16 | } |
17 | ||
18 | //_________________________________________________________________________________________________ | |
19 | Bool_t AliRsnCutTOFMatch::IsSelected(TObject *object) | |
20 | { | |
21 | // | |
22 | // Checks if the track has the status flags required for the TPC-TOF matching | |
23 | // | |
e6952ec7 | 24 | Bool_t accept = kFALSE; |
25 | if (!TargetOK(object)) return accept; | |
26 | ||
27 | AliVTrack *vtrack = fDaughter->Ref2Vtrack(); | |
28 | if (!vtrack) { | |
29 | AliError("Referenced daughter is not a track"); | |
30 | return accept; | |
31 | } | |
32 | if (MatchTOF(vtrack)) accept = kTRUE; | |
33 | return accept; | |
9cdd5474 | 34 | } |
35 | ||
36 | //----------------------------------------------------- | |
37 | inline Bool_t AliRsnCutTOFMatch::MatchTOF(const AliVTrack *vtrack) const | |
38 | { | |
39 | // | |
40 | // Checks if the track has matched the TOF detector | |
41 | // | |
42 | if (!vtrack) { | |
43 | AliWarning("NULL argument: impossible to check status"); | |
44 | return kFALSE; | |
45 | } | |
46 | if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE; | |
47 | if ((vtrack->GetStatus() & AliESDtrack::kTIME ) == 0) return kFALSE; | |
48 | return kTRUE; | |
49 | } |