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 **************************************************************************/
16 #include <TEveManager.h>
17 #include <TEvePointSet.h>
18 #include <EveBase/AliEveEventManager.h>
21 #include <AliRunLoader.h>
22 #include <AliCluster3D.h>
24 #include <TClonesArray.h>
28 TEvePointSet* hmpid_clusters(TEveElement* cont=0)
31 TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
32 const Char_t *name[nCh]={
43 TEvePointSet* clusters = new TEvePointSet(10000);
44 clusters->SetOwnIds(kTRUE);
46 AliEveEventManager::AssertGeometry();
48 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
49 rl->LoadRecPoints("HMPID");
51 TTree *cTree = rl->GetTreeR("HMPID", false);
54 for (Int_t k=0; k<nCh; k++) {
55 TBranch *br=cTree->GetBranch(name[k]);
57 br->SetAddress(&(cl[k]));
60 if (!cTree->GetEvent(0)) return 0;
63 for (Int_t i=0; i<nCh; i++) {
64 TClonesArray *arr=cl[i];
65 Int_t ncl=arr->GetEntriesFast();
68 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
69 Float_t g[3]; //global coordinates
71 clusters->SetNextPoint(g[0], g[1], g[2]);
72 AliCluster3D *atp = new AliCluster3D(*c);
73 clusters->SetPointId(atp);
77 rl->UnloadRecPoints("HMPID");
79 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
80 Warning("hmpid_clusters", "No HMPID clusters");
85 clusters->SetMarkerStyle(2);
86 clusters->SetMarkerSize(0.2);
87 clusters->SetMarkerColor(4);
89 clusters->SetName("HMPID Clusters");
91 clusters->SetTitle(Form("N=%d", clusters->Size()));
93 const TString viz_tag("REC Clusters HMPID");
95 clusters->ApplyVizTag(viz_tag, "Clusters");
97 gEve->AddElement(clusters, cont);