]>
Commit | Line | Data |
---|---|---|
8544d635 | 1 | |
2 | Reve::PointSet* phos_clusters(RenderElement* cont=0) | |
3 | { | |
0ccc545c | 4 | Alieve::Event::AssertGeometry(); |
8544d635 | 5 | |
6 | AliRunLoader* rl = Alieve::Event::AssertRunLoader(); | |
7 | rl->LoadRecPoints("PHOS"); | |
8 | ||
9 | TTree *cTree = rl->GetTreeR("PHOS", false); | |
10 | ||
11 | Reve::PointSet* clusters = new Reve::PointSet(10000); | |
12 | clusters->SetOwnIds(kTRUE); | |
13 | ||
6baa2e65 | 14 | AliPHOSEmcRecPoint *cl=NULL; |
8544d635 | 15 | TBranch *branch=cTree->GetBranch("PHOSEmcRP"); |
16 | branch->SetAddress(&cl); | |
17 | ||
6baa2e65 | 18 | Int_t nentr=(Int_t)branch->GetEntries(); |
8544d635 | 19 | Warning("phos_clusters",Form(" %d"),nentr); |
20 | for (Int_t i=0; i<nentr; i++) { | |
6baa2e65 | 21 | if (!branch->GetEvent(i)) continue; |
8544d635 | 22 | |
6baa2e65 | 23 | Float_t g[3]; //global coordinates |
24 | cl->GetGlobalXYZ(g); | |
8544d635 | 25 | |
6baa2e65 | 26 | clusters->SetNextPoint(g[0], g[1], g[2]); |
27 | AliCluster *atp = new AliCluster(*cl); | |
28 | clusters->SetPointId(atp); | |
8544d635 | 29 | } |
30 | ||
31 | if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) { | |
32 | Warning("phos_clusters", "No PHOS clusters"); | |
33 | delete clusters; | |
34 | return 0; | |
35 | } | |
36 | ||
37 | clusters->SetMarkerStyle(2); | |
38 | clusters->SetMarkerSize(0.5); | |
39 | clusters->SetMarkerColor(4); | |
40 | ||
41 | char form[1000]; | |
42 | sprintf(form,"PHOS Clusters"); | |
43 | clusters->SetName(form); | |
44 | ||
45 | char tip[1000]; | |
46 | sprintf(tip,"N=%d", clusters->Size()); | |
47 | clusters->SetTitle(tip); | |
48 | ||
49 | using namespace Reve; | |
50 | gReve->AddRenderElement(clusters); | |
51 | gReve->Redraw3D(); | |
52 | ||
53 | return clusters; | |
54 | } |