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.2 2000/10/06 16:49:46 cblume
21 Revision 1.1.2.2 2000/10/04 16:34:58 cblume
22 Replace include files by forward declarations
24 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
34 #include "AliTRDgeometry.h"
35 #include "AliTRDcluster.h"
36 #include "AliTRDtimeBin.h"
37 #include "AliTRDtrackingSector.h"
39 ClassImp(AliTRDtrackingSector)
41 //_______________________________________________________
43 AliTRDtrackingSector::~AliTRDtrackingSector()
53 //_______________________________________________________
54 AliTRDtimeBin &AliTRDtrackingSector::operator[](Int_t i)
64 //_______________________________________________________
66 void AliTRDtrackingSector::SetUp()
69 AliTRD *TRD = (AliTRD*) gAlice->GetDetector("TRD");
70 fGeom = TRD->GetGeometry();
72 fTimeBinSize = fGeom->GetTimeBinSize();
74 fN = AliTRDgeometry::Nplan() * (Int_t(AliTRDgeometry::DrThick()
77 fTimeBin = new AliTRDtimeBin[fN];
81 //______________________________________________________
83 Double_t AliTRDtrackingSector::GetX(Int_t l) const
85 if( (l<0) || (l>fN-1)) {
86 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
91 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
92 Int_t plane = l/tb_per_plane;
93 Int_t time_slice = l%(Int_t(AliTRDgeometry::DrThick()
96 Float_t t0 = fGeom->GetTime0(plane);
97 Double_t x = t0 + time_slice * fTimeBinSize;
99 // cerr<<"plane, tb, x = "<<plane<<","<<time_slice<<","<<x<<endl;
105 //______________________________________________________
107 Double_t AliTRDtrackingSector::GetMaxY(Int_t l) const
110 if((l<(fN-1)) && (l>-1)) {
111 Int_t tb_per_plane = fN/AliTRDgeometry::Nplan();
112 Int_t plane = l/tb_per_plane;
113 return fGeom->GetChamberWidth(plane);
117 "AliTRDtrackingSector::GetMaxY: TimeBin index is out of range !\n");
118 if(l<0) return fGeom->GetChamberWidth(0);
119 else return fGeom->GetChamberWidth(AliTRDgeometry::Nplan()-1);
123 //______________________________________________________
125 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
127 Float_t r_out = fGeom->GetTime0(AliTRDgeometry::Nplan()-1)
128 + AliTRDgeometry::DrThick();
129 Float_t r_in = fGeom->GetTime0(0);
130 // cerr<<"GetTimeBinNumber: r_in,r_out = "<<r_in<<","<<r_out<<endl;
132 if(x >= r_out) return fN-1;
133 if(x <= r_in) return 0;
135 Float_t gap = fGeom->GetTime0(1) - fGeom->GetTime0(0);
136 // cerr<<"GetTimeBinNumber: gap = "<<gap<<endl;
138 Int_t plane = Int_t((x - r_in + fTimeBinSize/2)/gap);
139 // cerr<<"GetTimeBinNumber: plane="<<plane<<endl;
141 Int_t local_tb = Int_t((x-fGeom->GetTime0(plane))/fTimeBinSize + 0.5);
142 // cerr<<"GetTimeBinNumber: local_tb="<<local_tb<<endl;
144 Int_t time_bin = plane * (Int_t(AliTRDgeometry::DrThick()
145 /fTimeBinSize) + 1) + local_tb;
146 // cerr<<"GetTimeBinNumber: time_bin = "<<time_bin<<endl;
152 //______________________________________________________
154 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
156 Int_t plane = fGeom->GetPlane(det);
158 Int_t time_bin = plane * (Int_t(AliTRDgeometry::DrThick()
159 /fTimeBinSize) + 1) + local_tb;