2 // Class AliRsnDaughter
4 // Light-weight AOD object which contains all required track details
5 // which are used for resonance analysis.
6 // Provides converters from all kinds of input track type: ESD, AOD and MC.
8 // author: A. Pulvirenti --- email: alberto.pulvirenti@ct.infn.it
11 #ifndef ALIRSNDAUGHTER_H
12 #define ALIRSNDAUGHTER_H
16 #include "AliVParticle.h"
17 #include "AliRsnPID.h"
27 class AliRsnDaughter : public AliVParticle
40 AliRsnDaughter (const AliRsnDaughter ©);
41 AliRsnDaughter (AliESDtrack *track, Bool_t useTPCInnerParam = kFALSE);
42 AliRsnDaughter (AliAODTrack *track);
43 AliRsnDaughter (AliMCParticle *track);
44 virtual ~AliRsnDaughter();
45 AliRsnDaughter& operator= (const AliRsnDaughter& copy);
48 virtual Double_t E() const {return TMath::Sqrt (fMass*fMass + P2());}
49 virtual Double_t E(Double_t mass) {SetM(mass); return E();}
50 virtual Double_t M() const {return fMass;}
51 virtual Double_t P2() const {return Px()*Px() + Py()*Py() + Pz()*Pz();}
52 virtual Double_t P() const {return TMath::Sqrt (P2());}
53 virtual Double_t Px() const {return fP[0];}
54 virtual Double_t Py() const {return fP[1];}
55 virtual Double_t Pz() const {return fP[2];}
56 virtual Double_t Pt() const {return TMath::Sqrt (Px()*Px() + Py()*Py());}
57 virtual Double_t OneOverPt() const {return 1.0 / Pt();}
58 virtual Bool_t PxPyPz (Double_t p[3]) const {p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE;}
59 void SetPx (Double_t value) {fP[0] = value;}
60 void SetPy (Double_t value) {fP[1] = value;}
61 void SetPz (Double_t value) {fP[2] = value;}
62 void SetP (Double_t px, Double_t py, Double_t pz) {SetPx (px); SetPy (py); SetPz (pz);}
63 void SetM (Double_t m) {fMass = m;}
66 virtual Double_t Xv() const {return fV[0];}
67 virtual Double_t Yv() const {return fV[1];}
68 virtual Double_t Zv() const {return fV[2];}
69 virtual Double_t Dr() const {return TMath::Sqrt (Xv()*Xv() + Yv()*Yv());}
70 virtual Bool_t XvYvZv (Double_t x[3]) const {x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE;}
71 void SetVx (Double_t value) {fV[0] = value;}
72 void SetVy (Double_t value) {fV[1] = value;}
73 void SetVz (Double_t value) {fV[2] = value;}
74 void SetV (Double_t vx, Double_t vy, Double_t vz) {SetVx (vx); SetVy (vy); SetVz (vz);}
77 virtual Double_t Phi() const {return TMath::ATan2 (Py(), Px());}
78 virtual Double_t Theta() const {return TMath::ATan2 (Pt(), Pz());}
79 virtual Double_t Eta() const {return -TMath::Log (TMath::Tan (0.5*Theta()));}
80 virtual Double_t Y() const {return TMath::Log ((E() + Pz()) / (E() - Pz()));}
83 virtual Short_t Charge() const {return fCharge;}
84 void SetCharge (Short_t value) {fCharge = value;}
87 virtual const Double_t* PID() const {return fPIDWeight;}
88 const Double_t* PIDProb() const {return fPIDProb;}
89 void SetPIDProb (Int_t i, Double_t value);
90 void SetPIDWeight (Int_t i, Double_t value);
91 static void SetPIDMethod(EPIDMethod method) {fgPIDMethod = method;}
92 void AssignRealisticPID();
93 AliRsnPID::EType PIDType(Double_t &prob);
95 // check that contains a given ESD flag
96 Bool_t CheckFlag (ULong_t flag) {return (fFlags & flag);}
98 // information getters from objects
99 Bool_t Adopt (AliESDtrack *track, Bool_t useTPCInnerParam = kFALSE);
100 Bool_t Adopt (AliAODTrack *track);
101 Bool_t Adopt (AliMCParticle *track);
103 // position in stack/array
104 Int_t Index() const {return fIndex;}
105 Int_t Label() const {return fLabel;}
106 Int_t GetLabel() const {return -1;}
107 void SetIndex (Int_t value) {fIndex = value;}
108 void SetLabel (Int_t value) {fLabel = value;}
111 void Print (Option_t *option = "ALL") const;
113 Bool_t InitMCInfo (TParticle *particle);
114 Bool_t InitMCInfo (AliMCParticle *mcParticle);
117 AliRsnMCInfo* GetMCInfo() const { return fMCInfo; }
119 // sorting (with respect to Pt)
120 virtual Bool_t IsSortable() const {return kTRUE;}
121 virtual Int_t Compare(const TObject* obj) const;
125 Int_t fIndex; // index of source object (ESD/AOD/MC) in its collection
126 Int_t fLabel; // label assigned to the track (act. by GEANT3)
128 Short_t fCharge; // charge sign
129 ULong_t fFlags; // status flags
131 Double_t fP[3]; // vector momentum (x, y, z)
132 Double_t fV[3]; // DCA vertex (x, y, z)
133 Double_t fMass; // mass (assigned externally)
135 AliRsnPID::EType fRealisticPID; // PID from Bayesian probs (largest one)
136 Double_t fPIDProb[AliRsnPID::kSpecies]; // PID probabilities (Bayesian comp.)
137 Double_t fPIDWeight[AliRsnPID::kSpecies]; // PID weights
139 AliRsnMCInfo *fMCInfo; // reference to particle object (if any)
140 static EPIDMethod fgPIDMethod; // flag to define how the PID is computed for this object
142 ClassDef (AliRsnDaughter, 4);