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.1.2.2 2000/10/04 16:34:58 cblume
19 Replace include files by forward declarations
21 Revision 1.1.2.1 2000/09/22 14:47:52 cblume
31 #include "AliTRDconst.h"
32 #include "AliTRDgeometry.h"
33 #include "AliTRDcluster.h"
34 #include "AliTRDtimeBin.h"
36 #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 = kNplan * (Int_t(kDrThick/fTimeBinSize) + 1);
76 fTimeBin = new AliTRDtimeBin[fN];
80 //______________________________________________________
82 Double_t AliTRDtrackingSector::GetX(Int_t l) const
84 if( (l<0) || (l>fN-1)) {
85 fprintf(stderr,"AliTRDtrackingSector::GetX: TimeBin index is out of range !\n");
90 Int_t tb_per_plane = fN/kNplan;
91 Int_t plane = l/tb_per_plane;
92 Int_t time_slice = l%(Int_t(kDrThick/fTimeBinSize) + 1);
94 Float_t t0 = fGeom->GetTime0(plane);
95 Double_t x = t0 + time_slice * fTimeBinSize;
97 // cerr<<"plane, tb, x = "<<plane<<","<<time_slice<<","<<x<<endl;
103 //______________________________________________________
105 Double_t AliTRDtrackingSector::GetMaxY(Int_t l) const
108 if((l<(fN-1)) && (l>-1)) {
109 Int_t tb_per_plane = fN/kNplan;
110 Int_t plane = l/tb_per_plane;
111 return fGeom->GetChamberWidth(plane);
115 "AliTRDtrackingSector::GetMaxY: TimeBin index is out of range !\n");
116 if(l<0) return fGeom->GetChamberWidth(0);
117 else return fGeom->GetChamberWidth(kNplan-1);
121 //______________________________________________________
123 Int_t AliTRDtrackingSector::GetTimeBinNumber(Double_t x) const
125 Float_t r_out = fGeom->GetTime0(kNplan-1) + kDrThick;
126 Float_t r_in = fGeom->GetTime0(0);
127 // cerr<<"GetTimeBinNumber: r_in,r_out = "<<r_in<<","<<r_out<<endl;
129 if(x >= r_out) return fN-1;
130 if(x <= r_in) return 0;
132 Float_t gap = fGeom->GetTime0(1) - fGeom->GetTime0(0);
133 // cerr<<"GetTimeBinNumber: gap = "<<gap<<endl;
135 Int_t plane = Int_t((x - r_in + fTimeBinSize/2)/gap);
136 // cerr<<"GetTimeBinNumber: plane="<<plane<<endl;
138 Int_t local_tb = Int_t((x-fGeom->GetTime0(plane))/fTimeBinSize + 0.5);
139 // cerr<<"GetTimeBinNumber: local_tb="<<local_tb<<endl;
141 Int_t time_bin = plane * (Int_t(kDrThick/fTimeBinSize) + 1) + local_tb;
142 // cerr<<"GetTimeBinNumber: time_bin = "<<time_bin<<endl;
148 //______________________________________________________
150 Int_t AliTRDtrackingSector::GetTimeBin(Int_t det, Int_t local_tb) const
152 Int_t plane = fGeom->GetPlane(det);
154 Int_t time_bin = plane * (Int_t(kDrThick/fTimeBinSize) + 1) + local_tb;