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