* show_scan_results.C
[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
bccc8088 22TEveTrackList* esd_spd_tracklets(Float_t radius=8, Width_t line_width=3,
786d9102 23 Float_t dPhiWindow=0.080, Float_t dThetaWindow=0.025,
24 Float_t dPhiShift05T=0.0045)
c46fd838 25{
57e8f8f1 26 // radius - cylindrical radius to which the tracklets should be extrapolated
c46fd838 27
57e8f8f1 28 AliESDEvent *esd = AliEveEventManager::AssertESD();
29 AliESDVertex *pv = esd->GetPrimaryVertexSPD();
30 AliMultiplicity *mul = esd->GetMultiplicity();
c46fd838 31
bccc8088 32 AliMagF *field = AliEveEventManager::AssertMagField();
33
3a20f984 34 TEveTrackList *cont = new TEveTrackList("SPD Tracklets");
57e8f8f1 35 cont->SetTitle(Form("N=%d", mul->GetNumberOfTracklets()));
36 cont->SetMainColor(7);
3a20f984 37 cont->SetLineWidth(line_width);
57e8f8f1 38
3a20f984 39 TEveTrackPropagator* prop = cont->GetPropagator();
40 prop->SetMaxR(radius);
57e8f8f1 41 gEve->AddElement(cont);
c46fd838 42
786d9102 43 const Float_t Bz = TMath::Abs(field->SolenoidField());
44
45 const Double_t dPhiShift = dPhiShift05T / 5.0 * Bz;
46 const Double_t dPhiWindow2 = dPhiWindow * dPhiWindow;
47 const Double_t dThetaWindow2 = dThetaWindow * dThetaWindow;
48
3a20f984 49 for (Int_t i = 0; i < mul->GetNumberOfTracklets(); ++i)
c46fd838 50 {
786d9102 51 Float_t theta = mul->GetTheta(i);
52 Float_t phi = mul->GetPhi(i);
53 Float_t dTheta = mul->GetDeltaTheta(i);
54 Float_t dPhi = mul->GetDeltaPhi(i);
57e8f8f1 55
0c75a99d 56 AliEveTracklet* t = new AliEveTracklet(i, pv, theta, phi, prop);
3a20f984 57 t->SetAttLineAttMarker(cont);
58 t->SetElementName(Form("Tracklet %d", i));
786d9102 59 t->SetElementTitle(Form("Id = %d\nEta=%.3f, Theta=%.3f, dTheta=%.3f\nPhi=%.3f dPhi=%.3f",
60 i, mul->GetEta(i), theta, dTheta, phi, dPhi));
61
62 dPhi -= dPhiShift;
63
64 Float_t d = dPhi*dPhi/dPhiWindow2 + dTheta*dTheta/dThetaWindow2;
65 if (d < 1.0f)
66 mul->SetLabel(i, 0, 3);
67 else
68 mul->SetLabel(i, 0, 0);
57e8f8f1 69
3a20f984 70 cont->AddElement(t);
c46fd838 71 }
72
3a20f984 73 cont->MakeTracks();
74
84aff7a4 75 gEve->Redraw3D();
c46fd838 76
57e8f8f1 77 return cont;
c46fd838 78}