]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/tof_clusters.C
Prototype for visualization-macro manager and gui.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tof_clusters.C
index adedb1b6f40f88d1e9f401c3138da475424bc520..14ea38318c6d8dee353b2e0f7fae0b253b052464 100644 (file)
@@ -65,10 +65,6 @@ TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
     return 0;
   }
 
-  clusters->SetMarkerStyle(2);
-  clusters->SetMarkerSize(0.2);
-  clusters->SetMarkerColor(4);
-
   char form[1000];
   sprintf(form,"TOF Clusters");
   clusters->SetName(form);
@@ -76,7 +72,20 @@ TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
   char tip[1000];
   sprintf(tip,"N=%d", clusters->Size());
   clusters->SetTitle(tip);
+
+  const TString viz_tag("TOF Clusters");
+  if (gEve->FindVizDBEntry(viz_tag) == 0)
+  {
+    TEvePointSet* m = new TEvePointSet();
+    m->SetMarkerColor(4);
+    m->SetMarkerSize(0.2);
+    m->SetMarkerStyle(2);
+    gEve->InsertVizDBEntry(viz_tag, m);
+  }
+  clusters->ApplyVizTag(viz_tag);
+
   gEve->AddElement(clusters, cont);
+
   gEve->Redraw3D();
 
   return clusters;
@@ -137,10 +146,6 @@ TEvePointSet* tof_clusters_sec(Int_t selectedSector,
     return 0;
   }
 
-  clusters->SetMarkerStyle(2);
-  clusters->SetMarkerSize(0.2);
-  clusters->SetMarkerColor(4);
-
   char form[1000];
   sprintf(form,"TOF Clusters");
   clusters->SetName(form);
@@ -148,7 +153,22 @@ TEvePointSet* tof_clusters_sec(Int_t selectedSector,
   char tip[1000];
   sprintf(tip,"N=%d", clusters->Size());
   clusters->SetTitle(tip);
+
+  const TString viz_tag("TOF Clusters");
+  if (gEve->FindVizDBEntry(viz_tag) == 0)
+  {
+    TEvePointSet* m = new TEvePointSet();
+    m->SetMarkerColor(4);
+    m->SetMarkerSize(0.2);
+    m->SetMarkerStyle(2);
+    gEve->InsertVizDBEntry(viz_tag, m);
+  }
+  // The above can be removed when going to new root - then call:
+  // clusters->ApplyVizTag(viz_tag, "Clusters");
+  clusters->ApplyVizTag(viz_tag);
+
   gEve->AddElement(clusters, cont);
+
   gEve->Redraw3D();
 
   return clusters;