]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tpc_hits.C
8e9f1f46cb9c76e7942e194d34a41f149c24a20d
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
1 // $Id$
2
3 Reve::PointSet*
4 tpc_hits(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
5          const char *selection = "TPC2.fArray.fR>80")
6 {
7   // Extracts 'major' TPC hits (not the compressed ones).
8   // This gives ~2.5% of all hits.
9
10   AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
11   rl->LoadHits("TPC");
12
13   TTree* ht = rl->GetTreeH("TPC", false);
14
15   //PH The line below is replaced waiting for a fix in Root
16   //PH which permits to use variable siza arguments in CINT
17   //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
18   //PH  Reve::PointSet* points = new Reve::PointSet(Form("TPC Hits '%s'", selection));
19   char form[1000];
20   sprintf(form,"TPC Hits '%s'", selection);
21   Reve::PointSet* points = new Reve::PointSet(form);
22   points->SetSourceCS(TPointSelectorConsumer::TVT_RPhiZ);
23
24   TPointSelector ps(ht, points, varexp, selection);
25   ps.Select();
26
27   if (points->Size() == 0) {
28     Warning("tpc_hits", Form("No hits match '%s'", selection));
29     delete points;
30     return 0;
31   }
32
33   //PH  points->SetTitle(Form("N=%d", points->Size()));
34   sprintf(form,"N=%d", points->Size());
35   points->SetTitle(form);
36   points->SetMarkerSize(.5);
37   points->SetMarkerColor((Color_t)3);
38
39   gReve->AddRenderElement(points);
40   gReve->Redraw3D();
41
42   return points;
43 }