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 2000/12/21 22:12:41 morsch
19 Clean-up of coding rule violations,
21 Revision 1.6 2000/10/18 08:41:32 morsch
22 Make NextPad() and MorePads() to iterate until the end.
24 Revision 1.5 2000/10/03 21:48:07 morsch
25 Adopt to const declaration of some of the methods in AliSegmentation.
27 Revision 1.4 2000/10/02 16:58:29 egangler
28 Cleaning of the code :
31 -> some useless includes removed or replaced by "class" statement
33 Revision 1.3 2000/07/03 11:54:57 morsch
34 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
35 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
37 Revision 1.2 2000/06/15 07:58:48 morsch
38 Code from MUON-dev joined
40 Revision 1.1.2.1 2000/06/09 21:37:56 morsch
41 AliMUONSegmentationV02 code from AliMUONSegResV02.cxx
47 /////////////////////////////////////////////////////
48 // Segmentation and Response classes version 02 //
49 /////////////////////////////////////////////////////
52 #include "AliMUONSegmentationV02.h"
55 //___________________________________________
56 ClassImp(AliMUONSegmentationV02)
59 AliMUONSegmentationV02::AliMUONSegmentationV02(Int_t nsec):
60 AliMUONSegmentationV01(nsec)
62 // Non default constructor
65 void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
73 Int_t AliMUONSegmentationV02::Npx() const
74 // Returns maximum number if pads in x
75 {return AliMUONSegmentationV01::Npy();}
77 Int_t AliMUONSegmentationV02::Npy() const
78 // Returns maximum number if pads in y
79 {return AliMUONSegmentationV01::Npx();}
82 Float_t AliMUONSegmentationV02::Dpx(Int_t isec) const
83 // Returns pad-size in x
86 Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const
87 // Returns pad-size in y
88 {return (*fDpxD)[isec];}
90 Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
91 // Returns sector number for given pad position
93 {return AliMUONSegmentationV01::Sector(iy, ix);}
95 void AliMUONSegmentationV02::
96 GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
97 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
100 AliMUONSegmentationV01::GetPadI(y, x, iy, ix);
101 // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
104 void AliMUONSegmentationV02::
105 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
107 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
110 AliMUONSegmentationV01::GetPadC(iy, ix, y, x);
112 void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
115 // Sets virtual pad coordinates, needed for evaluating pad response
116 // outside the tracking program
117 GetPadC(ix,iy,fX,fY);
118 fSector=Sector(ix,iy);
123 void AliMUONSegmentationV02::NextPad()
125 // Stepper for the iteration over pads
128 // Step to next pad in integration region
133 if (fY < fYmax && fY != 0) {
137 } else if (fIx != fIxmax) {
140 // get y-position of next row (yc), xc not used here
141 GetPadC(fIx,fIy,xc,yc);
142 // get x-pad coordiante for 1 pad in row (fIx)
143 GetPadI(xc,fYmin,ixc,fIy);
147 GetPadC(fIx,fIy,fX,fY);
148 fSector=Sector(fIx,fIy);
150 (fSector ==-1 || fSector==0 ))
152 // printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
156 Int_t AliMUONSegmentationV02::MorePads()
158 // Stopping condition for the iterator over pads
161 // Are there more pads in the integration region
163 return (fIx != -1 || fIy != -1);
165 if ((fY >= fYmax && fIx >= fIxmax) || fX==0) {
173 void AliMUONSegmentationV02::
174 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
176 // Returns list of next neighbours for given Pad (iX, iY)
179 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);