]>
Commit | Line | Data |
---|---|---|
e2bafbbc | 1 | // |
06351446 | 2 | // Class AliRsnDaughter |
3 | // | |
a378358c | 4 | // Interface to candidate daughters of a resonance (tracks or V0s). |
5 | // It contains two pointers to two AliVParticle-derived objects. | |
5eb970a4 | 6 | // for the computations required during resonance analysis. |
7 | // --- | |
8 | // Since the package revision, this object is not supposed to be stacked in memory | |
9 | // but created "on fly" during analysis and used just for computations, as an interface. | |
c37c6481 | 10 | // |
e0baff8c | 11 | // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it) |
12 | // M. Vala (martin.vala@cern.ch) | |
e2bafbbc | 13 | // |
a62a2d82 | 14 | |
15 | #ifndef ALIRSNDAUGHTER_H | |
16 | #define ALIRSNDAUGHTER_H | |
17 | ||
2dab9030 | 18 | #include <TLorentzVector.h> |
7c2974c8 | 19 | |
4fbb2459 | 20 | #include "AliESDtrack.h" |
2dab9030 | 21 | #include "AliESDv0.h" |
32992791 | 22 | #include "AliESDcascade.h" |
4fbb2459 | 23 | #include "AliMCParticle.h" |
a378358c | 24 | |
25 | #include "AliAODTrack.h" | |
26 | #include "AliAODv0.h" | |
32992791 | 27 | #include "AliAODcascade.h" |
ec927a7d | 28 | #include "AliAODMCParticle.h" |
a62a2d82 | 29 | |
2dab9030 | 30 | typedef AliPID::EParticleType EPARTYPE; |
31 | ||
2a1c7696 | 32 | class AliRsnDaughter : public TObject { |
33 | public: | |
34 | ||
35 | enum ERefType { | |
2dab9030 | 36 | kTrack = 0, |
37 | kV0, | |
32992791 | 38 | kCascade, |
2dab9030 | 39 | kNoType |
2a1c7696 | 40 | }; |
41 | ||
42 | AliRsnDaughter(); | |
43 | AliRsnDaughter(const AliRsnDaughter ©); | |
44 | AliRsnDaughter& operator= (const AliRsnDaughter& copy); | |
45 | virtual ~AliRsnDaughter() { /*nothing*/ } | |
46 | ||
47 | // basic getters (for data members) | |
48 | Bool_t IsOK() const {return fOK;} | |
49 | Int_t GetLabel() const {return fLabel;} | |
50 | Int_t GetMotherPDG() const {return fMotherPDG;} | |
51 | TLorentzVector& Prec() {return fPrec;} | |
52 | TLorentzVector& Psim() {return fPsim;} | |
53 | TLorentzVector& P(Bool_t mc = kFALSE) {return (mc ? fPsim : fPrec);} | |
54 | AliVParticle* GetRef() {return fRef;} | |
55 | AliVParticle* GetRefMC() {return fRefMC;} | |
56 | ||
57 | // basic setters (for data members) | |
58 | void SetBad() {fOK = kFALSE;} | |
59 | void SetGood() {fOK = kTRUE;} | |
60 | void SetLabel(Int_t label) {fLabel = label;} | |
61 | void SetMotherPDG(Int_t value) {fMotherPDG = value;} | |
62 | void SetRef(AliVParticle *p) {fRef = p;} | |
63 | void SetRefMC(AliVParticle *p = 0x0) {fRefMC = p;} | |
64 | ||
65 | // charge checkers | |
66 | Bool_t IsPos() const {return (fRef->Charge() > 0);} | |
67 | Bool_t IsNeg() const {return (fRef->Charge() < 0);} | |
68 | Bool_t IsNeutral() const {return (!IsPos() && !IsNeg());} | |
69 | Bool_t IsSign(Char_t sign) const {if (sign == '+') return IsPos(); else if (sign == '-') return IsNeg(); else return IsNeutral();} | |
70 | Short_t Charge() const {if (IsPos()) return 1 ; else if (IsNeg()) return -1 ; else return 0 ;} | |
71 | Char_t ChargeChar() const {if (IsPos()) return '+'; else if (IsNeg()) return '-'; else return '0';} | |
72 | ||
73 | // utilities | |
74 | void Reset(); | |
75 | Int_t GetPDG(Bool_t abs = kTRUE); | |
76 | Int_t GetID(); | |
77 | Bool_t HasFlag(ULong_t flag); | |
78 | Bool_t SetMass(Double_t mass); | |
79 | Bool_t IsKinkDaughter(); | |
80 | ||
81 | // getters which automatically convert refs into allowed types | |
82 | AliESDtrack* GetRefESDtrack() {return dynamic_cast<AliESDtrack*>(fRef);} | |
83 | AliESDv0* GetRefESDv0() {return dynamic_cast<AliESDv0*>(fRef);} | |
84 | AliESDcascade* GetRefESDcascade() {return dynamic_cast<AliESDcascade*>(fRef);} | |
85 | AliAODTrack* GetRefAODtrack() {return dynamic_cast<AliAODTrack*>(fRef);} | |
86 | AliAODv0* GetRefAODv0() {return dynamic_cast<AliAODv0*>(fRef);} | |
87 | AliAODcascade* GetRefAODcascade() {return dynamic_cast<AliAODcascade*>(fRef);} | |
88 | AliMCParticle* GetRefMCtrack() {return dynamic_cast<AliMCParticle*>(fRef);} | |
89 | AliMCParticle* GetRefMCESD() {return dynamic_cast<AliMCParticle*>(fRefMC);} | |
90 | AliAODMCParticle* GetRefMCAOD() {return dynamic_cast<AliAODMCParticle*>(fRefMC);} | |
91 | ||
92 | // check the input type | |
93 | Bool_t IsMC() {if (GetRefMCtrack()) return kTRUE; return kFALSE;} | |
94 | Bool_t IsAOD() {if (GetRefAODtrack() || GetRefAODv0()) return kTRUE; return kFALSE;} | |
95 | Bool_t IsESD() {if (GetRefESDtrack() || GetRefESDv0()) return kTRUE; return kFALSE;} | |
96 | Bool_t IsTrack() {if (GetRefESDtrack() || GetRefAODtrack() || GetRefMCtrack()) return kTRUE; return kFALSE;} | |
97 | Bool_t IsV0() {if (GetRefESDv0() || GetRefAODv0()) return kTRUE; return kFALSE;} | |
98 | Bool_t IsCascade() {if (GetRefESDcascade() || GetRefAODcascade()) return kTRUE; return kFALSE;} | |
99 | ERefType RefType() {if (IsTrack()) return kTrack; if (IsV0()) return kV0; if (IsCascade()) return kCascade; return kNoType;} | |
100 | ||
101 | private: | |
102 | ||
103 | Bool_t fOK; // internal utility flag which is kFALSE when this object should not be used | |
104 | Int_t fLabel; // GEANT label of corresponding MC | |
105 | Int_t fMotherPDG; // PDG code of mother (makes sense only if fRefMC is defined) | |
106 | ||
107 | TLorentzVector fPrec; // 4-vector filled with track info from default ref (if present) | |
108 | TLorentzVector fPsim; // 4-vector filled with track info from MC ref (if present) | |
109 | ||
110 | AliVParticle *fRef; // reference to reconstructed track in ESD/AOD | |
111 | AliVParticle *fRefMC; // reference to corresponding MC particle | |
112 | ||
113 | ClassDef(AliRsnDaughter, 8) | |
a62a2d82 | 114 | }; |
115 | ||
116 | #endif |