#ifndef UPARTICLE_H
#define UPARTICLE_H

#include "TObject.h"
#include "TLorentzVector.h"
#include "TMath.h"

class TParticle;

class UParticle : public TObject {

 private:
    Int_t      fIndex;        // index of this particle
    Int_t      fPdg;          // PDG code
    Int_t      fStatus;       // Status
    Int_t      fParent;       // Index of parent
    Int_t      fParentDecay;  // Parent decay index
    Int_t      fMate;         // index of last collision partner
    Int_t      fDecay;        // decay index (-1 if not decayed)
    Int_t      fChild[2];     // index of first and last child
    Double32_t fPx;           // px (GeV)
    Double32_t fPy;           // py (GeV)
    Double32_t fPz;           // pz (GeV)
    Double32_t fE;            // Energy (GeV)
    Double32_t fX;            // x (fm)
    Double32_t fY;            // y (fm)
    Double32_t fZ;            // z (fm)
    Double32_t fT;            // t (fm)
    Double32_t fWeight;       // weight
    
 public:
    UParticle();
    UParticle(Int_t index, Int_t pdg, Int_t status,
	      Int_t parent, Int_t parentDecay,
	      Int_t mate, Int_t decay, Int_t child[2],
	      Double_t px, Double_t py, Double_t pz, Double_t e,
	      Double_t x, Double_t y, Double_t z, Double_t t,
	      Double_t weight);
    UParticle(Int_t index, Int_t pdg, Int_t status,
	      Int_t parent, Int_t parentDecay,
	      Int_t mate, Int_t decay, Int_t child[2],
	      TLorentzVector mom, TLorentzVector pos,
	      Double_t weight);
    UParticle(const UParticle &right);
    UParticle(const TParticle &right);
    virtual ~UParticle();
    const UParticle& operator =  (const UParticle& right);
    const UParticle& operator =  (const TParticle& right);
    Bool_t operator == (UParticle& right) const;
    using TObject::Print;
    void Print(Option_t *option = "");
    inline Int_t    GetIndex()       const {return fIndex;}
    inline Int_t    GetPdg()         const {return fPdg;}
    inline Int_t    GetStatus()      const {return fStatus;}
    inline Int_t    GetParent()      const {return fParent;}
    inline Int_t    GetParentDecay() const {return fParentDecay;}
    inline Int_t    GetMate()        const {return fMate;}
    inline Int_t    GetDecay()       const {return fDecay;}
    inline Int_t    GetFirstChild()  const {return fChild[0];}
    inline Int_t    GetLastChild()   const {return fChild[1];}
    inline Double_t Px()             const {return fPx;}
    inline Double_t Py()             const {return fPy;}
    inline Double_t Pz()             const {return fPz;}
    inline Double_t E()              const {return fE;}
    inline TLorentzVector GetMomentum() const {return TLorentzVector(fPx,fPy,fPz,fE);}
    inline void Momentum(TLorentzVector& mom) const {mom.SetPxPyPzE(fPx,fPy,fPz,fE);}
    inline Double_t X()              const {return fX;}
    inline Double_t Y()              const {return fY;}
    inline Double_t Z()              const {return fZ;}
    inline Double_t T()              const {return fT;}
    inline TLorentzVector GetPosition() const {return TLorentzVector(fX,fY,fZ,fT);}
    inline void Position(TLorentzVector& pos) const {pos.SetXYZT(fX,fY,fZ,fT);}
    inline Double_t GetWeight()      const {return fWeight;}
    inline void SetIndex      (Int_t index)       {fIndex = index;}
    inline void SetPdg        (Int_t pdg)         {fPdg = pdg;}
    inline void SetStatus     (Int_t status)      {fStatus = status;}
    inline void SetParent     (Int_t parent)      {fParent = parent;}
    inline void SetParentDecay(Int_t parentDecay) {fParentDecay = parentDecay;}
    inline void SetMate       (Int_t mate)        {fMate = mate;}
    inline void SetDecay      (Int_t decay)       {fDecay = decay;}
    inline void SetChild      (Int_t child[2])    {fChild[0] = child[0]; fChild[1] = child[1];}
    inline void SetFirstChild (Int_t child)       {fChild[0] = child;}
    inline void SetLastChild  (Int_t child)       {fChild[1] = child;}
    inline void SetPx         (Double_t px)       {fPx = px;}
    inline void SetPy         (Double_t py)       {fPy = py;}
    inline void SetPz         (Double_t pz)       {fPz = pz;}
    inline void SetE          (Double_t e)        {fE = e;}
    inline void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
    {fPx = px; fPy = py; fPz = pz; fE = e;}
    inline void SetMomentum(TLorentzVector mom) {fPx=mom.Px(); fPy=mom.Py(); fPz=mom.Pz(); fE=mom.E();}
    inline void SetX          (Double_t x)        {fX = x;}
    inline void SetY          (Double_t y)        {fY = y;}
    inline void SetZ          (Double_t z)        {fZ = z;}
    inline void SetT          (Double_t t)        {fT = t;}
    inline void SetPosition(Double_t x, Double_t y, Double_t z, Double_t t) {fX = x; fY = y; fZ = z; fT = t;}
    inline void SetPosition(TLorentzVector pos)   {fX=pos.X(); fY=pos.Y(); fZ=pos.Z(); fT=pos.T();}
    inline void SetWeight     (Double_t weight)   {fWeight = weight;}
    
    ClassDef(UParticle, 1);
};


#endif
 UParticle.h:1
 UParticle.h:2
 UParticle.h:3
 UParticle.h:4
 UParticle.h:5
 UParticle.h:6
 UParticle.h:7
 UParticle.h:8
 UParticle.h:9
 UParticle.h:10
 UParticle.h:11
 UParticle.h:12
 UParticle.h:13
 UParticle.h:14
 UParticle.h:15
 UParticle.h:16
 UParticle.h:17
 UParticle.h:18
 UParticle.h:19
 UParticle.h:20
 UParticle.h:21
 UParticle.h:22
 UParticle.h:23
 UParticle.h:24
 UParticle.h:25
 UParticle.h:26
 UParticle.h:27
 UParticle.h:28
 UParticle.h:29
 UParticle.h:30
 UParticle.h:31
 UParticle.h:32
 UParticle.h:33
 UParticle.h:34
 UParticle.h:35
 UParticle.h:36
 UParticle.h:37
 UParticle.h:38
 UParticle.h:39
 UParticle.h:40
 UParticle.h:41
 UParticle.h:42
 UParticle.h:43
 UParticle.h:44
 UParticle.h:45
 UParticle.h:46
 UParticle.h:47
 UParticle.h:48
 UParticle.h:49
 UParticle.h:50
 UParticle.h:51
 UParticle.h:52
 UParticle.h:53
 UParticle.h:54
 UParticle.h:55
 UParticle.h:56
 UParticle.h:57
 UParticle.h:58
 UParticle.h:59
 UParticle.h:60
 UParticle.h:61
 UParticle.h:62
 UParticle.h:63
 UParticle.h:64
 UParticle.h:65
 UParticle.h:66
 UParticle.h:67
 UParticle.h:68
 UParticle.h:69
 UParticle.h:70
 UParticle.h:71
 UParticle.h:72
 UParticle.h:73
 UParticle.h:74
 UParticle.h:75
 UParticle.h:76
 UParticle.h:77
 UParticle.h:78
 UParticle.h:79
 UParticle.h:80
 UParticle.h:81
 UParticle.h:82
 UParticle.h:83
 UParticle.h:84
 UParticle.h:85
 UParticle.h:86
 UParticle.h:87
 UParticle.h:88
 UParticle.h:89
 UParticle.h:90
 UParticle.h:91
 UParticle.h:92
 UParticle.h:93
 UParticle.h:94
 UParticle.h:95
 UParticle.h:96
 UParticle.h:97
 UParticle.h:98
 UParticle.h:99
 UParticle.h:100
 UParticle.h:101
 UParticle.h:102
 UParticle.h:103