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