New macro: show SPD tracklets from AliMultiplicity.
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_spd_tracklets.C
CommitLineData
c46fd838 1// To use when per-line id is supported
2class TrackletId : public TObject
3{
4public:
5 // label, phi, theta
6 // virtual void Print(const Option_t* opt="") {}
7};
8
9Reve::StraightLineSet* esd_spd_tracklets(Float_t rad=8)
10{
11 AliESD * esd = Alieve::Event::AssertESD();
12 AliESDVertex * pv = esd->GetPrimaryVertex();
13 AliMultiplicity* mul = esd->GetMultiplicity();
14
15 Double_t pvx[3], pve[3];
16 pv->GetXYZ(pvx);
17 pv->GetSigmaXYZ(pve);
18
19 Reve::StraightLineSet* ls = new Reve::StraightLineSet();
20
21 for (Int_t i=0; i<mul->GetNumberOfTracklets(); ++i)
22 {
23 using namespace TMath;
24 Float_t dr[3];
25 dr[0] = rad*Cos(mul->GetPhi(i));
26 dr[1] = rad*Sin(mul->GetPhi(i));
27 dr[2] = rad/Tan(mul->GetTheta(i));
28 ls->AddLine(pvx[0], pvx[1], pvx[2],
29 pvx[0]+dr[0], pvx[1]+dr[1], pvx[2]+dr[2]);
30 }
31
32 gReve->AddRenderElement(ls);
33 gReve->Redraw3D();
34
35 return ls;
36}