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