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 /////////////////////////////////////////////////////
19 // Segmentation and Response classes version 02 //
20 /////////////////////////////////////////////////////
23 #include "AliMUONSegmentationV02.h"
24 #include "Riostream.h"
26 //___________________________________________
27 ClassImp(AliMUONSegmentationV02)
30 AliMUONSegmentationV02::AliMUONSegmentationV02(Int_t nsec):
31 AliMUONSegmentationV01(nsec)
33 // Non default constructor
36 void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
44 Int_t AliMUONSegmentationV02::Npx() const
45 // Returns maximum number if pads in x
46 {return AliMUONSegmentationV01::Npy();}
48 Int_t AliMUONSegmentationV02::Npy() const
49 // Returns maximum number if pads in y
50 {return AliMUONSegmentationV01::Npx();}
53 Float_t AliMUONSegmentationV02::Dpx(Int_t /*isec*/) const
54 // Returns pad-size in x
57 Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const
58 // Returns pad-size in y
59 {return (*fDpxD)[isec];}
61 void AliMUONSegmentationV02::Draw(const char * /*opt*/) const
64 Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
65 // Returns sector number for given pad position
67 {return AliMUONSegmentationV01::Sector(iy, ix);}
69 void AliMUONSegmentationV02::
70 GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
71 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
74 AliMUONSegmentationV01::GetPadI(y, x, iy, ix);
75 // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
78 void AliMUONSegmentationV02::GetPad(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy)
80 GetPadI(x, y, ix, iy);
83 void AliMUONSegmentationV02::
84 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
86 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
89 AliMUONSegmentationV01::GetPadC(iy, ix, y, x);
91 void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
94 // Sets virtual pad coordinates, needed for evaluating pad response
95 // outside the tracking program
97 fSector=Sector(ix,iy);
102 void AliMUONSegmentationV02::NextPad()
104 // Stepper for the iteration over pads
107 // Step to next pad in integration region
112 if (fY < fYmax && fY != 0) {
116 } else if (fIx != fIxmax) {
119 // get y-position of next row (yc), xc not used here
120 GetPadC(fIx,fIy,xc,yc);
121 // get x-pad coordiante for 1 pad in row (fIx)
122 GetPadI(xc,fYmin,ixc,fIy);
126 GetPadC(fIx,fIy,fX,fY);
127 fSector=Sector(fIx,fIy);
129 (fSector ==-1 || fSector==0 ))
131 // printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
135 Int_t AliMUONSegmentationV02::MorePads()
137 // Stopping condition for the iterator over pads
140 // Are there more pads in the integration region
142 return (fIx != -1 || fIy != -1);
144 if ((fY >= fYmax && fIx >= fIxmax) || fX==0) {
152 void AliMUONSegmentationV02::
153 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
155 // Returns list of next neighbours for given Pad (iX, iY)
158 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);