Use geometry from CDB.
[u/mrichter/AliRoot.git] / EVE / alice-macros / phos_clusters.C
CommitLineData
8544d635 1
2Reve::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
14 TClonesArray *cl=NULL;
15 TBranch *branch=cTree->GetBranch("PHOSEmcRP");
16 branch->SetAddress(&cl);
17
18 Int_t nentr=(Int_t)cTree->GetEntries();
19 Warning("phos_clusters",Form(" %d"),nentr);
20 for (Int_t i=0; i<nentr; i++) {
21 if (!cTree->GetEvent(i)) continue;
22
23 Int_t ncl=cl->GetEntriesFast();
24
25 while (ncl--) {
26 AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
27 Float_t g[3]; //global coordinates
28 c->GetGlobalXYZ(g);
29
30 clusters->SetNextPoint(g[0], g[1], g[2]);
31 AliCluster *atp = new AliCluster(*c);
32 clusters->SetPointId(atp);
33 }
34 }
35
36 if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
37 Warning("phos_clusters", "No PHOS clusters");
38 delete clusters;
39 return 0;
40 }
41
42 clusters->SetMarkerStyle(2);
43 clusters->SetMarkerSize(0.5);
44 clusters->SetMarkerColor(4);
45
46 char form[1000];
47 sprintf(form,"PHOS Clusters");
48 clusters->SetName(form);
49
50 char tip[1000];
51 sprintf(tip,"N=%d", clusters->Size());
52 clusters->SetTitle(tip);
53
54 using namespace Reve;
55 gReve->AddRenderElement(clusters);
56 gReve->Redraw3D();
57
58 return clusters;
59}