]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
88cb7938 | 16 | /* $Id$ */ |
a9e2aefa | 17 | |
a897a37a | 18 | ///////////////////////////////////////////////////// |
19 | // Segmentation and Response classes version 02 // | |
20 | ///////////////////////////////////////////////////// | |
21 | ||
30178c30 | 22 | #include <TArrayF.h> |
a9e2aefa | 23 | |
24 | #include "AliMUONSegmentationV02.h" | |
a897a37a | 25 | |
26 | //___________________________________________ | |
a9e2aefa | 27 | ClassImp(AliMUONSegmentationV02) |
a897a37a | 28 | |
e9e4cdf2 | 29 | |
30178c30 | 30 | AliMUONSegmentationV02::AliMUONSegmentationV02() |
31 | : AliMUONSegmentationV01() | |
32 | { | |
33 | // Default constructor | |
34 | } | |
35 | ||
36 | AliMUONSegmentationV02::AliMUONSegmentationV02(Int_t nsec) | |
37 | : AliMUONSegmentationV01(nsec) | |
e9e4cdf2 | 38 | { |
39 | // Non default constructor | |
40 | } | |
41 | ||
a9e2aefa | 42 | void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2) |
a897a37a | 43 | { |
a9e2aefa | 44 | // Sets the padsize |
45 | // | |
a897a37a | 46 | fDpy=p1; |
47 | fDpx=p2; | |
48 | } | |
49 | ||
c3eff6ad | 50 | Int_t AliMUONSegmentationV02::Npx() const |
a9e2aefa | 51 | // Returns maximum number if pads in x |
52 | {return AliMUONSegmentationV01::Npy();} | |
a897a37a | 53 | |
c3eff6ad | 54 | Int_t AliMUONSegmentationV02::Npy() const |
a9e2aefa | 55 | // Returns maximum number if pads in y |
56 | {return AliMUONSegmentationV01::Npx();} | |
a897a37a | 57 | |
58 | ||
b1ad38fa | 59 | Float_t AliMUONSegmentationV02::Dpx(Int_t /*isec*/) const |
a9e2aefa | 60 | // Returns pad-size in x |
a897a37a | 61 | {return fDpy;} |
62 | ||
c3eff6ad | 63 | Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const |
a9e2aefa | 64 | // Returns pad-size in y |
c3eff6ad | 65 | {return (*fDpxD)[isec];} |
66 | ||
b1ad38fa | 67 | void AliMUONSegmentationV02::Draw(const char * /*opt*/) const |
68 | {} | |
69 | ||
c3eff6ad | 70 | Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy) |
a9e2aefa | 71 | // Returns sector number for given pad position |
72 | // | |
73 | {return AliMUONSegmentationV01::Sector(iy, ix);} | |
a897a37a | 74 | |
a9e2aefa | 75 | void AliMUONSegmentationV02:: |
c3eff6ad | 76 | GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) |
a9e2aefa | 77 | // Returns pad coordinates (ix,iy) for given real coordinates (x,y) |
78 | // | |
a897a37a | 79 | { |
c3eff6ad | 80 | AliMUONSegmentationV01::GetPadI(y, x, iy, ix); |
a897a37a | 81 | // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy); |
82 | } | |
83 | ||
b1ad38fa | 84 | void AliMUONSegmentationV02::GetPad(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) |
85 | { | |
86 | GetPadI(x, y, ix, iy); | |
87 | } | |
88 | ||
a9e2aefa | 89 | void AliMUONSegmentationV02:: |
c3eff6ad | 90 | GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) |
de05461e | 91 | { |
a9e2aefa | 92 | // Returns real coordinates (x,y) for given pad coordinates (ix,iy) |
93 | // | |
de05461e | 94 | |
a30a000f | 95 | AliMUONSegmentationV01::GetPadC(iy, ix, y, x); |
a897a37a | 96 | } |
a9e2aefa | 97 | void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy) |
a897a37a | 98 | { |
a9e2aefa | 99 | // |
100 | // Sets virtual pad coordinates, needed for evaluating pad response | |
101 | // outside the tracking program | |
ecfa008b | 102 | GetPadC(ix,iy,fX,fY); |
a897a37a | 103 | fSector=Sector(ix,iy); |
104 | } | |
105 | ||
106 | ||
107 | ||
a9e2aefa | 108 | void AliMUONSegmentationV02::NextPad() |
a897a37a | 109 | { |
a9e2aefa | 110 | // Stepper for the iteration over pads |
111 | // | |
a897a37a | 112 | // |
113 | // Step to next pad in integration region | |
114 | Float_t xc,yc; | |
115 | Int_t ixc; | |
116 | ||
117 | // step up | |
ecfa008b | 118 | if (fY < fYmax && fY != 0) { |
119 | if (fIy==-1) fIy++; | |
120 | fIy++; | |
a897a37a | 121 | // step right |
ecfa008b | 122 | } else if (fIx != fIxmax) { |
123 | if (fIx==-1) fIx++; | |
124 | fIx++; | |
a897a37a | 125 | // get y-position of next row (yc), xc not used here |
ecfa008b | 126 | GetPadC(fIx,fIy,xc,yc); |
127 | // get x-pad coordiante for 1 pad in row (fIx) | |
128 | GetPadI(xc,fYmin,ixc,fIy); | |
a897a37a | 129 | } else { |
d7d176c9 | 130 | fIx=fIy=-1; |
a897a37a | 131 | } |
ecfa008b | 132 | GetPadC(fIx,fIy,fX,fY); |
133 | fSector=Sector(fIx,fIy); | |
a897a37a | 134 | if (MorePads() && |
a9e2aefa | 135 | (fSector ==-1 || fSector==0 )) |
a897a37a | 136 | NextPad(); |
ecfa008b | 137 | // printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy); |
a897a37a | 138 | |
139 | } | |
140 | ||
a9e2aefa | 141 | Int_t AliMUONSegmentationV02::MorePads() |
de05461e | 142 | { |
a9e2aefa | 143 | // Stopping condition for the iterator over pads |
144 | // | |
a897a37a | 145 | // |
146 | // Are there more pads in the integration region | |
de05461e | 147 | |
d7d176c9 | 148 | return (fIx != -1 || fIy != -1); |
149 | /* | |
ecfa008b | 150 | if ((fY >= fYmax && fIx >= fIxmax) || fX==0) { |
a897a37a | 151 | return 0; |
152 | } else { | |
153 | return 1; | |
154 | } | |
d7d176c9 | 155 | */ |
a897a37a | 156 | } |
157 | ||
a9e2aefa | 158 | void AliMUONSegmentationV02:: |
c3eff6ad | 159 | Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) |
a897a37a | 160 | { |
a9e2aefa | 161 | // Returns list of next neighbours for given Pad (iX, iY) |
162 | // | |
163 | Int_t n; | |
164 | AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist); | |
165 | *Nlist=n; | |
a897a37a | 166 | } |
167 | ||
168 | ||
a9e2aefa | 169 | |
170 |