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