# Event

class description - source file - inheritance tree

## class Event : public TObject

        public:

                          Event()
                          Event(const Event&)
                  virtual ~Event()
                   Track* AddTrack(Float_t random, Float_t ptmin = 1)
                     void Build(Int_t ev, Int_t arg5 = 600, Float_t ptmin = 1)
           static TClass* Class()
             virtual void Clear(Option_t* option)
                  Float_t GetClosestDistance(Int_t i)
                   UInt_t GetFlag() const
             EventHeader* GetHeader()
               TRefArray* GetHighPt() const
                    TH1F* GetHistogram() const
                   Track* GetLastTrack() const
                  Float_t GetMatrix(UChar_t x, UChar_t y)
                    Int_t GetMeasure(UChar_t which)
               TRefArray* GetMuons() const
                    Int_t GetNseg() const
                    Int_t GetNtrack() const
                    Int_t GetNvertex() const
                  Float_t GetTemperature() const
            TClonesArray* GetTracks() const
                   TBits& GetTriggerBits()
                    char* GetType()
                     TH1* GetWebHistogram() const
          virtual TClass* IsA() const
              static void Reset(Option_t* option)
                     void ResetHistogramPointer()
                     void SetFlag(UInt_t f)
                     void SetHeader(Int_t i, Int_t run, Int_t date, Float_t random)
                     void SetMatrix(UChar_t x, UChar_t y, Float_t what)
                     void SetMeasure(UChar_t which, Int_t what)
                     void SetNseg(Int_t n)
                     void SetNtrack(Int_t n)
                     void SetNvertex(Int_t n)
                     void SetRandomVertex()
                     void SetTemperature(Float_t t)
                     void SetType(char* type)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

                          char fType[20]         event type
                         char* fEventName        run+event number in character format
                         Int_t fNtrack           Number of tracks
                         Int_t fNseg             Number of track segments
                         Int_t fNvertex
                        UInt_t fFlag
                       Float_t fTemperature
                         Int_t fMeasures[10]
                       Float_t fMatrix[4][4]
                      Float_t* fClosestDistance  [fNvertex]
                   EventHeader fEvtHdr
                 TClonesArray* fTracks           ->array with all tracks
                    TRefArray* fHighPt           array of High Pt tracks only
                    TRefArray* fMuons            array of Muon tracks only
                          TRef fLastTrack        reference pointer to last track
                          TRef fWebHistogram     EXEC:GetWebHistogram reference to an histogram in a TWebFile
                         TH1F* fH                ->
                         TBits fTriggerBits      Bits triggered by this event.
          static TClonesArray* fgTracks
                  static TH1F* fgHist

## Class Description

                           Event and Track classes
                           =======================

      The Event class is a naive/simple example of an event structure.
         public:
            char           fType[20];
            Int_t          fNtrack;
            Int_t          fNseg;
            Int_t          fNvertex;
            UInt_t         fFlag;
            Float_t        fTemperature;
            Int_t          fMeasures[10];
            Float_t        fMatrix[4][4];
            Float_t       *fClosestDistance; //[fNvertex] indexed array!
            EventHeader    fEvtHdr;
            TClonesArray  *fTracks;
            TRefArray     *fHighPt;            //array of High Pt tracks only
            TRefArray     *fMuons;             //array of Muon tracks only
            TRef           fLastTrack;         //pointer to last track
            TRef           fHistoWeb;          //EXEC:GetHistoWeb reference to an histogram in a TWebFile
            TH1F          *fH;

       The EventHeader class has 3 data members (integers):
         public:
            Int_t          fEvtNum;
            Int_t          fRun;
            Int_t          fDate;

       The Event data member fTracks is a pointer to a TClonesArray.
       It is an array of a variable number of tracks per event.
       Each element of the array is an object of class Track with the members:
         private:
            Float_t      fPx;           //X component of the momentum
            Float_t      fPy;           //Y component of the momentum
            Float_t      fPz;           //Z component of the momentum
            Float_t      fRandom;       //A random track quantity
            Float_t      fMass2;        //The mass square of this particle
            Float_t      fBx;           //X intercept at the vertex
            Float_t      fBy;           //Y intercept at the vertex
            Float_t      fMeanCharge;   //Mean charge deposition of all hits of this track
            Float_t      fXfirst;       //X coordinate of the first point
            Float_t      fXlast;        //X coordinate of the last point
            Float_t      fYfirst;       //Y coordinate of the first point
            Float_t      fYlast;        //Y coordinate of the last point
            Float_t      fZfirst;       //Z coordinate of the first point
            Float_t      fZlast;        //Z coordinate of the last point
            Float_t      fCharge;       //Charge of this track
            Float_t      fVertex[3];    //Track vertex position
            Int_t        fNpoint;       //Number of points for this track
            Short_t      fValid;        //Validity criterion

       An example of a batch program to use the Event/Track classes is given
       in this directory: MainEvent.
       Look also in the same directory at the following macros:
         - eventa.C  an example how to read the tree
         - eventb.C  how to read events conditionally

       During the processing of the event (optionally) also a large number
       of histograms can be filled. The creation and handling of the
       histograms is taken care of by the HistogramManager class.

Event()

     Create an Event object.
     When the constructor is invoked for the first time, the class static
     variable fgTracks is 0 and the TClonesArray fgTracks is created.

~Event()

void Build(Int_t ev, Int_t arg5, Float_t ptmin)

Track* AddTrack(Float_t random, Float_t ptmin)

     Add a new track to the list of tracks for this event.
     To avoid calling the very time consuming operator new for each track,
     the standard but not well know C++ operator "new with placement"
     is called. If tracks[i] is 0, a new Track object will be created
     otherwise the previous Track[i] will be overwritten.

void Clear(Option_t *option)

void Reset(Option_t *option)

     Static function to reset all static objects for this event
       fgTracks->Delete(option);

void SetHeader(Int_t i, Int_t run, Int_t date, Float_t random)

void SetMeasure(UChar_t which, Int_t what)

void SetRandomVertex()

     This delete is to test the relocation of variable length array

### Inline Functions

                     void ResetHistogramPointer()
                     void SetNseg(Int_t n)
                     void SetNtrack(Int_t n)
                     void SetNvertex(Int_t n)
                     void SetFlag(UInt_t f)
                     void SetTemperature(Float_t t)
                     void SetType(char* type)
                     void SetMatrix(UChar_t x, UChar_t y, Float_t what)
                  Float_t GetClosestDistance(Int_t i)
                    char* GetType()
                    Int_t GetNtrack() const
                    Int_t GetNseg() const
                    Int_t GetNvertex() const
                   UInt_t GetFlag() const
                  Float_t GetTemperature() const
             EventHeader* GetHeader()
            TClonesArray* GetTracks() const
               TRefArray* GetHighPt() const
               TRefArray* GetMuons() const
                   Track* GetLastTrack() const
                    TH1F* GetHistogram() const
                     TH1* GetWebHistogram() const
                    Int_t GetMeasure(UChar_t which)
                  Float_t GetMatrix(UChar_t x, UChar_t y)
                   TBits& GetTriggerBits()
                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
                    Event Event(const Event&)

Author: Rene Brun 19/08/96
Last update: root/test:$Name: $:$Id: Event.cxx,v 1.22 2003/08/23 00:08:13 rdm Exp $