Updated macro to visualize phos clusters, finally a good one (Matevz+Cvetan)
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Jul 2007 14:50:18 +0000 (14:50 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Jul 2007 14:50:18 +0000 (14:50 +0000)
EVE/alice-macros/phos_clusters.C

index 63f0241..627942b 100644 (file)
@@ -11,23 +11,29 @@ Reve::PointSet* phos_clusters(RenderElement* cont=0)
   Reve::PointSet* clusters = new Reve::PointSet(10000);
   clusters->SetOwnIds(kTRUE);
 
-  AliPHOSEmcRecPoint *cl=NULL;
+  TObjArray *arr=NULL;
   TBranch *branch=cTree->GetBranch("PHOSEmcRP");
-  branch->SetAddress(&cl);
+  branch->SetAddress(&arr);
 
   Int_t nentr=(Int_t)branch->GetEntries();
-  Warning("phos_clusters",Form(" %d"),nentr);
   for (Int_t i=0; i<nentr; i++) {
     if (!branch->GetEvent(i)) continue;
 
-    Float_t g[3]; //global coordinates
-    cl->GetGlobalXYZ(g);
+    Int_t ncl=arr->GetEntriesFast();
+    while (ncl--) {
+      AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl);
 
-    clusters->SetNextPoint(g[0], g[1], g[2]);
-    AliCluster *atp = new AliCluster(*cl);
-    clusters->SetPointId(atp);
+      Float_t g[3]; //global coordinates
+      cl->GetGlobalXYZ(g);
+
+      AliCluster *atp = new AliCluster(*cl);
+      clusters->SetNextPoint(g[0], g[1], g[2]);
+      clusters->SetPointId(atp);
+    }
   }
 
+  Warning("phos_clusters"," %d",clusters->Size());
+
   if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
     Warning("phos_clusters", "No PHOS clusters");
     delete clusters;