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 **************************************************************************/
10 TEvePointSet* phos_clusters(TEveElement* cont=0)
12 AliEveEventManager::AssertGeometry();
14 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
15 rl->LoadRecPoints("PHOS");
17 TTree *cTree = rl->GetTreeR("PHOS", false);
19 TEvePointSet* clusters = new TEvePointSet(10000);
20 clusters->SetOwnIds(kTRUE);
23 TBranch *branch=cTree->GetBranch("PHOSEmcRP");
24 branch->SetAddress(&arr);
26 Int_t nentr=(Int_t)branch->GetEntries();
27 for (Int_t i=0; i<nentr; i++) {
28 if (!branch->GetEvent(i)) continue;
30 Int_t ncl=arr->GetEntriesFast();
32 AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl);
34 Float_t g[3]; //global coordinates
37 AliCluster *atp = new AliCluster(*cl);
38 clusters->SetNextPoint(g[0], g[1], g[2]);
39 clusters->SetPointId(atp);
43 Warning("phos_clusters"," %d", clusters->Size());
45 if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
46 Warning("phos_clusters", "No PHOS clusters");
51 clusters->SetMarkerStyle(2);
52 clusters->SetMarkerSize(0.5);
53 clusters->SetMarkerColor(4);
56 sprintf(form,"PHOS Clusters");
57 clusters->SetName(form);
60 sprintf(tip,"N=%d", clusters->Size());
61 clusters->SetTitle(tip);
62 gEve->AddElement(clusters);