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 #include "AliITSsegmentationSPD.h"
20 ClassImp(AliITSsegmentationSPD)
23 Float_t ColFromZ300(Float_t z) {
24 // Get column number for each z-coordinate taking into account the
25 // extra pixels in z direction assuming 300 micron sized pixels.
27 Float_t pitchz = 300.0;
28 col = Float_t (z/pitchz);
31 //_____________________________________________________________________________
32 Float_t ZFromCol300(Int_t col) {
33 // same comments as above
34 // Get z-coordinate for each colunm number
35 Float_t pitchz = 300.0;
40 //_____________________________________________________________________________
41 Float_t ZpitchFromCol300(Int_t col) {
42 // returns Z pixel pitch for 300 micron pixels.
45 //_____________________________________________________________________________
46 Float_t ColFromZ(Float_t z) {
47 // hard-wired - keep it like this till we can parametrise
48 // and get rid of AliITSgeomSPD425
49 // Get column number for each z-coordinate taking into account the
50 // extra pixels in z direction
55 col = Float_t(z/pitchz);
56 } else if( z < 14425) {
58 col = 31 + (z - 13175)/pitchz;
59 } else if( z < 27175) {
60 col = 33 + (z - 14425)/pitchz;
61 } else if( z < 28425) {
63 col = 63 + (z - 27175)/pitchz;
64 } else if( z < 41175) {
65 col = 65 + (z - 28425)/pitchz;
66 } else if( z < 42425) {
68 col = 95 + (z - 41175)/pitchz;
69 } else if( z < 55175) {
70 col = 97 + (z - 42425)/pitchz;
71 } else if( z < 56425) {
73 col = 127 + (z - 55175)/pitchz;
74 } else if( z < 69175) {
75 col = 129 + (z - 56425)/pitchz;
76 } else if( z < 70425) {
78 col = 159 + (z - 69175)/pitchz;
79 } else if( z < 83600) {
80 col = 161 + (z - 70425)/pitchz;
82 return TMath::Abs(col);
85 //_____________________________________________________________________________
86 Float_t ZFromCol(Int_t col) {
87 // same comments as above
88 // Get z-coordinate for each colunm number
92 if( col >=0 && col <= 30 ) {
93 z = (col + 0.5)*pitchz;
94 } else if( col >= 31 && col <= 32) {
96 z = 13175 + (col -31 + 0.5)*pitchz;
97 } else if( col >= 33 && col <= 62) {
98 z = 14425 + (col -33 + 0.5)*pitchz;
99 } else if( col >= 63 && col <= 64) {
101 z = 27175 + (col -63 + 0.5)*pitchz;
102 } else if( col >= 65 && col <= 94) {
103 z = 28425 + (col -65 + 0.5)*pitchz;
104 } else if( col >= 95 && col <= 96) {
106 z = 41175 + (col -95 + 0.5)*pitchz;
107 } else if( col >= 97 && col <= 126) {
108 z = 42425 + (col -97 + 0.5)*pitchz;
109 } else if( col >= 127 && col <= 128) {
111 z = 55175 + (col -127 + 0.5)*pitchz;
112 } else if( col >= 129 && col <= 158) {
113 z = 56425 + (col -129 + 0.5)*pitchz;
114 } else if( col >= 159 && col <= 160) {
116 z = 69175 + (col -159 + 0.5)*pitchz;
117 } else if( col >= 161 && col <= 191) {
118 z = 70425 + (col -161 + 0.5)*pitchz;
124 Float_t ZpitchFromCol(Int_t col) {
125 // Get pitch size in z direction for each colunm
127 Float_t pitchz = 425;
128 if( col >=32 && col <= 33 ) {
130 } else if( col >= 64 && col <= 65) {
132 } else if( col >= 96 && col <= 97) {
134 } else if( col >= 128 && col <= 129) {
136 } else if( col >= 160 && col <= 161) {
142 AliITSsegmentationSPD::AliITSsegmentationSPD(){
143 // Default constructor
150 //____________________________________________________________________________
151 AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSgeom *gm){
160 //____________________________________________________________________________
161 AliITSsegmentationSPD& AliITSsegmentationSPD::operator=(AliITSsegmentationSPD &source){
163 if(this==&source) return *this;
164 this->fNpx = source.fNpx;
165 this->fNpz = source.fNpz;
166 this->fDx = source.fDx;
167 this->fDy = source.fDy;
169 for(i=0;i<256;i++) this->fCellSizeX[i] = source.fCellSizeX[i];
170 for(i=0;i<280;i++) this->fCellSizeZ[i] = source.fCellSizeZ[i];
171 this->fCorr = new TF1(*(source.fCorr));// make a proper copy of the function
172 this->fGeom = source.fGeom; // copy only the pointers.
175 //____________________________________________________________________________
176 AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSsegmentationSPD &source){
180 //------------------------------
181 void AliITSsegmentationSPD::Init300(){
182 // Initialize infromation for 6 read out chip 300X50 micron pixel SPD
183 // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.37 cm
184 // long. It has 256 50 micron pixels in x and 279 300 micron size
187 //const Float_t kconv=10000.;
189 fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size
190 fNpz = 279; // The number of Z pixel Cell same as in fCellSizeZ array size
191 for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same
192 for(i=0;i<fNpz;i++) fCellSizeZ[i] = ZpitchFromCol300(i); // microns
193 for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array
195 for(i=0;i<fNpx;i++) fDx += fCellSizeX[i];
197 for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i];
198 fDy = 300.0; //microns SPD sensitive layer thickness
201 //------------------------------
202 void AliITSsegmentationSPD::Init(){
203 // Initialize infromation for 6 read out chip 425X50 micron pixel SPD
204 // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.375 cm
205 // long. It has 256 50 micron pixels in x and 197 mostly 425 micron size
206 // pixels in z. The two pixels between each readout chip are 625 microns long.
208 //const Float_t kconv=10000.;
210 fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size
211 fNpz = 192; // The number of Z pixel Cell same as in fCellSizeZ array size
212 for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same
213 for(i=0;i<fNpz;i++) fCellSizeZ[i] = ZpitchFromCol(i); // microns
214 for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array
216 for(i=0;i<fNpx;i++) fDx += fCellSizeX[i];
218 for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i];
219 fDy = 300.0; //microns SPD sensitive layer thickness
220 //printf(" AliITSsegmentationSPD - Init: fNpx fNpz fDx fDz %d %d %f %f\n",fNpx, fNpz, fDx, fDz);
223 //------------------------------
224 void AliITSsegmentationSPD::SetNPads(Int_t p1, Int_t p2){
225 // for SPD this function should be used ONLY when a beam test setup
226 // configuration is studied
232 //------------------------------
233 void AliITSsegmentationSPD::SetDetSize(Float_t p1, Float_t p2, Float_t p3){
234 // for SPD this function should be used ONLY when a beam test setup
235 // configuration is studied
242 //------------------------------
243 Float_t AliITSsegmentationSPD::Dpx(Int_t i){
244 //returs x pixel pitch for a give pixel
245 return fCellSizeX[i];
247 //------------------------------
248 Float_t AliITSsegmentationSPD::Dpz(Int_t i){
249 // returns z pixel pitch for a give pixel
250 return ZpitchFromCol(i);
252 //------------------------------
253 void AliITSsegmentationSPD::GetPadIxz(Float_t x,Float_t z,Int_t &ix,Int_t &iz){
254 // Returns pixel coordinates (ix,iz) for given real local coordinates (x,z)
257 // expects x, z in microns
259 // same segmentation on x
261 ix = (Int_t)(x/dpx + 1);
262 // different segmentation on z
263 iz = (Int_t)(ColFromZ(z) + 1);
266 if (iz > fNpz) iz= fNpz;
267 if (ix > fNpx) ix= fNpx;
269 if (iz < -fNpz) iz= -fNpz;
270 if (ix < -fNpx) ix=-fNpx;
274 //------------------------------
275 void AliITSsegmentationSPD::GetPadTxz(Float_t &x,Float_t &z){
276 // local transformation of real local coordinates (x,z)
279 // expects x, z in microns
281 // same segmentation on x
288 //------------------------------
289 void AliITSsegmentationSPD::GetPadCxz(Int_t ix,Int_t iz,Float_t &x,Float_t&z){
290 // Transform from pixel to real local coordinates
292 // returns x, z in microns
296 x = (ix>0) ? Float_t(ix*dpx)-dpx/2. : Float_t(ix*dpx)+dpx/2.;
301 //------------------------------
302 void AliITSsegmentationSPD::
303 Neighbours(Int_t iX, Int_t iZ, Int_t* Nlist, Int_t Xlist[8], Int_t Zlist[8]){
304 // returns the neighbouring pixels for use in Cluster Finders and the like.
306 *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1;
307 Zlist[0]=iZ-1;Zlist[1]=iZ+1;Zlist[2]=Zlist[3]=iZ;
312 Xlist[0]=Xlist[1]=iX;
317 Zlist[2]=Zlist[3]=iZ;