Still optimizing HTA
[u/mrichter/AliRoot.git] / EVE / macros / anyscan_init.C
CommitLineData
f6afd0e1 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
10class AliEveMacroExecutor;
11
12class TEveProjectionManager;
13class TEveGeoShape;
14class TEveUtil;
15
16R__EXTERN TEveProjectionManager *gRPhiMgr;
17R__EXTERN TEveProjectionManager *gRhoZMgr;
18
ad5abc55 19TEveGeoShape *gGeomGentle = 0;
20TEveGeoShape *gGeomGentleRPhi = 0;
21TEveGeoShape *gGeomGentleRhoZ = 0;
22TEveGeoShape *gGeomGentleTRD = 0;
f6afd0e1 23
24Bool_t gShowTRD = kFALSE;
25
26void anyscan_init()
27{
28 TEveUtil::LoadMacro("alieve_init.C");
29 alieve_init(".", -1);
30
df56539f 31 // TEveLine::SetDefaultSmooth(1);
f6afd0e1 32
33 TEveUtil::AssertMacro("VizDB_scan.C");
34
35
36 AliEveTrackFitter* fitter = new AliEveTrackFitter();
37 gEve->AddToListTree(fitter, 1);
38 gEve->AddElement(fitter, gEve->GetEventScene());
39
40 AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter");
41 gEve->AddToListTree(g_trkcnt, kFALSE);
42
43
44 gROOT->ProcessLine(".L SplitGLView.C+");
45 TEveBrowser* browser = gEve->GetBrowser();
46 browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)");
47
48 if (gRPhiMgr) {
49 TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
50 a->SetNumTickMarks(3);
51 a->SetText("R-Phi");
52 a->SetFontFile("comicbd");
53 a->SetFontSize(10);
54 gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a);
55 }
56 if (gRhoZMgr) {
57 TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
58 a->SetNumTickMarks(3);
59 a->SetText("Rho-Z");
60 a->SetFontFile("comicbd");
61 a->SetFontSize(10);
62 gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a);
63 }
64
65 // geometry
66 TEveUtil::LoadMacro("geom_gentle.C");
67 gGeomGentle = geom_gentle();
ad5abc55 68 gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
69 gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
f6afd0e1 70 if (gShowTRD) {
71 TEveUtil::LoadMacro("geom_gentle_trd.C");
72 gGeomGentleTRD = geom_gentle_trd();
73 }
74
75
76 AliEveMacroExecutor *exec = gAliEveEvent->GetExecutor();
77
7b2d546e 78 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE));
79 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit ITS", "its_hits.C", "its_hits", "", kFALSE));
80 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit TPC", "tpc_hits.C", "tpc_hits", "", kFALSE));
9e0bcce2 81 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "TPC RAW", "tpc_raw.C", "tpc_raw", "", kFALSE));
82 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "FMD RAW", "fmd_raw.C", "fmd_raw", "", kFALSE));
83 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "FMD DIGITS", "fmd_digits.C", "fmd_digits", "", kFALSE));
84 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "FMD Hits", "fmd_hits.C", "fmd_hits", "", kFALSE));
ad080421 85 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "VZERO RAW", "vzero_raw.C", "vzero_raw", "", kFALSE));
7b2d546e 86
ad5abc55 87 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE));
88 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE));
89 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE));
90 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE));
91 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE));
92 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE));
93 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE));
94 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE));
95 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE));
96
7b2d546e 97 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points"));
98 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0"));
f6afd0e1 99 // exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "esd_tracks.C", ""));
100 TEveUtil::LoadMacro("esd_tracks.C");
101
ad5abc55 102 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE));
103
7b2d546e 104 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C+", "its_clusters"));
105 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C+", "tpc_clusters"));
106 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters"));
107 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters"));
f6afd0e1 108
109 TEveBrowser* browser = gEve->GetBrowser();
110
111 browser->StartEmbedding(TRootBrowser::kRight);
112 AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec);
113 browser->StopEmbedding("DataSelection");
114 exewin->PopulateMacros();
115
12365217 116 browser->StartEmbedding();
117 new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE);
118 browser->StopEmbedding("QA histograms");
119
f6afd0e1 120 browser->GetTabRight()->SetTab(1);
121
122 browser->StartEmbedding(TRootBrowser::kBottom);
123 new AliEveEventManagerWindow;
124 browser->StopEmbedding("EventCtrl");
125
126 // event
127 gAliEveEvent->AddNewEventCommand("on_new_event();");
128 gAliEveEvent->GotoEvent(0);
129
130 gEve->EditElement(g_trkcnt);
131
132 gEve->Redraw3D(kTRUE);
133}
134
135/******************************************************************************/
136
137void on_new_event()
138{
139 printf("on_new_event() entered ...\n");
140
141 TEveElementList* cont = esd_tracks_vertex_cut();
142
143 // Here we expect five TEveTrackList containers.
144 // First two have reasonable primaries (sigma-to-prim-vertex < 5).
145 // Other three are almost certainly secondaries.
146 Int_t count = 1;
147 AliEveTrackCounter* g_trkcnt = AliEveTrackCounter::fgInstance;
148 g_trkcnt->Reset();
149 g_trkcnt->SetEventId(gAliEveEvent->GetEventId());
150 TEveElement::List_i i = cont->BeginChildren();
151 while (i != cont->EndChildren()) {
152 TEveTrackList* l = dynamic_cast<TEveTrackList*>(*i);
153 if (l != 0) {
154 // l->SetLineWidth(2);
155 g_trkcnt->RegisterTracks(l, (count <= 2));
156 ++count;
157 }
158 ++i;
159 }
160
161 AliESDEvent* esd = AliEveEventManager::AssertESD();
162 {
163 TTimeStamp ts(esd->GetTimeStamp());
164 TString win_title("Eve Main Window -- Timestamp: ");
165 win_title += ts.AsString("s");
166 win_title += "; Event # in ESD file: ";
167 win_title += esd->GetEventNumberInFile();
168 gEve->GetBrowser()->SetWindowName(win_title);
169 }
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]);
ad5abc55 178 gRPhiMgr->ImportElements(gGeomGentleRPhi);
f6afd0e1 179 if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD);
180 gRPhiMgr->ImportElements(top);
181 }
182 if (gRhoZMgr && top) {
183 gRhoZMgr->DestroyElements();
184 gRhoZMgr->SetCenter(x[0], x[1], x[2]);
ad5abc55 185 gRhoZMgr->ImportElements(gGeomGentleRhoZ);
f6afd0e1 186 if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD);
187 gRhoZMgr->ImportElements(top);
188 }
189
190 gROOT->ProcessLine("SplitGLView::UpdateSummary()");
191}