updating primary particle selection for high multiplicty trigger in pythia simulation
[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
4d62585e 11TEveGeoShape *gGeomGentle = 0;
de33999e 12
2a6fc1f9 13TEveScene *gRPhiGeomScene = 0;
14TEveScene *gRhoZGeomScene = 0;
15TEveScene *gRPhiEventScene = 0;
16TEveScene *gRhoZEventScene = 0;
17
18TEveProjectionManager *gRPhiMgr = 0;
19TEveProjectionManager *gRhoZMgr = 0;
20
21TEveViewer *g3DView = 0;
22TEveViewer *gRPhiView = 0;
23TEveViewer *gRhoZView = 0;
24
25Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
26
de33999e 27void alieve_online_init()
319f3084 28{
de33999e 29 gROOT->LoadMacro("geom_gentle.C");
30
31 gROOT->LoadMacro("primary_vertex.C");
32 gROOT->LoadMacro("esd_tracks.C");
44c97b40 33 // Disabled due to memory leaks
34 // gROOT->LoadMacro("trd_tracks.C++");
9fb2a3ed 35 gROOT->LoadMacro("trd_detectors.C++");
de33999e 36
dc9dec4d 37 gROOT->LoadMacro("its_clusters.C++");
38 gROOT->LoadMacro("tpc_clusters.C++");
95a0b764 39 gROOT->LoadMacro("tof_clusters.C++");
f1fa3b4b 40 gROOT->LoadMacro("hmpid_clusters.C++");
de33999e 41
42 gROOT->LoadMacro("acorde_raw.C");
43 gROOT->LoadMacro("its_raw.C");
44 gROOT->LoadMacro("tpc_raw.C");
95a0b764 45 gROOT->LoadMacro("tof_raw.C");
0cf37c7b 46 gROOT->LoadMacro("vzero_raw.C");
de33999e 47
a9e18d1c 48 TEveUtil::AssertMacro("VizDB_scan.C");
49
2a6fc1f9 50 TEveBrowser *browser = gEve->GetBrowser();
51 browser->ShowCloseTab(kFALSE);
52
2a8440b7 53 // Temp fix !!!
54 TGeoManager *man = gGeoManager;
de33999e 55 gGeomGentle = geom_gentle();
2a6fc1f9 56 gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
57 gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
2a8440b7 58 // Temp fix !!!
59 gGeoManager = man;
de33999e 60
2a6fc1f9 61 // Scenes
62 gRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
63 "Scene holding projected geometry for the RPhi view.");
64 gRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
65 "Scene holding projected geometry for the RhoZ view.");
66 gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
67 "Scene holding projected geometry for the RPhi view.");
68 gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
69 "Scene holding projected geometry for the RhoZ view.");
70
71 gRPhiMgr = new TEveProjectionManager();
72 gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
73 gEve->AddToListTree(gRPhiMgr, kFALSE);
74 {
de33999e 75 TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
b631c5f2 76 a->SetMainColor(kWhite);
68ca2fe7 77 a->SetTitle("R-Phi");
b631c5f2 78 a->SetTitleSize(0.05);
2a6fc1f9 79 a->SetTitleFont(102);
b631c5f2 80 a->SetLabelSize(0.025);
2a6fc1f9 81 a->SetLabelFont(102);
82 gRPhiGeomScene->AddElement(a);
de33999e 83 }
2a6fc1f9 84 gRPhiMgr->SetCurrentDepth(-10);
85 gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
86 gRPhiMgr->SetCurrentDepth(0);
87
88 gRhoZMgr = new TEveProjectionManager();
89 gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
90 gEve->AddToListTree(gRhoZMgr, kFALSE);
91 {
de33999e 92 TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
b631c5f2 93 a->SetMainColor(kWhite);
2a6fc1f9 94 a->SetTitle("Rho-Z");
b631c5f2 95 a->SetTitleSize(0.05);
2a6fc1f9 96 a->SetTitleFont(102);
b631c5f2 97 a->SetLabelSize(0.025);
2a6fc1f9 98 a->SetLabelFont(102);
99 gRhoZGeomScene->AddElement(a);
de33999e 100 }
2a6fc1f9 101 gRhoZMgr->SetCurrentDepth(-10);
102 gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
103 gRhoZMgr->SetCurrentDepth(0);
104
105 // Viewers
106 TEveWindowSlot *slot = 0;
107 TEveWindowPack *pack = 0;
108
109 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
110 pack = slot->MakePack();
111 pack->SetElementName("Multi View");
112 pack->SetHorizontal();
113 pack->SetShowTitleBar(kFALSE);
114 pack->NewSlot()->MakeCurrent();
115 g3DView = gEve->SpawnNewViewer("3D View", "");
116 g3DView->AddScene(gEve->GetGlobalScene());
117 g3DView->AddScene(gEve->GetEventScene());
118
119 pack = pack->NewSlot()->MakePack();
120 pack->SetShowTitleBar(kFALSE);
121 pack->NewSlot()->MakeCurrent();
122 gRPhiView = gEve->SpawnNewViewer("RPhi View", "");
123 gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
124 gRPhiView->AddScene(gRPhiGeomScene);
125 gRPhiView->AddScene(gRPhiEventScene);
126
127 pack->NewSlot()->MakeCurrent();
128 gRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
129 gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
130 gRhoZView->AddScene(gRhoZGeomScene);
131 gRhoZView->AddScene(gRhoZEventScene);
132
14a4b686 133 browser->GetTabRight()->SetTab(1);
de33999e 134
47aab29b 135 browser->StartEmbedding(TRootBrowser::kBottom);
4d62585e 136 new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
47aab29b 137 browser->StopEmbedding("EventCtrl");
138
de33999e 139 gEve->Redraw3D(kTRUE);
140}
141
142void alieve_online_on_new_event()
143{
effa8d5d 144 if (AliEveEventManager::HasRawReader())
145 its_raw();
de33999e 146 its_clusters();
147
effa8d5d 148 if (AliEveEventManager::HasRawReader())
149 tpc_raw();
de33999e 150 tpc_clusters();
151
95a0b764 152 if (AliEveEventManager::HasRawReader())
153 tof_raw();
154 tof_clusters();
155
f1fa3b4b 156 hmpid_clusters();
157
effa8d5d 158 if (AliEveEventManager::HasRawReader())
159 acorde_raw();
de33999e 160
0cf37c7b 161 if (AliEveEventManager::HasRawReader())
162 vzero_raw();
163
de33999e 164 primary_vertex();
165 esd_tracks();
166
44c97b40 167 // Disabled due to memory leaks
168 // if (AliEveEventManager::HasESDfriend()) trd_tracks();
169 // AliSysInfo::AddStamp("EveTRDTr");
9fb2a3ed 170 trd_detectors();
171
de33999e 172 AliESDEvent* esd = AliEveEventManager::AssertESD();
173 Double_t x[3];
174 esd->GetPrimaryVertex()->GetXYZ(x);
175
176 TEveElement* top = gEve->GetCurrentEvent();
177
2a6fc1f9 178 if (gRPhiMgr && top)
179 {
180 gRPhiEventScene->DestroyElements();
181 if (gCenterProjectionsAtPrimaryVertex)
182 gRPhiMgr->SetCenter(x[0], x[1], x[2]);
183 gRPhiMgr->ImportElements(top, gRPhiEventScene);
de33999e 184 }
2a6fc1f9 185 if (gRhoZMgr && top)
186 {
187 gRhoZEventScene->DestroyElements();
188 if (gCenterProjectionsAtPrimaryVertex)
189 gRhoZMgr->SetCenter(x[0], x[1], x[2]);
190 gRhoZMgr->ImportElements(top, gRhoZEventScene);
de33999e 191 }
319f3084 192}