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.6 2001/05/28 17:07:58 hristov
19 Last minute changes; ExB correction in AliTRDclusterizerV1; taking into account of material in G10 TEC frames and material between TEC planes (C.Blume,S.Sedykh)
21 Revision 1.5 2000/12/08 16:07:02 cblume
22 Update of the tracking by Sergei
24 Revision 1.4 2000/10/16 01:16:53 cblume
25 Changed timebin 0 to be the one closest to the readout
27 Revision 1.3 2000/10/15 23:40:01 cblume
30 Revision 1.2 2000/10/06 16:49:46 cblume
33 Revision 1.1.2.2 2000/10/04 16:34:58 cblume
34 Replace include files by forward declarations
36 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
46 #include "AliTRDgeometry.h"
47 #include "AliTRDcluster.h"
48 #include "AliTRDtimeBin.h"
49 #include "AliTRDtrackingSector.h"
51 ClassImp(AliTRDtrackingSector)
53 //_______________________________________________________
55 AliTRDtrackingSector::~AliTRDtrackingSector()
65 //_______________________________________________________
66 AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
76 //_______________________________________________________
78 void AliTRDtrackingSector::SetUp()
80 AliTRD *TRD = (AliTRD*) gAlice->GetDetector("TRD");
81 fGeom = TRD->GetGeometry();
83 fTimeBinSize = fGeom->GetTimeBinSize();
85 fN = AliTRDgeometry::Nplan() * (Int_t(AliTRDgeometry::DrThick()
88 fTimeBin = new AliTRDtimeBin[fN];
92 //______________________________________________________
94 Double_t AliTRDtrackingSector::GetX(Int_t tb) const
96 if( (tb<0) || (tb>fN-1)) {
97 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
102 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
103 Int_t local_tb = tb_per_plane - tb%tb_per_plane - 1;
105 Int_t plane = tb/tb_per_plane;
106 Float_t t0 = fGeom->GetTime0(plane);
107 Double_t x = t0 - (local_tb + 0.5) * fTimeBinSize;
113 //______________________________________________________
115 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
117 Float_t r_out = fGeom->GetTime0(AliTRDgeometry::Nplan()-1);
118 Float_t r_in = fGeom->GetTime0(0) - AliTRDgeometry::DrThick();
121 if(x >= r_out) return fN-1;
122 if(x <= r_in) return 0;
125 for (plane = AliTRDgeometry::Nplan()-1; plane >= 0; plane--) {
126 if(x > (fGeom->GetTime0(plane) - AliTRDgeometry::DrThick())) break;
129 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
130 Int_t local_tb = Int_t((fGeom->GetTime0(plane)-x)/fTimeBinSize);
132 if((local_tb < 0) || (local_tb >= tb_per_plane)) {
133 printf("AliTRDtrackingSector::GetTimeBinNumber: \n");
134 printf("local time bin %d is out of bounds [0..%d]: x = %f \n",
135 local_tb,tb_per_plane-1,x);
139 Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
144 //______________________________________________________
146 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
148 Int_t plane = fGeom->GetPlane(det);
150 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
152 Int_t time_bin = (plane + 1) * tb_per_plane - 1 - local_tb;
158 //______________________________________________________
160 Bool_t AliTRDtrackingSector::TECframe(Int_t tb, Double_t y, Double_t z) const
163 // Returns <true> if point defined by <x(tb),y,z> is within
164 // the TEC G10 frame, otherwise returns <false>
167 if((tb > (fN-1)) || (tb < 0)) return kFALSE;
169 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
170 Int_t plane = tb/tb_per_plane;
172 Double_t x = GetX(tb);
175 if((y > fGeom->GetChamberWidth(plane)/2.) &&
176 (y < x*TMath::Tan(0.5*AliTRDgeometry::GetAlpha()))) return kTRUE;
179 Float_t fRowPadSize, fRow0;
182 for(Int_t iCha = 1; iCha < AliTRDgeometry::Ncham(); iCha++) {
184 fRow0 = fGeom->GetRow0(plane,iCha-1,0);
185 fRowPadSize = fGeom->GetRowPadSize(plane,iCha-1,0);
186 nPadRows = fGeom->GetRowMax(plane,iCha-1,0);
187 zmin = fRow0 - fRowPadSize/2 + fRowPadSize * nPadRows;
189 fRow0 = fGeom->GetRow0(plane,iCha,0);
190 fRowPadSize = fGeom->GetRowPadSize(plane,iCha,0);
191 zmax = fRow0 - fRowPadSize/2;
193 if((z > zmin) && (z < zmax)) return kTRUE;