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 **************************************************************************/
10 TEvePointSet* clusters_from_label(Int_t label=0, TEveElement* cont=0)
12 AliESDEvent* esd = AliEveEventManager::AssertESD();
13 TEvePointSet* clusters = new TEvePointSet(64);
14 clusters->SetOwnIds(kTRUE);
16 for (Int_t n=0; n<esd->GetNumberOfTracks(); n++)
18 AliESDtrack* at = esd->GetTrack(n);
19 if (at->GetLabel() == label) {
20 const AliTrackPointArray* pArr = at->GetTrackPointArray();
22 Warning("clusters_from_label", "TrackPointArray not stored with ESD track.");
25 Int_t np = pArr->GetNPoints();
26 const Float_t* x = pArr->GetX();
27 const Float_t* y = pArr->GetY();
28 const Float_t* z = pArr->GetZ();
29 for (Int_t i=0; i<np; ++i) {
30 clusters->SetNextPoint(x[i], y[i], z[i]);
31 AliTrackPoint *atp = new AliTrackPoint;
32 pArr->GetPoint(*atp, i);
33 clusters->SetPointId(atp);
38 if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
39 Warning("clusters_from_label", Form("No clusters match label '%d'", label));
44 clusters->SetMarkerStyle(2);
45 clusters->SetMarkerSize(0.5);
46 clusters->SetMarkerColor(4);
47 //PH The line below is replaced waiting for a fix in Root
48 //PH which permits to use variable siza arguments in CINT
49 //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
50 //PH clusters->SetName(Form("Clusters lab=%d", label));
52 sprintf(form,"Clusters lab=%d", label);
53 clusters->SetName(form);
56 sprintf(tip,"N=%d", clusters->Size());
57 clusters->SetTitle(tip);
58 gEve->AddElement(clusters, cont);