]>
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 | **************************************************************************/ |
ba978640 | 9 | #if !defined(__CINT__) || defined(__MAKECINT__) |
10 | #include <TEveManager.h> | |
11 | #include <TEveElement.h> | |
12 | #include <TEvePointSet.h> | |
13 | ||
6c49a8e1 | 14 | #include <AliESDEvent.h> |
15 | #include <AliESDtrack.h> | |
16 | #include <AliTrackPointArray.h> | |
17 | #include <AliEveEventManager.h> | |
18 | #include <AliEveMultiView.h> | |
ba978640 | 19 | #endif |
d680093b | 20 | |
84aff7a4 | 21 | TEvePointSet* clusters_from_label(Int_t label=0, TEveElement* cont=0) |
d680093b | 22 | { |
d810d0de | 23 | AliESDEvent* esd = AliEveEventManager::AssertESD(); |
84aff7a4 | 24 | TEvePointSet* clusters = new TEvePointSet(64); |
426530cc | 25 | clusters->SetOwnIds(kTRUE); |
d680093b | 26 | |
39fbbcbb | 27 | for (Int_t n=0; n<esd->GetNumberOfTracks(); n++) |
28 | { | |
d680093b | 29 | AliESDtrack* at = esd->GetTrack(n); |
30 | if (at->GetLabel() == label) { | |
31 | const AliTrackPointArray* pArr = at->GetTrackPointArray(); | |
32 | if (pArr == 0) { | |
33 | Warning("clusters_from_label", "TrackPointArray not stored with ESD track."); | |
34 | continue; | |
35 | } | |
36 | Int_t np = pArr->GetNPoints(); | |
37 | const Float_t* x = pArr->GetX(); | |
38 | const Float_t* y = pArr->GetY(); | |
39 | const Float_t* z = pArr->GetZ(); | |
40 | for (Int_t i=0; i<np; ++i) { | |
41 | clusters->SetNextPoint(x[i], y[i], z[i]); | |
426530cc | 42 | AliTrackPoint *atp = new AliTrackPoint; |
43 | pArr->GetPoint(*atp, i); | |
44 | clusters->SetPointId(atp); | |
d680093b | 45 | } |
46 | } | |
47 | } | |
2caed564 | 48 | |
84aff7a4 | 49 | if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) { |
ba978640 | 50 | Warning("clusters_from_label", "No clusters match label '%d'", label); |
2caed564 | 51 | delete clusters; |
52 | return 0; | |
53 | } | |
54 | ||
d680093b | 55 | clusters->SetMarkerStyle(2); |
a8600b56 | 56 | clusters->SetMarkerSize(0.5); |
d680093b | 57 | clusters->SetMarkerColor(4); |
7be1e8cd | 58 | //PH The line below is replaced waiting for a fix in Root |
59 | //PH which permits to use variable siza arguments in CINT | |
60 | //PH on some platforms (alphalinuxgcc, solariscc5, etc.) | |
61 | //PH clusters->SetName(Form("Clusters lab=%d", label)); | |
62 | char form[1000]; | |
63 | sprintf(form,"Clusters lab=%d", label); | |
64 | clusters->SetName(form); | |
d680093b | 65 | |
2caed564 | 66 | char tip[1000]; |
67 | sprintf(tip,"N=%d", clusters->Size()); | |
68 | clusters->SetTitle(tip); | |
84aff7a4 | 69 | gEve->AddElement(clusters, cont); |
70 | gEve->Redraw3D(); | |
39fbbcbb | 71 | |
72 | return clusters; | |
d680093b | 73 | } |