]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/clusters_from_label.C
Code for jet finding using TPC and EMCAL ESD information.
[u/mrichter/AliRoot.git] / EVE / alice-macros / clusters_from_label.C
CommitLineData
d680093b 1// $Id$
2
3void clusters_from_label(Int_t label=0)
4{
5 AliESD* esd = Alieve::Event::AssertESD();
426530cc 6 Reve::PointSet* clusters = new Reve::PointSet(64);
7 clusters->SetOwnIds(kTRUE);
d680093b 8
9 for (Int_t n=0; n<esd->GetNumberOfTracks(); n++) {
10 AliESDtrack* at = esd->GetTrack(n);
11 if (at->GetLabel() == label) {
12 const AliTrackPointArray* pArr = at->GetTrackPointArray();
13 if (pArr == 0) {
14 Warning("clusters_from_label", "TrackPointArray not stored with ESD track.");
15 continue;
16 }
17 Int_t np = pArr->GetNPoints();
18 const Float_t* x = pArr->GetX();
19 const Float_t* y = pArr->GetY();
20 const Float_t* z = pArr->GetZ();
21 for (Int_t i=0; i<np; ++i) {
22 clusters->SetNextPoint(x[i], y[i], z[i]);
426530cc 23 AliTrackPoint *atp = new AliTrackPoint;
24 pArr->GetPoint(*atp, i);
25 clusters->SetPointId(atp);
d680093b 26 }
27 }
28 }
29 clusters->SetMarkerStyle(2);
a8600b56 30 clusters->SetMarkerSize(0.5);
d680093b 31 clusters->SetMarkerColor(4);
32 clusters->SetName(Form("Clusters lab=%d", label));
33
34 using namespace Reve;
a8600b56 35 gReve->AddRenderElement(clusters);
5b96ea20 36 gReve->Redraw3D();
d680093b 37}