2 // Class AliRsnCutDaughterType
4 // General implementation of a single cut strategy, which can be:
5 // - a value contained in a given interval [--> IsBetween() ]
6 // - a value equal to a given reference [--> MatchesValue()]
8 // In all cases, the reference value(s) is (are) given as data members
9 // and each kind of cut requires a given value type (Int, UInt, Double),
10 // but the cut check procedure is then automatized and chosen thanks to
11 // an enumeration of the implemented cut types.
12 // At the end, the user (or any other point which uses this object) has
13 // to use the method IsSelected() to check if this cut has been passed.
15 // authors: Martin Vala (martin.vala@cern.ch)
16 // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
19 #include "AliRsnDaughter.h"
20 #include "AliRsnCutDaughterType.h"
22 ClassImp(AliRsnCutDaughterType)
24 //_________________________________________________________________________________________________
25 AliRsnCutDaughterType::AliRsnCutDaughterType() :
30 // Default constructor.
33 SetTargetType(AliRsnTarget::kDaughter);
36 //_________________________________________________________________________________________________
37 AliRsnCutDaughterType::AliRsnCutDaughterType
38 (const char *name, EType type) :
39 AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
47 //_________________________________________________________________________________________________
48 Bool_t AliRsnCutDaughterType::IsSelected(TObject *object)
55 if (!TargetOK(object, AliRsnTarget::kDaughter)) return kFALSE;
57 // check the daughter according to the selected type
58 // in some cases this means to retrieve the track status
59 AliRsnDaughter *daughter = fDaughter;
60 AliVTrack *track = dynamic_cast<AliVTrack*>(daughter->GetRef());
61 AliESDtrack *esdT = dynamic_cast<AliESDtrack*>(daughter->GetRef());
63 if (track) status = (ULong_t)track->GetStatus();
68 return ((status & AliESDtrack::kTPCin) != 0);
72 UChar_t itsCluMap = track->GetITSClusterMap();
74 for(k = 2; k < 6; k++) if(itsCluMap & (1 << k)) ++nITS;
75 if (nITS < 3) return kFALSE;
77 return ((status & AliESDtrack::kTPCin) == 0 && (status & AliESDtrack::kITSrefit) != 0 && (status & AliESDtrack::kITSpureSA) == 0 && (status & AliESDtrack::kITSpid) != 0);
79 return daughter->IsV0();
81 AliError("No good reference type is chosen. Cut skipped");