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.8 2001/05/16 14:57:17 alibrary
19 New files for folders and Stack
21 Revision 1.7 2001/01/26 21:25:48 morsch
22 Empty default constructors and.
24 Revision 1.6 2000/12/21 22:12:41 morsch
25 Clean-up of coding rule violations,
27 Revision 1.5 2000/10/26 19:32:04 morsch
28 Problem with iteration over y-pads for 2nd cathode corrected.
30 Revision 1.4 2000/10/25 19:56:55 morsch
31 Handle correctly slats with less than 3 segmentation zones.
33 Revision 1.3 2000/10/22 16:56:33 morsch
34 - Store chamber number as slat id.
36 Revision 1.2 2000/10/18 11:42:06 morsch
37 - AliMUONRawCluster contains z-position.
38 - Some clean-up of useless print statements during initialisations.
40 Revision 1.1 2000/10/06 08:59:03 morsch
41 Segmentation classes for bending and non bending plane slat modules (A. de Falco, A. Morsch)
45 /////////////////////////////////////////////////////
46 // Segmentation classes for slat modules //
47 // to be used with AluMUONSegmentationSlat //
48 /////////////////////////////////////////////////////
51 #include "AliMUONSegmentationSlatModuleN.h"
53 #include <Riostream.h>
55 #include "AliMUONSegmentationV01.h"
57 //___________________________________________
58 ClassImp(AliMUONSegmentationSlatModuleN)
60 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN()
62 // Default constructor
65 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN(Int_t nsec)
66 : AliMUONSegmentationSlatModule(nsec)
68 // Non default constructor
72 Float_t AliMUONSegmentationSlatModuleN::Dpx(Int_t isec) const
75 // Returns x-pad size for given sector isec
79 Float_t AliMUONSegmentationSlatModuleN::Dpy(Int_t isec) const
82 // Returns y-pad size for given sector isec
83 return (*fDpxD)[isec];
87 void AliMUONSegmentationSlatModuleN::
88 GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
90 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
93 if (ix > fNpx) ix= fNpx;
97 for (Int_t i = fNsec-1; i > 0; i--) {
100 if (fCx[isec] == fCx[isec-1] && isec > 1) isec--;
111 iy = Int_t(y/(*fDpxD)[isec])+1;
115 void AliMUONSegmentationSlatModuleN::
116 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
118 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
120 x = Float_t(ix*fDpx)-fDpx/2.;
123 Int_t isec=Sector(ix,iy);
124 if (isec == -1) printf("\n gtpadc2 Warning isec !\n");
125 y = iy*(*fDpxD)[isec]-(*fDpxD)[isec]/2.;
129 void AliMUONSegmentationSlatModuleN::NextPad()
131 // Stepper for the iteration over pads
136 if ((fY + Dpy(fSector)) < fYmax) {
138 GetPadC(fIx,fIy,fX,fY);
140 } else if (fIx != fIxmax) {
142 // get y-position of next row (yc), xc not used here
143 GetPadC(fIx,fIy,xc,yc);
144 // get x-pad coordiante for 1 pad in row (fIx)
145 GetPadI(xc,fYmin,ixc,fIy);
146 GetPadC(fIx,fIy,fX,fY);
147 fSector=Sector(fIx,fIy);
152 if (fIy > fNpyS[fSector]) printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
153 GetPadC(fIx, fIy, xc, yc);
154 // printf("\n Next Pad (n)%d %d %f %f %d %f %d ", fIx,fIy,fX,fY,fSector, fYmax, fIxmax);
157 Int_t AliMUONSegmentationSlatModuleN::MorePads()
159 // Stopping condition for the iterator over pads
162 // Are there more pads in the integration region
171 void AliMUONSegmentationSlatModuleN::
172 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
174 // Returns list of next neighbours for given Pad (iX, iY)
179 Int_t ix,iy,isec1,isec2;
180 Float_t kEpsil= 0.001;
184 Int_t isec=Sector(iX, iY);
186 if (iY+1 <= fNpyS[isec]) {
203 GetPadC(iX, iY, x, y);
204 GetPadI(x+fDpx, y, ix, iy);
211 isec1=Sector(iX, iY);
212 isec2=Sector(iX-1, iY);
217 GetPadC(iX, iY, x, y);
218 GetPadI(x-fDpx, y+kEpsil, ix, iy);
223 GetPadI(x-fDpx, y-kEpsil, ix, iy);
234 void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
237 // Fill the arrays fCx (x-contour) for each sector
238 // These arrays help in converting from real to pad co-ordinates and
241 // Segmentation is defined by rectangular modules approximating
242 // concentric circles as shown below
244 // PCB module size in cm
246 // printf("\n Initialise Segmentation SlatModuleN \n");
252 // number of pad rows per PCB
254 fNpxPCB = Int_t(fDxPCB/fDpx) ;
256 // Calculate padsize along y
257 (*fDpxD)[fNsec-1]=fDpy;
259 for (Int_t i=fNsec-2; i>=0; i--){
260 (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
264 // fill the arrays defining the pad segmentation boundaries
267 // Loop over sectors (isec=0 is the dead space surounding the beam pipe)
269 for (Int_t isec=0; isec<4; isec++) {
275 fNpxS[isec] = fNpxS[isec-1] + fPcbBoards[isec]*fNpxPCB;
276 fNpyS[isec] = Int_t(fDyPCB/fDpy)*(*fNDiv)[isec];
277 fCx[isec] = fCx[isec-1] + fPcbBoards[isec]*fDxPCB;
278 fNpx += fPcbBoards[isec] * fNpxPCB;
283 fNpy=Int_t(fDyPCB/fDpy)*(*fNDiv)[1];