]>
Commit | Line | Data |
---|---|---|
319f3084 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
3 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
4 | * full copyright notice. * | |
5 | **************************************************************************/ | |
6 | ||
2a6fc1f9 | 7 | class TEveProjectionManager; |
8 | class TEveGeoShape; | |
9 | class TEveUtil; | |
10 | ||
2a6fc1f9 | 11 | Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE; |
12 | ||
3545fba9 | 13 | |
de33999e | 14 | void alieve_online_init() |
319f3084 | 15 | { |
3e6470df | 16 | if (gROOT->LoadMacro("MultiView.C++") != 0) |
3545fba9 | 17 | { |
18 | gEnv->SetValue("Root.Stacktrace", "no"); | |
19 | Fatal("alieve_online.C", "Failed loading MultiView.C in compiled mode."); | |
20 | } | |
de33999e | 21 | |
a9e18d1c | 22 | TEveUtil::AssertMacro("VizDB_scan.C"); |
23 | ||
06f4984c | 24 | TEveBrowser *browser = gEve->GetBrowser(); |
2a6fc1f9 | 25 | browser->ShowCloseTab(kFALSE); |
26 | ||
3545fba9 | 27 | // Gentle-geom loading changes gGeoManager. |
28 | TEveGeoManagerHolder mgrRestore; | |
2a6fc1f9 | 29 | |
9cd7053b | 30 | gMultiView = new MultiView; |
3545fba9 | 31 | |
32 | TEveUtil::LoadMacro("geom_gentle.C"); | |
9cd7053b | 33 | gMultiView->InitGeomGentle(geom_gentle(), |
34 | geom_gentle_rphi(), | |
35 | geom_gentle_rhoz()); | |
3545fba9 | 36 | |
37 | // See visscan_init.C for how to add TRD / MUON geometry. | |
2a6fc1f9 | 38 | |
c027b127 | 39 | //============================================================================ |
40 | // Standard macros to execute -- not all are enabled by default. | |
41 | //============================================================================ | |
42 | ||
43 | AliEveMacroExecutor *exec = AliEveEventManager::GetMaster()->GetExecutor(); | |
44 | ||
45 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE)); | |
46 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE)); | |
47 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE)); | |
48 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE)); | |
49 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE)); | |
50 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE)); | |
51 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE)); | |
52 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE)); | |
53 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE)); | |
54 | ||
55 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C++", "its_clusters")); | |
56 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C++", "tpc_clusters")); | |
72d099dc | 57 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C++", "trd_clusters")); |
c027b127 | 58 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C++", "tof_clusters")); |
59 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus HMPID", "hmpid_clusters.C++", "hmpid_clusters")); | |
60 | ||
61 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "emcal_digits.C++", "emcal_digits")); | |
62 | ||
63 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS", "its_raw.C", "its_raw")); | |
64 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw")); | |
65 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TOF", "tof_raw.C", "tof_raw")); | |
66 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw")); | |
67 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw")); | |
68 | ||
69 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks", "", kFALSE)); | |
70 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_MI", "", kFALSE)); | |
71 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE)); | |
72 | ||
73 | // ??? | |
74 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC TRD", "trd_detectors.C++", "trd_detectors", "", kFALSE)); | |
75 | // trd_tracks disabled due to memory leaks | |
76 | ||
77 | //---------------------------------------------------------------------------- | |
78 | ||
79 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
80 | slot->StartEmbedding(); | |
81 | AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec); | |
82 | slot->StopEmbedding("DataSelection"); | |
83 | exewin->PopulateMacros(); | |
84 | ||
85 | //============================================================================ | |
86 | // Final GUI setup | |
87 | //============================================================================ | |
88 | ||
14a4b686 | 89 | browser->GetTabRight()->SetTab(1); |
de33999e | 90 | |
47aab29b | 91 | browser->StartEmbedding(TRootBrowser::kBottom); |
4d62585e | 92 | new AliEveEventManagerWindow(AliEveEventManager::GetMaster()); |
47aab29b | 93 | browser->StopEmbedding("EventCtrl"); |
94 | ||
06f4984c | 95 | browser->MoveResize(0, 0, gClient->GetDisplayWidth(), |
96 | gClient->GetDisplayHeight() - 32); | |
97 | ||
98 | gEve->GetViewers()->SwitchColorSet(); | |
99 | ||
100 | TString autoRun(gSystem->Getenv("ONLINERECO_AUTORUN")); | |
101 | if (autoRun == "1" || autoRun.CompareTo("true", TString::kIgnoreCase) == 0) | |
102 | { | |
103 | AliEveEventManager::GetMaster()->SetAutoLoad(kTRUE); | |
104 | } | |
105 | ||
1110f3fe | 106 | { |
107 | TGTab *tab = gEve->GetBrowser()->GetTab(2); | |
108 | ||
109 | TGHorizontalFrame *hf = (TGHorizontalFrame*) tab->GetParent(); | |
110 | TGVerticalFrame *vf = (TGVerticalFrame*) hf ->GetParent(); | |
111 | ||
112 | hf->Resize(hf->GetWidth(), hf->GetHeight() + 80); | |
113 | vf->Layout(); | |
114 | } | |
115 | ||
3e6470df | 116 | gEve->FullRedraw3D(kTRUE); |
117 | ||
9cd7053b | 118 | TGLViewer *glv = gMultiView->f3DView->GetGLViewer(); |
3e6470df | 119 | glv->CurrentCamera().RotateRad(-0.4, 1); |
120 | glv->DoDraw(); | |
de33999e | 121 | } |
122 | ||
9cd7053b | 123 | |
124 | Int_t g_pic_id = 0; | |
125 | Int_t g_pic_max = 10; | |
126 | TTimeStamp g_pic_prev(0, 0); | |
44854372 | 127 | |
de33999e | 128 | void alieve_online_on_new_event() |
129 | { | |
de33999e | 130 | AliESDEvent* esd = AliEveEventManager::AssertESD(); |
131 | Double_t x[3]; | |
132 | esd->GetPrimaryVertex()->GetXYZ(x); | |
133 | ||
134 | TEveElement* top = gEve->GetCurrentEvent(); | |
135 | ||
9cd7053b | 136 | gMultiView->DestroyEventRPhi(); |
3545fba9 | 137 | if (gCenterProjectionsAtPrimaryVertex) |
9cd7053b | 138 | gMultiView->SetCenterRPhi(x[0], x[1], x[2]); |
139 | gMultiView->ImportEventRPhi(top); | |
3545fba9 | 140 | |
9cd7053b | 141 | gMultiView->DestroyEventRhoZ(); |
3545fba9 | 142 | if (gCenterProjectionsAtPrimaryVertex) |
9cd7053b | 143 | gMultiView->SetCenterRhoZ(x[0], x[1], x[2]); |
144 | gMultiView->ImportEventRhoZ(top); | |
44854372 | 145 | |
9cd7053b | 146 | // Register image to amore. |
44854372 | 147 | const TString pichost("aldaqacrs3"); |
9cd7053b | 148 | TTimeStamp now; |
149 | Double_t delta = now.AsDouble() - g_pic_prev.AsDouble(); | |
150 | ||
151 | printf("Pre image dump: host='%s', delta=%f.\n", | |
152 | gSystem->HostName(), delta); | |
153 | ||
44854372 | 154 | if (pichost == gSystem->HostName() && delta >= 30) |
155 | { | |
156 | TString id; id.Form("online-viz-%03d", g_pic_id); | |
157 | TString pic(id); pic += ".png"; | |
158 | ||
9cd7053b | 159 | printf("In image dump: file='%s'.\n", pic.Data()); |
160 | ||
44854372 | 161 | gEve->GetBrowser()->RaiseWindow(); |
162 | gEve->FullRedraw3D(); | |
163 | gSystem->ProcessEvents(); | |
44854372 | 164 | |
9cd7053b | 165 | Int_t status; |
166 | ||
167 | status = gSystem->Exec(TString::Format("xwd -id %u | convert - %s", | |
168 | gEve->GetBrowser()->GetId(), pic.Data())); | |
169 | ||
170 | printf("Post capture -- status=%d.\n", status); | |
171 | ||
172 | status = gSystem->Exec(TString::Format("SendImageToAmore %s %s %d", | |
173 | id.Data(), pic.Data(), | |
174 | AliEveEventManager::AssertRawReader()->GetRunNumber())); | |
175 | ||
176 | printf("Post AMORE reg -- status=%d, run=%d.\n", status, | |
177 | AliEveEventManager::AssertRawReader()->GetRunNumber()); | |
44854372 | 178 | |
179 | if (++g_pic_id >= g_pic_max) | |
180 | g_pic_id = 0; | |
9cd7053b | 181 | g_pic_prev.Set(); |
44854372 | 182 | } |
319f3084 | 183 | } |