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.6 2000/12/21 22:12:41 morsch
19 Clean-up of coding rule violations,
21 Revision 1.5 2000/10/26 19:32:04 morsch
22 Problem with iteration over y-pads for 2nd cathode corrected.
24 Revision 1.4 2000/10/25 19:56:55 morsch
25 Handle correctly slats with less than 3 segmentation zones.
27 Revision 1.3 2000/10/22 16:56:33 morsch
28 - Store chamber number as slat id.
30 Revision 1.2 2000/10/18 11:42:06 morsch
31 - AliMUONRawCluster contains z-position.
32 - Some clean-up of useless print statements during initialisations.
34 Revision 1.1 2000/10/06 08:59:03 morsch
35 Segmentation classes for bending and non bending plane slat modules (A. de Falco, A. Morsch)
39 /////////////////////////////////////////////////////
40 // Segmentation classes for slat modules //
41 // to be used with AluMUONSegmentationSlat //
42 /////////////////////////////////////////////////////
45 #include "AliMUONSegmentationSlatModuleN.h"
49 #include "AliMUONSegmentationV01.h"
51 //___________________________________________
52 ClassImp(AliMUONSegmentationSlatModuleN)
54 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN()
56 // Default constructor
59 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN(Int_t nsec)
60 : AliMUONSegmentationSlatModule(nsec)
62 // Non default constructor
66 Float_t AliMUONSegmentationSlatModuleN::Dpx(Int_t isec) const
69 // Returns x-pad size for given sector isec
73 Float_t AliMUONSegmentationSlatModuleN::Dpy(Int_t isec) const
76 // Returns y-pad size for given sector isec
77 return (*fDpxD)[isec];
81 void AliMUONSegmentationSlatModuleN::
82 GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
84 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
87 if (ix > fNpx) ix= fNpx;
91 for (Int_t i = fNsec-1; i > 0; i--) {
94 if (fCx[isec] == fCx[isec-1] && isec > 1) isec--;
105 iy = Int_t(y/(*fDpxD)[isec])+1;
109 void AliMUONSegmentationSlatModuleN::
110 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
112 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
114 x = Float_t(ix*fDpx)-fDpx/2.;
117 Int_t isec=Sector(ix,iy);
118 if (isec == -1) printf("\n gtpadc2 Warning isec !\n");
119 y = iy*(*fDpxD)[isec]-(*fDpxD)[isec]/2.;
123 void AliMUONSegmentationSlatModuleN::NextPad()
125 // Stepper for the iteration over pads
130 if ((fY + Dpy(fSector)) < fYmax) {
132 GetPadC(fIx,fIy,fX,fY);
134 } else if (fIx != fIxmax) {
136 // get y-position of next row (yc), xc not used here
137 GetPadC(fIx,fIy,xc,yc);
138 // get x-pad coordiante for 1 pad in row (fIx)
139 GetPadI(xc,fYmin,ixc,fIy);
140 GetPadC(fIx,fIy,fX,fY);
141 fSector=Sector(fIx,fIy);
146 if (fIy > fNpyS[fSector]) printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
147 GetPadC(fIx, fIy, xc, yc);
148 // printf("\n Next Pad (n)%d %d %f %f %d %f %d ", fIx,fIy,fX,fY,fSector, fYmax, fIxmax);
151 Int_t AliMUONSegmentationSlatModuleN::MorePads()
153 // Stopping condition for the iterator over pads
156 // Are there more pads in the integration region
165 void AliMUONSegmentationSlatModuleN::
166 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
168 // Returns list of next neighbours for given Pad (iX, iY)
173 Int_t ix,iy,isec1,isec2;
174 Float_t kEpsil= 0.001;
178 Int_t isec=Sector(iX, iY);
180 if (iY+1 <= fNpyS[isec]) {
197 GetPadC(iX, iY, x, y);
198 GetPadI(x+fDpx, y, ix, iy);
205 isec1=Sector(iX, iY);
206 isec2=Sector(iX-1, iY);
211 GetPadC(iX, iY, x, y);
212 GetPadI(x-fDpx, y+kEpsil, ix, iy);
217 GetPadI(x-fDpx, y-kEpsil, ix, iy);
228 void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
231 // Fill the arrays fCx (x-contour) for each sector
232 // These arrays help in converting from real to pad co-ordinates and
235 // Segmentation is defined by rectangular modules approximating
236 // concentric circles as shown below
238 // PCB module size in cm
240 printf("\n Initialise Segmentation SlatModuleN \n");
246 // number of pad rows per PCB
248 fNpxPCB = Int_t(fDxPCB/fDpx) ;
250 // Calculate padsize along y
251 (*fDpxD)[fNsec-1]=fDpy;
253 for (Int_t i=fNsec-2; i>=0; i--){
254 (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
258 // fill the arrays defining the pad segmentation boundaries
261 // Loop over sectors (isec=0 is the dead space surounding the beam pipe)
263 for (Int_t isec=0; isec<4; isec++) {
269 fNpxS[isec] = fNpxS[isec-1] + fPcbBoards[isec]*fNpxPCB;
270 fNpyS[isec] = Int_t(fDyPCB/fDpy)*(*fNDiv)[isec];
271 fCx[isec] = fCx[isec-1] + fPcbBoards[isec]*fDxPCB;
272 fNpx += fPcbBoards[isec] * fNpxPCB;
277 fNpy=Int_t(fDyPCB/fDpy)*(*fNDiv)[1];