]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnDaughter.h
removed eff-c++ warnings
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnDaughter.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               *
4  **************************************************************************/
5
6 //-------------------------------------------------------------------------
7 //                      Class AliRsnDaughter
8 //
9 //           A simple object which describes a reconstructed track
10 //           with some references to its related generated particle
11 //           and some facilities which could help in composing its
12 //           4-momentum, for resonance study.
13 //
14 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
15 //-------------------------------------------------------------------------
16
17 #ifndef ALIRSNDAUGHTER_H
18 #define ALIRSNDAUGHTER_H
19
20 #include "AliPID.h"
21 #include <TVector3.h>
22 #include <TLorentzVector.h>
23
24 class TParticle;
25 class AliESDtrack;
26
27 class AliRsnDaughter : public TObject
28 {
29 public:
30         
31         AliRsnDaughter();
32         
33         virtual       ~AliRsnDaughter() { }
34         
35         // 4-momentum
36         Double_t       GetEnergy() const {return TMath::Sqrt(fMass*fMass + GetP2());}
37         Double_t       GetMass() const {return fMass;}
38         Double_t       GetP2() const {return fP[0]*fP[0] + fP[1]*fP[1] + fP[2]*fP[2];}
39         Double_t       GetP() const  {return TMath::Sqrt(GetP2());}
40         Double_t       GetPx() const {return fP[0];}
41         Double_t       GetPy() const {return fP[1];}
42         Double_t       GetPz() const {return fP[2];}
43         Double_t       GetPt() const {return TMath::Sqrt(fP[0]*fP[0] + fP[1]*fP[1]);}
44         void           SetPxPyPz(Double_t px, Double_t py, Double_t pz) {fP[0] = px; fP[1] = py; fP[2] = pz;}
45         void           SetMass(Double_t m) {fMass = m;}
46         
47         // DCA vertex
48         Double_t       GetVx() const {return fV[0];}
49         Double_t       GetVy() const {return fV[1];}
50         Double_t       GetVz() const {return fV[2];}
51         Double_t       GetVt() const {return TMath::Sqrt(fV[0]*fV[0] + fV[1]*fV[1]);}
52         void           SetVxVyVz(Double_t vx,Double_t vy,Double_t vz) {fV[0]=vx;fV[1]=vy;fV[2]=vz;}
53         
54         // charge sign
55         Char_t         GetSign() const {return fSign;}
56         void           SetSign(Char_t value) {fSign = value;}
57         void           SetSign(Int_t value) {fSign = (Char_t)value;}
58         
59         // PID
60         UShort_t       GetPDG() const {return fPDG;}
61         Double_t       GetPIDweight(Int_t i) const {return ( (i>=0&&i<AliPID::kSPECIES)?fPIDwgt[i]:-1.0 );}
62         void           SetPDG(Int_t pdg) {fPDG = (UShort_t)TMath::Abs(pdg);}
63         void           SetPDG(UShort_t pdg) {fPDG = TMath::Abs(pdg);}
64         void           SetPIDweights(const Double_t *pid) {Int_t i;for(i=0;i<AliPID::kSPECIES;i++)fPIDwgt[i]=pid[i];}
65         
66         // position in stack/ESD array
67         UShort_t       GetIndex() const {return fIndex;}
68         Int_t          GetLabel() const {return fLabel;}
69         void           SetIndex(UShort_t value) {fIndex = value;}
70         void           SetIndex(Int_t value) {fIndex = (UShort_t)value;}
71         void           SetLabel(Int_t l) {fLabel = l;}
72         
73         // MC info (when available)
74         Int_t          GetMother() const {return fMother;}
75         Short_t        GetMotherPDG() const {return fMotherPDG;}
76         Short_t        GetTruePDG() const {return fTruePDG;}
77         void           SetMother(Int_t l) {fMother = l;}
78         void           SetMotherPDG(Short_t pdg) {fMotherPDG = pdg;}
79         void           SetTruePDG(Short_t pdg) {fTruePDG = pdg;}
80         
81         // print info
82         void           Print(Option_t *option = "") const;
83         
84         // static methods
85         static AliRsnDaughter * Adopt(AliESDtrack* track, Int_t index);
86         static AliRsnDaughter * Adopt(TParticle* particle, Int_t label);
87         static AliRsnDaughter   Sum(AliRsnDaughter t1, AliRsnDaughter t2);
88         
89 private:
90         
91         AliRsnDaughter(Int_t label, UShort_t index, Double_t *p, Double_t *v, Char_t sign);
92         
93         Char_t     fSign;                     // charge sign
94         UShort_t   fPDG;                      // assigned PDG code from PID (0=undefined)
95         UShort_t   fIndex;                    // reference index in AliESD container
96
97         Double_t   fP[3];                     // vector momentum
98         Double_t   fV[3];                     // production vertex
99         Double_t   fMass;                     // mass
100         
101         Double_t   fPIDwgt[AliPID::kSPECIES]; // particle PID weights
102         
103         // The following data are useful for simulated events only
104         // and can be left blank when using real or 'realistic' data
105         
106         Int_t      fLabel;        // GEANT label of corresponding particle
107         Short_t    fTruePDG;      // PDG code of corresponding particle
108         Int_t      fMother;       // GEANT label of mother particle
109         Short_t    fMotherPDG;    // PDG code of mother particle
110         
111         ClassDef(AliRsnDaughter,1)
112 };
113
114 #endif