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 **************************************************************************/
18 Revision 1.5 2000/12/08 16:07:02 cblume
19 Update of the tracking by Sergei
21 Revision 1.4 2000/10/16 01:16:53 cblume
22 Changed timebin 0 to be the one closest to the readout
24 Revision 1.3 2000/10/15 23:40:01 cblume
27 Revision 1.2 2000/10/06 16:49:46 cblume
30 Revision 1.1.2.2 2000/10/04 16:34:58 cblume
31 Replace include files by forward declarations
33 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
43 #include "AliTRDgeometry.h"
44 #include "AliTRDcluster.h"
45 #include "AliTRDtimeBin.h"
46 #include "AliTRDtrackingSector.h"
48 ClassImp(AliTRDtrackingSector)
50 //_______________________________________________________
52 AliTRDtrackingSector::~AliTRDtrackingSector()
62 //_______________________________________________________
63 AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
73 //_______________________________________________________
75 void AliTRDtrackingSector::SetUp()
77 AliTRD *TRD = (AliTRD*) gAlice->GetDetector("TRD");
78 fGeom = TRD->GetGeometry();
80 fTimeBinSize = fGeom->GetTimeBinSize();
82 fN = AliTRDgeometry::Nplan() * (Int_t(AliTRDgeometry::DrThick()
85 fTimeBin = new AliTRDtimeBin[fN];
89 //______________________________________________________
91 Double_t AliTRDtrackingSector::GetX(Int_t tb) const
93 if( (tb<0) || (tb>fN-1)) {
94 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
99 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
100 Int_t local_tb = tb_per_plane - tb%tb_per_plane - 1;
102 Int_t plane = tb/tb_per_plane;
103 Float_t t0 = fGeom->GetTime0(plane);
104 Double_t x = t0 - (local_tb + 0.5) * fTimeBinSize;
110 //______________________________________________________
112 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
114 Float_t r_out = fGeom->GetTime0(AliTRDgeometry::Nplan()-1);
115 Float_t r_in = fGeom->GetTime0(0) - AliTRDgeometry::DrThick();
118 if(x >= r_out) return fN-1;
119 if(x <= r_in) return 0;
122 for (plane = AliTRDgeometry::Nplan()-1; plane >= 0; plane--) {
123 if(x > (fGeom->GetTime0(plane) - AliTRDgeometry::DrThick())) break;
126 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
127 Int_t local_tb = Int_t((fGeom->GetTime0(plane)-x)/fTimeBinSize);
129 if((local_tb < 0) || (local_tb >= tb_per_plane)) {
130 printf("AliTRDtrackingSector::GetTimeBinNumber: \n");
131 printf("local time bin %d is out of bounds [0..%d]: x = %f \n",
132 local_tb,tb_per_plane-1,x);
136 Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
141 //______________________________________________________
143 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
145 Int_t plane = fGeom->GetPlane(det);
147 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
149 Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
155 //______________________________________________________
157 Bool_t AliTRDtrackingSector::TECframe(Int_t tb, Double_t y, Double_t z) const
160 // Returns <true> if point defined by <x(tb),y,z> is within
161 // the TEC G10 frame, otherwise returns <false>
164 if((tb > (fN-1)) || (tb < 0)) return kFALSE;
166 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
167 Int_t plane = tb/tb_per_plane;
169 Double_t x = GetX(tb);
172 if((y > fGeom->GetChamberWidth(plane)/2.) &&
173 (y < x*TMath::Tan(0.5*AliTRDgeometry::GetAlpha()))) return kTRUE;
176 Float_t fRowPadSize, fRow0;
179 for(Int_t iCha = 1; iCha < AliTRDgeometry::Ncham(); iCha++) {
181 fRow0 = fGeom->GetRow0(plane,iCha-1,0);
182 fRowPadSize = fGeom->GetRowPadSize(plane,iCha-1,0);
183 nPadRows = fGeom->GetRowMax(plane,iCha-1,0);
184 zmin = fRow0 - fRowPadSize/2 + fRowPadSize * nPadRows;
186 fRow0 = fGeom->GetRow0(plane,iCha,0);
187 fRowPadSize = fGeom->GetRowPadSize(plane,iCha,0);
188 zmax = fRow0 - fRowPadSize/2;
190 if((z > zmin) && (z < zmax)) return kTRUE;