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);
33 TEvePointSet* clusters = new TEvePointSet(10000);
34 clusters->SetOwnIds(kTRUE);
37 TBranch *branch=cTree->GetBranch("PHOSEmcRP");
38 branch->SetAddress(&arr);
40 Int_t nentr=(Int_t)branch->GetEntries();
41 for (Int_t i=0; i<nentr; i++) {
42 if (!branch->GetEvent(i)) continue;
44 Int_t ncl=arr->GetEntriesFast();
46 AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl);
48 Float_t g[3]; //global coordinates
51 AliCluster *atp = new AliCluster(*cl);
52 clusters->SetNextPoint(g[0], g[1], g[2]);
53 clusters->SetPointId(atp);
57 Warning("phos_clusters"," %d", clusters->Size());
59 if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
60 Warning("phos_clusters", "No PHOS clusters");
65 clusters->SetMarkerStyle(2);
66 clusters->SetMarkerSize(0.5);
67 clusters->SetMarkerColor(4);
69 clusters->SetName("PHOS Clusters");
71 clusters->SetTitle(Form("N=%d", clusters->Size()));
73 const TString viz_tag("REC Clusters PHOS");
75 clusters->ApplyVizTag(viz_tag, "Clusters");
77 gEve->AddElement(clusters);