2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
19 #include <TEveManager.h>
20 #include <TEvePointSet.h>
21 #include <Alieve/AliEveEventManager.h>
23 #include <AliRunLoader.h>
24 #include <AliCluster.h>
26 #include <TClonesArray.h>
30 TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50)
32 AliEveEventManager::AssertGeometry();
34 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
35 rl->LoadRecPoints("ITS");
37 TTree *cTree = rl->GetTreeR("ITS", false);
39 TEvePointSet* clusters = new TEvePointSet(10000);
40 clusters->SetOwnIds(kTRUE);
42 TClonesArray *cl = NULL;
43 TBranch *branch = cTree->GetBranch("ITSRecPoints");
44 branch->SetAddress(&cl);
46 Int_t nentr=(Int_t)cTree->GetEntries();
47 for (Int_t i=0; i<nentr; i++) {
48 if (!cTree->GetEvent(i)) continue;
50 Int_t ncl=cl->GetEntriesFast();
52 Float_t maxRsqr = maxR*maxR;
54 AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
55 Float_t g[3]; //global coordinates
57 if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
59 clusters->SetNextPoint(g[0], g[1], g[2]);
60 AliCluster *atp = new AliCluster(*c);
61 clusters->SetPointId(atp);
66 if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
67 Warning("its_clusters", "No ITS clusters");
72 clusters->SetMarkerStyle(2);
73 clusters->SetMarkerSize(0.2);
74 clusters->SetMarkerColor(4);
77 sprintf(form,"ITS Clusters");
78 clusters->SetName(form);
81 sprintf(tip,"N=%d", clusters->Size());
82 clusters->SetTitle(tip);
83 gEve->AddElement(clusters, cont);