]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/tpc_hits.C
Changes from Reve::RenderElement.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
CommitLineData
5a5a1232 1// $Id$
2
3Reve::PointSet*
4tpc_hits(const char *varexp = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
2caed564 5 const char *selection = "TPC2.fArray.fR>80",
6 RenderElement* cont = 0)
5a5a1232 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);
f37061fc 15
7be1e8cd 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);
f37061fc 23 points->SetSourceCS(TPointSelectorConsumer::TVT_RPhiZ);
24
25 TPointSelector ps(ht, points, varexp, selection);
26 ps.Select();
27
2caed564 28 if (points->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
bcb585f3 29 Warning("tpc_hits", Form("No hits match '%s'", selection));
52465a1b 30 delete points;
31 return 0;
32 }
33
7be1e8cd 34 //PH points->SetTitle(Form("N=%d", points->Size()));
35 sprintf(form,"N=%d", points->Size());
36 points->SetTitle(form);
8a68912d 37 points->SetMarkerSize(.5);
5a5a1232 38 points->SetMarkerColor((Color_t)3);
39
2caed564 40 if(cont)
41 gReve->AddRenderElement(cont, points);
42 else
43 gReve->AddRenderElement(points);
44
5b96ea20 45 gReve->Redraw3D();
5a5a1232 46
47 return points;
48}