12 #include <TEveManager.h>
13 #include <TEvePointSet.h>
14 #include <Alieve/EventAlieve.h>
16 #include <AliRunLoader.h>
17 #include <AliCluster.h>
19 #include <TClonesArray.h>
23 TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50)
25 Alieve::Event::AssertGeometry();
27 AliRunLoader* rl = Alieve::Event::AssertRunLoader();
28 rl->LoadRecPoints("ITS");
30 TTree *cTree = rl->GetTreeR("ITS", false);
32 TEvePointSet* clusters = new TEvePointSet(10000);
33 clusters->SetOwnIds(kTRUE);
35 TClonesArray *cl = NULL;
36 TBranch *branch = cTree->GetBranch("ITSRecPoints");
37 branch->SetAddress(&cl);
39 Int_t nentr=(Int_t)cTree->GetEntries();
40 for (Int_t i=0; i<nentr; i++) {
41 if (!cTree->GetEvent(i)) continue;
43 Int_t ncl=cl->GetEntriesFast();
45 Float_t maxRsqr = maxR*maxR;
47 AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
48 Float_t g[3]; //global coordinates
50 if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
52 clusters->SetNextPoint(g[0], g[1], g[2]);
53 AliCluster *atp = new AliCluster(*c);
54 clusters->SetPointId(atp);
59 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
60 Warning("its_clusters", "No ITS clusters");
65 clusters->SetMarkerStyle(2);
66 clusters->SetMarkerSize(0.2);
67 clusters->SetMarkerColor(4);
70 sprintf(form,"ITS Clusters");
71 clusters->SetName(form);
74 sprintf(tip,"N=%d", clusters->Size());
75 clusters->SetTitle(tip);
76 gEve->AddElement(clusters, cont);