X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVE%2Falice-macros%2Ftpc_hits.C;h=2d5a00b481ee8f8af2c0c6b079d30636b9a208d1;hb=03ed6463b5267b974da6df1fbb3a4f32bd37984e;hp=f85082af6b5b7faf5a6a4cc1b24eb0219e04ef54;hpb=7be1e8cd393354fa4f1773fe21601ba91c1c6319;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVE/alice-macros/tpc_hits.C b/EVE/alice-macros/tpc_hits.C index f85082af6b5..2d5a00b481e 100644 --- a/EVE/alice-macros/tpc_hits.C +++ b/EVE/alice-macros/tpc_hits.C @@ -1,37 +1,59 @@ // $Id$ - -Reve::PointSet* -tpc_hits(const char *varexp = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ", - const char *selection = "TPC2.fArray.fR>80") +// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 + +/************************************************************************** + * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * + * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * + * full copyright notice. * + **************************************************************************/ + +#if !defined(__CINT__) || defined(__MAKECINT__) +#include +#include +#include +#include +#include +#include + +#include +#include +#endif + +TEvePointSet* +tpc_hits(const char *varexp = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ", + const char *selection = "TPC2.fArray.fR>80", + TEveElement *cont = 0) { // Extracts 'major' TPC hits (not the compressed ones). // This gives ~2.5% of all hits. - AliRunLoader* rl = Alieve::Event::AssertRunLoader(); + AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); rl->LoadHits("TPC"); TTree* ht = rl->GetTreeH("TPC", false); - //PH The line below is replaced waiting for a fix in Root - //PH which permits to use variable siza arguments in CINT - //PH on some platforms (alphalinuxgcc, solariscc5, etc.) - //PH Reve::PointSet* points = new Reve::PointSet(Form("TPC Hits '%s'", selection)); - char form[1000]; - sprintf(form,"TPC Hits '%s'", selection); - Reve::PointSet* points = new Reve::PointSet(form); - points->SetSourceCS(TPointSelectorConsumer::TVT_RPhiZ); + TEvePointSet* points = new TEvePointSet(Form("TPC Hits '%s'", selection)); + points->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ); - TPointSelector ps(ht, points, varexp, selection); + TEvePointSelector ps(ht, points, varexp, selection); ps.Select(); - //PH points->SetTitle(Form("N=%d", points->Size())); - sprintf(form,"N=%d", points->Size()); - points->SetTitle(form); + if (points->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) { + Warning("tpc_hits", "No hits match '%s'", selection); + delete points; + return 0; + } + + points->SetName(Form("TPC Hits")); + const TString viz_tag("SIM Hits TPC"); + points->ApplyVizTag(viz_tag, "Hits"); + + points->SetTitle(Form("N=%d", points->Size())); points->SetMarkerSize(.5); - points->SetMarkerColor((Color_t)3); + points->SetMarkerColor(3); - gReve->AddRenderElement(points); - gReve->Redraw3D(); + gEve->AddElement(points, cont); + gEve->Redraw3D(); return points; }