]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/esd_spd_tracklets.C
9166f7d73b18e557d3d952f8d806794a2cd375e1
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_spd_tracklets.C
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
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.
21
22 TEveTrackList* esd_spd_tracklets(Float_t radius=8, Width_t line_width=3)
23 {
24   // radius - cylindrical radius to which the tracklets should be extrapolated
25
26   AliESDEvent     *esd = AliEveEventManager::AssertESD();
27   AliESDVertex    *pv  = esd->GetPrimaryVertexSPD();
28   AliMultiplicity *mul = esd->GetMultiplicity();
29
30   TEveTrackList *cont = new TEveTrackList("SPD Tracklets");
31   cont->SetTitle(Form("N=%d", mul->GetNumberOfTracklets()));
32   cont->SetMainColor(7);
33   cont->SetLineWidth(line_width);
34
35   TEveTrackPropagator* prop = cont->GetPropagator();
36   prop->SetMaxR(radius);
37   gEve->AddElement(cont);
38
39   for (Int_t i = 0; i < mul->GetNumberOfTracklets(); ++i)
40   {
41     Float_t theta = mul->GetTheta(i);
42     Float_t phi   = mul->GetPhi(i);
43
44     AliEveTracklet* t = new AliEveTracklet(pv, theta, phi, prop);
45     t->SetAttLineAttMarker(cont);
46     t->SetElementName(Form("Tracklet %d", i));
47     t->SetElementTitle(Form("id=%d: theta=%.3f, phi=%.3f", i, theta, phi));
48
49     cont->AddElement(t);
50   }
51
52   cont->MakeTracks();
53
54   gEve->Redraw3D();
55
56   return cont;
57 }