]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tpc_hits.C
Fix aclic compilation.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 TEvePointSet*
11 tpc_hits(const char  *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
12          const char  *selection = "TPC2.fArray.fR>80",
13          TEveElement *cont      = 0)
14 {
15   // Extracts 'major' TPC hits (not the compressed ones).
16   // This gives ~2.5% of all hits.
17
18   AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
19   rl->LoadHits("TPC");
20
21   TTree* ht = rl->GetTreeH("TPC", false);
22
23   //PH The line below is replaced waiting for a fix in Root
24   //PH which permits to use variable siza arguments in CINT
25   //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
26   //PH  TEvePointSet* points = new TEvePointSet(Form("TPC Hits '%s'", selection));
27   char form[1000];
28   sprintf(form,"TPC Hits '%s'", selection);
29   TEvePointSet* points = new TEvePointSet(form);
30   points->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
31
32   TEvePointSelector ps(ht, points, varexp, selection);
33   ps.Select();
34
35   if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
36     Warning("tpc_hits", Form("No hits match '%s'", selection));
37     delete points;
38     return 0;
39   }
40
41   //PH  points->SetTitle(Form("N=%d", points->Size()));
42   sprintf(form,"N=%d", points->Size());
43   points->SetTitle(form);
44   points->SetMarkerSize(.5);
45   points->SetMarkerColor((Color_t)3);
46
47   gEve->AddElement(points, cont);
48   gEve->Redraw3D();
49
50   return points;
51 }