]>
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 | ||
503bfbc8 | 17 | TEveGeoShape *gGeomGentle = 0; |
18 | TEveGeoShape *gGeomGentleTRD = 0; | |
19 | ||
20 | Bool_t gShowTRD = kFALSE; | |
e9b9f7d2 | 21 | |
22 | void visscan_init() | |
23 | { | |
24 | TEveUtil::LoadMacro("alieve_init.C"); | |
25 | alieve_init(".", -1); | |
26 | ||
e9b9f7d2 | 27 | AliEveTrackFitter* fitter = new AliEveTrackFitter(); |
28 | gEve->AddToListTree(fitter, 1); | |
29 | gEve->AddElement(fitter, gEve->GetEventScene()); | |
30 | ||
f76c9e9b | 31 | AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter"); |
e9b9f7d2 | 32 | gEve->AddToListTree(g_trkcnt, kFALSE); |
33 | ||
34 | ||
a6337352 | 35 | gROOT->ProcessLine(".L SplitGLView.C+"); |
e9b9f7d2 | 36 | TEveBrowser* browser = gEve->GetBrowser(); |
37 | browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)"); | |
38 | ||
39 | if (gRPhiMgr) { | |
40 | TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr); | |
41 | a->SetNumTickMarks(3); | |
42 | a->SetText("R-Phi"); | |
43 | a->SetFontFile("comicbd"); | |
44 | a->SetFontSize(10); | |
45 | gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a); | |
e9b9f7d2 | 46 | } |
47 | if (gRhoZMgr) { | |
48 | TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr); | |
49 | a->SetNumTickMarks(3); | |
50 | a->SetText("Rho-Z"); | |
51 | a->SetFontFile("comicbd"); | |
52 | a->SetFontSize(10); | |
53 | gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a); | |
e9b9f7d2 | 54 | } |
55 | ||
f6afd0e1 | 56 | // geometry |
57 | TEveUtil::LoadMacro("geom_gentle.C"); | |
58 | gGeomGentle = geom_gentle(); | |
59 | if (gShowTRD) { | |
60 | TEveUtil::LoadMacro("geom_gentle_trd.C"); | |
61 | gGeomGentleTRD = geom_gentle_trd(); | |
62 | } | |
63 | ||
64 | // event data | |
65 | TEveUtil::LoadMacro("primary_vertex.C"); | |
66 | TEveUtil::LoadMacro("esd_V0_points.C"); | |
67 | TEveUtil::LoadMacro("esd_V0.C"); | |
68 | TEveUtil::LoadMacro("esd_tracks.C"); | |
69 | TEveUtil::LoadMacro("its_clusters.C+"); | |
70 | TEveUtil::LoadMacro("tpc_clusters.C+"); | |
71 | TEveUtil::LoadMacro("trd_clusters.C+"); | |
72 | TEveUtil::LoadMacro("tof_clusters.C+"); | |
73 | ||
74 | TEveLine::SetDefaultSmooth(1); | |
75 | ||
76 | TEveBrowser* browser = gEve->GetBrowser(); | |
77 | ||
78 | browser->StartEmbedding(TRootBrowser::kBottom); | |
79 | new AliEveEventManagerWindow; | |
80 | browser->StopEmbedding("EventCtrl"); | |
81 | ||
e9b9f7d2 | 82 | // event |
83 | gAliEveEvent->AddNewEventCommand("on_new_event();"); | |
84 | gAliEveEvent->GotoEvent(0); | |
85 | ||
ca49b003 | 86 | gEve->EditElement(g_trkcnt); |
87 | ||
e9b9f7d2 | 88 | gEve->Redraw3D(kTRUE); |
89 | } | |
90 | ||
91 | /******************************************************************************/ | |
92 | ||
93 | void on_new_event() | |
94 | { | |
95 | try { | |
96 | TEvePointSet* itsc = its_clusters(); | |
787c89c5 | 97 | if (itsc) { |
98 | itsc->SetMarkerColor(5); | |
99 | } | |
e9b9f7d2 | 100 | |
101 | TEvePointSet* tpcc = tpc_clusters(); | |
787c89c5 | 102 | if (tpcc) { |
103 | tpcc->SetMarkerColor(4); | |
104 | } | |
503bfbc8 | 105 | |
106 | TEvePointSet* trdc = trd_clusters(); | |
787c89c5 | 107 | if (trdc) { |
108 | trdc->SetMarkerColor(7); | |
109 | trdc->SetMarkerStyle(4); | |
110 | trdc->SetMarkerSize(0.5); | |
111 | } | |
a6337352 | 112 | |
113 | TEvePointSet* tofc = tof_clusters(); | |
114 | if (tofc) { | |
115 | tofc->SetMarkerColor(kOrange); | |
116 | tofc->SetMarkerStyle(4); | |
117 | tofc->SetMarkerSize(0.5); | |
118 | } | |
e9b9f7d2 | 119 | } |
120 | catch(TEveException& exc) { | |
121 | printf("Exception loading ITS/TPC clusters: %s\n", exc.Data()); | |
122 | } | |
123 | ||
124 | primary_vertex(1, 1); | |
3a60982a | 125 | esd_V0_points(); |
ca8a6926 | 126 | esd_V0(); |
e9b9f7d2 | 127 | |
128 | TEveElementList* cont = esd_tracks_vertex_cut(); | |
129 | ||
130 | // Here we expect five TEveTrackList containers. | |
131 | // First two have reasonable primaries (sigma-to-prim-vertex < 5). | |
132 | // Other three are almost certainly secondaries. | |
133 | Int_t count = 1; | |
f76c9e9b | 134 | AliEveTrackCounter* g_trkcnt = AliEveTrackCounter::fgInstance; |
e9b9f7d2 | 135 | g_trkcnt->Reset(); |
136 | g_trkcnt->SetEventId(gAliEveEvent->GetEventId()); | |
137 | TEveElement::List_i i = cont->BeginChildren(); | |
138 | while (i != cont->EndChildren()) { | |
139 | TEveTrackList* l = dynamic_cast<TEveTrackList*>(*i); | |
140 | if (l != 0) { | |
141 | // l->SetLineWidth(2); | |
142 | g_trkcnt->RegisterTracks(l, (count <= 2)); | |
143 | ++count; | |
144 | } | |
145 | ++i; | |
146 | } | |
147 | ||
148 | AliESDEvent* esd = AliEveEventManager::AssertESD(); | |
a27140cb | 149 | { |
150 | TTimeStamp ts(esd->GetTimeStamp()); | |
151 | TString win_title("Eve Main Window -- Timestamp: "); | |
152 | win_title += ts.AsString("s"); | |
5858bcbe | 153 | win_title += "; Event # in ESD file: "; |
a27140cb | 154 | win_title += esd->GetEventNumberInFile(); |
155 | gEve->GetBrowser()->SetWindowName(win_title); | |
156 | } | |
e9b9f7d2 | 157 | Double_t x[3]; |
158 | esd->GetPrimaryVertex()->GetXYZ(x); | |
159 | ||
160 | TEveElement* top = gEve->GetCurrentEvent(); | |
161 | ||
162 | if (gRPhiMgr && top) { | |
163 | gRPhiMgr->DestroyElements(); | |
164 | gRPhiMgr->SetCenter(x[0], x[1], x[2]); | |
165 | gRPhiMgr->ImportElements(gGeomGentle); | |
503bfbc8 | 166 | if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD); |
e9b9f7d2 | 167 | gRPhiMgr->ImportElements(top); |
168 | } | |
169 | if (gRhoZMgr && top) { | |
170 | gRhoZMgr->DestroyElements(); | |
171 | gRhoZMgr->SetCenter(x[0], x[1], x[2]); | |
172 | gRhoZMgr->ImportElements(gGeomGentle); | |
503bfbc8 | 173 | if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD); |
e9b9f7d2 | 174 | gRhoZMgr->ImportElements(top); |
175 | } | |
176 | ||
177 | gROOT->ProcessLine("SplitGLView::UpdateSummary()"); | |
178 | } | |
179 | ||
180 | /******************************************************************************/ | |
181 | ||
182 | TParticle* id(Int_t label=0, Bool_t showParents=kTRUE) | |
183 | { | |
184 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); | |
185 | rl->LoadKinematics(); | |
186 | AliStack* stack = rl->Stack(); | |
187 | ||
188 | printf("Number primaries %d, all particles %d, label %d\n", | |
189 | stack->GetNprimary(), stack->GetNtrack(), label); | |
190 | if (label < 0 || label >= stack->GetNtrack()) { | |
191 | printf(" Label exceeds available range.\n"); | |
192 | return 0; | |
193 | } | |
194 | ||
195 | TParticle* part = stack->Particle(label); | |
196 | if (part != 0) { | |
197 | part->Print(); | |
198 | if (showParents) { | |
199 | while (part->GetMother(0) >= 0) { | |
200 | part = stack->Particle(part->GetMother(0)); | |
201 | part->Print(); | |
202 | } | |
203 | } | |
204 | } | |
205 | return stack->Particle(label); | |
206 | } |