]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/EventAlieve.h
Runloader is updated when moving to next file (quick fix).
[u/mrichter/AliRoot.git] / EVE / Alieve / EventAlieve.h
1 // $Header$
2
3 #ifndef ALIEVE_Event_H
4 #define ALIEVE_Event_H
5
6 #include <TList.h>
7
8 #include <Reve/EventBase.h>
9
10 class AliRunLoader;
11 class AliESD;
12 class AliESDfriend;
13
14 class AliMagF;
15
16 class TFile;
17 class TTree;
18
19 namespace Alieve {
20
21 class Event : public Reve::EventBase
22 {
23 private:
24   Event(const Event&);            // Not implemented
25   Event& operator=(const Event&); // Not implemented
26
27 protected:
28   TString       fPath;
29   Int_t         fEventId;
30
31   AliRunLoader* fRunLoader;
32
33   TFile*        fESDFile;
34   TTree*        fESDTree;
35   AliESD*       fESD;
36   AliESDfriend* fESDfriend;
37   Bool_t        fESDfriendExists;
38
39   TList         fNewEventCommands;
40
41   static Bool_t fgUseRunLoader;
42   static Bool_t fgUseESDTree;
43   static Bool_t fgAvoidExcOnOpen;
44
45   static AliMagF* fgMagField;
46
47 public:
48   static void Initialize(Bool_t use_runloader=kTRUE, Bool_t use_esd=kTRUE,
49                          Bool_t avoid_exc_on_open=kTRUE);
50
51   Event();
52   Event(TString path, Int_t ev=0);
53
54   void Open();
55   void GotoEvent(Int_t event);
56   void NextEvent() { GotoEvent(fEventId + 1); }
57   void PrevEvent() { GotoEvent(fEventId - 1); }
58   void Close();
59
60   virtual void  AfterNewEventLoaded();
61
62   TList& GetNewEventCommands() { return fNewEventCommands; }
63   void   AddNewEventCommand(const Text_t* cmd);
64
65   Int_t         GetEventId()   const { return fEventId; }
66   AliRunLoader* GetRunLoader() const { return fRunLoader; }
67   TTree*        GetESDTree()   const { return fESDTree; }
68   AliESD*       GetESD()       const { return fESD; }
69   AliESDfriend* GetESDfriend()       const { return fESDfriend; }
70   Bool_t        GetESDfriendExists() const { return fESDfriendExists; }
71   virtual const Text_t* GetTitle()   const { return fPath.Data(); }
72
73   static AliRunLoader* AssertRunLoader();
74   static AliESD*       AssertESD();
75   static AliESDfriend* AssertESDfriend();
76
77   static AliMagF*      AssertMagField();
78
79   ClassDef(Event, 1);
80 }; // endclass Event
81
82 extern Event* gEvent;
83
84 }
85
86 #endif