]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Included files: updated EVE repository
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 May 2008 14:31:06 +0000 (14:31 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 May 2008 14:31:06 +0000 (14:31 +0000)
EVE/alice-macros/tof_clusters.C

index 8894c90254dcd6581c2c0ff4559020ebc8309184..51b29772bf5e9058bfffcf7605b0f6eca1039da3 100644 (file)
@@ -5,22 +5,16 @@
  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
  * full copyright notice.                                                 *
  **************************************************************************/
-
-
 #ifdef __CINT__
 
-namespace TEve
-{
-class Element;
-class PointSet;
-}
+class TEveElement;
+class TEvePointSet;
 
 #else
 
-#include <TEve/TEve.h>
-#include <TEve/TEveManager.h>
-#include <TEve/PointSet.h>
-#include <Alieve/EventAlieve.h>
+#include <TEveManager.h>
+#include <TEvePointSet.h>
+#include <EveBase/AliEveEventManager.h>
 
 #include <AliRunLoader.h>
 #include <AliCluster.h>
@@ -31,21 +25,22 @@ class PointSet;
 
 TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
 {
-
   AliEveEventManager::AssertGeometry();
 
   AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
   rl->LoadRecPoints("TOF");
 
   TTree *cTree = rl->GetTreeR("TOF", false);
+  if (cTree == 0)
+    return 0;
 
-  TEvePointSet* clusters = new TEvePointSet(10000);  
-  clusters->SetOwnIds(kTRUE);
-
-  TClonesArray *cl=NULL;
-  TBranch *branch=cTree->GetBranch("TOF");
+  TClonesArray *cl = NULL;
+  TBranch *branch = cTree->GetBranch("TOF");
   branch->SetAddress(&cl);
 
+  TEvePointSet* clusters = new TEvePointSet(10000);
+  clusters->SetOwnIds(kTRUE);
+
   Int_t nentr=(Int_t)cTree->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!cTree->GetEvent(i)) continue;
@@ -54,24 +49,20 @@ TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
     cout<<" ncl = "<<ncl<<endl;
     Float_t maxRsqr = maxR*maxR;
     while (ncl--) {
-      
       AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
-     
       Float_t g[3]; //global coordinates
       c->GetGlobalXYZ(g);
-      
       if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
       {
        clusters->SetNextPoint(g[0], g[1], g[2]);
        AliCluster *atp = new AliCluster(*c);
-
        clusters->SetPointId(atp);
-       }
+      }
     }
   }
 
-  if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
-    Warning("tof_clusters", "No TOF clusters");
+  if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
+    Warning("tof_clusters.C", "No TOF clusters");
     delete clusters;
     return 0;
   }
@@ -87,7 +78,6 @@ TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
   char tip[1000];
   sprintf(tip,"N=%d", clusters->Size());
   clusters->SetTitle(tip);
-
   gEve->AddElement(clusters, cont);
   gEve->Redraw3D();