2 // Class AliRsnDaughter
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.
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.
12 // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
13 // M. Vala (martin.vala@cern.ch)
16 #ifndef ALIRSNDAUGHTER_H
17 #define ALIRSNDAUGHTER_H
19 #include <TLorentzVector.h>
21 #include "AliESDtrack.h"
22 #include "AliAODTrack.h"
25 #include "AliMCParticle.h"
27 typedef AliPID::EParticleType EPARTYPE;
32 class AliRsnPIDDefESD;
34 class AliRsnDaughter : public TObject
46 AliRsnDaughter(const AliRsnDaughter ©);
47 virtual ~AliRsnDaughter();
48 AliRsnDaughter& operator= (const AliRsnDaughter& copy);
52 void Print(Option_t* const option = "") const;
56 Int_t GetLabel() const {return fLabel;}
57 Bool_t HasFlag(ULong_t flag) const;
58 Bool_t IsOK() const {return fOK;}
59 void SetBad() {fOK = kFALSE;}
60 void SetGood() {fOK = kTRUE;}
61 void SetLabel(Int_t label) {fLabel = label;}
64 TLorentzVector& P(Bool_t mc = kFALSE) {return (mc ? fPMC : fP);}
65 Bool_t SetMass(Double_t mass);
68 Bool_t IsPos() const {return (fRef->Charge() > 0);}
69 Bool_t IsNeg() const {return (fRef->Charge() < 0);}
70 Bool_t IsNeutral() const {return (!IsPos() && !IsNeg());}
71 Bool_t IsSign(Char_t sign) const {if (sign=='+') return IsPos(); else if (sign=='-') return IsNeg(); else return IsNeutral();}
72 Short_t Charge() const {if (IsPos()) return 1 ; else if (IsNeg()) return -1 ; else return 0 ;}
73 Char_t ChargeChar() const {if (IsPos()) return '+'; else if (IsNeg()) return '-'; else return '0';}
75 // MC info & references
76 AliVParticle* GetRef() const {return fRef;}
77 AliMCParticle* GetRefMCtrack() const {return dynamic_cast<AliMCParticle*>(fRef);}
78 AliESDtrack* GetRefESDtrack() const {return dynamic_cast<AliESDtrack*>(fRef);}
79 AliAODTrack* GetRefAODtrack() const {return dynamic_cast<AliAODTrack*>(fRef);}
80 AliESDv0* GetRefESDv0() const {return dynamic_cast<AliESDv0*>(fRef);}
81 AliAODv0* GetRefAODv0() const {return dynamic_cast<AliAODv0*>(fRef);}
82 AliMCParticle* GetRefMC() const {return fRefMC;}
83 TParticle* GetParticle() const {if (fRefMC) return fRefMC->Particle(); else return 0x0;}
84 Int_t GetMotherPDG() const {return fMotherPDG;}
85 Bool_t IsMC() const {if (GetRefMCtrack()) return kTRUE; return kFALSE;}
86 Bool_t IsAOD() const {if (GetRefAODtrack() || GetRefAODv0()) return kTRUE; return kFALSE;}
87 Bool_t IsESD() const {if (GetRefESDtrack() || GetRefESDv0()) return kTRUE; return kFALSE;}
88 Bool_t IsTrack() const {if (GetRefESDtrack() || GetRefAODtrack() || GetRefMCtrack()) return kTRUE; return kFALSE;}
89 Bool_t IsV0() const {if (GetRefESDv0() || GetRefAODv0()) return kTRUE; return kFALSE;}
90 ERefType RefType() const {if (IsTrack()) return kTrack; if (IsV0()) return kV0; return kNoType;}
91 void SetRef(AliVParticle *ref) {fRef = ref;}
92 void SetRefMC(AliMCParticle *refMC) {fRefMC = refMC;}
93 void SetMotherPDG(Int_t value) {fMotherPDG = value;}
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)
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)
104 AliVParticle *fRef; // reference to track in ESD/AOD/MC (all info are taken from this object)
105 AliMCParticle *fRefMC; // reference to corresponding MC particle
107 ClassDef(AliRsnDaughter, 8)