]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/esd_cascade_points.C
Merge from eve-dev.
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_cascade_points.C
diff --git a/EVE/alice-macros/esd_cascade_points.C b/EVE/alice-macros/esd_cascade_points.C
new file mode 100644 (file)
index 0000000..e8f0731
--- /dev/null
@@ -0,0 +1,40 @@
+// $Id: esd_cascade_points.C 26897 2008-06-25 23:58:36Z mtadel $
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+void esd_cascade_fill_pointset(TEvePointSet* ps)
+{
+  AliESDEvent* esd = AliEveEventManager::AssertESD();
+
+  Int_t NCascades = esd->GetNumberOfCascades();
+
+  Double_t x, y, z;
+  for (Int_t n = 0; n < NCascades; ++n)
+  {
+    AliESDcascade* av = esd->GetCascade(n);
+    av->GetXYZcascade(x, y, z);
+    ps->SetNextPoint(x, y, z);
+    ps->SetPointId(av);
+  }
+}
+
+TEvePointSet* esd_cascade_points()
+{
+  TEvePointSet* points = new TEvePointSet("Cascade vertex locations");
+
+  esd_cascade_fill_pointset(points);
+
+  points->SetTitle(Form("N=%d", points->Size()));
+  points->SetMarkerStyle(4);
+  points->SetMarkerSize(1.5);
+  points->SetMarkerColor(kGray);
+
+  gEve->AddElement(points);
+  gEve->Redraw3D();
+
+  return points;
+}