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.7 2001/01/26 21:25:48 morsch
19 Empty default constructors and.
21 Revision 1.6 2000/12/21 22:12:41 morsch
22 Clean-up of coding rule violations,
24 Revision 1.5 2000/10/26 19:32:04 morsch
25 Problem with iteration over y-pads for 2nd cathode corrected.
27 Revision 1.4 2000/10/25 19:56:55 morsch
28 Handle correctly slats with less than 3 segmentation zones.
30 Revision 1.3 2000/10/22 16:56:33 morsch
31 - Store chamber number as slat id.
33 Revision 1.2 2000/10/18 11:42:06 morsch
34 - AliMUONRawCluster contains z-position.
35 - Some clean-up of useless print statements during initialisations.
37 Revision 1.1 2000/10/06 08:59:03 morsch
38 Segmentation classes for bending and non bending plane slat modules (A. de Falco, A. Morsch)
42 /////////////////////////////////////////////////////
43 // Segmentation classes for slat modules //
44 // to be used with AluMUONSegmentationSlat //
45 /////////////////////////////////////////////////////
48 #include "AliMUONSegmentationSlatModuleN.h"
52 #include "AliMUONSegmentationV01.h"
54 //___________________________________________
55 ClassImp(AliMUONSegmentationSlatModuleN)
57 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN()
59 // Default constructor
62 AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN(Int_t nsec)
63 : AliMUONSegmentationSlatModule(nsec)
65 // Non default constructor
69 Float_t AliMUONSegmentationSlatModuleN::Dpx(Int_t isec) const
72 // Returns x-pad size for given sector isec
76 Float_t AliMUONSegmentationSlatModuleN::Dpy(Int_t isec) const
79 // Returns y-pad size for given sector isec
80 return (*fDpxD)[isec];
84 void AliMUONSegmentationSlatModuleN::
85 GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
87 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
90 if (ix > fNpx) ix= fNpx;
94 for (Int_t i = fNsec-1; i > 0; i--) {
97 if (fCx[isec] == fCx[isec-1] && isec > 1) isec--;
108 iy = Int_t(y/(*fDpxD)[isec])+1;
112 void AliMUONSegmentationSlatModuleN::
113 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
115 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
117 x = Float_t(ix*fDpx)-fDpx/2.;
120 Int_t isec=Sector(ix,iy);
121 if (isec == -1) printf("\n gtpadc2 Warning isec !\n");
122 y = iy*(*fDpxD)[isec]-(*fDpxD)[isec]/2.;
126 void AliMUONSegmentationSlatModuleN::NextPad()
128 // Stepper for the iteration over pads
133 if ((fY + Dpy(fSector)) < fYmax) {
135 GetPadC(fIx,fIy,fX,fY);
137 } else if (fIx != fIxmax) {
139 // get y-position of next row (yc), xc not used here
140 GetPadC(fIx,fIy,xc,yc);
141 // get x-pad coordiante for 1 pad in row (fIx)
142 GetPadI(xc,fYmin,ixc,fIy);
143 GetPadC(fIx,fIy,fX,fY);
144 fSector=Sector(fIx,fIy);
149 if (fIy > fNpyS[fSector]) printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
150 GetPadC(fIx, fIy, xc, yc);
151 // printf("\n Next Pad (n)%d %d %f %f %d %f %d ", fIx,fIy,fX,fY,fSector, fYmax, fIxmax);
154 Int_t AliMUONSegmentationSlatModuleN::MorePads()
156 // Stopping condition for the iterator over pads
159 // Are there more pads in the integration region
168 void AliMUONSegmentationSlatModuleN::
169 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
171 // Returns list of next neighbours for given Pad (iX, iY)
176 Int_t ix,iy,isec1,isec2;
177 Float_t kEpsil= 0.001;
181 Int_t isec=Sector(iX, iY);
183 if (iY+1 <= fNpyS[isec]) {
200 GetPadC(iX, iY, x, y);
201 GetPadI(x+fDpx, y, ix, iy);
208 isec1=Sector(iX, iY);
209 isec2=Sector(iX-1, iY);
214 GetPadC(iX, iY, x, y);
215 GetPadI(x-fDpx, y+kEpsil, ix, iy);
220 GetPadI(x-fDpx, y-kEpsil, ix, iy);
231 void AliMUONSegmentationSlatModuleN::Init(Int_t chamber)
234 // Fill the arrays fCx (x-contour) for each sector
235 // These arrays help in converting from real to pad co-ordinates and
238 // Segmentation is defined by rectangular modules approximating
239 // concentric circles as shown below
241 // PCB module size in cm
243 // printf("\n Initialise Segmentation SlatModuleN \n");
249 // number of pad rows per PCB
251 fNpxPCB = Int_t(fDxPCB/fDpx) ;
253 // Calculate padsize along y
254 (*fDpxD)[fNsec-1]=fDpy;
256 for (Int_t i=fNsec-2; i>=0; i--){
257 (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
261 // fill the arrays defining the pad segmentation boundaries
264 // Loop over sectors (isec=0 is the dead space surounding the beam pipe)
266 for (Int_t isec=0; isec<4; isec++) {
272 fNpxS[isec] = fNpxS[isec-1] + fPcbBoards[isec]*fNpxPCB;
273 fNpyS[isec] = Int_t(fDyPCB/fDpy)*(*fNDiv)[isec];
274 fCx[isec] = fCx[isec-1] + fPcbBoards[isec]*fDxPCB;
275 fNpx += fPcbBoards[isec] * fNpxPCB;
280 fNpy=Int_t(fDyPCB/fDpy)*(*fNDiv)[1];