]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/phos_clusters.C
Set svn:keywords prop.
[u/mrichter/AliRoot.git] / EVE / alice-macros / phos_clusters.C
index 0330ad3d9b36582f6c7450fd75aa4c0581af29cc..ef3937e5148befab40fff1a6219bd7bf6a8ca14a 100644 (file)
@@ -1,40 +1,48 @@
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
-Reve::PointSet* phos_clusters(RenderElement* cont=0)
+/**************************************************************************
+ * 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* phos_clusters(TEveElement* cont=0)
 {
-  if (!gGeoManager)
-    gReve->GetGeometry("$PWD/geometry.root");
+  AliEveEventManager::AssertGeometry();
 
-  AliRunLoader* rl = Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
   rl->LoadRecPoints("PHOS");
 
   TTree *cTree = rl->GetTreeR("PHOS", false);
 
-  Reve::PointSet* clusters = new Reve::PointSet(10000);
+  TEvePointSet* clusters = new TEvePointSet(10000);
   clusters->SetOwnIds(kTRUE);
 
-  TClonesArray *cl=NULL;
+  TObjArray *arr=NULL;
   TBranch *branch=cTree->GetBranch("PHOSEmcRP");
-  branch->SetAddress(&cl);
+  branch->SetAddress(&arr);
 
-  Int_t nentr=(Int_t)cTree->GetEntries();
-  Warning("phos_clusters",Form(" %d"),nentr);
+  Int_t nentr=(Int_t)branch->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
-    if (!cTree->GetEvent(i)) continue;
-
-    Int_t ncl=cl->GetEntriesFast();
+    if (!branch->GetEvent(i)) continue;
 
+    Int_t ncl=arr->GetEntriesFast();
     while (ncl--) {
-      AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
+      AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl);
+
       Float_t g[3]; //global coordinates
-      c->GetGlobalXYZ(g);
+      cl->GetGlobalXYZ(g);
 
+      AliCluster *atp = new AliCluster(*cl);
       clusters->SetNextPoint(g[0], g[1], g[2]);
-      AliCluster *atp = new AliCluster(*c);
       clusters->SetPointId(atp);
     }
   }
 
-  if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
+  Warning("phos_clusters"," %d", clusters->Size());
+
+  if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
     Warning("phos_clusters", "No PHOS clusters");
     delete clusters;
     return 0;
@@ -51,10 +59,8 @@ Reve::PointSet* phos_clusters(RenderElement* cont=0)
   char tip[1000];
   sprintf(tip,"N=%d", clusters->Size());
   clusters->SetTitle(tip);
-
-  using namespace Reve;
-  gReve->AddRenderElement(clusters);
-  gReve->Redraw3D();
+  gEve->AddElement(clusters);
+  gEve->Redraw3D();
 
   return clusters;
 }