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*
tpc_hits(const char  *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
	 const char  *selection = "TPC2.fArray.fR>80",
         TEveElement *cont      = 0)
{
  // Extracts 'major' TPC hits (not the compressed ones).
  // This gives ~2.5% of all hits.

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

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

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

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

  if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
    Warning("tpc_hits", "No hits match '%s'", selection);
    delete points;
    return 0;
  }
  
  points->SetName(Form("TPC Hits"));
  const TString viz_tag("SIM Hits TPC");
  points->ApplyVizTag(viz_tag, "Hits");

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

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

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