]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/tof_hits.C
Error codes for histogram booking taken with getters, no longer hard coded (D. Elia)
[u/mrichter/AliRoot.git] / EVE / alice-macros / tof_hits.C
index b8ee2a239819d7a974784a19510bcb71c75f2e61..a28c48f73b45f7ee6c62441b615da47b3efd3c70 100644 (file)
@@ -1,11 +1,18 @@
 // $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
-Reve::PointSet*
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+TEvePointSet*
 tof_hits(const char *varexp    = "fX:fY:fZ",
         const char *selection = "",
-        Reve::RenderElement* cont)
+        TEveElement* cont)
 {
-  AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
   rl->LoadHits("TOF");
 
   TTree* ht = rl->GetTreeH("TOF", false);
@@ -13,15 +20,15 @@ tof_hits(const char *varexp    = "fX:fY:fZ",
   //PH The line below is replaced waiting for a fix in Root
   //PH which permits to use variable siza arguments in CINT
   //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
-  //PH  Reve::PointSet* points = new Reve::PointSet(Form("TOF Hits '%s'", selection));
+  //PH  TEvePointSet* points = new TEvePointSet(Form("TOF Hits '%s'", selection));
   char form[1000];
   sprintf(form,"TOF Hits '%s'", selection);
-  Reve::PointSet* points = new Reve::PointSet(form);
+  TEvePointSet* points = new TEvePointSet(form);
 
-  TPointSelector ps(ht, points, varexp, selection);
+  TEvePointSelector ps(ht, points, varexp, selection);
   ps.Select();
 
-  if( points->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
+  if( points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
     Warning("tof_hits", Form("No hits match '%s'", selection));
     delete points;
     return 0;
@@ -31,14 +38,10 @@ tof_hits(const char *varexp    = "fX:fY:fZ",
   sprintf(form,"N=%d", points->Size());
   points->SetTitle(form);
   points->SetMarkerSize(.5);
-  points->SetMarkerColor((Color_t)2);
-
- if(cont)
-    gReve->AddRenderElement(cont, points);
-  else 
-    gReve->AddRenderElement(points);
+  points->SetMarkerColor(2);
 
-  gReve->Redraw3D();
+  gEve->AddElement(points, cont);
+  gEve->Redraw3D();
 
   return points;
 }