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 ITS track class
19 // Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
20 //-------------------------------------------------------------------------
24 #include "AliL3StandardIncludes.h"
26 #include "AliESDHLTtrack.h"
27 #include "AliL3ITStrack.h"
29 ClassImp(AliL3ITStrack)
31 //____________________________________________________________________________
32 AliL3ITStrack::AliL3ITStrack():AliITStrackV2(),
35 //------------------------------------------------------------------
37 //------------------------------------------------------------------
40 //____________________________________________________________________________
41 AliL3ITStrack::AliL3ITStrack(const AliL3ITStrack& t) : AliITStrackV2(t) {
42 //------------------------------------------------------------------
44 //------------------------------------------------------------------
45 fESDHLTtrack=t.fESDHLTtrack;
48 //____________________________________________________________________________
49 AliL3ITStrack::AliL3ITStrack(AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *) {
50 // The method constructs an AliL3ITStrack object from an ESD HLT track
54 SetNumberOfClusters(0);
56 SetNumberOfClusters(t.GetNHits());
57 SetLabel(t.GetMCid());
61 fAlpha = fmod((t.GetSector()+0.5)*(2*TMath::Pi()/18),2*TMath::Pi());
62 if (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
63 else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
65 //First the emiision angle
66 Double_t psi = t.GetPsi()-(t.GetSector()+0.5)*(2*TMath::Pi()/18);
68 //Then local x,y coordinates
69 Double_t radius = t.GetPt()*GetConvConst();
70 Double_t xhit = 82.97; //Position at first TPC padrow
71 Double_t trackphi0 = psi + (-t.GetCharge())*TMath::Pi()/2;
72 Double_t x0 = t.GetFirstPointX()*TMath::Cos(fAlpha) + t.GetFirstPointY()*TMath::Sin(fAlpha);
73 Double_t y0 = t.GetFirstPointY()*TMath::Cos(fAlpha) - t.GetFirstPointX()*TMath::Sin(fAlpha);
74 Double_t centerx = radius * cos(trackphi0) + x0;
75 Double_t centery = radius * sin(trackphi0) + y0;
76 Double_t aa = (xhit - centerx)*(xhit - centerx);
77 Double_t r2 = radius*radius;
78 if(aa > r2) throw "AliITStrackV2: conversion failed !\n";
79 Double_t aa2 = sqrt(r2 - aa);
80 Double_t y1 = centery + aa2;
81 Double_t y2 = centery - aa2;
83 if(fabs(y2) < fabs(y1)) yhit = y2;
86 Double_t angle1 = atan2((yhit - centery),(xhit - centerx));
87 if(angle1 < 0) angle1 += 2.*TMath::Pi();
88 Double_t angle2 = atan2((x0-centery),(y0-centerx));
89 if(angle2 < 0) angle2 += 2.*TMath::Pi();
90 Double_t diffangle = angle1 - angle2;
91 diffangle = fmod(diffangle,2.*TMath::Pi());
92 if(((-t.GetCharge())*diffangle) < 0) diffangle = diffangle - (-t.GetCharge())*2.*TMath::Pi();
93 Double_t stot = fabs(diffangle)*radius;
96 zhit = zvertex + stot*t.GetTgl();
98 zhit = t.GetFirstPointZ() + stot*t.GetTgl();
100 //Local sine of track azimuthal angle
101 if((-t.GetCharge())<0)
103 Double_t sinbeta = -1.*(centerx - xhit)/radius;
105 //Filling of the track paramaters
113 //and covariance matrix
118 fC44=(0.005+0.025*t.GetPt())*(0.005+0.025*t.GetPt())*fP4*fP4;
122 fC30=0; fC31=0; fC32=0;
123 fC40=0; fC41=0; fC42=0; fC43=0;
132 //_____________________________________________________________________________
133 Int_t AliL3ITStrack::Compare(const TObject *o) const {
134 //-----------------------------------------------------------------
135 // This function compares tracks according to the their curvature
136 //-----------------------------------------------------------------
137 AliL3ITStrack *t=(AliL3ITStrack*)o;
138 Double_t co=TMath::Abs(t->Get1Pt());
139 Double_t c =TMath::Abs(Get1Pt());
140 // Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
141 // Double_t c =GetSigmaY2()*GetSigmaZ2();
143 else if (c<co) return -1;