StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EventT.h
1 #ifndef __EVENT__
2 #define __EVENT__
3 #include <string.h>
4 #include "TObject.h"
5 #include "HitT.h"
6 #include "TrackT.h"
7 #include "TClonesArray.h"
8 #include "TRefArray.h"
9 #include "TRef.h"
10 #include "THashList.h"
11 class TGeoHMatrix;
12 class EventTHeader {
13  private:
14  Int_t fEvtNum;
15  Int_t fRun;
16  Int_t fDate;
17  Double32_t fField;
18  public:
19  EventTHeader() : fEvtNum(0), fRun(0), fDate(0), fField(0) { }
20  virtual ~EventTHeader() { }
21  void Set(Int_t i, Int_t r, Int_t d, Double32_t Field = 0)
22  { fEvtNum = i; fRun = r; fDate = d; fField = Field;}
23  Int_t GetEvtNum() const { return fEvtNum; }
24  Int_t GetRun() const { return fRun; }
25  Int_t GetDate() const { return fDate; }
26  Double32_t GetField() const {return fField;}
27 
28  ClassDef(EventTHeader,1) //EventT Header
29 };
30 class StEvent;
31 
32 class EventT : public TObject {
33 
34  private:
35  UInt_t fNPTracks;
36  UInt_t fNtrack; //Number of tracks
37  UInt_t fNhit; //Number of hits
38  UInt_t fFlag;
39  EventTHeader fEvtHdr;
40  Double32_t fVertex[3]; //
41  Double32_t fCovariantMatrix[6];//
42  TClonesArray *fTracks; //->array with all tracks
43  TClonesArray *fHits; //->array with all hits
44  Bool_t fIsValid; //
45 
46  static TClonesArray *fgTracks;
47  static TClonesArray *fgHits;
48  static THashList *fRotList;
49 
50  public:
51  EventT();
52  virtual ~EventT();
53  Int_t Build(StEvent *pEventT, UInt_t MinNoHits = 2, Double_t pCut = 0.2);
54  void Clear(Option_t *option ="");
55  Bool_t IsValid() const { return fIsValid; }
56  static void Reset(Option_t *option ="");
57  void SetNtrack(UInt_t n) { fNtrack = n; }
58  void SetNhit(UInt_t n) { fNhit = n; }
59  void SetFlag(UInt_t f) { fFlag = f; }
60  void SetHeader(Int_t i, Int_t run, Int_t date, Double32_t field);
61  TrackT *AddTrackT();
62  HitT *AddHitT();
63  HitT *SetHitT(HitT *h, StHit *hit, TGeoHMatrix *comb, TrackT *track);
64  Double32_t GetVertex(UInt_t i=0) {return (i<3)?fVertex[i]:0;}
65  UInt_t GetTotalNoTracks() const {return fNPTracks;}
66  UInt_t GetNtrack() const { return fNtrack; }
67  UInt_t GetNhit() const { return fNhit; }
68  UInt_t GetFlag() const { return fFlag; }
69  EventTHeader *GetHeader() { return &fEvtHdr; }
70  const Double32_t *GetVertex() const {return fVertex;}
71  const Double32_t *GetCovMatrix() const {return fCovariantMatrix;}
72  TClonesArray *GetTracks() const {return fTracks;}
73  TClonesArray *GetHits() const {return fHits;}
74  TrackT *GetTrackT(UInt_t i=0) const {return fTracks && i < fNtrack ? (TrackT*) fTracks->At(i): 0;}
75  HitT *GetHitT(UInt_t i=0) const {return fHits && i < fNhit ? (HitT*) fHits->At(i): 0;}
76  Int_t GetIndexOfTrackT(const TrackT *obj) const {return fgTracks->IndexOf(obj);}
77  Int_t GetIndexOfHitT(const HitT *obj) const {return fgHits->IndexOf(obj);}
78  static void SetRotMatrices(THashList *Rot) {fRotList = Rot;}
79  static void RestoreListOfRotations();
80  static THashList *RotMatrices() {return fRotList;}
81  virtual void Print(Option_t *opt="") const;
82  ClassDef(EventT,1) //EventT structure
83 };
84 #endif
Definition: StHit.h:125
Definition: TrackT.h:8
Definition: HitT.h:7
Definition: EventT.h:32