]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/t0_hits.C
New files; macros to demonstrate non-linear projections.
[u/mrichter/AliRoot.git] / EVE / alice-macros / t0_hits.C
CommitLineData
6a680ee5 1// $Id$
2
3Reve::PointSet*
4t0_hits(const char *varexp = "T0.fX:T0.fY:T0.fZ",
5 const char *selection = "")
6{
7 // Extracts T0 hits.
8
9
10 AliRunLoader* rl = Alieve::Event::AssertRunLoader();
11 rl->LoadHits("T0");
12
13 TTree* ht = rl->GetTreeH("T0", false);
14
15 Int_t nTracks = ht->GetEntries();
16 // printf("Found %d tracks. \n",nTracks);
17 for (Int_t it = 0; it < nTracks; it++) {
18
19 TClonesArray *hits = 0;
20 ht->SetBranchAddress("T0",&hits);
21
22 ht->GetEvent(it);
23 Int_t nHits = hits->GetEntriesFast();
24 // printf("Found %d hits in track %d. \n",nHits,it);
25
26 }
27 Reve::PointSet* points = new Reve::PointSet(Form("T0 Hits '%s'", selection));
28 points->SetSourceCS(TPointSelectorConsumer::TVT_XYZ);
29
30 TPointSelector ps(ht, points, varexp, selection);
31 ps.Select();
32
33 points->SetTitle(Form("N=%d", points->Size()));
34 points->SetMarkerSize(.5);
35 points->SetMarkerColor((Color_t)3);
36
37 gReve->AddRenderElement(points);
38 gReve->Redraw3D();
39
40 return points;
41}