From Pawel Debski: more modes for VizDB.
[u/mrichter/AliRoot.git] / EVE / alice-macros / t0_hits.C
CommitLineData
6a680ee5 1// $Id$
d810d0de 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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
6a680ee5 9
84aff7a4 10TEvePointSet*
6a680ee5 11t0_hits(const char *varexp = "T0.fX:T0.fY:T0.fZ",
84aff7a4 12 const char *selection = "")
6a680ee5 13{
14 // Extracts T0 hits.
15
16
d810d0de 17 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
6a680ee5 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++) {
51346b82 25
6a680ee5 26 TClonesArray *hits = 0;
27 ht->SetBranchAddress("T0",&hits);
51346b82 28
6a680ee5 29 ht->GetEvent(it);
84aff7a4 30 // Int_t nHits = hits->GetEntriesFast();
31 // printf("Found %d hits in track %d.\n", nHits, it);
6a680ee5 32
33 }
30650838 34 TEvePointSet* points = new TEvePointSet(Form("T0 Hits '%s'", selection));
84aff7a4 35 points->SetSourceCS(TEvePointSelectorConsumer::kTVT_XYZ);
6a680ee5 36
84aff7a4 37 TEvePointSelector ps(ht, points, varexp, selection);
6a680ee5 38 ps.Select();
39
40 points->SetTitle(Form("N=%d", points->Size()));
41 points->SetMarkerSize(.5);
fbc350a3 42 points->SetMarkerColor(3);
6a680ee5 43
30650838 44 points->SetName(Form("T0 Hits"));
9dcd42ea 45 const TString viz_tag("SIM Hits T0");
46 points->ApplyVizTag(viz_tag, "Hits");
47
84aff7a4 48 gEve->AddElement(points);
49 gEve->Redraw3D();
6a680ee5 50
51 return points;
52}