]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
8544d635 | 9 | |
84aff7a4 | 10 | TEvePointSet* phos_clusters(TEveElement* cont=0) |
8544d635 | 11 | { |
d810d0de | 12 | AliEveEventManager::AssertGeometry(); |
8544d635 | 13 | |
d810d0de | 14 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); |
8544d635 | 15 | rl->LoadRecPoints("PHOS"); |
16 | ||
17 | TTree *cTree = rl->GetTreeR("PHOS", false); | |
18 | ||
84aff7a4 | 19 | TEvePointSet* clusters = new TEvePointSet(10000); |
8544d635 | 20 | clusters->SetOwnIds(kTRUE); |
21 | ||
895164e4 | 22 | TObjArray *arr=NULL; |
8544d635 | 23 | TBranch *branch=cTree->GetBranch("PHOSEmcRP"); |
895164e4 | 24 | branch->SetAddress(&arr); |
8544d635 | 25 | |
6baa2e65 | 26 | Int_t nentr=(Int_t)branch->GetEntries(); |
8544d635 | 27 | for (Int_t i=0; i<nentr; i++) { |
6baa2e65 | 28 | if (!branch->GetEvent(i)) continue; |
8544d635 | 29 | |
895164e4 | 30 | Int_t ncl=arr->GetEntriesFast(); |
31 | while (ncl--) { | |
32 | AliCluster *cl=(AliCluster*)arr->UncheckedAt(ncl); | |
8544d635 | 33 | |
895164e4 | 34 | Float_t g[3]; //global coordinates |
35 | cl->GetGlobalXYZ(g); | |
36 | ||
37 | AliCluster *atp = new AliCluster(*cl); | |
38 | clusters->SetNextPoint(g[0], g[1], g[2]); | |
39 | clusters->SetPointId(atp); | |
40 | } | |
8544d635 | 41 | } |
42 | ||
84aff7a4 | 43 | Warning("phos_clusters"," %d", clusters->Size()); |
895164e4 | 44 | |
84aff7a4 | 45 | if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) { |
8544d635 | 46 | Warning("phos_clusters", "No PHOS clusters"); |
47 | delete clusters; | |
48 | return 0; | |
49 | } | |
50 | ||
51 | clusters->SetMarkerStyle(2); | |
52 | clusters->SetMarkerSize(0.5); | |
53 | clusters->SetMarkerColor(4); | |
54 | ||
30650838 | 55 | clusters->SetName("PHOS Clusters"); |
8544d635 | 56 | |
9dcd42ea | 57 | clusters->SetTitle(Form("N=%d", clusters->Size())); |
30650838 | 58 | |
59 | const TString viz_tag("REC Clusters PHOS"); | |
60 | ||
61 | clusters->ApplyVizTag(viz_tag, "Clusters"); | |
62 | ||
84aff7a4 | 63 | gEve->AddElement(clusters); |
30650838 | 64 | |
84aff7a4 | 65 | gEve->Redraw3D(); |
8544d635 | 66 | |
67 | return clusters; | |
68 | } |