// @(#)root/eg:$Id$
// Author: Ola Nordmann   21/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TPrimary                                                             //
// Is a small class in order to define the particles at the production  //
// vertex.                                                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TPrimary
#define ROOT_TPrimary

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAtt3D
#include "TAtt3D.h"
#endif
#ifndef ROOT_X3DBuffer
#include "X3DBuffer.h"
#endif

class TAttParticle;

class TPrimary : public TObject, public TAttLine, public TAtt3D {

protected:
        Int_t         fPart;         //Particle id produced
        Int_t         fFirstMother;  //Index of the first mother particle
        Int_t         fSecondMother; //Index of the second mother particle(if any)
        Int_t         fGeneration;   //Generation flag: last gen. (0) or not (1) or ghost (2)
        Double_t      fPx;           //Momentum in x direction in GeV/c
        Double_t      fPy;           //Momentum in y direction in GeV/c
        Double_t      fPz;           //Momentum in z direction in GeV/c
        Double_t      fEtot;         //Total energy in GeV
        Double_t      fVx;           //Production vertex x position in user units
        Double_t      fVy;           //Production vertex y position in user units
        Double_t      fVz;           //Production vertex z position in user units
        Double_t      fTime;         //Time of particle production in user units
        Double_t      fTimeEnd;      //Time of particle destruction (always in the pp-cms!)
        TString       fType;         //Indicator of primary type

public:
   TPrimary();
   TPrimary(Int_t part, Int_t first, Int_t second, Int_t gener,
            Double_t px, Double_t py, Double_t pz,
            Double_t etot, Double_t vx, Double_t vy, Double_t vz,
            Double_t time, Double_t timend, const char *type = "");
   virtual ~TPrimary();
   virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
   virtual void          ExecuteEvent(Int_t event, Int_t px, Int_t py);
   virtual const TAttParticle  *GetParticle() const;
   virtual const char   *GetName() const;
   virtual const char   *GetTitle() const;
   virtual Int_t         GetFirstMother() const { return fFirstMother; }
   virtual Int_t         GetSecondMother() const { return fSecondMother; }
   virtual Int_t         GetGeneration() const { return fGeneration; }
   virtual Double_t      GetXMomentum() const { return fPx; }
   virtual Double_t      GetYMomentum() const { return fPy; }
   virtual Double_t      GetZMomentum() const { return fPz; }
   virtual Double_t      GetTotalEnergy() const { return fEtot; }
   virtual Double_t      GetXPosition() const { return fVx; }
   virtual Double_t      GetYPosition() const { return fVy; }
   virtual Double_t      GetZPosition() const { return fVz; }
   virtual Double_t      GetTime() const { return fTime; }
   virtual Double_t      GetTimeEnd() const { return fTimeEnd; }
   virtual const char   *GetType() const { return fType.Data(); }
   virtual void          Paint(Option_t *option = "");
   virtual void          Print(Option_t *option = "") const;
   virtual void          Sizeof3D() const;

   ClassDef(TPrimary,1)  //TPrimary vertex particle information
};

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