]>
Commit | Line | Data |
---|---|---|
ef795f0b | 1 | // $Id: AliEveEventManager.h 64557 2013-10-16 20:03:08Z hristov $ |
d810d0de | 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 | |
f944f125 | 17 | #include <AliEventInfo.h> |
18 | ||
7e0cf530 | 19 | #include <AliESDEvent.h> |
20 | ||
7e0cf530 | 21 | |
ef795f0b | 22 | #ifdef ZMQ |
23 | #include <zmq.hpp> | |
24 | #else | |
25 | namespace zmq{ | |
26 | class context_t; | |
27 | } | |
28 | #endif | |
7e0cf530 | 29 | |
f6afd0e1 | 30 | class AliEveMacroExecutor; |
3d94b490 | 31 | class AliEveEventSelector; |
ef795f0b | 32 | class AliSocket; |
f6afd0e1 | 33 | |
5a5a1232 | 34 | class AliRunLoader; |
af885e0f | 35 | class AliESDEvent; |
3aecaefc | 36 | class AliESDfriend; |
b3b7b8d3 | 37 | class AliAODEvent; |
c2c4b7a2 | 38 | class AliRawReader; |
5a5a1232 | 39 | |
8661a211 | 40 | class AliGRPObject; |
f944f125 | 41 | class AliRecoParam; |
93845f6c | 42 | class AliMagF; |
43 | ||
3d94b490 | 44 | class TEveElement; |
5a5a1232 | 45 | class TFile; |
46 | class TTree; | |
632d2b03 | 47 | class TGeoManager; |
3d94b490 | 48 | class TString; |
49 | class TMap; | |
5a5a1232 | 50 | |
a15e6d7d | 51 | //============================================================================== |
52 | // | |
53 | // AliEveEventManager | |
54 | // | |
55 | // Interface to ALICE event-data (RunLoader, ESD), magnetic field and | |
56 | // geometry. | |
57 | // | |
58 | ||
5a5a1232 | 59 | |
f76c9e9b | 60 | class AliEveEventManager : public TEveEventManager, |
51104899 | 61 | public TQObject |
5a5a1232 | 62 | { |
5a5a1232 | 63 | public: |
51104899 | 64 | enum EVisibleESDTrees{ kOfflineTree, kHLTTree }; |
65 | ||
66 | static void SetESDFileName(const TString& esd, EVisibleESDTrees shown=kOfflineTree); | |
67 | static void SetESDfriendFileName(const TString& esdf); | |
68 | static void SetAODFileName(const TString& aod); | |
69 | static void AddAODfriend (const TString& friendFileName); | |
70 | static void SetRawFileName(const TString& raw); | |
71 | static void SetCdbUri (const TString& cdb); | |
72 | static void SetGAliceFileName(const TString& galice); | |
73 | ||
74 | // set Local Directory or URL where the files are located | |
75 | // it can also be a path to root_archive.zip | |
76 | // assumes the filenames of ESD, AOD, etc are standard ALICE names | |
77 | // (AliESDs.root, AliESDfriends.root, AliAOD.root, AliAODfriend.root, galice.root,raw.root) | |
78 | static void SetFilesPath(const TString& path); | |
79 | ||
80 | static void SetAssertElements(Bool_t assertRunloader, Bool_t assertEsd, | |
81 | Bool_t assertAod, Bool_t assertRaw); | |
82 | static void SearchRawForCentralReconstruction(); | |
83 | ||
84 | AliEveEventManager(const TString& name="Event", Int_t ev=0); | |
85 | virtual ~AliEveEventManager(); | |
86 | ||
87 | virtual void Open(); | |
88 | void SetEvent(AliRunLoader *runLoader, AliRawReader *rawReader, AliESDEvent *esd, AliESDfriend *esdf); | |
89 | virtual Int_t GetMaxEventId(Bool_t refreshESD=kFALSE) const; | |
90 | virtual void GotoEvent(Int_t event); | |
91 | virtual void NextEvent(); | |
92 | virtual void PrevEvent(); | |
93 | virtual void Close(); | |
94 | void Timeout(); // * SIGNAL* | |
95 | ||
96 | Int_t GetEventId() const { return fEventId; } | |
97 | AliRunLoader* GetRunLoader() const { return fRunLoader; } | |
98 | TFile* GetESDFile() const { return fESDFile; } | |
99 | TTree* GetESDTree() const { return fESDTree; } | |
100 | TTree* GetHLTESDTree() const { return fHLTESDTree; } | |
101 | AliESDEvent* GetESD() const { return fESD; } | |
102 | AliESDfriend* GetESDfriend() const { return fESDfriend; } | |
103 | Bool_t GetESDfriendExists() const { return fESDfriendExists; } | |
104 | TFile* GetAODFile() const { return fAODFile; } | |
105 | TTree* GetAODTree() const { return fAODTree; } | |
106 | AliAODEvent* GetAOD() const { return fAOD; } | |
107 | AliEveEventSelector* GetEventSelector() const { return fPEventSelector; } | |
108 | TString GetEventInfoHorizontal() const; | |
109 | TString GetEventInfoVertical() const; | |
110 | const AliEventInfo* GetEventInfo(); | |
111 | ||
ef795f0b | 112 | static bool ConnectToServer(const char* host, int port); // connect to the events server |
7e0cf530 | 113 | |
51104899 | 114 | static Int_t CurrentEventId(); |
115 | ||
116 | static Bool_t HasRunLoader(); | |
117 | static Bool_t HasESD(); | |
118 | static Bool_t HasESDfriend(); | |
119 | static Bool_t HasAOD(); | |
120 | static Bool_t HasRawReader(); | |
121 | ||
122 | static AliRunLoader* AssertRunLoader(); | |
123 | static AliESDEvent* AssertESD(); | |
124 | static AliESDfriend* AssertESDfriend(); | |
125 | static AliAODEvent* AssertAOD(); | |
126 | static AliRawReader* AssertRawReader(); | |
127 | ||
128 | static AliMagF* AssertMagField(); | |
129 | static TGeoManager* AssertGeometry(); | |
130 | static AliRecoParam* AssertRecoParams(); | |
ef795f0b | 131 | |
132 | static AliSocket* AssertSubscriber(); | |
51104899 | 133 | |
134 | static AliEveEventManager* AddDependentManager(const TString& name, const TString& path); | |
135 | static AliEveEventManager* GetDependentManager(const TString& name); | |
136 | ||
137 | static AliEveEventManager* GetMaster(); | |
138 | static AliEveEventManager* GetCurrent(); | |
139 | ||
140 | static void RegisterTransient (TEveElement* element); | |
141 | static void RegisterTransientList(TEveElement* element); | |
142 | ||
143 | ||
144 | Double_t GetAutoLoadTime() const { return fAutoLoadTime; } | |
145 | Bool_t GetAutoLoad() const { return fAutoLoad; } | |
146 | void SetAutoLoadTime(Float_t time); | |
147 | void SetAutoLoad(Bool_t autoLoad); | |
148 | void SetTrigSel(Int_t trig); | |
149 | void AutoLoadNextEvent(); | |
150 | ||
151 | Bool_t AreEventFilesOpened() const { return fIsOpen; } | |
152 | Bool_t IsEventAvailable() const { return fHasEvent; } | |
153 | Bool_t IsUnderExternalControl() const { return fExternalCtrl; } | |
154 | ||
155 | Bool_t InsertGlobal(const TString& tag, TEveElement* model); | |
156 | Bool_t InsertGlobal(const TString& tag, TEveElement* model, | |
157 | Bool_t replace, Bool_t update); | |
158 | TEveElement* FindGlobal(const TString& tag); | |
159 | ||
160 | virtual void AfterNewEventLoaded(); | |
161 | void NewEventDataLoaded(); // *SIGNAL* | |
162 | void NewEventLoaded(); // *SIGNAL* | |
163 | ||
164 | AliEveMacroExecutor* GetExecutor() const { return fExecutor; } | |
ef795f0b | 165 | void InitOCDB(int runNo=-1); |
4b456ebb | 166 | protected: |
51104899 | 167 | Int_t fEventId; // Id of current event. |
4b456ebb | 168 | |
51104899 | 169 | AliRunLoader* fRunLoader; // Run loader. |
4b456ebb | 170 | |
51104899 | 171 | TFile *fESDFile; // ESD file. |
172 | TTree *fESDTree; // ESD tree. | |
173 | TTree *fHLTESDTree; // HLT ESD tree. | |
174 | AliESDEvent *fESD; // ESDEvent object. | |
175 | AliESDfriend *fESDfriend; // ESDfriend object. | |
176 | Bool_t fESDfriendExists; // Flag specifying if ESDfriend was found during opening of the event-data. | |
177 | TFile *fAODFile; // AOD file. | |
178 | TTree *fAODTree; // AOD tree. | |
179 | AliAODEvent *fAOD; // AODEvent object. | |
4b456ebb | 180 | |
51104899 | 181 | AliRawReader *fRawReader; // Raw-data reader. |
182 | AliEventInfo fEventInfo; // Current Event Info | |
80547f2d | 183 | |
51104899 | 184 | Bool_t fAutoLoad; // Automatic loading of events (online) |
185 | Float_t fAutoLoadTime; // Auto-load time in seconds | |
186 | TTimer *fAutoLoadTimer; // Timer for automatic event loading | |
80547f2d | 187 | |
51104899 | 188 | Bool_t fIsOpen; // Are event-files opened. |
189 | Bool_t fHasEvent; // Is an event available. | |
190 | Bool_t fExternalCtrl; // Are we under external event-loop. | |
3d94b490 | 191 | |
51104899 | 192 | TMap* fGlobal; |
193 | Bool_t fGlobalReplace; // Are global replace | |
194 | Bool_t fGlobalUpdate; // Are global updates | |
f6afd0e1 | 195 | |
51104899 | 196 | AliEveMacroExecutor *fExecutor; // Executor for std macros |
08b0f222 | 197 | |
51104899 | 198 | TEveElementList *fTransients; // Container for additional transient (per event) elements. |
199 | TEveElementList *fTransientLists; // Container for lists of transient (per event) elements. | |
008ac94c | 200 | |
51104899 | 201 | AliEveEventSelector* fPEventSelector; // Event filter |
4d62585e | 202 | |
51104899 | 203 | TList *fSubManagers; // Dependent event-managers, used for event embedding. |
4b456ebb | 204 | |
51104899 | 205 | static TString fgGAliceFileName; // galice.root file |
206 | static TString fgESDFileName; // Name by which to open ESD. | |
207 | static EVisibleESDTrees fgESDvisibleTrees; // trees to open from ESD | |
208 | static TString fgESDfriendsFileName; | |
209 | static TString fgAODFileName; // Name by which to open AOD. | |
210 | static TString fgRawFileName; // Name by which to open raw-data file. | |
211 | static TString fgCdbUri; // Global URI to CDB. | |
212 | static Bool_t fgAssertRunLoader; // Global flag specifying if AliRunLoader must be asserted during opening of the event-data. | |
213 | static Bool_t fgAssertESD; // Global flag specifying if ESDEvent must be asserted during opening of the event-data. | |
214 | static Bool_t fgAssertAOD; // Global flag specifying if AODEvent must be asserted during opening of the event-data. | |
215 | static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data. | |
4b456ebb | 216 | |
51104899 | 217 | static TList *fgAODfriends; // Global list of AOD friend names to be attached during opening of the event-data (empty by default). |
25dddcb1 | 218 | |
51104899 | 219 | static Bool_t fgRawFromStandardLoc; // Global flag to enable looking for raw data in ../../../raw/, as it is stored for central reco. |
220 | ||
221 | static Bool_t fgGRPLoaded; // Global run parameters loaded? | |
222 | static AliMagF *fgMagField; // Global pointer to magnetic field. | |
223 | static AliRecoParam* fgRecoParam; | |
224 | static Bool_t fgUniformField; // Track with uniform field. | |
8661a211 | 225 | |
ef795f0b | 226 | static zmq::context_t* fgSubContext; |
227 | static AliSocket* fgSubSock; | |
4b456ebb | 228 | private: |
51104899 | 229 | AliEveEventManager(const AliEveEventManager&); // Not implemented |
230 | AliEveEventManager& operator=(const AliEveEventManager&); // Not implemented | |
231 | ||
232 | void InitInternals(); | |
ef795f0b | 233 | |
51104899 | 234 | void StartAutoLoadTimer(); |
235 | void StopAutoLoadTimer(); | |
4b456ebb | 236 | |
51104899 | 237 | static Bool_t InitGRP(); |
238 | static Bool_t InitRecoParam(); | |
488869c1 | 239 | |
51104899 | 240 | TTree* readESDTree(const char* treeName, int &run); |
8661a211 | 241 | |
51104899 | 242 | Bool_t fAutoLoadTimerRunning; // State of auto-load timer. |
488869c1 | 243 | |
51104899 | 244 | static AliEveEventManager* fgMaster; |
245 | static AliEveEventManager* fgCurrent; | |
4d62585e | 246 | |
51104899 | 247 | ClassDef(AliEveEventManager, 0); // Interface for getting all event components in a uniform way. |
4b456ebb | 248 | }; |
5a5a1232 | 249 | |
5a5a1232 | 250 | #endif |