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.4 2000/10/16 01:16:53 cblume
19 Changed timebin 0 to be the one closest to the readout
21 Revision 1.3 2000/10/15 23:40:01 cblume
24 Revision 1.2 2000/10/06 16:49:46 cblume
27 Revision 1.1.2.2 2000/10/04 16:34:58 cblume
28 Replace include files by forward declarations
30 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
40 #include "AliTRDgeometry.h"
41 #include "AliTRDcluster.h"
42 #include "AliTRDtimeBin.h"
43 #include "AliTRDtrackingSector.h"
45 ClassImp(AliTRDtrackingSector)
47 //_______________________________________________________
49 AliTRDtrackingSector::~AliTRDtrackingSector()
59 //_______________________________________________________
60 AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
70 //_______________________________________________________
72 void AliTRDtrackingSector::SetUp()
74 AliTRD *TRD = (AliTRD*) gAlice->GetDetector("TRD");
75 fGeom = TRD->GetGeometry();
77 fTimeBinSize = fGeom->GetTimeBinSize();
79 fN = AliTRDgeometry::Nplan() * (Int_t(AliTRDgeometry::DrThick()
82 fTimeBin = new AliTRDtimeBin[fN];
86 //______________________________________________________
88 Double_t AliTRDtrackingSector::GetX(Int_t l) const
90 if( (l<0) || (l>fN-1)) {
91 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
96 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
97 Int_t plane = l/tb_per_plane;
98 Int_t time_slice = l%(Int_t(AliTRDgeometry::DrThick()
101 Float_t t0 = fGeom->GetTime0(plane);
102 Double_t x = t0 - time_slice * fTimeBinSize;
108 //______________________________________________________
110 Double_t AliTRDtrackingSector::GetMaxY(Int_t l) const
113 if((l<(fN-1)) && (l>-1)) {
114 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
115 Int_t plane = l/tb_per_plane;
116 return fGeom->GetChamberWidth(plane);
120 "AliTRDtrackingSector::GetMaxY: TimeBin index is out of range !\n");
121 if(l<0) return fGeom->GetChamberWidth(0);
122 else return fGeom->GetChamberWidth(AliTRDgeometry::Nplan()-1);
126 //______________________________________________________
128 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
130 Float_t r_out = fGeom->GetTime0(AliTRDgeometry::Nplan()-1);
131 Float_t r_in = fGeom->GetTime0(0) - AliTRDgeometry::DrThick();
133 if(x >= r_out) return fN-1;
134 if(x <= r_in) return 0;
136 Float_t gap = fGeom->GetTime0(1) - fGeom->GetTime0(0);
138 Int_t plane = Int_t((x - r_in + fTimeBinSize/2)/gap);
140 Int_t local_tb = Int_t((fGeom->GetTime0(plane)-x)/fTimeBinSize + 0.5);
143 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
145 Int_t time_bin = plane * (Int_t(AliTRDgeometry::DrThick()/fTimeBinSize) + 1)
146 + (tb_per_plane - 1 - local_tb);
151 //______________________________________________________
153 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
155 Int_t plane = fGeom->GetPlane(det);
157 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
159 Int_t time_bin = plane * (Int_t(AliTRDgeometry::DrThick()/fTimeBinSize) + 1)
160 + (tb_per_plane - 1 - local_tb);