]>
Commit | Line | Data |
---|---|---|
1 | // $Id$ | |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
7 | * full copyright notice. * | |
8 | **************************************************************************/ | |
9 | ||
10 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
11 | #include <AliQAHistViewer.h> | |
12 | #endif | |
13 | ||
14 | class AliEveMacroExecutor; | |
15 | class TEveProjectionManager; | |
16 | class TEveGeoShape; | |
17 | class TEveUtil; | |
18 | class TSystem; | |
19 | class TInterpreter; | |
20 | ||
21 | ||
22 | Bool_t gShowMuonRPhi = kFALSE; | |
23 | Bool_t gShowMuonRhoZ = kTRUE; | |
24 | ||
25 | Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE; | |
26 | ||
27 | ||
28 | void visscan_init(const TString& cdburi = "", | |
29 | const TString& path = ".", | |
30 | Bool_t showHLTESDTree=kFALSE, | |
31 | Bool_t showMuon = kTRUE, | |
32 | Bool_t showTrd = kFALSE) | |
33 | { | |
34 | ||
35 | if (showMuon) | |
36 | { | |
37 | if (gSystem->Getenv("ALICE_ROOT") != 0) | |
38 | { | |
39 | gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT"))); | |
40 | gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT"))); | |
41 | } | |
42 | } | |
43 | else | |
44 | { | |
45 | gShowMuonRPhi = gShowMuonRhoZ = kFALSE; | |
46 | } | |
47 | ||
48 | if (cdburi.IsNull() && ! AliCDBManager::Instance()->IsDefaultStorageSet()) | |
49 | { | |
50 | gEnv->SetValue("Root.Stacktrace", "no"); | |
51 | Fatal("visscan_init.C", "OCDB path MUST be specified as the first argument."); | |
52 | } | |
53 | ||
54 | AliEveEventManager::AddAODfriend("AliAOD.VertexingHF.root"); | |
55 | ||
56 | TEveUtil::LoadMacro("alieve_init.C"); | |
57 | alieve_init(cdburi, path, -1, showHLTESDTree); | |
58 | ||
59 | // TEveLine::SetDefaultSmooth(1); | |
60 | ||
61 | TEveUtil::AssertMacro("VizDB_scan.C"); | |
62 | ||
63 | AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor(); | |
64 | TEveBrowser *browser = gEve->GetBrowser(); | |
65 | browser->ShowCloseTab(kFALSE); | |
66 | ||
67 | ||
68 | //============================================================================== | |
69 | // Geometry, scenes, projections and viewers | |
70 | //============================================================================== | |
71 | ||
72 | AliEveMultiView *mv = new AliEveMultiView; | |
73 | ||
74 | mv->SetDepth(-10); | |
75 | ||
76 | TEveUtil::LoadMacro("geom_gentle.C"); | |
77 | mv->InitGeomGentle(geom_gentle(), geom_gentle_rphi(), geom_gentle_rhoz(), 0); | |
78 | ||
79 | if (showTrd) { | |
80 | TEveUtil::LoadMacro("geom_gentle_trd.C"); | |
81 | mv->InitGeomGentleTrd(geom_gentle_trd()); | |
82 | } | |
83 | ||
84 | if (gShowMuonRPhi || gShowMuonRhoZ) { | |
85 | TEveUtil::LoadMacro("geom_gentle_muon.C"); | |
86 | mv->InitGeomGentleMuon(geom_gentle_muon(kFALSE), gShowMuonRPhi, gShowMuonRhoZ, kFALSE); | |
87 | } | |
88 | ||
89 | mv->SetDepth(0); | |
90 | ||
91 | //============================================================================== | |
92 | // Registration of per-event macros | |
93 | //============================================================================== | |
94 | ||
95 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE)); | |
96 | ||
97 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ITS", "its_hits.C", "its_hits", "", kFALSE)); | |
98 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TPC", "tpc_hits.C", "tpc_hits", "", kFALSE)); | |
99 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits T0", "t0_hits.C", "t0_hits", "", kFALSE)); | |
100 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits FMD", "fmd_hits.C", "fmd_hits", "", kFALSE)); | |
101 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ACORDE", "acorde_hits.C", "acorde_hits", "", kFALSE)); | |
102 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits EMCAL", "emcal_hits.C", "emcal_hits", "", kFALSE)); | |
103 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TOF", "tof_hits.C", "tof_hits", "", kFALSE)); | |
104 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TRD", "trd_hits.C", "trd_hits", "", kFALSE)); | |
105 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits VZERO", "vzero_hits.C", "vzero_hits", "", kFALSE)); | |
106 | ||
107 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG ITS", "its_digits.C", "its_digits", "", kFALSE)); | |
108 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TPC", "tpc_digits.C", "tpc_digits", "", kFALSE)); | |
109 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TOF", "tof_digits.C", "tof_digits", "", kFALSE)); | |
110 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG HMPID", "hmpid_digits.C","hmpid_digits","", kFALSE)); | |
111 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD", "fmd_digits.C", "fmd_digits", "", kFALSE)); | |
112 | ||
113 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS", "its_raw.C", "its_raw", "", kFALSE)); | |
114 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw", "", kFALSE)); | |
115 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TOF", "tof_raw.C", "tof_raw", "", kFALSE)); | |
116 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW HMPID", "hmpid_raw.C", "hmpid_raw", "", kFALSE)); | |
117 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0", "t0_raw.C", "t0_raw", "", kFALSE)); | |
118 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw", "", kFALSE)); | |
119 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE)); | |
120 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE)); | |
121 | ||
122 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE)); | |
123 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE)); | |
124 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE)); | |
125 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX SPD", "primary_vertex.C", "primary_vertex_spd", "", kTRUE)); | |
126 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse SPD", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE)); | |
127 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box SPD", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE)); | |
128 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX TPC", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE)); | |
129 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse TPC", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE)); | |
130 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box TPC", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE)); | |
131 | ||
132 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_onfly")); | |
133 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_offline")); | |
134 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0")); | |
135 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C", "esd_cascade_points")); | |
136 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C", "esd_cascade")); | |
137 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C", "esd_kink_points")); | |
138 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C", "esd_kink")); | |
139 | ||
140 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks", "esd_tracks.C", "esd_tracks", "", kFALSE)); | |
141 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS standalone", "esd_tracks.C", "esd_tracks_ITS_standalone", "", kFALSE)); | |
142 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS", "esd_tracks.C", "esd_tracks_ITS", "", kFALSE)); | |
143 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks TPC", "esd_tracks.C", "esd_tracks_TPC", "", kFALSE)); | |
144 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MI", "esd_tracks.C", "esd_tracks_MI", "", kFALSE)); | |
145 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by category", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE)); | |
146 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by anal cuts", "esd_tracks.C", "esd_tracks_by_anal_cuts", "", kFALSE)); | |
147 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Lego", "lego.C", "lego", "", kFALSE)); | |
148 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Beams Info", "beams_info.C", "beams_info", "", kFALSE)); | |
149 | ||
150 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklets SPD", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kTRUE)); | |
151 | ||
152 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC", "esd_zdc.C", "esd_zdc", "", kFALSE)); | |
153 | ||
154 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters", "clusters.C", "clusters", "", kFALSE)); | |
155 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters ITS", "its_clusters.C", "its_clusters")); | |
156 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TPC", "tpc_clusters.C", "tpc_clusters")); | |
157 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TRD", "trd_clusters.C", "trd_clusters")); | |
158 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TOF", "tof_clusters.C", "tof_clusters")); | |
159 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters HMPID", "hmpid_clusters.C", "hmpid_clusters")); | |
160 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters PHOS", "phos_clusters.C", "phos_clusters")); | |
161 | ||
162 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TPC", "vplot_tpc.C", "vplot_tpc", "", kFALSE)); | |
163 | ||
164 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF", "aod_HF.C", "aod_HF", "", kFALSE)); | |
165 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE)); | |
166 | ||
167 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "DUMP VZERO", "vzero_dump.C", "vzero_dump", "", kFALSE)); | |
168 | ||
169 | if (showMuon) | |
170 | { | |
171 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM TrackRef MUON", "muon_trackRefs.C", "muon_trackRefs", "kTRUE", kFALSE)); | |
172 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON", "muon_raw.C", "muon_raw", "", kFALSE)); | |
173 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG MUON", "muon_digits.C", "muon_digits", "", kFALSE)); | |
174 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters MUON", "muon_clusters.C", "muon_clusters", "", kTRUE)); | |
175 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MUON", "esd_muon_tracks.C", "esd_muon_tracks", "kTRUE,kFALSE", kTRUE)); | |
176 | } | |
177 | ||
178 | //============================================================================== | |
179 | // Additional GUI components | |
180 | //============================================================================== | |
181 | ||
182 | // Macro / data selection | |
183 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
184 | slot->StartEmbedding(); | |
185 | AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec); | |
186 | slot->StopEmbedding("DataSelection"); | |
187 | exewin->PopulateMacros(); | |
188 | ||
189 | // Event selection tab | |
190 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
191 | slot->StartEmbedding(); | |
192 | new AliEveEventSelectorWindow(gClient->GetRoot(), 600, 400, AliEveEventManager::GetMaster()->GetEventSelector()); | |
193 | slot->StopEmbedding("Selections"); | |
194 | ||
195 | // QA viewer | |
196 | /* | |
197 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
198 | slot->StartEmbedding(); | |
199 | new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE); | |
200 | slot->StopEmbedding("QA histograms"); | |
201 | ||
202 | browser->GetTabRight()->SetTab(1); | |
203 | */ | |
204 | browser->StartEmbedding(TRootBrowser::kBottom); | |
205 | new AliEveEventManagerWindow(AliEveEventManager::GetMaster()); | |
206 | browser->StopEmbedding("EventCtrl"); | |
207 | ||
208 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
209 | TEveWindowTab *store_tab = slot->MakeTab(); | |
210 | store_tab->SetElementNameTitle("WindowStore", | |
211 | "Undocked windows whose previous container is not known\n" | |
212 | "are placed here when the main-frame is closed."); | |
213 | gEve->GetWindowManager()->SetDefaultContainer(store_tab); | |
214 | ||
215 | ||
216 | //============================================================================== | |
217 | // AliEve objects - global tools | |
218 | //============================================================================== | |
219 | ||
220 | AliEveTrackFitter* fitter = new AliEveTrackFitter(); | |
221 | gEve->AddToListTree(fitter, 1); | |
222 | gEve->AddElement(fitter, gEve->GetEventScene()); | |
223 | ||
224 | AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter"); | |
225 | gEve->AddToListTree(g_trkcnt, kFALSE); | |
226 | ||
227 | ||
228 | //============================================================================== | |
229 | // Final stuff | |
230 | //============================================================================== | |
231 | ||
232 | // A refresh to show proper window. | |
233 | gEve->GetViewers()->SwitchColorSet(); | |
234 | gEve->Redraw3D(kTRUE); | |
235 | gSystem->ProcessEvents(); | |
236 | ||
237 | // Register command to call on each event. | |
238 | AliEveEventManager::GetMaster()->AddNewEventCommand("on_new_event();"); | |
239 | AliEveEventManager::GetMaster()->GotoEvent(0); | |
240 | ||
241 | gEve->EditElement(g_trkcnt); | |
242 | ||
243 | gEve->Redraw3D(kTRUE); | |
244 | } | |
245 | ||
246 | /******************************************************************************/ | |
247 | ||
248 | void on_new_event() | |
249 | { | |
250 | Double_t x[3] = { 0, 0, 0 }; | |
251 | ||
252 | if (AliEveEventManager::HasESD()) | |
253 | { | |
254 | AliESDEvent* esd = AliEveEventManager::AssertESD(); | |
255 | esd->GetPrimaryVertex()->GetXYZ(x); | |
256 | ||
257 | TTimeStamp ts(esd->GetTimeStamp()); | |
258 | TString win_title("Eve Main Window -- Timestamp: "); | |
259 | win_title += ts.AsString("s"); | |
260 | win_title += "; Event # in ESD file: "; | |
261 | win_title += esd->GetEventNumberInFile(); | |
262 | gEve->GetBrowser()->SetWindowName(win_title); | |
263 | } | |
264 | ||
265 | TEveElement* top = gEve->GetCurrentEvent(); | |
266 | ||
267 | AliEveMultiView *mv = AliEveMultiView::Instance(); | |
268 | ||
269 | //mv->DestroyEventRPhi(); | |
270 | if (gCenterProjectionsAtPrimaryVertex) | |
271 | mv->SetCenterRPhi(x[0], x[1], x[2]); | |
272 | mv->ImportEventRPhi(top); | |
273 | ||
274 | //mv->DestroyEventRhoZ(); | |
275 | if (gCenterProjectionsAtPrimaryVertex) | |
276 | mv->SetCenterRhoZ(x[0], x[1], x[2]); | |
277 | mv->ImportEventRhoZ(top); | |
278 | } |