]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/EventAlieve.h
Invert the modality of run-loader and esd loading: always try to open them and compla...
[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 class TGeoManager;
19
20 namespace Alieve {
21
22 class Event : public Reve::EventBase
23 {
24 private:
25   Event(const Event&);            // Not implemented
26   Event& operator=(const Event&); // Not implemented
27
28 protected:
29   TString       fPath;
30   Int_t         fEventId;
31
32   AliRunLoader* fRunLoader;
33
34   TFile*        fESDFile;
35   TTree*        fESDTree;
36   AliESD*       fESD;
37   AliESDfriend* fESDfriend;
38   Bool_t        fESDfriendExists;
39
40   TList         fNewEventCommands;
41
42   static TString  fgCdbUri;
43   static Bool_t   fgAssertRunLoader;
44   static Bool_t   fgAssertESDTree;
45
46   static AliMagF* fgMagField;
47
48 public:
49   static void SetCdbUri(const Text_t* cdb) { if (cdb) fgCdbUri = cdb; }
50   static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd)
51   { fgAssertRunLoader = assertRunloader; fgAssertESDTree = assertEsd; }
52
53   Event();
54   Event(TString path, Int_t ev=0);
55
56   void Open();
57   void GotoEvent(Int_t event);
58   void NextEvent() { GotoEvent(fEventId + 1); }
59   void PrevEvent() { GotoEvent(fEventId - 1); }
60   void Close();
61
62   virtual void  AfterNewEventLoaded();
63
64   TList& GetNewEventCommands() { return fNewEventCommands; }
65   void   AddNewEventCommand(const Text_t* cmd);
66
67   Int_t         GetEventId()   const { return fEventId; }
68   AliRunLoader* GetRunLoader() const { return fRunLoader; }
69   TTree*        GetESDTree()   const { return fESDTree; }
70   AliESD*       GetESD()       const { return fESD; }
71   AliESDfriend* GetESDfriend()       const { return fESDfriend; }
72   Bool_t        GetESDfriendExists() const { return fESDfriendExists; }
73   virtual const Text_t* GetTitle()   const { return fPath.Data(); }
74
75   static AliRunLoader* AssertRunLoader();
76   static AliESD*       AssertESD();
77   static AliESDfriend* AssertESDfriend();
78
79   static AliMagF*      AssertMagField();
80
81   static TGeoManager*  AssertGeometry();
82
83   ClassDef(Event, 1);
84 }; // endclass Event
85
86 extern Event* gEvent;
87
88 }
89
90 #endif