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, Float_t maxR=1000)
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();
66 Float_t maxRsqr = maxR*maxR;
68 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
69 Float_t g[3]; //global coordinates
71 if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
73 clusters->SetNextPoint(g[0], g[1], g[2]);
74 AliCluster3D *atp = new AliCluster3D(*c);
75 clusters->SetPointId(atp);
80 rl->UnloadRecPoints("HMPID");
82 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
83 Warning("hmpid_clusters", "No HMPID clusters");
88 clusters->SetMarkerStyle(2);
89 clusters->SetMarkerSize(0.2);
90 clusters->SetMarkerColor(4);
93 sprintf(form,"HMPID Clusters");
94 clusters->SetName(form);
97 sprintf(tip,"N=%d", clusters->Size());
98 clusters->SetTitle(tip);
99 gEve->AddElement(clusters, cont);