]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/primary_vertex.C
Changed default point-size in accordance with the new convention.
[u/mrichter/AliRoot.git] / EVE / alice-macros / primary_vertex.C
CommitLineData
3c1a4392 1// $Header$
2
3TPolyMarker3D* make_vertex_marker(AliESDVertex* v, const Text_t* name)
4{
5 Double_t x[3], e[3];
6 v->GetTruePos(x);
7 v->GetSigmaXYZ(e);
8
9 printf("%s: %f %f %f - %f %f %f\n", name,
10 x[0], x[1], x[2], e[0], e[1], e[2]);
11
12 TPolyMarker3D* m = new TPolyMarker3D(8);
13 m->SetName(name);
14
15 // Problem with volume/length suppression of objects in TGLViewer
16 /*
17 m->SetPoint(0, x[0]+e[0], x[1]+e[1], x[2]+e[2]);
18 m->SetPoint(1, x[0]+e[0], x[1]-e[1], x[2]+e[2]);
19 m->SetPoint(2, x[0]-e[0], x[1]-e[1], x[2]+e[2]);
20 m->SetPoint(3, x[0]-e[0], x[1]+e[1], x[2]+e[2]);
21
22 m->SetPoint(4, x[0]+e[0], x[1]+e[1], x[2]-e[2]);
23 m->SetPoint(5, x[0]+e[0], x[1]-e[1], x[2]-e[2]);
24 m->SetPoint(6, x[0]-e[0], x[1]+e[1], x[2]-e[2]);
25 m->SetPoint(7, x[0]-e[0], x[1]-e[1], x[2]-e[2]);
26 */
27 m->SetPoint(0, x[0], x[1], x[2]);
28
29 return m;
30}
31
32void register_vertex_marker(TPolyMarker3D* m)
33{
34 using namespace Reve;
35 Color_t* colp = FindColorVar(m, "fMarkerColor");
36 RenderElementObjPtr* rnrEl = new RenderElementObjPtr(m, *colp);
37 gReve->AddRenderElement(rnrEl);
5b96ea20 38 gReve->Redraw3D();
3c1a4392 39}
40
41void primary_vertex(Bool_t showSPD=kTRUE)
42{
43 AliESD* esd = Alieve::Event::AssertESD();
44
45 AliESDVertex* pv = esd->GetPrimaryVertex();
46 TPolyMarker3D* pvm = make_vertex_marker(pv, "Primary Vertex");
5b96ea20 47 pvm->SetMarkerStyle(5);
3c1a4392 48 pvm->SetMarkerColor(3);
49 register_vertex_marker(pvm);
50
51 if(showSPD) {
52 AliESDVertex* spdv = esd->GetVertex();
53 TPolyMarker3D* spdvm = make_vertex_marker(spdv, "SPD Vertex");
54 spdvm->SetMarkerStyle(2);
55 spdvm->SetMarkerColor(7);
56 register_vertex_marker(spdvm);
57 }
58}