60942319b0b258ae98678470308e95355f1e34f8
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_V0_points.C
1 // $Id$
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 void esd_VO_fill_pointset(TEvePointSet* ps, Bool_t onFly)
11 {
12   AliESDEvent* esd = AliEveEventManager::AssertESD();
13
14   Int_t NV0s = esd->GetNumberOfV0s();
15
16   Double_t x, y, z;
17   for (Int_t n = 0; n < NV0s; ++n)
18   {
19     AliESDv0* av = esd->GetV0(n);
20     if (av->GetOnFlyStatus() == onFly)
21     {
22       av->GetXYZ(x, y, z);
23       ps->SetNextPoint(x, y, z);
24       ps->SetPointId(av);
25     }
26   }
27 }
28
29 TEvePointSet* esd_V0_points_offline()
30 {
31   TEvePointSet* points = new TEvePointSet("V0 offline vertex locations");
32
33   esd_VO_fill_pointset(points, kFALSE);
34
35   points->SetTitle(Form("N=%d", points->Size()));
36   points->SetMarkerStyle(4);
37   points->SetMarkerSize(2);
38   points->SetMarkerColor((Color_t)(kOrange+8));
39
40   gEve->AddElement(points);
41   gEve->Redraw3D();
42
43   return points;
44 }
45
46 TEvePointSet* esd_V0_points_onfly()
47 {
48   TEvePointSet* points = new TEvePointSet("V0 on-the-fly vertex locations");
49
50   esd_VO_fill_pointset(points, kTRUE);
51
52   points->SetTitle(Form("N=%d", points->Size()));
53   points->SetMarkerStyle(4);
54   points->SetMarkerSize(2);
55   points->SetMarkerColor((Color_t)(kPink+10));
56
57   gEve->AddElement(points);
58   gEve->Redraw3D();
59
60   return points;
61 }
62
63
64 void esd_V0_points()
65 {
66   esd_V0_points_offline();
67   esd_V0_points_onfly();
68 }