]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
5a5a1232 | 3 | |
d810d0de | 4 | /************************************************************************** |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
ecb84424 | 10 | #ifndef AliEveEventManager_H |
a15e6d7d | 11 | #define AliEveEventManager_H |
5a5a1232 | 12 | |
84aff7a4 | 13 | #include <TEveEventManager.h> |
f76c9e9b | 14 | #include <TQObject.h> |
ecb84424 | 15 | #include <TObjArray.h> |
5a5a1232 | 16 | |
f6afd0e1 | 17 | class AliEveMacroExecutor; |
008ac94c | 18 | class AliEveEventSelector; |
f6afd0e1 | 19 | |
5a5a1232 | 20 | class AliRunLoader; |
af885e0f | 21 | class AliESDEvent; |
3aecaefc | 22 | class AliESDfriend; |
b3b7b8d3 | 23 | class AliAODEvent; |
c2c4b7a2 | 24 | class AliRawReader; |
5a5a1232 | 25 | |
8661a211 | 26 | class AliGRPObject; |
93845f6c | 27 | class AliMagF; |
28 | ||
5a5a1232 | 29 | class TFile; |
30 | class TTree; | |
632d2b03 | 31 | class TGeoManager; |
5a5a1232 | 32 | |
a15e6d7d | 33 | //============================================================================== |
34 | // | |
35 | // AliEveEventManager | |
36 | // | |
37 | // Interface to ALICE event-data (RunLoader, ESD), magnetic field and | |
38 | // geometry. | |
39 | // | |
40 | ||
5a5a1232 | 41 | |
f76c9e9b | 42 | class AliEveEventManager : public TEveEventManager, |
43 | public TQObject | |
5a5a1232 | 44 | { |
5a5a1232 | 45 | public: |
4d62585e | 46 | static void SetESDFileName(const TString& esd); |
b3b7b8d3 | 47 | static void SetAODFileName(const TString& aod); |
48 | static void AddAODfriend (const TString& friendFileName); | |
4d62585e | 49 | static void SetRawFileName(const TString& raw); |
50 | static void SetCdbUri (const TString& cdb); | |
b3b7b8d3 | 51 | static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, |
52 | Bool_t assertAod, Bool_t assertRaw); | |
632d2b03 | 53 | |
08b0f222 | 54 | |
ba5d58f2 | 55 | AliEveEventManager(const TString& name="Event"); |
56 | AliEveEventManager(const TString& name, const TString& path, Int_t ev=0); | |
a15e6d7d | 57 | virtual ~AliEveEventManager(); |
58 | ||
516389a2 | 59 | virtual void Open(); |
482d0751 | 60 | void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf); |
f76c9e9b | 61 | virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const; |
516389a2 | 62 | virtual void GotoEvent(Int_t event); |
63 | virtual void NextEvent(); | |
64 | virtual void PrevEvent(); | |
65 | virtual void Close(); | |
90fa773e | 66 | |
b3b7b8d3 | 67 | Int_t GetEventId() const { return fEventId; } |
68 | AliRunLoader* GetRunLoader() const { return fRunLoader; } | |
69 | TFile* GetESDFile() const { return fESDFile; } | |
70 | TTree* GetESDTree() const { return fESDTree; } | |
71 | AliESDEvent* GetESD() const { return fESD; } | |
2cea771a | 72 | AliESDfriend* GetESDfriend() const { return fESDfriend; } |
73 | Bool_t GetESDfriendExists() const { return fESDfriendExists; } | |
b3b7b8d3 | 74 | TFile* GetAODFile() const { return fAODFile; } |
75 | TTree* GetAODTree() const { return fAODTree; } | |
76 | AliAODEvent* GetAOD() const { return fAOD; } | |
2cea771a | 77 | virtual const Text_t* GetTitle() const { return fPath.Data(); } |
008ac94c | 78 | AliEveEventSelector* GetEventSelector() const { return fPEventSelector; } |
12365217 | 79 | TString GetEventInfoHorizontal() const; |
80 | TString GetEventInfoVertical() const; | |
5a5a1232 | 81 | |
f6afd0e1 | 82 | static Bool_t HasRunLoader(); |
83 | static Bool_t HasESD(); | |
84 | static Bool_t HasESDfriend(); | |
b3b7b8d3 | 85 | static Bool_t HasAOD(); |
f6afd0e1 | 86 | static Bool_t HasRawReader(); |
87 | ||
5a5a1232 | 88 | static AliRunLoader* AssertRunLoader(); |
32e219c2 | 89 | static AliESDEvent* AssertESD(); |
3aecaefc | 90 | static AliESDfriend* AssertESDfriend(); |
b3b7b8d3 | 91 | static AliAODEvent* AssertAOD(); |
c2c4b7a2 | 92 | static AliRawReader* AssertRawReader(); |
5a5a1232 | 93 | |
8661a211 | 94 | static AliMagF* AssertMagField(); |
632d2b03 | 95 | static TGeoManager* AssertGeometry(); |
96 | ||
ba5d58f2 | 97 | static AliEveEventManager* AddDependentManager(const TString& name, const TString& path); |
98 | static AliEveEventManager* GetDependentManager(const TString& name); | |
4d62585e | 99 | |
100 | static AliEveEventManager* GetMaster(); | |
101 | static AliEveEventManager* GetCurrent(); | |
102 | ||
8661a211 | 103 | static void RegisterTransient (TEveElement* element); |
104 | static void RegisterTransientList(TEveElement* element); | |
08b0f222 | 105 | |
106 | ||
488869c1 | 107 | Double_t GetAutoLoadTime() const { return fAutoLoadTime; } |
108 | Bool_t GetAutoLoad() const { return fAutoLoad; } | |
109 | void SetAutoLoadTime(Float_t time); | |
319f3084 | 110 | void SetAutoLoad(Bool_t autoLoad); |
488869c1 | 111 | void AutoLoadNextEvent(); |
80547f2d | 112 | |
488869c1 | 113 | Bool_t AreEventFilesOpened() const { return fIsOpen; } |
114 | Bool_t IsEventAvailable() const { return fHasEvent; } | |
115 | Bool_t IsUnderExternalControl() const { return fExternalCtrl; } | |
319f3084 | 116 | |
f6afd0e1 | 117 | virtual void AfterNewEventLoaded(); |
118 | void NewEventLoaded(); // *SIGNAL* | |
119 | ||
120 | AliEveMacroExecutor* GetExecutor() const { return fExecutor; } | |
f76c9e9b | 121 | |
4b456ebb | 122 | protected: |
123 | TString fPath; // URL to event-data. | |
124 | Int_t fEventId; // Id of current event. | |
125 | ||
126 | AliRunLoader* fRunLoader; // Run loader. | |
127 | ||
4d62585e | 128 | TFile *fESDFile; // ESD file. |
129 | TTree *fESDTree; // ESD tree. | |
130 | AliESDEvent *fESD; // ESDEvent object. | |
131 | AliESDfriend *fESDfriend; // ESDfriend object. | |
4b456ebb | 132 | Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data. |
b3b7b8d3 | 133 | TFile *fAODFile; // AOD file. |
134 | TTree *fAODTree; // AOD tree. | |
135 | AliAODEvent *fAOD; // AODEvent object. | |
4b456ebb | 136 | |
4d62585e | 137 | AliRawReader *fRawReader; // Raw-data reader. |
c2c4b7a2 | 138 | |
319f3084 | 139 | Bool_t fAutoLoad; // Automatic loading of events (online) |
488869c1 | 140 | Float_t fAutoLoadTime; // Auto-load time in seconds |
319f3084 | 141 | TTimer *fAutoLoadTimer; // Timer for automatic event loading |
80547f2d | 142 | |
143 | Bool_t fIsOpen; // Are event-files opened. | |
144 | Bool_t fHasEvent; // Is an event available. | |
145 | Bool_t fExternalCtrl; // Are we under external event-loop. | |
146 | ||
f6afd0e1 | 147 | AliEveMacroExecutor *fExecutor; // Executor for std macros |
148 | ||
08b0f222 | 149 | TEveElementList *fTransients; // Container for additional transient (per event) elements. |
8661a211 | 150 | TEveElementList *fTransientLists; // Container for lists of transient (per event) elements. |
08b0f222 | 151 | |
008ac94c | 152 | AliEveEventSelector* fPEventSelector; // Event filter |
153 | ||
4d62585e | 154 | TList *fSubManagers; // Dependent event-managers, used for event embedding. |
155 | ||
c2c4b7a2 | 156 | static TString fgESDFileName; // Name by which to open ESD. |
b3b7b8d3 | 157 | static TString fgAODFileName; // Name by which to open AOD. |
c2c4b7a2 | 158 | static TString fgRawFileName; // Name by which to open raw-data file. |
4b456ebb | 159 | static TString fgCdbUri; // Global URI to CDB. |
160 | static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data. | |
161 | static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data. | |
b3b7b8d3 | 162 | static Bool_t fgAssertAOD; // Global flag specifying if AODEvent must be asserted during opening of the event-data. |
c2c4b7a2 | 163 | static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data. |
4b456ebb | 164 | |
b3b7b8d3 | 165 | static TList *fgAODfriends; // Global list of AOD friend names to be attached during opening of the event-data (empty by default). |
4b456ebb | 166 | |
55216596 | 167 | static Bool_t fgGRPLoaded; // Global run parameters loaded? |
8661a211 | 168 | static AliMagF *fgMagField; // Global pointer to magnetic field. |
169 | static Bool_t fgUniformField; // Track with uniform field. | |
170 | ||
4b456ebb | 171 | private: |
172 | AliEveEventManager(const AliEveEventManager&); // Not implemented | |
173 | AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented | |
174 | ||
488869c1 | 175 | void InitInternals(); |
176 | void StartAutoLoadTimer(); | |
177 | void StopAutoLoadTimer(); | |
178 | ||
8661a211 | 179 | static Bool_t InitGRP(); |
8661a211 | 180 | |
488869c1 | 181 | Bool_t fAutoLoadTimerRunning; // State of auto-load timer. |
182 | ||
4d62585e | 183 | static AliEveEventManager* fgMaster; |
184 | static AliEveEventManager* fgCurrent; | |
185 | ||
4b456ebb | 186 | ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way. |
187 | }; | |
5a5a1232 | 188 | |
5a5a1232 | 189 | #endif |