Removing obsolete macros which used the AliTPCtracker
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
CommitLineData
5a5a1232 1// $Id$
d810d0de 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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
5a5a1232 9
ba978640 10#if !defined(__CINT__) || defined(__MAKECINT__)
11#include <TString.h>
12#include <TTree.h>
13#include <TEvePointSet.h>
14#include <TEveElement.h>
15#include <TEveManager.h>
16#include <TEveTreeTools.h>
17
6c49a8e1 18#include <AliRunLoader.h>
19#include <AliEveEventManager.h>
ba978640 20#endif
21
84aff7a4 22TEvePointSet*
16718cdc 23tpc_hits(const char *varexp = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
24 const char *selection = "TPC2.fArray.fR>80",
25 TEveElement *cont = 0)
5a5a1232 26{
27 // Extracts 'major' TPC hits (not the compressed ones).
28 // This gives ~2.5% of all hits.
29
d810d0de 30 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
5a5a1232 31 rl->LoadHits("TPC");
32
33 TTree* ht = rl->GetTreeH("TPC", false);
f37061fc 34
9dcd42ea 35 TEvePointSet* points = new TEvePointSet(Form("TPC Hits '%s'", selection));
84aff7a4 36 points->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
f37061fc 37
84aff7a4 38 TEvePointSelector ps(ht, points, varexp, selection);
f37061fc 39 ps.Select();
40
84aff7a4 41 if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
ba978640 42 Warning("tpc_hits", "No hits match '%s'", selection);
52465a1b 43 delete points;
44 return 0;
45 }
9dcd42ea 46
30650838 47 points->SetName(Form("TPC Hits"));
9dcd42ea 48 const TString viz_tag("SIM Hits TPC");
49 points->ApplyVizTag(viz_tag, "Hits");
50
9dcd42ea 51 points->SetTitle(Form("N=%d", points->Size()));
8a68912d 52 points->SetMarkerSize(.5);
fbc350a3 53 points->SetMarkerColor(3);
5a5a1232 54
84aff7a4 55 gEve->AddElement(points, cont);
56 gEve->Redraw3D();
5a5a1232 57
58 return points;
59}