+// $Id$
+// 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. *
+ **************************************************************************/
#ifdef __CINT__
-namespace TEveUtil
-{
class TEveElement;
class TEvePointSet;
-}
#else
-#include <TEve.h>
#include <TEveManager.h>
#include <TEvePointSet.h>
-#include <Alieve/EventAlieve.h>
+#include <EveBase/AliEveEventManager.h>
#include <AliRunLoader.h>
#include <AliCluster3D.h>
#endif
-TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
+TEvePointSet* hmpid_clusters(TEveElement* cont=0)
{
const Int_t nCh=7;
TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
- Char_t *name[nCh]={
+ const Char_t *name[nCh]={
"HMPID0",
"HMPID1",
"HMPID2",
TEvePointSet* clusters = new TEvePointSet(10000);
clusters->SetOwnIds(kTRUE);
- Alieve::Event::AssertGeometry();
-
- AliRunLoader* rl = Alieve::Event::AssertRunLoader();
+ AliEveEventManager::AssertGeometry();
+
+ AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
rl->LoadRecPoints("HMPID");
TTree *cTree = rl->GetTreeR("HMPID", false);
TBranch *br=cTree->GetBranch(name[k]);
if (!br) return 0;
br->SetAddress(&(cl[k]));
- }
+ }
if (!cTree->GetEvent(0)) return 0;
TClonesArray *arr=cl[i];
Int_t ncl=arr->GetEntriesFast();
- Float_t maxRsqr = maxR*maxR;
while (ncl--) {
AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
Float_t g[3]; //global coordinates
c->GetGlobalXYZ(g);
- if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
- {
- clusters->SetNextPoint(g[0], g[1], g[2]);
- AliCluster3D *atp = new AliCluster3D(*c);
- clusters->SetPointId(atp);
- }
+ clusters->SetNextPoint(g[0], g[1], g[2]);
+ AliCluster3D *atp = new AliCluster3D(*c);
+ clusters->SetPointId(atp);
}
}
+ rl->UnloadRecPoints("HMPID");
+
if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
Warning("hmpid_clusters", "No HMPID clusters");
delete clusters;
clusters->SetMarkerSize(0.2);
clusters->SetMarkerColor(4);
- char form[1000];
- sprintf(form,"HMPID Clusters");
- clusters->SetName(form);
+ clusters->SetName("HMPID Clusters");
+
+ clusters->SetTitle(Form("N=%d", clusters->Size()));
+
+ const TString viz_tag("REC Clusters HMPID");
+
+ clusters->ApplyVizTag(viz_tag, "Clusters");
- char tip[1000];
- sprintf(tip,"N=%d", clusters->Size());
- clusters->SetTitle(tip);
gEve->AddElement(clusters, cont);
+
gEve->Redraw3D();
return clusters;