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 **************************************************************************/
20 #include <TEveManager.h>
21 #include <TEvePointSet.h>
22 #include <Alieve/EventAlieve.h>
24 #include <AliRunLoader.h>
25 #include <AliCluster3D.h>
27 #include <TClonesArray.h>
31 TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
34 TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
46 TEvePointSet* clusters = new TEvePointSet(10000);
47 clusters->SetOwnIds(kTRUE);
49 AliEveEventManager::AssertGeometry();
51 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
52 rl->LoadRecPoints("HMPID");
54 TTree *cTree = rl->GetTreeR("HMPID", false);
57 for (Int_t k=0; k<nCh; k++) {
58 TBranch *br=cTree->GetBranch(name[k]);
60 br->SetAddress(&(cl[k]));
63 if (!cTree->GetEvent(0)) return 0;
66 for (Int_t i=0; i<nCh; i++) {
67 TClonesArray *arr=cl[i];
68 Int_t ncl=arr->GetEntriesFast();
70 Float_t maxRsqr = maxR*maxR;
72 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
73 Float_t g[3]; //global coordinates
75 if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
77 clusters->SetNextPoint(g[0], g[1], g[2]);
78 AliCluster3D *atp = new AliCluster3D(*c);
79 clusters->SetPointId(atp);
84 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
85 Warning("hmpid_clusters", "No HMPID clusters");
90 clusters->SetMarkerStyle(2);
91 clusters->SetMarkerSize(0.2);
92 clusters->SetMarkerColor(4);
95 sprintf(form,"HMPID Clusters");
96 clusters->SetName(form);
99 sprintf(tip,"N=%d", clusters->Size());
100 clusters->SetTitle(tip);
101 gEve->AddElement(clusters, cont);