Remove AliDebug stuff.
[u/mrichter/AliRoot.git] / EVE / alice-macros / its_clusters.C
1
2 Reve::PointSet* its_clusters(RenderElement* cont=0, Float_t maxR=50)
3 {
4   Alieve::Event::AssertGeometry();
5
6   AliRunLoader* rl = Alieve::Event::AssertRunLoader();
7   rl->LoadRecPoints("ITS");
8
9   TTree *cTree = rl->GetTreeR("ITS", false);
10
11   Reve::PointSet* clusters = new Reve::PointSet(10000);
12   clusters->SetOwnIds(kTRUE);
13
14   TClonesArray *cl=NULL;
15   TBranch *branch=cTree->GetBranch("ITSRecPoints");
16   branch->SetAddress(&cl);
17
18   Int_t nentr=(Int_t)cTree->GetEntries();
19   for (Int_t i=0; i<nentr; i++) {
20     if (!cTree->GetEvent(i)) continue;
21
22     Int_t ncl=cl->GetEntriesFast();
23
24     Float_t maxRsqr = maxR*maxR;
25     while (ncl--) {
26       AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
27       Float_t g[3]; //global coordinates
28       c->GetGlobalXYZ(g);
29       if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
30       {
31         clusters->SetNextPoint(g[0], g[1], g[2]);
32         AliCluster *atp = new AliCluster(*c);
33         clusters->SetPointId(atp);
34       }
35     }
36   }
37
38   if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
39     Warning("its_clusters", "No ITS clusters");
40     delete clusters;
41     return 0;
42   }
43
44   clusters->SetMarkerStyle(2);
45   clusters->SetMarkerSize(0.2);
46   clusters->SetMarkerColor(4);
47
48   char form[1000];
49   sprintf(form,"ITS Clusters");
50   clusters->SetName(form);
51
52   char tip[1000];
53   sprintf(tip,"N=%d", clusters->Size());
54   clusters->SetTitle(tip);
55
56   using namespace Reve;
57   gReve->AddRenderElement(clusters);
58   gReve->Redraw3D();
59
60   return clusters;
61 }