Added support to display the HLT ESD Tree. See the comment in visscan_local.C for How
[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 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TEveManager.h>
12 #include <TEvePointSet.h>
13
14 #include <AliESDEvent.h>
15 #include <AliESDv0.h>
16 #include <AliEveEventManager.h>
17 #endif
18
19 void esd_VO_fill_pointset(TEvePointSet* ps, Bool_t onFly)
20 {
21   AliESDEvent* esd = AliEveEventManager::AssertESD();
22
23   Int_t NV0s = esd->GetNumberOfV0s();
24
25   Double_t x, y, z;
26   for (Int_t n = 0; n < NV0s; ++n)
27   {
28     AliESDv0* av = esd->GetV0(n);
29     if (av->GetOnFlyStatus() == onFly)
30     {
31       av->GetXYZ(x, y, z);
32       ps->SetNextPoint(x, y, z);
33       ps->SetPointId(av);
34     }
35   }
36 }
37
38 TEvePointSet* esd_V0_points_offline()
39 {
40   TEvePointSet* points = new TEvePointSet("V0 offline vertex locations");
41
42   esd_VO_fill_pointset(points, kFALSE);
43
44   points->SetTitle(Form("N=%d", points->Size()));
45   points->SetMarkerStyle(4);
46   points->SetMarkerSize(1.5);
47   points->SetMarkerColor(kOrange+8);
48
49   gEve->AddElement(points);
50   gEve->Redraw3D();
51
52   return points;
53 }
54
55 TEvePointSet* esd_V0_points_onfly()
56 {
57   TEvePointSet* points = new TEvePointSet("V0 on-the-fly vertex locations");
58
59   esd_VO_fill_pointset(points, kTRUE);
60
61   points->SetTitle(Form("N=%d", points->Size()));
62   points->SetMarkerStyle(4);
63   points->SetMarkerSize(1.5);
64   points->SetMarkerColor(kPink+10);
65
66   gEve->AddElement(points);
67   gEve->Redraw3D();
68
69   return points;
70 }
71
72
73 void esd_V0_points()
74 {
75   esd_V0_points_offline();
76   esd_V0_points_onfly();
77 }