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 **************************************************************************/
17 #include <TEveManager.h>
18 #include <TEvePointSet.h>
19 #include <EveDet/AliEveEventManager.h>
21 #include <AliRunLoader.h>
22 #include <AliCluster3D.h>
24 #include <TClonesArray.h>
28 TEvePointSet* hmpid_clusters(TEveElement* cont=0, Float_t maxR=1000)
31 TClonesArray *cl[nCh] = {0,0,0,0,0,0,0};
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();
67 Float_t maxRsqr = maxR*maxR;
69 AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl);
70 Float_t g[3]; //global coordinates
72 if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
74 clusters->SetNextPoint(g[0], g[1], g[2]);
75 AliCluster3D *atp = new AliCluster3D(*c);
76 clusters->SetPointId(atp);
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);
92 sprintf(form,"HMPID Clusters");
93 clusters->SetName(form);
96 sprintf(tip,"N=%d", clusters->Size());
97 clusters->SetTitle(tip);
98 gEve->AddElement(clusters, cont);