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 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TObjArray.h>
15 #include <TEveManager.h>
16 #include <TEveElement.h>
17 #include <TEvePointSet.h>
19 #include <AliCluster.h>
20 #include <AliRunLoader.h>
21 #include <AliEveEventManager.h>
24 TEvePointSet* phos_clusters(TEveElement* cont=0)
26 AliEveEventManager::AssertGeometry();
28 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
29 rl->LoadRecPoints("PHOS");
31 TTree *cTree = rl->GetTreeR("PHOS", false);
35 TEvePointSet* clusters = new TEvePointSet(10000);
36 clusters->SetOwnIds(kTRUE);
39 TBranch *branch=cTree->GetBranch("PHOSEmcRP");
40 branch->SetAddress(&arr);
42 Int_t nentr=(Int_t)branch->GetEntries();
43 for (Int_t i=0; i<nentr; i++) {
44 if (!branch->GetEvent(i)) continue;
46 Int_t ncl=arr->GetEntriesFast();
48 AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl);
50 Float_t g[3]; //global coordinates
53 AliCluster *atp = new AliCluster(*cl);
54 clusters->SetNextPoint(g[0], g[1], g[2]);
55 clusters->SetPointId(atp);
59 Warning("phos_clusters"," %d", clusters->Size());
61 if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
62 Warning("phos_clusters", "No PHOS clusters");
67 clusters->SetMarkerStyle(2);
68 clusters->SetMarkerSize(0.5);
69 clusters->SetMarkerColor(4);
71 clusters->SetName("PHOS Clusters");
73 clusters->SetTitle(Form("N=%d", clusters->Size()));
75 const TString viz_tag("REC Clusters PHOS");
77 clusters->ApplyVizTag(viz_tag, "Clusters");
79 gEve->AddElement(clusters);