]>
Commit | Line | Data |
---|---|---|
d680093b | 1 | // $Id$ |
d810d0de | 2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
d680093b | 9 | |
84aff7a4 | 10 | TEvePointSet* clusters_from_label(Int_t label=0, TEveElement* cont=0) |
d680093b | 11 | { |
d810d0de | 12 | AliESDEvent* esd = AliEveEventManager::AssertESD(); |
84aff7a4 | 13 | TEvePointSet* clusters = new TEvePointSet(64); |
426530cc | 14 | clusters->SetOwnIds(kTRUE); |
d680093b | 15 | |
39fbbcbb | 16 | for (Int_t n=0; n<esd->GetNumberOfTracks(); n++) |
17 | { | |
d680093b | 18 | AliESDtrack* at = esd->GetTrack(n); |
19 | if (at->GetLabel() == label) { | |
20 | const AliTrackPointArray* pArr = at->GetTrackPointArray(); | |
21 | if (pArr == 0) { | |
22 | Warning("clusters_from_label", "TrackPointArray not stored with ESD track."); | |
23 | continue; | |
24 | } | |
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]); | |
426530cc | 31 | AliTrackPoint *atp = new AliTrackPoint; |
32 | pArr->GetPoint(*atp, i); | |
33 | clusters->SetPointId(atp); | |
d680093b | 34 | } |
35 | } | |
36 | } | |
2caed564 | 37 | |
84aff7a4 | 38 | if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) { |
2caed564 | 39 | Warning("clusters_from_label", Form("No clusters match label '%d'", label)); |
40 | delete clusters; | |
41 | return 0; | |
42 | } | |
43 | ||
d680093b | 44 | clusters->SetMarkerStyle(2); |
a8600b56 | 45 | clusters->SetMarkerSize(0.5); |
d680093b | 46 | clusters->SetMarkerColor(4); |
7be1e8cd | 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)); | |
51 | char form[1000]; | |
52 | sprintf(form,"Clusters lab=%d", label); | |
53 | clusters->SetName(form); | |
d680093b | 54 | |
2caed564 | 55 | char tip[1000]; |
56 | sprintf(tip,"N=%d", clusters->Size()); | |
57 | clusters->SetTitle(tip); | |
84aff7a4 | 58 | gEve->AddElement(clusters, cont); |
59 | gEve->Redraw3D(); | |
39fbbcbb | 60 | |
61 | return clusters; | |
d680093b | 62 | } |