]>
Commit | Line | Data |
---|---|---|
d680093b | 1 | // $Id$ |
2 | ||
39fbbcbb | 3 | Reve::PointSet* clusters_from_label(Int_t label=0) |
d680093b | 4 | { |
5 | AliESD* esd = Alieve::Event::AssertESD(); | |
426530cc | 6 | Reve::PointSet* clusters = new Reve::PointSet(64); |
7 | clusters->SetOwnIds(kTRUE); | |
d680093b | 8 | |
39fbbcbb | 9 | for (Int_t n=0; n<esd->GetNumberOfTracks(); n++) |
10 | { | |
d680093b | 11 | AliESDtrack* at = esd->GetTrack(n); |
12 | if (at->GetLabel() == label) { | |
13 | const AliTrackPointArray* pArr = at->GetTrackPointArray(); | |
14 | if (pArr == 0) { | |
15 | Warning("clusters_from_label", "TrackPointArray not stored with ESD track."); | |
16 | continue; | |
17 | } | |
18 | Int_t np = pArr->GetNPoints(); | |
19 | const Float_t* x = pArr->GetX(); | |
20 | const Float_t* y = pArr->GetY(); | |
21 | const Float_t* z = pArr->GetZ(); | |
22 | for (Int_t i=0; i<np; ++i) { | |
23 | clusters->SetNextPoint(x[i], y[i], z[i]); | |
426530cc | 24 | AliTrackPoint *atp = new AliTrackPoint; |
25 | pArr->GetPoint(*atp, i); | |
26 | clusters->SetPointId(atp); | |
d680093b | 27 | } |
28 | } | |
29 | } | |
30 | clusters->SetMarkerStyle(2); | |
a8600b56 | 31 | clusters->SetMarkerSize(0.5); |
d680093b | 32 | clusters->SetMarkerColor(4); |
7be1e8cd | 33 | //PH The line below is replaced waiting for a fix in Root |
34 | //PH which permits to use variable siza arguments in CINT | |
35 | //PH on some platforms (alphalinuxgcc, solariscc5, etc.) | |
36 | //PH clusters->SetName(Form("Clusters lab=%d", label)); | |
37 | char form[1000]; | |
38 | sprintf(form,"Clusters lab=%d", label); | |
39 | clusters->SetName(form); | |
d680093b | 40 | |
41 | using namespace Reve; | |
a8600b56 | 42 | gReve->AddRenderElement(clusters); |
5b96ea20 | 43 | gReve->Redraw3D(); |
39fbbcbb | 44 | |
45 | return clusters; | |
d680093b | 46 | } |