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