]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/tpc_hits.C
* init-macros
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
index 8e9f1f46cb9c76e7942e194d34a41f149c24a20d..fb1f3d55d377172433cc39a9c71c978c29c56e7d 100644 (file)
@@ -1,13 +1,21 @@
 // $Id$
-
-Reve::PointSet*
-tpc_hits(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
-        const char *selection = "TPC2.fArray.fR>80")
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * 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*
+tpc_hits(const char  *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
+        const char  *selection = "TPC2.fArray.fR>80",
+         TEveElement *cont      = 0)
 {
   // Extracts 'major' TPC hits (not the compressed ones).
   // This gives ~2.5% of all hits.
 
-  AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
   rl->LoadHits("TPC");
 
   TTree* ht = rl->GetTreeH("TPC", false);
@@ -15,16 +23,16 @@ tpc_hits(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.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("TPC Hits '%s'", selection));
+  //PH  TEvePointSet* points = new TEvePointSet(Form("TPC Hits '%s'", selection));
   char form[1000];
   sprintf(form,"TPC Hits '%s'", selection);
-  Reve::PointSet* points = new Reve::PointSet(form);
-  points->SetSourceCS(TPointSelectorConsumer::TVT_RPhiZ);
+  TEvePointSet* points = new TEvePointSet(form);
+  points->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
 
-  TPointSelector ps(ht, points, varexp, selection);
+  TEvePointSelector ps(ht, points, varexp, selection);
   ps.Select();
 
-  if (points->Size() == 0) {
+  if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
     Warning("tpc_hits", Form("No hits match '%s'", selection));
     delete points;
     return 0;
@@ -34,10 +42,10 @@ tpc_hits(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ"
   sprintf(form,"N=%d", points->Size());
   points->SetTitle(form);
   points->SetMarkerSize(.5);
-  points->SetMarkerColor((Color_t)3);
+  points->SetMarkerColor(3);
 
-  gReve->AddRenderElement(points);
-  gReve->Redraw3D();
+  gEve->AddElement(points, cont);
+  gEve->Redraw3D();
 
   return points;
 }