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 **************************************************************************/
19 #include "AliITSsegmentationSPD.h"
20 #include "AliITSgeom.h"
22 ClassImp(AliITSsegmentationSPD)
25 Float_t ColFromZ300(Float_t z) {
26 // Get column number for each z-coordinate taking into account the
27 // extra pixels in z direction assuming 300 micron sized pixels.
29 Float_t pitchz = 300.0;
30 col = Float_t (z/pitchz);
33 //_____________________________________________________________________________
34 Float_t ZFromCol300(Int_t col) {
35 // same comments as above
36 // Get z-coordinate for each colunm number
37 Float_t pitchz = 300.0;
42 //_____________________________________________________________________________
43 Float_t ZpitchFromCol300(Int_t col) {
44 // returns Z pixel pitch for 300 micron pixels.
47 //_____________________________________________________________________________
48 Float_t ColFromZ(Float_t z) {
49 // hard-wired - keep it like this till we can parametrise
50 // and get rid of AliITSgeomSPD425
51 // Get column number for each z-coordinate taking into account the
52 // extra pixels in z direction
57 col = Float_t(z/pitchz);
58 } else if( z < 14425) {
60 col = 31 + (z - 13175)/pitchz;
61 } else if( z < 27175) {
62 col = 33 + (z - 14425)/pitchz;
63 } else if( z < 28425) {
65 col = 63 + (z - 27175)/pitchz;
66 } else if( z < 41175) {
67 col = 65 + (z - 28425)/pitchz;
68 } else if( z < 42425) {
70 col = 95 + (z - 41175)/pitchz;
71 } else if( z < 55175) {
72 col = 97 + (z - 42425)/pitchz;
73 } else if( z < 56425) {
75 col = 127 + (z - 55175)/pitchz;
76 } else if( z < 69175) {
77 col = 129 + (z - 56425)/pitchz;
78 } else if( z < 70425) {
80 col = 159 + (z - 69175)/pitchz;
81 } else if( z < 83600) {
82 col = 161 + (z - 70425)/pitchz;
84 return TMath::Abs(col);
87 //_____________________________________________________________________________
88 Float_t ZFromCol(Int_t col) {
89 // same comments as above
90 // Get z-coordinate for each colunm number
94 if( col >=0 && col <= 30 ) {
95 z = (col + 0.5)*pitchz;
96 } else if( col >= 31 && col <= 32) {
98 z = 13175 + (col -31 + 0.5)*pitchz;
99 } else if( col >= 33 && col <= 62) {
100 z = 14425 + (col -33 + 0.5)*pitchz;
101 } else if( col >= 63 && col <= 64) {
103 z = 27175 + (col -63 + 0.5)*pitchz;
104 } else if( col >= 65 && col <= 94) {
105 z = 28425 + (col -65 + 0.5)*pitchz;
106 } else if( col >= 95 && col <= 96) {
108 z = 41175 + (col -95 + 0.5)*pitchz;
109 } else if( col >= 97 && col <= 126) {
110 z = 42425 + (col -97 + 0.5)*pitchz;
111 } else if( col >= 127 && col <= 128) {
113 z = 55175 + (col -127 + 0.5)*pitchz;
114 } else if( col >= 129 && col <= 158) {
115 z = 56425 + (col -129 + 0.5)*pitchz;
116 } else if( col >= 159 && col <= 160) {
118 z = 69175 + (col -159 + 0.5)*pitchz;
119 } else if( col >= 161 && col <= 191) {
120 z = 70425 + (col -161 + 0.5)*pitchz;
126 Float_t ZpitchFromCol(Int_t col) {
127 // Get pitch size in z direction for each colunm
129 Float_t pitchz = 425;
130 if( col >=32 && col <= 33 ) {
132 } else if( col >= 64 && col <= 65) {
134 } else if( col >= 96 && col <= 97) {
136 } else if( col >= 128 && col <= 129) {
138 } else if( col >= 160 && col <= 161) {
144 AliITSsegmentationSPD::AliITSsegmentationSPD(){
145 // Default constructor
152 //____________________________________________________________________________
153 AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSgeom *gm){
162 //____________________________________________________________________________
163 AliITSsegmentationSPD& AliITSsegmentationSPD::operator=(AliITSsegmentationSPD &source){
165 if(this==&source) return *this;
166 this->fNpx = source.fNpx;
167 this->fNpz = source.fNpz;
168 this->fDx = source.fDx;
169 this->fDy = source.fDy;
171 for(i=0;i<256;i++) this->fCellSizeX[i] = source.fCellSizeX[i];
172 for(i=0;i<280;i++) this->fCellSizeZ[i] = source.fCellSizeZ[i];
173 this->fCorr = new TF1(*(source.fCorr));// make a proper copy of the function
174 this->fGeom = source.fGeom; // copy only the pointers.
177 //____________________________________________________________________________
178 AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSsegmentationSPD &source){
182 //------------------------------
183 void AliITSsegmentationSPD::Init300(){
184 // Initialize infromation for 6 read out chip 300X50 micron pixel SPD
185 // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.37 cm
186 // long. It has 256 50 micron pixels in x and 279 300 micron size
189 //const Float_t kconv=10000.;
191 fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size
192 fNpz = 279; // The number of Z pixel Cell same as in fCellSizeZ array size
193 for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same
194 for(i=0;i<fNpz;i++) fCellSizeZ[i] = ZpitchFromCol300(i); // microns
195 for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array
197 for(i=0;i<fNpx;i++) fDx += fCellSizeX[i];
199 for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i];
200 fDy = 300.0; //microns SPD sensitive layer thickness
203 //------------------------------
204 void AliITSsegmentationSPD::Init(){
205 // Initialize infromation for 6 read out chip 425X50 micron pixel SPD
206 // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.375 cm
207 // long. It has 256 50 micron pixels in x and 197 mostly 425 micron size
208 // pixels in z. The two pixels between each readout chip are 625 microns long.
210 //const Float_t kconv=10000.;
212 fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size
213 fNpz = 192; // The number of Z pixel Cell same as in fCellSizeZ array size
214 for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same
215 for(i=0;i<fNpz;i++) fCellSizeZ[i] = ZpitchFromCol(i); // microns
216 for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array
218 for(i=0;i<fNpx;i++) fDx += fCellSizeX[i];
220 for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i];
221 fDy = 300.0; //microns SPD sensitive layer thickness
222 //printf(" AliITSsegmentationSPD - Init: fNpx fNpz fDx fDz %d %d %f %f\n",fNpx, fNpz, fDx, fDz);
225 //------------------------------
226 void AliITSsegmentationSPD::SetNPads(Int_t p1, Int_t p2){
227 // for SPD this function should be used ONLY when a beam test setup
228 // configuration is studied
234 //------------------------------
235 void AliITSsegmentationSPD::SetDetSize(Float_t p1, Float_t p2, Float_t p3){
236 // for SPD this function should be used ONLY when a beam test setup
237 // configuration is studied
244 //------------------------------
245 Float_t AliITSsegmentationSPD::Dpx(Int_t i){
246 //returs x pixel pitch for a give pixel
247 return fCellSizeX[i];
249 //------------------------------
250 Float_t AliITSsegmentationSPD::Dpz(Int_t i){
251 // returns z pixel pitch for a give pixel
252 return ZpitchFromCol(i);
254 //------------------------------
255 void AliITSsegmentationSPD::GetPadIxz(Float_t x,Float_t z,Int_t &ix,Int_t &iz){
256 // Returns pixel coordinates (ix,iz) for given real local coordinates (x,z)
259 // expects x, z in microns
261 // same segmentation on x
263 ix = (Int_t)(x/dpx + 1);
264 // different segmentation on z
265 iz = (Int_t)(ColFromZ(z) + 1);
268 if (iz > fNpz) iz= fNpz;
269 if (ix > fNpx) ix= fNpx;
271 if (iz < -fNpz) iz= -fNpz;
272 if (ix < -fNpx) ix=-fNpx;
276 //------------------------------
277 void AliITSsegmentationSPD::GetPadTxz(Float_t &x,Float_t &z){
278 // local transformation of real local coordinates (x,z)
281 // expects x, z in microns
283 // same segmentation on x
290 //------------------------------
291 void AliITSsegmentationSPD::GetPadCxz(Int_t ix,Int_t iz,Float_t &x,Float_t&z){
292 // Transform from pixel to real local coordinates
294 // returns x, z in microns
298 x = (ix>0) ? Float_t(ix*dpx)-dpx/2. : Float_t(ix*dpx)+dpx/2.;
303 //------------------------------
304 void AliITSsegmentationSPD::
305 Neighbours(Int_t iX, Int_t iZ, Int_t* Nlist, Int_t Xlist[8], Int_t Zlist[8]){
306 // returns the neighbouring pixels for use in Cluster Finders and the like.
308 *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1;
309 Zlist[0]=iZ-1;Zlist[1]=iZ+1;Zlist[2]=Zlist[3]=iZ;
314 Xlist[0]=Xlist[1]=iX;
319 Zlist[2]=Zlist[3]=iZ;