]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/hmpid_clusters.C
In muon-related macros in EVE:
[u/mrichter/AliRoot.git] / EVE / alice-macros / hmpid_clusters.C
index ed2b040302a56f0e1025709ed6df220eb4d01083..4cd981354f3f80b143074abc791a5857f1d88698 100644 (file)
@@ -13,10 +13,9 @@ class TEvePointSet;
 
 #else
 
-#include <TEve.h>
 #include <TEveManager.h>
 #include <TEvePointSet.h>
-#include <EveDet/AliEveEventManager.h>
+#include <EveBase/AliEveEventManager.h>
 
 #include <AliRunLoader.h>
 #include <AliCluster3D.h>
@@ -25,11 +24,11 @@ class TEvePointSet;
 
 #endif
 
-TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
+TEvePointSet* hmpid_clusters(TEveElement* cont=0)
 {
   const Int_t nCh=7;
   TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
-  Char_t *name[nCh]={
+  const Char_t *name[nCh]={
     "HMPID0",
     "HMPID1",
     "HMPID2",
@@ -64,20 +63,18 @@ TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
     TClonesArray *arr=cl[i];
     Int_t ncl=arr->GetEntriesFast();
 
-    Float_t maxRsqr = maxR*maxR;
     while (ncl--) {
       AliCluster3D *c=(AliCluster3D*)arr->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]);
-       AliCluster3D *atp = new AliCluster3D(*c);
-       clusters->SetPointId(atp);
-      }
+      clusters->SetNextPoint(g[0], g[1], g[2]);
+      AliCluster3D *atp = new AliCluster3D(*c);
+      clusters->SetPointId(atp);
     }
   }
 
+  rl->UnloadRecPoints("HMPID");
+
   if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
     Warning("hmpid_clusters", "No HMPID clusters");
     delete clusters;
@@ -88,14 +85,16 @@ TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
   clusters->SetMarkerSize(0.2);
   clusters->SetMarkerColor(4);
 
-  char form[1000];
-  sprintf(form,"HMPID Clusters");
-  clusters->SetName(form);
+  clusters->SetName("HMPID Clusters");
+
+  clusters->SetTitle(Form("N=%d", clusters->Size()));
+
+  const TString viz_tag("REC Clusters HMPID");
+
+  clusters->ApplyVizTag(viz_tag, "Clusters");
 
-  char tip[1000];
-  sprintf(tip,"N=%d", clusters->Size());
-  clusters->SetTitle(tip);
   gEve->AddElement(clusters, cont);
+
   gEve->Redraw3D();
 
   return clusters;