]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - EVE/alice-macros/t0_hits.C
From Pawel Debski: more modes for VizDB.
[u/mrichter/AliRoot.git] / EVE / alice-macros / t0_hits.C
... / ...
CommitLineData
1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9
10TEvePointSet*
11t0_hits(const char *varexp = "T0.fX:T0.fY:T0.fZ",
12 const char *selection = "")
13{
14 // Extracts T0 hits.
15
16
17 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
18 rl->LoadHits("T0");
19
20 TTree* ht = rl->GetTreeH("T0", false);
21
22 Int_t nTracks = ht->GetEntries();
23 // printf("Found %d tracks. \n",nTracks);
24 for (Int_t it = 0; it < nTracks; it++) {
25
26 TClonesArray *hits = 0;
27 ht->SetBranchAddress("T0",&hits);
28
29 ht->GetEvent(it);
30 // Int_t nHits = hits->GetEntriesFast();
31 // printf("Found %d hits in track %d.\n", nHits, it);
32
33 }
34 TEvePointSet* points = new TEvePointSet(Form("T0 Hits '%s'", selection));
35 points->SetSourceCS(TEvePointSelectorConsumer::kTVT_XYZ);
36
37 TEvePointSelector ps(ht, points, varexp, selection);
38 ps.Select();
39
40 points->SetTitle(Form("N=%d", points->Size()));
41 points->SetMarkerSize(.5);
42 points->SetMarkerColor(3);
43
44 points->SetName(Form("T0 Hits"));
45 const TString viz_tag("SIM Hits T0");
46 points->ApplyVizTag(viz_tag, "Hits");
47
48 gEve->AddElement(points);
49 gEve->Redraw3D();
50
51 return points;
52}