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.1.2.1 2000/06/09 21:37:56 morsch
19 AliMUONSegmentationV02 code from AliMUONSegResV02.cxx
25 /////////////////////////////////////////////////////
26 // Segmentation and Response classes version 02 //
27 /////////////////////////////////////////////////////
30 #include "AliMUONSegmentationV02.h"
33 //___________________________________________
34 ClassImp(AliMUONSegmentationV02)
36 void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
44 Int_t AliMUONSegmentationV02::Npx()
45 // Returns maximum number if pads in x
46 {return AliMUONSegmentationV01::Npy();}
48 Int_t AliMUONSegmentationV02::Npy()
49 // Returns maximum number if pads in y
50 {return AliMUONSegmentationV01::Npx();}
53 Float_t AliMUONSegmentationV02::Dpx(Int_t isec)
54 // Returns pad-size in x
57 Float_t AliMUONSegmentationV02::Dpy(Int_t isec)
58 // Returns pad-size in y
60 Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
61 // Returns sector number for given pad position
63 {return AliMUONSegmentationV01::Sector(iy, ix);}
65 void AliMUONSegmentationV02::
67 GetPadIxy(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
68 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
71 AliMUONSegmentationV01::GetPadIxy(y, x, iy, ix);
72 // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
75 void AliMUONSegmentationV02::
76 GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
77 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
80 AliMUONSegmentationV01::GetPadCxy(iy, ix, y, x);
82 void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
85 // Sets virtual pad coordinates, needed for evaluating pad response
86 // outside the tracking program
87 GetPadCxy(ix,iy,fx,fy);
88 fSector=Sector(ix,iy);
93 void AliMUONSegmentationV02::NextPad()
95 // Stepper for the iteration over pads
98 // Step to next pad in integration region
103 if (fy < fymax && fy != 0) {
107 } else if (fix != fixmax) {
110 // get y-position of next row (yc), xc not used here
111 GetPadCxy(fix,fiy,xc,yc);
112 // get x-pad coordiante for 1 pad in row (fix)
113 GetPadIxy(xc,fymin,ixc,fiy);
115 printf("\n Error: Stepping outside integration region\n ");
117 GetPadCxy(fix,fiy,fx,fy);
118 fSector=Sector(fix,fiy);
120 (fSector ==-1 || fSector==0 ))
122 // printf("\n this pad %f %f %d %d \n",fx,fy,fix,fiy);
126 Int_t AliMUONSegmentationV02::MorePads()
127 // Stopping condition for the iterator over pads
130 // Are there more pads in the integration region
132 if ((fy >= fymax && fix >= fixmax) || fx==0) {
139 void AliMUONSegmentationV02::
140 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
142 // Returns list of next neighbours for given Pad (iX, iY)
145 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);