#ifndef ROOT_Event #define ROOT_Event ////////////////////////////////////////////////////////////////////////// // // // Event // // // // Description of the event and track parameters // // // ////////////////////////////////////////////////////////////////////////// #include "TObject.h" #include "TClonesArray.h" #include "TH1.h" #include "TMath.h" #include class EventHeader { public: Int_t fEvtNum; Int_t fRun; Int_t fDate; public: EventHeader() : fEvtNum(0), fRun(0), fDate(0) { } void Set(Int_t i, Int_t r, Int_t d) { fEvtNum = i; fRun = r; fDate = d; } Int_t GetEvtNum() const { return fEvtNum; } Int_t GetRun() const { return fRun; } Int_t GetDate() const { return fDate; } ClassDef(EventHeader,1) //Event Header }; class Event : public TObject { public: Int_t fNtrack; Int_t fNseg; Int_t fNvertex; UInt_t fFlag; Float_t fTemperature; EventHeader fEvtHdr; TClonesArray *fTracks; TH1F *fH; public: Event(); virtual ~Event(); void Clear(Option_t *option =""); void Hcreate(); void Hfill(); void SetNseg(Int_t n) { fNseg = n; } void SetNtrack(Int_t n) { fNtrack = n; } void SetNvertex(Int_t n) { fNvertex = n; } void SetFlag(UInt_t f) { fFlag = f; } void SetTemperature(Float_t t) { fTemperature = t; } void SetHeader(Int_t i, Int_t run, Int_t date, Float_t random); void AddTrack(Float_t random); Int_t GetNtrack() const { return fNtrack; } Int_t GetNseg() const { return fNseg; } Int_t GetNvertex() const { return fNvertex; } UInt_t GetFlag() const { return fFlag; } Float_t GetTemperature() const { return fTemperature; } EventHeader *GetHeader() { return &fEvtHdr; } TClonesArray *GetTracks() { return fTracks; } TH1F *GetHistogram() {return fH;} ClassDef(Event,1) //Event structure }; class Track : public TObject { 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 Int_t fNpoint; //Number of points for this track Short_t fValid; //Validity criterion public: Track() {;} Track(Float_t random); virtual ~Track() {;} Float_t GetPx() {return fPx;} Float_t GetPy() {return fPy;} Float_t GetPz() {return fPz;} Float_t GetPt() {return TMath::Sqrt(fPx*fPx + fPy*fPy);} Float_t GetRandom() {return fRandom;} Float_t GetBx() {return fBx;} Float_t GetBy() {return fBy;} Float_t GetMass2() {return fMass2;} Float_t GetMeanCharge() {return fMeanCharge;} Float_t GetXfirst() {return fXfirst;} Float_t GetXlast() {return fXlast;} Float_t GetYfirst() {return fYfirst;} Float_t GetYlast() {return fYlast;} Float_t GetZfirst() {return fZfirst;} Float_t GetZlast() {return fZlast;} Float_t GetCharge() {return fCharge;} Int_t GetNpoint() {return fNpoint;} Short_t GetValid() {return fValid;} virtual void SetValid(Int_t valid=1) {fValid = valid;} ClassDef(Track,1) //A Track segment }; #endif