Reverting commit 35237, it causes crash in the reconstruction of simulated data
[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
c46fd838 10// To use when per-line id is supported
cb4245bb 11
c46fd838 12class TrackletId : public TObject
13{
14public:
15 // label, phi, theta
16 // virtual void Print(const Option_t* opt="") {}
17};
18
84aff7a4 19TEveStraightLineSet* esd_spd_tracklets(Float_t rad=8)
c46fd838 20{
d810d0de 21 AliESDEvent * esd = AliEveEventManager::AssertESD();
d80678e8 22 AliESDVertex * pv = esd->GetPrimaryVertexSPD();
c46fd838 23 AliMultiplicity* mul = esd->GetMultiplicity();
24
25 Double_t pvx[3], pve[3];
26 pv->GetXYZ(pvx);
27 pv->GetSigmaXYZ(pve);
28
4a74a340 29 TEveStraightLineSet* ls = new TEveStraightLineSet("SPD tracklets");
c46fd838 30
31 for (Int_t i=0; i<mul->GetNumberOfTracklets(); ++i)
32 {
33 using namespace TMath;
34 Float_t dr[3];
4a74a340 35 Float_t phi = mul->GetPhi(i);
723492dc 36 dr[0] = rad*Cos(phi);
37 dr[1] = rad*Sin(phi);
c46fd838 38 dr[2] = rad/Tan(mul->GetTheta(i));
39 ls->AddLine(pvx[0], pvx[1], pvx[2],
40 pvx[0]+dr[0], pvx[1]+dr[1], pvx[2]+dr[2]);
41 }
42
ad5abc55 43 ls->SetElementTitle(Form("N=%d", mul->GetNumberOfTracklets()));
84aff7a4 44 gEve->AddElement(ls);
45 gEve->Redraw3D();
c46fd838 46
47 return ls;
48}