]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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 | ||
16 | /* | |
17 | $Log$ | |
c3eff6ad | 18 | Revision 1.6 2000/10/02 16:58:29 egangler |
19 | Cleaning of the code : | |
20 | -> coding conventions | |
21 | -> void Streamers | |
22 | -> some useless includes removed or replaced by "class" statement | |
23 | ||
ecfa008b | 24 | Revision 1.5 2000/07/03 11:54:57 morsch |
25 | AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER | |
26 | The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC. | |
27 | ||
a30a000f | 28 | Revision 1.4 2000/06/29 12:34:09 morsch |
29 | AliMUONSegmentation class has been made independent of AliMUONChamber. This makes | |
30 | it usable with any other geometry class. The link to the object to which it belongs is | |
31 | established via an index. This assumes that there exists a global geometry manager | |
32 | from which the pointer to the parent object can be obtained (in our case gAlice). | |
33 | ||
d81db581 | 34 | Revision 1.3 2000/06/26 10:01:26 pcrochet |
35 | global variables removed | |
36 | ||
3f2cdba8 | 37 | Revision 1.2 2000/06/15 07:58:48 morsch |
38 | Code from MUON-dev joined | |
39 | ||
a9e2aefa | 40 | Revision 1.1.2.1 2000/06/09 21:51:58 morsch |
41 | Code from AliMUONSegResTriggerY.cxx | |
42 | ||
43 | */ | |
44 | ||
3f2cdba8 | 45 | |
a9e2aefa | 46 | /* |
47 | Old Log: | |
48 | Revision 1.1.2.4 2000/05/05 10:17:04 morsch | |
49 | Y strip numerotation changed (CP) | |
50 | ||
51 | Revision 1.1.2.3 2000/04/26 12:33:40 morsch | |
52 | Minor changes in some methods (CP) | |
53 | ||
54 | Revision 1.1.2.2 2000/02/20 07:49:50 morsch | |
55 | Bugs in Dpx, Dpy and ISector methods corrected (P.C.) | |
56 | ||
57 | Revision 1.1.2.1 2000/02/17 14:34:57 morsch | |
58 | Draft version from P. Crochet | |
59 | ||
60 | */ | |
61 | ||
62 | #include "AliMUONSegmentationTriggerY.h" | |
3f2cdba8 | 63 | #include "AliMUONTriggerConstants.h" |
a9e2aefa | 64 | #include "TMath.h" |
65 | #include "TRandom.h" | |
66 | #include "TArc.h" | |
67 | #include "AliMUONChamber.h" | |
68 | #include <iostream.h> | |
69 | ClassImp(AliMUONSegmentationTriggerY) | |
70 | ||
3f2cdba8 | 71 | //------------------------------------------------------------------ |
d81db581 | 72 | void AliMUONSegmentationTriggerY::Init(Int_t chamber) |
a9e2aefa | 73 | { |
3f2cdba8 | 74 | // intialize Y segmentation |
a9e2aefa | 75 | cout << "Initialize Trigger Chamber Geometry Y " << "\n"; |
d81db581 | 76 | AliMUONSegmentationTrigger::Init(chamber); |
a9e2aefa | 77 | |
78 | // calculate x & y position of Y strips | |
3f2cdba8 | 79 | Int_t nModule=AliMUONTriggerConstants::Nmodule(); |
80 | for (Int_t imodule=0; imodule<nModule; imodule++) { | |
81 | Float_t width=StripSizeY(AliMUONTriggerConstants::ModuleId(imodule)); | |
82 | Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule); | |
83 | for (Int_t istrip=0; istrip<nStrip; istrip++){ | |
a9e2aefa | 84 | if (imodule<63) { |
3f2cdba8 | 85 | fXofysmin[imodule][istrip]= |
86 | (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip))*fZscale; | |
87 | fXofysmax[imodule][istrip]= | |
88 | (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip+1))*fZscale; | |
a9e2aefa | 89 | } else { |
90 | fXofysmin[imodule][istrip]=-1.*fXofysmax[imodule-63][istrip]; | |
91 | fXofysmax[imodule][istrip]=-1.*fXofysmin[imodule-63][istrip]; | |
92 | } | |
3f2cdba8 | 93 | fYofysmin[imodule][istrip] = fYcmin[imodule]*fZscale; |
94 | fYofysmax[imodule][istrip] = fYcmax[imodule]*fZscale; | |
a9e2aefa | 95 | } |
96 | } | |
97 | ||
98 | } | |
99 | ||
100 | //------------------------------------------------------------------ | |
c3eff6ad | 101 | void AliMUONSegmentationTriggerY::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy) |
102 | { | |
a9e2aefa | 103 | // Returns pad coordinates (ix,iy) for given real coordinates (x,y) |
104 | // x,y = real coordinates; ix = module number , iy = strip number | |
105 | ||
106 | ix = 0; | |
107 | iy = 0; | |
3f2cdba8 | 108 | Int_t nModule=AliMUONTriggerConstants::Nmodule(); |
109 | for (Int_t imodule=0; imodule<nModule; imodule++) { | |
110 | Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule); | |
111 | for (Int_t istrip=0; istrip<nStrip; istrip++){ | |
a9e2aefa | 112 | if (x>fXofysmin[imodule][istrip]&&x<fXofysmax[imodule][istrip]&& |
113 | y>fYofysmin[imodule][istrip]&&y<fYofysmax[imodule][istrip]){ | |
3f2cdba8 | 114 | ix = AliMUONTriggerConstants::ModuleId(imodule); |
a9e2aefa | 115 | iy = istrip; |
116 | } | |
117 | } | |
118 | } | |
119 | } | |
120 | ||
121 | //------------------------------------------------------------------ | |
c3eff6ad | 122 | void AliMUONSegmentationTriggerY::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) |
123 | { | |
a9e2aefa | 124 | // Returns real coordinates (x,y) for given pad coordinates (ix,iy) |
125 | // ix = module number , iy = strip number; x,y = center of strip | |
126 | x = 0.; | |
127 | y = 0.; | |
3f2cdba8 | 128 | Int_t nModule=AliMUONTriggerConstants::Nmodule(); |
129 | for (Int_t imodule=0; imodule<nModule; imodule++) { | |
130 | if (AliMUONTriggerConstants::ModuleId(imodule)==ix){ | |
a9e2aefa | 131 | x=fXofysmin[imodule][iy]+(fXofysmax[imodule][iy]-fXofysmin[imodule][iy])/2.; |
132 | y=fYofysmin[imodule][iy]+(fYofysmax[imodule][iy]-fYofysmin[imodule][iy])/2.; | |
133 | } | |
134 | } | |
135 | } | |
136 | ||
137 | //------------------------------------------------------------------ | |
138 | void AliMUONSegmentationTriggerY::SetPadSize(Float_t p1, Float_t p2) | |
139 | { | |
140 | // Sets the padsize | |
141 | // | |
142 | fDpx=p1; | |
143 | fDpy=p2; | |
144 | } | |
145 | ||
146 | //------------------------------------------------------------------ | |
147 | void AliMUONSegmentationTriggerY:: | |
c3eff6ad | 148 | Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]) |
149 | { | |
a9e2aefa | 150 | // Returns list of next neighbours for given Pad (ix, iy) |
151 | Int_t absiX=TMath::Abs(iX); | |
152 | *Nlist = 0; | |
153 | ||
154 | if (absiX!=0) { | |
155 | Int_t numModule=ModuleNumber(absiX); | |
156 | ||
3f2cdba8 | 157 | if (iY==AliMUONTriggerConstants::NstripY(numModule)-1) { // strip right |
a9e2aefa | 158 | if (absiX%10!=7) { |
159 | *Nlist=1; | |
160 | Xlist[0]=absiX+1; | |
161 | Ylist[0]=0; | |
162 | } | |
163 | } else { | |
164 | *Nlist=1; | |
165 | Xlist[0]=absiX; | |
166 | Ylist[0]=iY+1; | |
167 | } | |
168 | ||
169 | if (iY==0) { // strip left | |
170 | if (absiX%10!=1&&absiX!=52) { | |
171 | *Nlist=*Nlist+1; | |
172 | Xlist[*Nlist-1]=absiX-1; | |
3f2cdba8 | 173 | Ylist[*Nlist-1]=AliMUONTriggerConstants::NstripY(numModule-1)-1; |
a9e2aefa | 174 | } |
175 | } else { | |
176 | *Nlist=*Nlist+1; | |
177 | Xlist[*Nlist-1]=absiX; | |
178 | Ylist[*Nlist-1]=iY-1; | |
179 | } | |
180 | ||
181 | if (iX<0) { // left side of chamber | |
182 | for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];} | |
183 | } | |
184 | } | |
185 | } | |
186 | ||
187 | //------------------------------------------------------------------ | |
188 | void AliMUONSegmentationTriggerY::SetPad(Int_t ix, Int_t iy) | |
189 | { | |
190 | // Sets virtual pad coordinates, needed for evaluating pad response | |
191 | // outside the tracking program | |
ecfa008b | 192 | GetPadC(ix,iy,fX,fY); |
193 | GetPadI(fX,fY,fIx,fIy); | |
a9e2aefa | 194 | fSector=Sector(ix,iy); |
195 | } | |
196 | ||
197 | //------------------------------------------------------------------ | |
c3eff6ad | 198 | Int_t AliMUONSegmentationTriggerY::ISector() |
a9e2aefa | 199 | { return fSector;} |
200 | ||
201 | //------------------------------------------------------------------ | |
c3eff6ad | 202 | |
a9e2aefa | 203 | Int_t AliMUONSegmentationTriggerY::Ix() |
ecfa008b | 204 | { return fIx;} |
a9e2aefa | 205 | |
206 | //------------------------------------------------------------------ | |
c3eff6ad | 207 | |
a9e2aefa | 208 | Int_t AliMUONSegmentationTriggerY::Iy() |
ecfa008b | 209 | { return fIy;} |
a9e2aefa | 210 | |
211 | //------------------------------------------------------------------ | |
c3eff6ad | 212 | Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec) const |
3f2cdba8 | 213 | { |
214 | // returns x size of y strips for sector isec | |
a9e2aefa | 215 | if (isec==1) { |
216 | return 2.125*fZscale; | |
217 | } else if (isec==2) { | |
218 | return 2.125*fZscale; | |
219 | } else if (isec==3) { | |
220 | return 2.125*fZscale; | |
221 | } else if (isec==4) { | |
222 | return 4.25*fZscale; | |
223 | } else { | |
224 | return 0.; | |
225 | } | |
226 | } | |
227 | ||
228 | //------------------------------------------------------------------ | |
c3eff6ad | 229 | Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec) const |
3f2cdba8 | 230 | { |
231 | // returns y size of y strips for sector isec | |
a9e2aefa | 232 | if (isec==1) { |
233 | return 68.0*fZscale; | |
234 | } else if (isec==2) { | |
235 | return 51.0*fZscale; | |
236 | } else if (isec==3) { | |
237 | return 68.0*fZscale; | |
238 | } else if (isec==4) { | |
239 | return 68.0*fZscale; | |
240 | } else if (isec==5) { | |
241 | return 68.0*fZscale; | |
242 | } else { | |
243 | return 0.; | |
244 | } | |
245 | ||
246 | } | |
247 | ||
248 | //------------------------------------------------------------------ | |
249 | void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit) | |
3f2cdba8 | 250 | { |
251 | // set hits during diintegration | |
252 | AliMUONSegmentationTrigger::SetHit(xhit,yhit); | |
253 | } | |
a9e2aefa | 254 | |
255 | //------------------------------------------------------------------ | |
256 | Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy) | |
257 | { | |
258 | // Returns sector number for given module | |
259 | // | |
260 | Int_t absix=TMath::Abs(ix); | |
261 | Int_t iwidth=Int_t(StripSizeY(absix)); | |
3f2cdba8 | 262 | |
a9e2aefa | 263 | if (absix==52) { |
264 | return 1; | |
265 | } else if (absix==41||absix==61) { | |
266 | return 2; | |
267 | } else if (iwidth==2) { | |
268 | return 3; | |
269 | } else if (iwidth==4) { | |
270 | return 4; | |
271 | } else { | |
272 | return 0; | |
273 | } | |
274 | } | |
275 | ||
276 | //------------------------------------------------------------------ | |
277 | void AliMUONSegmentationTriggerY:: | |
278 | IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width) | |
279 | { | |
280 | // returns quantities needed to evaluate neighbour strip response | |
281 | Int_t ix,iy; | |
282 | Float_t xstrip,ystrip; | |
ecfa008b | 283 | GetPadI(fXhit,fYhit,ix,iy); |
a30a000f | 284 | GetPadC(ix,iy,xstrip,ystrip); |
ecfa008b | 285 | x1=fXhit; // hit x position |
a9e2aefa | 286 | x2=xstrip; // x coordinate of the main strip |
ecfa008b | 287 | x3=fX; // current strip real x coordinate |
a9e2aefa | 288 | width=StripSizeY(ix); // width of the main strip |
289 | } | |
290 | ||
291 | ||
292 | ||
293 |