]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/emcal_hits.C
Merged EVE-dev-after-merge to EVE-dev into HEAD. Requires ROOT-5.17.04.
[u/mrichter/AliRoot.git] / EVE / alice-macros / emcal_hits.C
1 // $Id$
2
3 Reve::PointSet*
4 emcal_hits(const char *varexp    = "fX:fY:fZ",
5            const char *selection = "",
6            Reve::RenderElement* cont = 0)
7 {
8   AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
9   rl->LoadHits("EMCAL");
10
11   TTree* ht = rl->GetTreeH("EMCAL", false);
12   
13   //PH The line below is replaced waiting for a fix in Root
14   //PH which permits to use variable siza arguments in CINT
15   //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
16   //PH  Reve::PointSet* points = new Reve::PointSet(Form("EMCAL Hits '%s'", selection));
17   char form[1000];
18   sprintf(form,"EMCAL Hits '%s'", selection);
19   Reve::PointSet* points = new Reve::PointSet(form);
20
21   TPointSelector ps(ht, points, varexp, selection);
22   ps.Select();
23
24   if(points->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
25     Warning("emcal_hits", Form("No hits match '%s'", selection));
26     delete points;
27     return 0;
28   }
29
30   //PH  points->SetTitle(Form("N=%d", points->Size()));
31   sprintf(form,"N=%d", points->Size());
32   points->SetTitle(form);
33   points->SetMarkerSize(.5);
34   points->SetMarkerColor((Color_t)2);
35
36   gReve->AddRenderElement(points, cont);
37   gReve->Redraw3D();
38
39   return points;
40 }