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.8 2002/03/28 14:59:07 cblume
21 Revision 1.7 2001/11/19 08:44:08 cblume
22 Fix bugs reported by Rene
24 Revision 1.6 2001/05/28 17:07:58 hristov
25 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)
27 Revision 1.5 2000/12/08 16:07:02 cblume
28 Update of the tracking by Sergei
30 Revision 1.4 2000/10/16 01:16:53 cblume
31 Changed timebin 0 to be the one closest to the readout
33 Revision 1.3 2000/10/15 23:40:01 cblume
36 Revision 1.2 2000/10/06 16:49:46 cblume
39 Revision 1.1.2.2 2000/10/04 16:34:58 cblume
40 Replace include files by forward declarations
42 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
47 /////////////////////////////////////////////////////////////////////////
51 /////////////////////////////////////////////////////////////////////////
58 #include "AliTRDgeometry.h"
59 #include "AliTRDcluster.h"
60 #include "AliTRDtimeBin.h"
61 #include "AliTRDtrackingSector.h"
62 #include "AliTRDparameter.h"
64 ClassImp(AliTRDtrackingSector)
66 //_______________________________________________________
67 AliTRDtrackingSector::~AliTRDtrackingSector()
77 //_______________________________________________________
78 AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
88 //_______________________________________________________
89 void AliTRDtrackingSector::SetUp()
95 AliTRD *trd = (AliTRD*) gAlice->GetDetector("TRD");
96 fGeom = trd->GetGeometry();
98 fN = AliTRDgeometry::Nplan() * (Int_t(AliTRDgeometry::DrThick()
101 fTimeBin = new AliTRDtimeBin[fN];
104 fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
107 fTimeBinSize = fPar->GetTimeBinSize();
111 //______________________________________________________
112 Double_t AliTRDtrackingSector::GetX(Int_t tb) const
115 // Get global x coordinate
118 if( (tb<0) || (tb>fN-1)) {
119 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
124 Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
125 Int_t localTb = tbPerPlane - tb%tbPerPlane - 1;
127 Int_t plane = tb/tbPerPlane;
128 Float_t t0 = fPar->GetTime0(plane);
129 Double_t x = t0 - (localTb + 0.5) * fTimeBinSize;
137 //______________________________________________________
138 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
141 // Returns the time bin number
144 Float_t rOut = fPar->GetTime0(AliTRDgeometry::Nplan()-1);
145 Float_t rIn = fPar->GetTime0(0) - AliTRDgeometry::DrThick();
148 if(x >= rOut) return fN-1;
149 if(x <= rIn) return 0;
152 for (plane = AliTRDgeometry::Nplan()-1; plane >= 0; plane--) {
153 if(x > (fPar->GetTime0(plane) - AliTRDgeometry::DrThick())) break;
156 Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
157 Int_t localTb = Int_t((fPar->GetTime0(plane)-x)/fTimeBinSize);
159 if((localTb < 0) || (localTb >= tbPerPlane)) {
160 printf("AliTRDtrackingSector::GetTimeBinNumber: \n");
161 printf("local time bin %d is out of bounds [0..%d]: x = %f \n",
162 localTb,tbPerPlane-1,x);
166 Int_t timeBin = (plane + 1) * tbPerPlane - 1 - localTb;
171 //______________________________________________________
172 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t localTb) const
178 Int_t plane = fGeom->GetPlane(det);
180 Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
182 Int_t timeBin = (plane + 1) * tbPerPlane - 1 - localTb;
189 //______________________________________________________
191 Bool_t AliTRDtrackingSector::TECframe(Int_t tb, Double_t y, Double_t z) const
194 // Returns <true> if point defined by <x(tb),y,z> is within
195 // the TEC G10 frame, otherwise returns <false>
198 if((tb > (fN-1)) || (tb < 0)) return kFALSE;
200 Int_t tbPerPlane = fN/AliTRDgeometry::Nplan();
201 Int_t plane = tb/tbPerPlane;
203 Double_t x = GetX(tb);
206 if((y > fGeom->GetChamberWidth(plane)/2.) &&
207 (y < x*TMath::Tan(0.5*AliTRDgeometry::GetAlpha()))) return kTRUE;
210 Float_t fRowPadSize, fRow0;
213 for(Int_t iCha = 1; iCha < AliTRDgeometry::Ncham(); iCha++) {
215 fRow0 = fPar->GetRow0(plane,iCha-1,0);
216 fRowPadSize = fPar->GetRowPadSize(plane,iCha-1,0);
217 nPadRows = fPar->GetRowMax(plane,iCha-1,0);
218 zmin = fRow0 - fRowPadSize/2 + fRowPadSize * nPadRows;
220 fRow0 = fPar->GetRow0(plane,iCha,0);
221 fRowPadSize = fPar->GetRowPadSize(plane,iCha,0);
222 zmax = fRow0 - fRowPadSize/2;
224 if((z > zmin) && (z < zmax)) return kTRUE;