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>
20 #include <AliRunLoader.h>
21 #include <AliCluster3D.h>
23 #include <TClonesArray.h>
27 TEvePointSet* hmpid_clusters(TEveElement* cont=0)
30 TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
31 const Char_t *name[nCh]={
42 TEvePointSet* clusters = new TEvePointSet(10000);
43 clusters->SetOwnIds(kTRUE);
45 AliEveEventManager::AssertGeometry();
47 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
48 rl->LoadRecPoints("HMPID");
50 TTree *cTree = rl->GetTreeR("HMPID", false);
53 for (Int_t k=0; k<nCh; k++) {
54 TBranch *br=cTree->GetBranch(name[k]);
56 br->SetAddress(&(cl[k]));
59 if (!cTree->GetEvent(0)) return 0;
62 for (Int_t i=0; i<nCh; i++) {
63 TClonesArray *arr=cl[i];
64 Int_t ncl=arr->GetEntriesFast();
67 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
68 Float_t g[3]; //global coordinates
70 clusters->SetNextPoint(g[0], g[1], g[2]);
71 AliCluster3D *atp = new AliCluster3D(*c);
72 clusters->SetPointId(atp);
76 rl->UnloadRecPoints("HMPID");
78 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
79 Warning("hmpid_clusters", "No HMPID clusters");
84 clusters->SetMarkerStyle(2);
85 clusters->SetMarkerSize(0.2);
86 clusters->SetMarkerColor(4);
88 clusters->SetName("HMPID Clusters");
90 clusters->SetTitle(Form("N=%d", clusters->Size()));
92 const TString viz_tag("REC Clusters HMPID");
94 clusters->ApplyVizTag(viz_tag, "Clusters");
96 gEve->AddElement(clusters, cont);