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