]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/acorde_hits.C
Make macros compilable with ACLiC
[u/mrichter/AliRoot.git] / EVE / alice-macros / acorde_hits.C
CommitLineData
41e87e2b 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 **************************************************************************/
4f8b4026 9#if !defined(__CINT__) || defined(__MAKECINT__)
10#include <TTree.h>
11#include <TString.h>
12#include <TEveManager.h>
13#include <TEveElement.h>
14#include <TEvePointSet.h>
15
16#include <EveBase/AliEveEventManager.h>
17#include <STEER/STEER/AliRunLoader.h>
18#endif
41e87e2b 19
84aff7a4 20TEvePointSet*
16718cdc 21acorde_hits(const char *varexp = "ACORDE.fX:ACORDE.fY:ACORDE.fZ",
22 const char *selection = "",
23 TEveElement *cont = 0)
41e87e2b 24{
d810d0de 25 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
41e87e2b 26 rl->LoadHits("ACORDE");
27
28 TTree* ht = rl->GetTreeH("ACORDE", false);
51346b82 29
30650838 30 TEvePointSet* points = new TEvePointSet(Form("ACORDE Hits '%s'", selection));
41e87e2b 31
84aff7a4 32 TEvePointSelector ps(ht, points, varexp, selection);
41e87e2b 33 ps.Select();
34
84aff7a4 35 if(points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE)
36 {
4f8b4026 37 Warning("acorde_hits", "No hits match '%s'", selection);
41e87e2b 38 delete points;
84aff7a4 39 return 0;
41e87e2b 40 }
41
30650838 42 points->SetName(Form("ACORDE Hits"));
43 const TString viz_tag("SIM Hits ACORDE");
44 points->ApplyVizTag(viz_tag, "Hits");
45
9dcd42ea 46 points->SetTitle(Form("N=%d", points->Size()));
41e87e2b 47 points->SetMarkerSize(.5);
fbc350a3 48 points->SetMarkerColor(2);
41e87e2b 49
84aff7a4 50 gEve->AddElement(points, cont);
51 gEve->Redraw3D();
41e87e2b 52
53 return points;
54}