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 <TString.h>
#include <TTree.h>
#include <TEvePointSet.h>
#include <TEveElement.h>
#include <TEveManager.h>
#include <TEveTreeTools.h>

#include <AliRunLoader.h>
#include <AliEveEventManager.h>
#endif

TEvePointSet*
trd_hits(const char *varexp    = "fX:fY:fZ",
	 const char *selection = "",
	 TEveElement* cont = 0)
{
  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
  rl->LoadHits("TRD");

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

  TEvePointSet* points = new TEvePointSet(Form("TRD Hits '%s'", selection));

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

  if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
    Warning("trd_hits", "No hits match '%s'", selection);
    delete points;
    return 0;
  }

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

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

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

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