]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/t0_hits.C
macros for ITS upgrade visualization
[u/mrichter/AliRoot.git] / EVE / alice-macros / t0_hits.C
index 7914289c9bc0ddba429c8a6308197b5bb4dc4ff9..38b01d47afad4c43b34f03a1c85beaa80817c718 100644 (file)
@@ -1,13 +1,32 @@
 // $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
-Reve::PointSet*
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TClonesArray.h>
+#include <TTree.h>
+#include <TEvePointSet.h>
+#include <TEveElement.h>
+#include <TEveManager.h>
+#include <TEveTreeTools.h>
+
+#include <AliRunLoader.h>
+#include <AliEveEventManager.h>
+#endif
+
+TEvePointSet*
 t0_hits(const char *varexp    = "T0.fX:T0.fY:T0.fZ",
-        const char *selection = "")
+       const char *selection = "")
 {
   // Extracts  T0 hits.
 
 
-  AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
   rl->LoadHits("T0");
 
   TTree* ht = rl->GetTreeH("T0", false);
@@ -15,27 +34,31 @@ t0_hits(const char *varexp    = "T0.fX:T0.fY:T0.fZ",
   Int_t nTracks = ht->GetEntries();
   // printf("Found %d tracks. \n",nTracks);
   for (Int_t it = 0; it < nTracks; it++) {
+
     TClonesArray *hits = 0;
     ht->SetBranchAddress("T0",&hits);
+
     ht->GetEvent(it);
- Int_t nHits = hits->GetEntriesFast();
//  printf("Found %d hits in track %d. \n",nHits,it);
   // Int_t nHits = hits->GetEntriesFast();
   // printf("Found %d hits in track %d.\n", nHits, it);
 
   }
-  Reve::PointSet* points = new Reve::PointSet(Form("T0 Hits '%s'", selection));
-   points->SetSourceCS(TPointSelectorConsumer::TVT_XYZ);
+  TEvePointSet* points = new TEvePointSet(Form("T0 Hits '%s'", selection));
+  points->SetSourceCS(TEvePointSelectorConsumer::kTVT_XYZ);
 
-  TPointSelector ps(ht, points, varexp, selection);
+  TEvePointSelector ps(ht, points, varexp, selection);
   ps.Select();
 
   points->SetTitle(Form("N=%d", points->Size()));
   points->SetMarkerSize(.5);
-  points->SetMarkerColor((Color_t)3);
+  points->SetMarkerColor(3);
+
+  points->SetName(Form("T0 Hits"));
+  const TString viz_tag("SIM Hits T0");
+  points->ApplyVizTag(viz_tag, "Hits");
 
-  gReve->AddRenderElement(points);
-  gReve->Redraw3D();
+  gEve->AddElement(points);
+  gEve->Redraw3D();
 
   return points;
 }