]>
Commit | Line | Data |
---|---|---|
e9b9f7d2 | 1 | // $Id: NLT_trackcount_init.C 24927 2008-04-04 13:46:04Z mtadel $ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
7 | * full copyright notice. * | |
8 | **************************************************************************/ | |
9 | ||
10 | class TEveProjectionManager; | |
11 | class TEveGeoShape; | |
12 | class TEveUtil; | |
13 | ||
14 | R__EXTERN TEveProjectionManager *gRPhiMgr; | |
15 | R__EXTERN TEveProjectionManager *gRhoZMgr; | |
16 | ||
5e078eda | 17 | TEveGeoShape *gGeomGentle = 0; |
18 | TEveGeoShape *gGeomGentleRPhi = 0; | |
19 | TEveGeoShape *gGeomGentleRhoZ = 0; | |
20 | TEveGeoShape *gGeomGentleTRD = 0; | |
503bfbc8 | 21 | |
22 | Bool_t gShowTRD = kFALSE; | |
e9b9f7d2 | 23 | |
24 | void visscan_init() | |
25 | { | |
26 | TEveUtil::LoadMacro("alieve_init.C"); | |
27 | alieve_init(".", -1); | |
28 | ||
e9b9f7d2 | 29 | AliEveTrackFitter* fitter = new AliEveTrackFitter(); |
30 | gEve->AddToListTree(fitter, 1); | |
31 | gEve->AddElement(fitter, gEve->GetEventScene()); | |
32 | ||
f76c9e9b | 33 | AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter"); |
e9b9f7d2 | 34 | gEve->AddToListTree(g_trkcnt, kFALSE); |
35 | ||
36 | ||
a6337352 | 37 | gROOT->ProcessLine(".L SplitGLView.C+"); |
e9b9f7d2 | 38 | TEveBrowser* browser = gEve->GetBrowser(); |
39 | browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)"); | |
40 | ||
41 | if (gRPhiMgr) { | |
42 | TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr); | |
43 | a->SetNumTickMarks(3); | |
44 | a->SetText("R-Phi"); | |
45 | a->SetFontFile("comicbd"); | |
46 | a->SetFontSize(10); | |
47 | gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a); | |
e9b9f7d2 | 48 | } |
49 | if (gRhoZMgr) { | |
50 | TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr); | |
51 | a->SetNumTickMarks(3); | |
52 | a->SetText("Rho-Z"); | |
53 | a->SetFontFile("comicbd"); | |
54 | a->SetFontSize(10); | |
55 | gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a); | |
e9b9f7d2 | 56 | } |
57 | ||
f6afd0e1 | 58 | // geometry |
59 | TEveUtil::LoadMacro("geom_gentle.C"); | |
5e078eda | 60 | gGeomGentle = geom_gentle(); |
61 | gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy(); | |
62 | gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy(); | |
f6afd0e1 | 63 | if (gShowTRD) { |
64 | TEveUtil::LoadMacro("geom_gentle_trd.C"); | |
65 | gGeomGentleTRD = geom_gentle_trd(); | |
66 | } | |
67 | ||
68 | // event data | |
69 | TEveUtil::LoadMacro("primary_vertex.C"); | |
70 | TEveUtil::LoadMacro("esd_V0_points.C"); | |
71 | TEveUtil::LoadMacro("esd_V0.C"); | |
75b17362 | 72 | TEveUtil::LoadMacro("esd_cascade_points.C"); |
f6afd0e1 | 73 | TEveUtil::LoadMacro("esd_tracks.C"); |
74 | TEveUtil::LoadMacro("its_clusters.C+"); | |
75 | TEveUtil::LoadMacro("tpc_clusters.C+"); | |
76 | TEveUtil::LoadMacro("trd_clusters.C+"); | |
77 | TEveUtil::LoadMacro("tof_clusters.C+"); | |
78 | ||
df56539f | 79 | // TEveLine::SetDefaultSmooth(1); |
f6afd0e1 | 80 | |
81 | TEveBrowser* browser = gEve->GetBrowser(); | |
82 | ||
83 | browser->StartEmbedding(TRootBrowser::kBottom); | |
ba5d58f2 | 84 | new AliEveEventManagerWindow(AliEveEventManager::GetMaster()); |
f6afd0e1 | 85 | browser->StopEmbedding("EventCtrl"); |
86 | ||
e9b9f7d2 | 87 | // event |
4d62585e | 88 | AliEveEventManager::GetMaster()->AddNewEventCommand("on_new_event();"); |
89 | AliEveEventManager::GetMaster()->GotoEvent(0); | |
e9b9f7d2 | 90 | |
ca49b003 | 91 | gEve->EditElement(g_trkcnt); |
92 | ||
e9b9f7d2 | 93 | gEve->Redraw3D(kTRUE); |
94 | } | |
95 | ||
96 | /******************************************************************************/ | |
97 | ||
98 | void on_new_event() | |
99 | { | |
100 | try { | |
101 | TEvePointSet* itsc = its_clusters(); | |
787c89c5 | 102 | if (itsc) { |
103 | itsc->SetMarkerColor(5); | |
104 | } | |
e9b9f7d2 | 105 | |
106 | TEvePointSet* tpcc = tpc_clusters(); | |
787c89c5 | 107 | if (tpcc) { |
108 | tpcc->SetMarkerColor(4); | |
109 | } | |
503bfbc8 | 110 | |
111 | TEvePointSet* trdc = trd_clusters(); | |
787c89c5 | 112 | if (trdc) { |
113 | trdc->SetMarkerColor(7); | |
114 | trdc->SetMarkerStyle(4); | |
115 | trdc->SetMarkerSize(0.5); | |
116 | } | |
a6337352 | 117 | |
118 | TEvePointSet* tofc = tof_clusters(); | |
119 | if (tofc) { | |
120 | tofc->SetMarkerColor(kOrange); | |
121 | tofc->SetMarkerStyle(4); | |
122 | tofc->SetMarkerSize(0.5); | |
123 | } | |
e9b9f7d2 | 124 | } |
125 | catch(TEveException& exc) { | |
126 | printf("Exception loading ITS/TPC clusters: %s\n", exc.Data()); | |
127 | } | |
128 | ||
ad5abc55 | 129 | primary_vertex(); |
130 | primary_vertex_ellipse(); | |
131 | primary_vertex_spd(); | |
132 | primary_vertex_ellipse_spd(); | |
133 | ||
3a60982a | 134 | esd_V0_points(); |
ca8a6926 | 135 | esd_V0(); |
e9b9f7d2 | 136 | |
75b17362 | 137 | esd_cascade_points(); |
138 | ||
f76c9e9b | 139 | AliEveTrackCounter* g_trkcnt = AliEveTrackCounter::fgInstance; |
e9b9f7d2 | 140 | g_trkcnt->Reset(); |
4d62585e | 141 | g_trkcnt->SetEventId(AliEveEventManager::GetMaster()->GetEventId()); |
29207369 | 142 | |
143 | TEveElementList* cont = esd_tracks_by_category(); | |
144 | ||
145 | // Here we expect several TEveTrackList containers. | |
146 | // First two have reasonable primaries (sigma-to-prim-vertex < 5). | |
147 | // Others are almost certainly secondaries. | |
148 | Int_t count = 1; | |
e9b9f7d2 | 149 | TEveElement::List_i i = cont->BeginChildren(); |
df56539f | 150 | while (i != cont->EndChildren()) |
151 | { | |
e9b9f7d2 | 152 | TEveTrackList* l = dynamic_cast<TEveTrackList*>(*i); |
29207369 | 153 | if (l != 0) |
154 | { | |
e9b9f7d2 | 155 | g_trkcnt->RegisterTracks(l, (count <= 2)); |
156 | ++count; | |
157 | } | |
158 | ++i; | |
159 | } | |
160 | ||
161 | AliESDEvent* esd = AliEveEventManager::AssertESD(); | |
a27140cb | 162 | { |
163 | TTimeStamp ts(esd->GetTimeStamp()); | |
164 | TString win_title("Eve Main Window -- Timestamp: "); | |
165 | win_title += ts.AsString("s"); | |
5858bcbe | 166 | win_title += "; Event # in ESD file: "; |
a27140cb | 167 | win_title += esd->GetEventNumberInFile(); |
168 | gEve->GetBrowser()->SetWindowName(win_title); | |
169 | } | |
e9b9f7d2 | 170 | Double_t x[3]; |
171 | esd->GetPrimaryVertex()->GetXYZ(x); | |
172 | ||
173 | TEveElement* top = gEve->GetCurrentEvent(); | |
174 | ||
175 | if (gRPhiMgr && top) { | |
176 | gRPhiMgr->DestroyElements(); | |
177 | gRPhiMgr->SetCenter(x[0], x[1], x[2]); | |
5e078eda | 178 | gRPhiMgr->ImportElements(gGeomGentleRPhi); |
503bfbc8 | 179 | if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD); |
e9b9f7d2 | 180 | gRPhiMgr->ImportElements(top); |
181 | } | |
182 | if (gRhoZMgr && top) { | |
183 | gRhoZMgr->DestroyElements(); | |
184 | gRhoZMgr->SetCenter(x[0], x[1], x[2]); | |
5e078eda | 185 | gRhoZMgr->ImportElements(gGeomGentleRhoZ); |
503bfbc8 | 186 | if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD); |
e9b9f7d2 | 187 | gRhoZMgr->ImportElements(top); |
188 | } | |
189 | ||
190 | gROOT->ProcessLine("SplitGLView::UpdateSummary()"); | |
191 | } |