Fix aclic compilation.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_clusters.C
index d3ae171563f4030e60abe53e5b6f9378cec84f77..0196f746d977091358b55fafec40628fc5ab03ba 100644 (file)
@@ -1,14 +1,39 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
-Reve::PointSet* tpc_clusters(RenderElement* cont=0, Float_t maxR=270)
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifdef __CINT__
+
+class TEveElement;
+class TEvePointSet;
+
+#else
+
+#include <TEveManager.h>
+#include <TEvePointSet.h>
+#include <EveBase/AliEveEventManager.h>
+
+#include <AliRunLoader.h>
+#include <AliCluster.h>
+#include <TPC/AliTPCClustersRow.h>
+
+#endif
+
+TEvePointSet* tpc_clusters(TEveElement* cont=0, Float_t maxR=270)
 {
   const Int_t kMaxCl=100*160;
 
-  Alieve::Event::AssertGeometry();
+  AliEveEventManager::AssertGeometry();
 
-  Reve::PointSet* clusters = new Reve::PointSet(kMaxCl);
+  TEvePointSet* clusters = new TEvePointSet(kMaxCl);
   clusters->SetOwnIds(kTRUE);
 
-  AliRunLoader* rl = Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
   rl->LoadRecPoints("TPC");
 
   AliTPCClustersRow *clrow=new AliTPCClustersRow();
@@ -16,10 +41,10 @@ Reve::PointSet* tpc_clusters(RenderElement* cont=0, Float_t maxR=270)
   clrow->SetArray(kMaxCl);
 
   TTree *cTree = rl->GetTreeR("TPC", false);
-  TBranch *branch=cTree->SetBranchAddress("Segment",&clrow);
+  cTree->SetBranchAddress("Segment", &clrow);
 
   Float_t maxRsqr = maxR*maxR;
-  TClonesArray *cl=clrow->GetArray(); 
+  TClonesArray *cl=clrow->GetArray();
   Int_t nentr=(Int_t)cTree->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!cTree->GetEvent(i)) continue;
@@ -42,7 +67,7 @@ Reve::PointSet* tpc_clusters(RenderElement* cont=0, Float_t maxR=270)
 
   delete clrow;
 
-  if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
+  if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
     Warning("tpc_clusters", "No TPC clusters");
     delete clusters;
     return 0;
@@ -59,10 +84,8 @@ Reve::PointSet* tpc_clusters(RenderElement* cont=0, Float_t maxR=270)
   char tip[1000];
   sprintf(tip,"N=%d", clusters->Size());
   clusters->SetTitle(tip);
-
-  using namespace Reve;
-  gReve->AddRenderElement(clusters);
-  gReve->Redraw3D();
+  gEve->AddElement(clusters, cont);
+  gEve->Redraw3D();
 
   return clusters;
 }