1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //-------------------------------------------------------------------------
17 // Implementation of the HLT TPC Hough Kalman track class
19 // Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
20 //-------------------------------------------------------------------------
22 #include "AliHLTHoughKalmanTrack.h"
24 #include "AliHLTStandardIncludes.h"
25 #include "AliHLTHoughTrack.h"
26 #include "AliHLTHoughBaseTransformer.h"
27 #include "AliHLTHoughTransformerRow.h"
28 #include "AliHLTHistogram.h"
30 Int_t CalcExternalParams(const AliHLTHoughTrack& t, Double_t deltax, Double_t deltay, Double_t deltaeta, const Double_t zvertex, const Double_t xhit, Double_t xx[5]);
32 ClassImp(AliHLTHoughKalmanTrack)
34 //____________________________________________________________________________
35 AliHLTHoughKalmanTrack::AliHLTHoughKalmanTrack(const AliHLTHoughTrack& t) throw (const Char_t *)
38 // The method constructs an AliHLTHoughKalmanTrack object
39 // from an HLT Hough track
42 SetNumberOfClusters(t.GetLastRow()-t.GetFirstRow());
43 SetLabel(t.GetMCid());
48 Double_t alpha = fmod((t.GetSector()+0.5)*(2*TMath::Pi()/18),2*TMath::Pi());
49 if (alpha < -TMath::Pi()) alpha += 2*TMath::Pi();
50 else if (alpha >= TMath::Pi()) alpha -= 2*TMath::Pi();
52 const Double_t xhit = 82.97;
53 const Double_t zvertex = t.GetFirstPointZ();
55 Double_t deltax = t.GetPterr();
56 Double_t deltay = t.GetPsierr();
57 Double_t deltaeta = t.GetTglerr();
58 if(CalcExternalParams(t,0,0,0,zvertex,xhit,par)==0) throw "AliHLTHoughKalmanTrack: conversion failed !\n";
60 Double_t cnv=1./(GetBz()*kB2C);
62 //and covariance matrix
63 //For the moment estimate the covariance matrix numerically
65 if(CalcExternalParams(t,deltax,0,0,zvertex,xhit,xx1)==0) throw "AliHLTHoughKalmanTrack: conversion failed !\n";
67 if(CalcExternalParams(t,0,deltay,0,zvertex,xhit,xx2)==0) throw "AliHLTHoughKalmanTrack: conversion failed !\n";
69 if(CalcExternalParams(t,0,0,deltaeta,zvertex,xhit,xx3)==0) throw "AliHLTHoughKalmanTrack: conversion failed !\n";
71 Double_t dx1[5],dx2[5],dx3[5];
72 for(Int_t i=0;i<5;i++) {
79 dx1[0]*dx1[0]+dx2[0]*dx2[0],
81 0., 0., dx1[2]*dx1[2]+dx2[2]*dx2[2],
82 0., dx3[3]*dx3[1], 0., dx3[3]*dx3[3],
83 0., 0., 0., 0., dx1[4]*dx1[4]+dx2[4]*dx2[4]
86 fC20=dx1[2]*dx1[0]+dx2[2]*dx2[0];
87 fC40=dx1[4]*dx1[0]+dx2[4]*dx2[0];
88 fC42=dx1[4]*dx1[2]+dx2[4]*dx2[2];
92 fC10=fC30=fC21=fC41=fC32=fC43=0;
95 cov[10]*=cnv; cov[11]*=cnv; cov[12]*=cnv; cov[13]*=cnv; cov[14]*=(cnv*cnv);
98 Set(xhit,alpha,par,cov);
102 //____________________________________________________________________________
103 Int_t CalcExternalParams(const AliHLTHoughTrack& t, Double_t deltax, Double_t deltay, Double_t deltaeta, const Double_t zvertex, const Double_t xhit, Double_t xx[5])
105 // Translate the parameters of the Hough tracks into
106 // AliKalmanTrack paramters
108 //First get the emiision angle and track curvature
109 Double_t binx = t.GetBinX()+deltax;
110 Double_t biny = t.GetBinY()+deltay;
111 Double_t psi = atan((binx-biny)/(AliHLTHoughTransformerRow::GetBeta1()-AliHLTHoughTransformerRow::GetBeta2()));
112 Double_t kappa = 2.0*(binx*cos(psi)-AliHLTHoughTransformerRow::GetBeta1()*sin(psi));
113 Double_t radius = 1./kappa;
116 Double_t centerx = -1.*radius*sin(psi);
117 Double_t centery = radius*cos(psi);
118 Double_t aa = (xhit - centerx)*(xhit - centerx);
119 Double_t r2 = radius*radius;
120 if(aa > r2) return 0;
121 Double_t aa2 = sqrt(r2 - aa);
122 Double_t y1 = centery + aa2;
123 Double_t y2 = centery - aa2;
125 if(fabs(y2) < fabs(y1)) yhit = y2;
128 Double_t stot = sqrt(xhit*xhit+yhit*yhit);
132 Double_t eta=t.GetPseudoRapidity()+deltaeta;
133 Double_t theta = 2*atan(exp(-1.*eta));
134 Double_t tanl = 1./tan(theta);
135 zhit = zvertex + stot*tanl;
139 xx[2] = (xhit-centerx)/radius;