Autorun functionality added (Matevz)
[u/mrichter/AliRoot.git] / EVE / macros / alieve_online.C
CommitLineData
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 7class TEveProjectionManager;
8class TEveGeoShape;
9class TEveUtil;
10
2a6fc1f9 11Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
12
3545fba9 13
de33999e 14void alieve_online_init()
319f3084 15{
3545fba9 16 if (gROOT->LoadMacro("MultiView.C+") != 0)
17 {
18 gEnv->SetValue("Root.Stacktrace", "no");
19 Fatal("alieve_online.C", "Failed loading MultiView.C in compiled mode.");
20 }
de33999e 21
22 gROOT->LoadMacro("primary_vertex.C");
23 gROOT->LoadMacro("esd_tracks.C");
44c97b40 24 // Disabled due to memory leaks
25 // gROOT->LoadMacro("trd_tracks.C++");
9fb2a3ed 26 gROOT->LoadMacro("trd_detectors.C++");
de33999e 27
dc9dec4d 28 gROOT->LoadMacro("its_clusters.C++");
29 gROOT->LoadMacro("tpc_clusters.C++");
95a0b764 30 gROOT->LoadMacro("tof_clusters.C++");
f1fa3b4b 31 gROOT->LoadMacro("hmpid_clusters.C++");
38aefcea 32 gROOT->LoadMacro("emcal_digits.C++");
de33999e 33
34 gROOT->LoadMacro("acorde_raw.C");
35 gROOT->LoadMacro("its_raw.C");
36 gROOT->LoadMacro("tpc_raw.C");
95a0b764 37 gROOT->LoadMacro("tof_raw.C");
0cf37c7b 38 gROOT->LoadMacro("vzero_raw.C");
de33999e 39
a9e18d1c 40 TEveUtil::AssertMacro("VizDB_scan.C");
41
2a6fc1f9 42 TEveBrowser *browser = gEve->GetBrowser();
43 browser->ShowCloseTab(kFALSE);
44
3545fba9 45 // Gentle-geom loading changes gGeoManager.
46 TEveGeoManagerHolder mgrRestore;
2a6fc1f9 47
3545fba9 48 gMultiView = new MultiView;
49
50 TEveUtil::LoadMacro("geom_gentle.C");
51 gMultiView->InitGeomGentle(geom_gentle(),
52 geom_gentle_rphi(),
53 geom_gentle_rhoz());
54
55 // See visscan_init.C for how to add TRD / MUON geometry.
2a6fc1f9 56
14a4b686 57 browser->GetTabRight()->SetTab(1);
de33999e 58
47aab29b 59 browser->StartEmbedding(TRootBrowser::kBottom);
4d62585e 60 new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
47aab29b 61 browser->StopEmbedding("EventCtrl");
62
de33999e 63 gEve->Redraw3D(kTRUE);
64}
65
66void alieve_online_on_new_event()
67{
effa8d5d 68 if (AliEveEventManager::HasRawReader())
69 its_raw();
de33999e 70 its_clusters();
71
effa8d5d 72 if (AliEveEventManager::HasRawReader())
73 tpc_raw();
de33999e 74 tpc_clusters();
75
95a0b764 76 if (AliEveEventManager::HasRawReader())
77 tof_raw();
78 tof_clusters();
79
f1fa3b4b 80 hmpid_clusters();
81
effa8d5d 82 if (AliEveEventManager::HasRawReader())
83 acorde_raw();
de33999e 84
0cf37c7b 85 if (AliEveEventManager::HasRawReader())
86 vzero_raw();
87
38aefcea 88 emcal_digits();
89
de33999e 90 primary_vertex();
91 esd_tracks();
92
44c97b40 93 // Disabled due to memory leaks
94 // if (AliEveEventManager::HasESDfriend()) trd_tracks();
95 // AliSysInfo::AddStamp("EveTRDTr");
9fb2a3ed 96 trd_detectors();
97
de33999e 98 AliESDEvent* esd = AliEveEventManager::AssertESD();
99 Double_t x[3];
100 esd->GetPrimaryVertex()->GetXYZ(x);
101
102 TEveElement* top = gEve->GetCurrentEvent();
103
3545fba9 104 gMultiView->DestroyEventRPhi();
105 if (gCenterProjectionsAtPrimaryVertex)
106 gMultiView->SetCenterRPhi(x[0], x[1], x[2]);
107 gMultiView->ImportEventRPhi(top);
108
109 gMultiView->DestroyEventRhoZ();
110 if (gCenterProjectionsAtPrimaryVertex)
111 gMultiView->SetCenterRhoZ(x[0], x[1], x[2]);
112 gMultiView->ImportEventRhoZ(top);
319f3084 113}