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

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

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

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

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

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

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

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

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

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

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