2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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 **************************************************************************/
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TClonesArray.h>
14 #include <TEveManager.h>
15 #include <TEveElement.h>
16 #include <TEvePointSet.h>
20 #include <STEER/STEER/AliCluster3D.h>
21 #include <STEER/STEER/AliRunLoader.h>
22 #include <EveBase/AliEveEventManager.h>
30 TEvePointSet* hmpid_clusters(TEveElement* cont=0)
33 TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
34 const Char_t *name[nCh]={
45 TEvePointSet* clusters = new TEvePointSet(10000);
46 clusters->SetOwnIds(kTRUE);
48 AliEveEventManager::AssertGeometry();
50 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
51 rl->LoadRecPoints("HMPID");
53 TTree *cTree = rl->GetTreeR("HMPID", false);
56 for (Int_t k=0; k<nCh; k++) {
57 TBranch *br=cTree->GetBranch(name[k]);
59 br->SetAddress(&(cl[k]));
62 if (!cTree->GetEvent(0)) return 0;
65 for (Int_t i=0; i<nCh; i++) {
66 TClonesArray *arr=cl[i];
67 Int_t ncl=arr->GetEntriesFast();
70 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
71 Float_t g[3]; //global coordinates
73 clusters->SetNextPoint(g[0], g[1], g[2]);
74 AliCluster3D *atp = new AliCluster3D(*c);
75 clusters->SetPointId(atp);
79 rl->UnloadRecPoints("HMPID");
81 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
82 Warning("hmpid_clusters", "No HMPID clusters");
87 clusters->SetMarkerStyle(2);
88 clusters->SetMarkerSize(0.2);
89 clusters->SetMarkerColor(4);
91 clusters->SetName("HMPID Clusters");
93 clusters->SetTitle(Form("N=%d", clusters->Size()));
95 const TString viz_tag("REC Clusters HMPID");
97 clusters->ApplyVizTag(viz_tag, "Clusters");
99 gEve->AddElement(clusters, cont);