ROOT logo
// $Id$
// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007

/**************************************************************************
 * 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 = "")
{
  // Extracts  T0 hits.


  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
  rl->LoadHits("T0");

  TTree* ht = rl->GetTreeH("T0", false);

  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);

  }
  TEvePointSet* points = new TEvePointSet(Form("T0 Hits '%s'", selection));
  points->SetSourceCS(TEvePointSelectorConsumer::kTVT_XYZ);

  TEvePointSelector ps(ht, points, varexp, selection);
  ps.Select();

  points->SetTitle(Form("N=%d", points->Size()));
  points->SetMarkerSize(.5);
  points->SetMarkerColor(3);

  points->SetName(Form("T0 Hits"));
  const TString viz_tag("SIM Hits T0");
  points->ApplyVizTag(viz_tag, "Hits");

  gEve->AddElement(points);
  gEve->Redraw3D();

  return points;
}
 t0_hits.C:1
 t0_hits.C:2
 t0_hits.C:3
 t0_hits.C:4
 t0_hits.C:5
 t0_hits.C:6
 t0_hits.C:7
 t0_hits.C:8
 t0_hits.C:9
 t0_hits.C:10
 t0_hits.C:11
 t0_hits.C:12
 t0_hits.C:13
 t0_hits.C:14
 t0_hits.C:15
 t0_hits.C:16
 t0_hits.C:17
 t0_hits.C:18
 t0_hits.C:19
 t0_hits.C:20
 t0_hits.C:21
 t0_hits.C:22
 t0_hits.C:23
 t0_hits.C:24
 t0_hits.C:25
 t0_hits.C:26
 t0_hits.C:27
 t0_hits.C:28
 t0_hits.C:29
 t0_hits.C:30
 t0_hits.C:31
 t0_hits.C:32
 t0_hits.C:33
 t0_hits.C:34
 t0_hits.C:35
 t0_hits.C:36
 t0_hits.C:37
 t0_hits.C:38
 t0_hits.C:39
 t0_hits.C:40
 t0_hits.C:41
 t0_hits.C:42
 t0_hits.C:43
 t0_hits.C:44
 t0_hits.C:45
 t0_hits.C:46
 t0_hits.C:47
 t0_hits.C:48
 t0_hits.C:49
 t0_hits.C:50
 t0_hits.C:51
 t0_hits.C:52
 t0_hits.C:53
 t0_hits.C:54
 t0_hits.C:55
 t0_hits.C:56
 t0_hits.C:57
 t0_hits.C:58
 t0_hits.C:59
 t0_hits.C:60
 t0_hits.C:61
 t0_hits.C:62
 t0_hits.C:63
 t0_hits.C:64
 t0_hits.C:65