Changed cut values for consistency with other D0 tasks (Chiara B)
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_spd_tracklets.C
CommitLineData
d810d0de 1// $Id$
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 **************************************************************************/
cb4245bb 9
57e8f8f1 10// Lines commented with //x should be reactivated when we
11// move to a newer ROOT (after 5.25.2).
12// Corresponding lines that are now replacing them should be removed.
13//
14// The problem was the TEveTrackProjected did not support projection
15// of tracks with locked points -- and we do that for tracklets.
16//
17// Maybe it would be even better to have AliEveTracklet : public TEveLine
18// and support both in AliEveTrackCounter.
19// Or have trackelt counter -- as not all histograms collected for tracks
20// are relevant for tracklets.
cb4245bb 21
ab4aef8b 22TEveElementList* esd_spd_tracklets(Float_t radius=8, Width_t line_width=3)
57e8f8f1 23//x TEveTrackList* esd_spd_tracklets(Float_t rad=8)
c46fd838 24{
57e8f8f1 25 // radius - cylindrical radius to which the tracklets should be extrapolated
c46fd838 26
57e8f8f1 27 AliESDEvent *esd = AliEveEventManager::AssertESD();
28 AliESDVertex *pv = esd->GetPrimaryVertexSPD();
29 AliMultiplicity *mul = esd->GetMultiplicity();
c46fd838 30
31 Double_t pvx[3], pve[3];
32 pv->GetXYZ(pvx);
33 pv->GetSigmaXYZ(pve);
34
57e8f8f1 35 TEveCompound *cont = new TEveCompound("SPD Tracklets");
36 cont->OpenCompound();
37 //x TEveTrackList *cont = new TEveTrackList("SPD Tracklets");
38 cont->SetTitle(Form("N=%d", mul->GetNumberOfTracklets()));
39 cont->SetMainColor(7);
40 //x cont->SetLineWidth(line_width);
41
42 gEve->AddElement(cont);
c46fd838 43
44 for (Int_t i=0; i<mul->GetNumberOfTracklets(); ++i)
45 {
46 using namespace TMath;
57e8f8f1 47 Float_t theta = mul->GetTheta(i);
48 Float_t phi = mul->GetPhi(i);
c46fd838 49 Float_t dr[3];
57e8f8f1 50 dr[0] = radius*Cos(phi);
51 dr[1] = radius*Sin(phi);
52 dr[2] = radius/Tan(theta);
53
54 TEveLine* track = new TEveLine;
55 track->SetMainColor(7);
56 track->SetLineWidth(line_width);
57 //x AliEveTrack* track = new AliEveTrack;
58 //x track->SetPropagator(cont->GetPropagator());
59 //x track->SetAttLineAttMarker(cont);
60 track->SetElementName(Form("Tracklet %d", i));
61 track->SetElementTitle(Form("id=%d: theta=%.3f, phi=%.3f", i, theta, phi));
62
63 track->SetPoint(0, pvx[0], pvx[1], pvx[2]);
64 track->SetPoint(1,pvx[0]+dr[0], pvx[1]+dr[1], pvx[2]+dr[2]);
65
66 //x track->SetLockPoints(kTRUE);
67
68 cont->AddElement(track);
c46fd838 69 }
70
84aff7a4 71 gEve->Redraw3D();
c46fd838 72
57e8f8f1 73 return cont;
c46fd838 74}