]>
Commit | Line | Data |
---|---|---|
9ff9fab7 | 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 | /* $Id$ */ | |
17 | ||
18 | #include "AliMUONTriggerSegmentationV2.h" | |
19 | ||
9ff9fab7 | 20 | #include "AliMpPCB.h" |
21 | #include "AliMpTrigger.h" | |
22 | #include "AliMpTriggerSegmentation.h" | |
23 | #include "AliMpSlat.h" | |
24 | ||
8fbf5237 | 25 | #include "AliLog.h" |
9ff9fab7 | 26 | |
27 | #include "Riostream.h" | |
28 | #include "TClass.h" | |
29 | #include "TString.h" | |
30 | ||
31 | ClassImp(AliMUONTriggerSegmentationV2) | |
32 | ||
33 | namespace | |
34 | { | |
35 | // Int_t SPECIAL_SECTOR = 8; | |
36 | Int_t fgIntOffset(1); | |
37 | Float_t FMAX(1E9); | |
38 | Int_t CODEMAKER(1000); | |
39 | ||
40 | Int_t Code(Int_t ixLA, Int_t iyLA) | |
41 | { | |
42 | return iyLA*CODEMAKER + ixLA; | |
43 | } | |
44 | ||
45 | void Decode(Int_t code, Int_t& ixLA, Int_t& iyLA) | |
46 | { | |
47 | iyLA = code/CODEMAKER; | |
48 | ixLA = code - iyLA*CODEMAKER; | |
49 | } | |
50 | } | |
51 | ||
52 | //_____________________________________________________________________________ | |
53 | AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2() | |
54 | : AliMUONVGeometryDESegmentation(), | |
55 | fDetElemId(-1), | |
56 | fPlaneType(kNonBendingPlane), | |
57 | fSlat(0), | |
58 | fSlatSegmentation(0), | |
59 | fXhit(FMAX), | |
60 | fYhit(FMAX), | |
61 | fLineNumber(-1) | |
62 | { | |
63 | // | |
64 | // Default ctor (empty). | |
65 | // | |
66 | AliDebug(1,Form("this=%p default (empty) ctor",this)); | |
67 | } | |
68 | ||
69 | //_____________________________________________________________________________ | |
8fbf5237 | 70 | AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2( |
71 | AliMpVSegmentation* segmentation, | |
72 | Int_t detElemId, AliMpPlaneType bendingOrNonBending) | |
9ff9fab7 | 73 | : AliMUONVGeometryDESegmentation(), |
74 | fDetElemId(detElemId), | |
75 | fPlaneType(bendingOrNonBending), | |
76 | fSlat(0), | |
77 | fSlatSegmentation(0), | |
78 | fXhit(FMAX), | |
79 | fYhit(FMAX), | |
80 | fLineNumber(-1) | |
81 | { | |
82 | // | |
83 | // Normal ctor. | |
84 | // | |
8fbf5237 | 85 | |
86 | fSlatSegmentation = dynamic_cast<AliMpTriggerSegmentation*>(segmentation); | |
87 | if (fSlatSegmentation) | |
88 | fSlat = fSlatSegmentation->Slat(); | |
89 | else | |
90 | AliFatal("Wrong mapping segmentation type"); | |
91 | ||
dda778c2 | 92 | TString id(fSlat->GetID()); |
93 | Ssiz_t pos = id.Last('L'); | |
94 | if ( pos <= 0 ) | |
95 | { | |
96 | AliFatal(Form("Cannot infer line number for slat %s",id.Data())); | |
97 | } | |
98 | fLineNumber = TString(id(pos+1),1).Atoi(); | |
9ff9fab7 | 99 | |
100 | AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId, | |
101 | ( (bendingOrNonBending==kBendingPlane)?"Bending":"NonBending" ), | |
102 | fSlatSegmentation)); | |
103 | } | |
104 | ||
105 | //_____________________________________________________________________________ | |
106 | AliMUONTriggerSegmentationV2::AliMUONTriggerSegmentationV2(const AliMUONTriggerSegmentationV2& rhs) : AliMUONVGeometryDESegmentation(rhs) | |
107 | { | |
108 | AliFatal("Not implemented."); | |
109 | } | |
110 | ||
111 | //_____________________________________________________________________________ | |
112 | AliMUONTriggerSegmentationV2::~AliMUONTriggerSegmentationV2() | |
113 | { | |
114 | AliDebug(1,Form("this=%p",this)); | |
115 | // Destructor | |
116 | } | |
117 | ||
118 | //_____________________________________________________________________________ | |
119 | AliMUONTriggerSegmentationV2& AliMUONTriggerSegmentationV2::operator=(const AliMUONTriggerSegmentationV2& rhs) | |
120 | { | |
121 | // Protected assignement operator | |
122 | if (this == &rhs) return *this; | |
123 | AliFatal("Not implemented."); | |
124 | return *this; | |
125 | } | |
126 | ||
127 | //_____________________________________________________________________________ | |
128 | TF1* | |
129 | AliMUONTriggerSegmentationV2::CorrFunc(Int_t) const | |
130 | { | |
131 | AliFatal("Not implemented"); | |
132 | return 0x0; | |
133 | } | |
134 | ||
135 | //_____________________________________________________________________________ | |
136 | Float_t | |
137 | AliMUONTriggerSegmentationV2::Distance2AndOffset(Int_t, Int_t, | |
138 | Float_t, Float_t, Int_t*) | |
139 | { | |
140 | AliFatal("Not implemented"); | |
141 | return 0; | |
142 | } | |
143 | ||
144 | //_____________________________________________________________________________ | |
145 | void | |
146 | AliMUONTriggerSegmentationV2::Draw(Option_t*) | |
147 | { | |
148 | AliFatal("Not Implemented"); | |
149 | } | |
150 | ||
151 | //_____________________________________________________________________________ | |
152 | Float_t | |
153 | AliMUONTriggerSegmentationV2::Dpx() const | |
154 | { | |
155 | AliFatal("Not Implemented"); | |
156 | return 0.0; | |
157 | } | |
158 | ||
159 | //_____________________________________________________________________________ | |
160 | Float_t | |
161 | AliMUONTriggerSegmentationV2::Dpy() const | |
162 | { | |
163 | AliFatal("Not Implemented"); | |
164 | return 0.0; | |
165 | } | |
166 | ||
167 | //_____________________________________________________________________________ | |
168 | Float_t | |
169 | AliMUONTriggerSegmentationV2::Dpx(int sectorCode) const | |
170 | { | |
171 | Int_t ixLA, iyLA; | |
172 | Decode(sectorCode,ixLA,iyLA); | |
173 | AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE); | |
174 | if ( !pad.IsValid() ) return 0.0; | |
175 | return pad.Dimensions().X()*2.0; | |
176 | } | |
177 | ||
178 | //_____________________________________________________________________________ | |
179 | Float_t | |
180 | AliMUONTriggerSegmentationV2::Dpy(int sectorCode) const | |
181 | { | |
182 | Int_t ixLA, iyLA; | |
183 | Decode(sectorCode,ixLA,iyLA); | |
184 | AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE); | |
185 | if ( !pad.IsValid() ) return 0.0; | |
186 | return pad.Dimensions().Y()*2.0; | |
187 | } | |
188 | ||
189 | //_____________________________________________________________________________ | |
190 | void | |
191 | AliMUONTriggerSegmentationV2::FirstPad(Float_t /*xhit*/, Float_t /*yhit*/, | |
192 | Float_t /*zhit*/, | |
193 | Float_t /*dx*/, Float_t /*dy*/) | |
194 | { | |
195 | AliFatal("Not implemented"); | |
196 | } | |
197 | ||
198 | //_____________________________________________________________________________ | |
199 | Float_t | |
200 | AliMUONTriggerSegmentationV2::GetAnod(Float_t) const | |
201 | { | |
202 | AliFatal("Not implemented"); | |
203 | return 0.0; | |
204 | } | |
205 | ||
206 | //_____________________________________________________________________________ | |
207 | AliMUONGeometryDirection | |
208 | AliMUONTriggerSegmentationV2::GetDirection() | |
209 | { | |
210 | //AliWarning("Not Implemented"); | |
211 | return kDirUndefined; | |
212 | } | |
213 | ||
b7ef3c96 | 214 | //______________________________________________________________________________ |
215 | const AliMpVSegmentation* | |
216 | AliMUONTriggerSegmentationV2::GetMpSegmentation() const | |
217 | { | |
218 | // Returns the mapping segmentation | |
219 | // (provides access to electronics info) | |
220 | ||
221 | return fSlatSegmentation; | |
222 | } | |
223 | ||
9ff9fab7 | 224 | //_____________________________________________________________________________ |
225 | void | |
226 | AliMUONTriggerSegmentationV2::GetNParallelAndOffset(Int_t,Int_t,Int_t*,Int_t*) | |
227 | { | |
228 | AliFatal("Not Implemented"); | |
229 | } | |
230 | ||
231 | //_____________________________________________________________________________ | |
232 | void | |
233 | AliMUONTriggerSegmentationV2::GetPadC(Int_t ix, Int_t iy, | |
234 | Float_t& x, Float_t& y, Float_t& z) | |
235 | { | |
236 | z = 0; | |
237 | GetPadC(ix,iy,x,y); | |
238 | } | |
239 | ||
240 | //_____________________________________________________________________________ | |
241 | void | |
242 | AliMUONTriggerSegmentationV2::GetPadC(Int_t ixGlo, Int_t iyGlo, | |
243 | Float_t& x, Float_t& y) | |
244 | { | |
245 | Int_t ixLA,iyLA; | |
246 | IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA); | |
247 | AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE); | |
248 | x = pad.Position().X(); | |
249 | y = pad.Position().Y(); | |
250 | } | |
251 | ||
252 | //_____________________________________________________________________________ | |
253 | void | |
254 | AliMUONTriggerSegmentationV2::GetPadI(Float_t x, Float_t y, Float_t, | |
255 | Int_t& ix, Int_t& iy) | |
256 | { | |
257 | GetPadI(x,y,ix,iy); | |
258 | } | |
259 | ||
260 | //_____________________________________________________________________________ | |
261 | void | |
262 | AliMUONTriggerSegmentationV2::GetPadI(Float_t x, Float_t y, | |
263 | Int_t& ixGlo, Int_t& iyGlo) | |
264 | { | |
265 | AliDebug(2,Form("%s x=%e y=%e ixGlo,iyGlo=%d,%d\n", | |
266 | fSlatSegmentation->GetName(), | |
267 | x,y,ixGlo,iyGlo)); | |
268 | ||
9ff9fab7 | 269 | AliMpPad pad = |
c608ca37 | 270 | fSlatSegmentation->PadByPosition(TVector2(x,y), kTRUE); |
9ff9fab7 | 271 | |
272 | if ( pad != AliMpPad::Invalid() ) | |
273 | { | |
274 | Int_t ix = pad.GetIndices().GetFirst(); | |
275 | Int_t iy = pad.GetIndices().GetSecond(); | |
276 | ILoc2IGlo(ix,iy,ixGlo,iyGlo); | |
277 | } | |
278 | else | |
279 | { | |
280 | ixGlo=iyGlo=-1; | |
281 | } | |
282 | AliDebug(2,Form("ixGlo,iyGlo=%d,%d\n",ixGlo,iyGlo)); | |
283 | } | |
284 | ||
285 | //_____________________________________________________________________________ | |
286 | void | |
287 | AliMUONTriggerSegmentationV2::GetPadLoc2Glo(Int_t ix, Int_t iy, | |
288 | Int_t& ixGlo, Int_t& iyGlo) const | |
289 | { | |
290 | // | |
291 | // Converts from local (in PC convention) to (ix,iy) to global (ix,iy) | |
292 | // | |
293 | ||
294 | ixGlo=iyGlo=-1; // starts with invalid values | |
295 | ||
296 | if ( fPlaneType == kBendingPlane ) | |
297 | { | |
298 | ixGlo = 10*LineNumber() + ix; | |
299 | iyGlo = iy - fgIntOffset; | |
300 | } | |
301 | else if ( fPlaneType == kNonBendingPlane ) | |
302 | { | |
303 | Int_t i = fSlat->GetLayer(0)->FindPCBIndex(ix-fgIntOffset); | |
304 | if (i<0) | |
305 | { | |
306 | AliError(Form("Invalid local (ix=%d,iy=%d) ?",ix,iy)); | |
307 | return ; | |
308 | } | |
309 | AliMpPCB* pcb = fSlat->GetLayer(0)->FindPCB(ix-fgIntOffset); | |
310 | iyGlo = ix - pcb->Ixmin() - fgIntOffset; | |
311 | if ( LineNumber() == 5 ) ++i; | |
312 | ixGlo = 10*LineNumber() + i + fgIntOffset; | |
313 | } | |
314 | } | |
315 | ||
316 | //_____________________________________________________________________________ | |
317 | void | |
318 | AliMUONTriggerSegmentationV2::GetPadGlo2Loc(Int_t ixGlo, Int_t iyGlo, | |
319 | Int_t& ix, Int_t& iy) const | |
320 | { | |
321 | // | |
322 | // Converts from global (ix,iy) to local (ix,iy) (in PC convention) | |
323 | // | |
324 | ||
325 | ix=iy=-1; // starts with invalid values | |
326 | ||
327 | if ( abs(ixGlo) == 51 ) return; | |
328 | ||
329 | Int_t column = ModuleColNum(ixGlo); | |
330 | ||
331 | if ( fPlaneType == kBendingPlane ) | |
332 | { | |
333 | ix = column + fgIntOffset; | |
334 | iy = iyGlo + fgIntOffset; | |
335 | } | |
336 | else if ( fPlaneType == kNonBendingPlane ) | |
337 | { | |
338 | if ( LineNumber()==5 ) --column; | |
339 | AliMpPCB* pcb = fSlat->GetLayer(0)->GetPCB(column); | |
340 | if (!pcb) | |
341 | { | |
342 | AliError(Form("Invalid global (ix=%d,iy=%d)",ixGlo,iyGlo)); | |
343 | return; | |
344 | } | |
345 | ix = pcb->Ixmin() + iyGlo + fgIntOffset; | |
346 | iy = fgIntOffset; | |
347 | } | |
348 | } | |
349 | ||
350 | //_____________________________________________________________________________ | |
351 | void | |
352 | AliMUONTriggerSegmentationV2::GiveTestPoints(Int_t&,Float_t*,Float_t*) const | |
353 | { | |
354 | AliFatal("Not Implemented"); | |
355 | } | |
356 | ||
357 | //_____________________________________________________________________________ | |
358 | Bool_t | |
359 | AliMUONTriggerSegmentationV2::HasPad(Float_t x, Float_t y, Float_t) | |
360 | { | |
361 | // | |
362 | // Well, 2 implementations are possible here | |
363 | // Either reuse HasPad(int,int), or get it from scratch using | |
364 | // underlying fSlatSegmentation. | |
365 | // Took second option, but w/o checking whether this is the faster. | |
366 | // The second option is commented out below, for the record. | |
367 | ||
368 | // Int_t ix, iy; | |
369 | // GetPadI(x,y,z,ix,iy); | |
370 | // Int_t ixLA, iyLA; | |
371 | // IGlo2ILoc(ix,iy,ixLA,iyLA); | |
372 | // Int_t ixPC, iyPC; | |
373 | // LA2PC(ixLA,iyLA,ixPC,iyPC); | |
374 | // Bool_t ok1 = HasPad(ixPC,iyPC); | |
375 | ||
376 | AliMpPad pad = | |
c608ca37 | 377 | fSlatSegmentation->PadByPosition(TVector2(x,y),kFALSE); |
9ff9fab7 | 378 | return pad.IsValid(); |
379 | } | |
380 | ||
381 | //_____________________________________________________________________________ | |
382 | Bool_t | |
383 | AliMUONTriggerSegmentationV2::HasPad(Int_t ixGlo, Int_t iyGlo) | |
384 | { | |
385 | Int_t ixLA, iyLA; | |
386 | IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA); | |
387 | return fSlatSegmentation->HasPad(AliMpIntPair(ixLA,iyLA)); | |
388 | } | |
389 | ||
390 | //_____________________________________________________________________________ | |
391 | void | |
392 | AliMUONTriggerSegmentationV2::IGlo2ILoc(Int_t ixGlo, Int_t iyGlo, | |
6c92c893 | 393 | Int_t& ixLA, Int_t& iyLA) const |
9ff9fab7 | 394 | { |
395 | Int_t ixPC, iyPC; | |
396 | GetPadGlo2Loc(ixGlo,iyGlo,ixPC,iyPC); | |
397 | PC2LA(ixPC,iyPC,ixLA,iyLA); | |
398 | } | |
399 | ||
400 | //_____________________________________________________________________________ | |
401 | void | |
402 | AliMUONTriggerSegmentationV2::ILoc2IGlo(Int_t ixLA, Int_t iyLA, | |
6c92c893 | 403 | Int_t& ixGlo, Int_t& iyGlo) const |
9ff9fab7 | 404 | { |
405 | Int_t ixPC, iyPC; | |
406 | LA2PC(ixLA,iyLA,ixPC,iyPC); | |
407 | GetPadLoc2Glo(ixPC,iyPC,ixGlo,iyGlo); | |
408 | } | |
409 | ||
9ff9fab7 | 410 | //_____________________________________________________________________________ |
411 | Int_t | |
412 | AliMUONTriggerSegmentationV2::ISector() | |
413 | { | |
414 | // FIXME: remove the usage of ISector from all the code. | |
415 | return -10; | |
416 | } | |
417 | ||
418 | //_____________________________________________________________________________ | |
419 | void AliMUONTriggerSegmentationV2::IntegrationLimits(Float_t& x1, | |
420 | Float_t& x2, | |
421 | Float_t& x3, | |
422 | Float_t& x4) | |
423 | { | |
424 | // x1 : hit x(y) position | |
425 | // x2 : x(y) coordinate of the main strip | |
426 | // x3 : current strip real x(y) coordinate | |
427 | // x4 : dist. between x(y) hit pos. and the closest border of the current strip | |
428 | // | |
429 | // Note : need to return (only) x4. | |
430 | ||
431 | AliFatal("Check me before usage. ResponseTrigger does not use me, while" | |
432 | "ResponseTriggerV1 does ?"); | |
433 | ||
434 | AliMpPad strip = | |
435 | fSlatSegmentation->PadByPosition(TVector2(fXhit,fYhit),kFALSE); | |
436 | if ( !strip.IsValid() ) | |
437 | { | |
438 | AliWarning(Form("%s got invalid fXhit,fYhit=%e,%e\n", | |
439 | fSlatSegmentation->GetName(),fXhit,fYhit)); | |
440 | x1=x2=x3=x4=0; | |
441 | } | |
442 | else | |
443 | { | |
444 | Double_t xstrip = strip.Position().X(); | |
445 | Double_t ystrip = strip.Position().Y(); | |
446 | AliDebug(1,Form("fXhit,Yhit=%e,%e xstrip,ystrip=%e,%e\n", | |
447 | fXhit,fYhit,xstrip,ystrip)); | |
448 | x1 = (fPlaneType==kBendingPlane) ? fYhit : fXhit; | |
449 | x2 = (fPlaneType==kBendingPlane) ? ystrip : xstrip; | |
450 | x3 = (fPlaneType==kBendingPlane) ? | |
451 | fCurrentPad.Position().Y() : fCurrentPad.Position().X(); | |
452 | Double_t xmin = 0.0; | |
453 | Double_t xmax = 0.0; | |
454 | if (fPlaneType==kBendingPlane) | |
455 | { | |
456 | xmin = x3 - fCurrentPad.Dimensions().X(); | |
457 | xmax = x3 + fCurrentPad.Dimensions().X(); | |
458 | } | |
459 | else | |
460 | { | |
461 | xmin = x3 - fCurrentPad.Dimensions().Y(); | |
462 | xmax = x3 + fCurrentPad.Dimensions().Y(); | |
463 | } | |
464 | // dist. between the hit and the closest border of the current strip | |
465 | x4 = (TMath::Abs(xmax-x1) > TMath::Abs(xmin-x1)) ? | |
466 | TMath::Abs(xmin-x1):TMath::Abs(xmax-x1); | |
467 | ||
468 | AliDebug(1,Form("Bending %d x1=%e x2=%e x3=%e x4=%e xmin,max=%e,%e\n", | |
469 | fPlaneType,x1,x2,x3,x4,xmin,xmax)); | |
470 | ||
471 | } | |
472 | } | |
473 | ||
474 | //_____________________________________________________________________________ | |
475 | Int_t | |
476 | AliMUONTriggerSegmentationV2::Ix() | |
477 | { | |
478 | if ( fCurrentPad.IsValid() ) | |
479 | { | |
480 | Int_t ixGlo,iyGlo; | |
481 | ILoc2IGlo(fCurrentPad.GetIndices().GetFirst(), | |
482 | fCurrentPad.GetIndices().GetSecond(),ixGlo,iyGlo); | |
483 | return ixGlo; | |
484 | } | |
485 | return -1; | |
486 | } | |
487 | ||
488 | //_____________________________________________________________________________ | |
489 | Int_t | |
490 | AliMUONTriggerSegmentationV2::Iy() | |
491 | { | |
492 | if ( fCurrentPad.IsValid() ) | |
493 | { | |
494 | Int_t ixGlo,iyGlo; | |
495 | ILoc2IGlo(fCurrentPad.GetIndices().GetFirst(), | |
496 | fCurrentPad.GetIndices().GetSecond(),ixGlo,iyGlo); | |
497 | return iyGlo; | |
498 | } | |
499 | return -1; | |
500 | } | |
501 | ||
502 | ||
503 | //_____________________________________________________________________________ | |
504 | void | |
505 | AliMUONTriggerSegmentationV2::LA2PC(Int_t ixLA, Int_t iyLA, | |
6c92c893 | 506 | Int_t& ixPC, Int_t& iyPC) const |
9ff9fab7 | 507 | { |
508 | // | |
509 | // From LA to PC conventions for integers indices. | |
510 | // | |
511 | ixPC=iyPC=-1; | |
512 | ||
513 | if ( ixLA<0 || iyLA<0 ) return; | |
514 | ||
515 | ixPC = ixLA + 1; | |
516 | iyPC = iyLA + 1; | |
517 | ||
518 | if ( fPlaneType == kBendingPlane ) | |
519 | { | |
520 | if ( LineNumber()==5 ) | |
521 | { | |
522 | ++ixPC; | |
523 | } | |
524 | if ( LineNumber()==4 && ixLA==0 ) | |
525 | { | |
526 | iyPC -= 16; | |
527 | } | |
528 | } | |
529 | ||
530 | AliDebug(3,Form("ix,iy LA (%d,%d) -> PC (%d,%d)",ixLA,iyLA,ixPC,iyPC)); | |
531 | ||
532 | } | |
533 | ||
534 | //_____________________________________________________________________________ | |
535 | Int_t | |
536 | AliMUONTriggerSegmentationV2::LineNumber() const | |
537 | { | |
538 | return 10-fLineNumber; | |
539 | } | |
540 | ||
541 | //_____________________________________________________________________________ | |
542 | Int_t | |
543 | AliMUONTriggerSegmentationV2::ModuleColNum(Int_t ixGlo) const | |
544 | { | |
545 | // returns column number (from 0 to 6) in which the (global) module | |
546 | // ix is sitting (could return 7 if ix=isec) | |
547 | return TMath::Abs(ixGlo)-Int_t(TMath::Abs(ixGlo)/10)*10-1; | |
548 | } | |
549 | ||
550 | //_____________________________________________________________________________ | |
551 | Int_t | |
552 | AliMUONTriggerSegmentationV2::MorePads() | |
553 | { | |
554 | AliFatal("Not implemented"); | |
555 | return 0; | |
556 | } | |
557 | ||
558 | //_____________________________________________________________________________ | |
559 | void AliMUONTriggerSegmentationV2::Neighbours(Int_t /*iX*/, Int_t /*iY*/, | |
560 | Int_t* /*Nlist*/, | |
561 | Int_t /*Xlist*/[10], | |
562 | Int_t /*Ylist*/[10]) | |
563 | { | |
564 | //-----------------BENDING----------------------------------------- | |
565 | // Returns list of 10 next neighbours for given X strip (ix, iy) | |
566 | // neighbour number 4 in the list - | |
567 | // neighbour number 3 in the list | | |
568 | // neighbour number 2 in the list |_ Upper part | |
569 | // neighbour number 1 in the list | | |
570 | // neighbour number 0 in the list - | |
571 | // X strip (ix, iy) | |
572 | // neighbour number 5 in the list - | |
573 | // neighbour number 6 in the list | _ Lower part | |
574 | // neighbour number 7 in the list | | |
575 | // neighbour number 8 in the list | | |
576 | // neighbour number 9 in the list - | |
577 | ||
578 | //-----------------NON-BENDING------------------------------------- | |
579 | // Returns list of 10 next neighbours for given Y strip (ix, iy) | |
580 | // neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list | |
581 | // \_______/ \_______/ | |
582 | // left right | |
583 | AliFatal("Please implement me"); | |
584 | } | |
585 | ||
586 | //_____________________________________________________________________________ | |
587 | void | |
588 | AliMUONTriggerSegmentationV2::NextPad() | |
589 | { | |
590 | AliFatal("Not implemented"); | |
591 | } | |
592 | ||
593 | //_____________________________________________________________________________ | |
594 | Int_t | |
595 | AliMUONTriggerSegmentationV2::Npx() const | |
596 | { | |
597 | return 124;// FIXME: this should not have to be done, if only we'd stick | |
598 | // to a local (ix,iy) convention !!! | |
599 | // return fSlatSegmentation->MaxPadIndexX()+1; | |
600 | } | |
601 | ||
602 | //_____________________________________________________________________________ | |
603 | Int_t | |
604 | AliMUONTriggerSegmentationV2::Npy() const | |
605 | { | |
606 | return 64; | |
607 | // return fSlatSegmentation->MaxPadIndexY()+1; | |
608 | } | |
609 | ||
610 | //_____________________________________________________________________________ | |
611 | void | |
612 | AliMUONTriggerSegmentationV2::PC2LA(Int_t ixPC, Int_t iyPC, | |
6c92c893 | 613 | Int_t& ixLA, Int_t& iyLA) const |
9ff9fab7 | 614 | { |
615 | // | |
616 | // From PC to LA conventions for integers indices. | |
617 | // | |
618 | ixLA=iyLA=-1; | |
619 | ||
620 | if ( ixPC<0 || iyPC<0 ) return; | |
621 | ||
622 | ixLA = ixPC - 1; | |
623 | iyLA = iyPC - 1; | |
624 | ||
625 | if ( fPlaneType == kBendingPlane ) | |
626 | { | |
627 | if ( LineNumber()==5 ) | |
628 | { | |
629 | --ixLA; | |
630 | } | |
631 | if ( LineNumber()==4 && ixLA==0 ) | |
632 | { | |
633 | iyLA += 16; | |
634 | } | |
635 | } | |
636 | ||
637 | AliDebug(3,Form("ix,iy PC (%d,%d) -> LA (%d,%d)",ixPC,iyPC,ixLA,iyLA)); | |
638 | } | |
639 | ||
640 | //_____________________________________________________________________________ | |
641 | void | |
642 | AliMUONTriggerSegmentationV2::Print(Option_t* opt) const | |
643 | { | |
644 | TString sopt(opt); | |
645 | ||
646 | cout << "DetElemId=" << fDetElemId << " PlaneType=" | |
647 | << fPlaneType << " Npx=" << Npx() << " Npy=" << Npy() << endl; | |
648 | if ( ( sopt.Contains("SEG") || sopt.Contains("ALL") ) && fSlatSegmentation ) | |
649 | { | |
650 | fSlatSegmentation->Print(); | |
651 | } | |
652 | if ( sopt.Contains("ALL") && fSlat ) | |
653 | { | |
654 | fSlat->Print(); | |
655 | } | |
656 | } | |
657 | ||
9ff9fab7 | 658 | //_____________________________________________________________________________ |
659 | Int_t | |
660 | AliMUONTriggerSegmentationV2::Sector(Int_t ix, Int_t iy) | |
661 | { | |
662 | Int_t ixLA, iyLA; | |
663 | IGlo2ILoc(ix,iy,ixLA,iyLA); | |
664 | AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE); | |
665 | if ( !pad.IsValid() ) return -1; | |
666 | return Code(ixLA,iyLA); | |
667 | ||
668 | // AliMpPCB* pcb = fSlat->GetLayer(0)->FindPCB(ixLA); | |
669 | // if (!pcb) | |
670 | // { | |
671 | // AliError(Form("Could not find a pcb at (%d,%d) for slat %s", | |
672 | // ix,iy,fSlat->GetName())); | |
673 | // return -1; | |
674 | // } | |
675 | // if ( pcb->PadSizeX()==-1.0 ) | |
676 | // { | |
677 | // // special case of column 7 non-bending. | |
678 | // return SPECIAL_SECTOR; | |
679 | // } | |
680 | // return fSlat->GetLayer(0)->FindPCBIndex(ixLA); | |
681 | } | |
682 | ||
683 | //_____________________________________________________________________________ | |
684 | Int_t | |
685 | AliMUONTriggerSegmentationV2::Sector(Float_t, Float_t) | |
686 | { | |
687 | AliFatal("Not implemented"); | |
688 | return 0; | |
689 | } | |
690 | ||
691 | //_____________________________________________________________________________ | |
692 | void | |
693 | AliMUONTriggerSegmentationV2::SetCorrFunc(Int_t,TF1*) | |
694 | { | |
695 | AliFatal("Not Implemented"); | |
696 | } | |
697 | ||
698 | //_____________________________________________________________________________ | |
699 | void | |
700 | AliMUONTriggerSegmentationV2::SetDAnod(float) | |
701 | { | |
702 | AliFatal("Not Implemented"); | |
703 | } | |
704 | ||
705 | //_____________________________________________________________________________ | |
706 | void | |
707 | AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y) | |
708 | { | |
709 | fXhit = x; | |
710 | fYhit = y; | |
711 | ||
712 | // | |
713 | // insure we're within the slat limits. If not, issue an error and sets | |
714 | // the current hit to slat center. | |
715 | // FIXME: this should probably a) not happen at all b) be a fatal error | |
716 | // | |
717 | if ( fXhit < -fSlat->DX() || fXhit > fSlat->DX() || | |
718 | fYhit < -fSlat->DY() || fYhit > fSlat->DY() ) | |
719 | { | |
720 | AliError(Form("Hit outside slat %s limits (x,y)hit = (%e,%e)." | |
721 | " Forcing to (0,0)",fSlat->GetID(),fXhit,fYhit)); | |
722 | fXhit = 0.0; | |
723 | fYhit = 0.0; | |
724 | } | |
725 | ||
726 | } | |
727 | ||
728 | //_____________________________________________________________________________ | |
729 | void | |
730 | AliMUONTriggerSegmentationV2::SetHit(Float_t x, Float_t y, Float_t) | |
731 | { | |
732 | SetHit(x,y); | |
733 | } | |
734 | ||
735 | //_____________________________________________________________________________ | |
736 | void | |
737 | AliMUONTriggerSegmentationV2::SetPad(Int_t ix, Int_t iy) | |
738 | { | |
739 | Int_t ixLA, iyLA; | |
740 | IGlo2ILoc(ix,iy,ixLA,iyLA); | |
741 | fCurrentPad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE); | |
742 | if ( !fCurrentPad.IsValid() ) | |
743 | { | |
744 | AliError(Form("Setting current pad to invalid ! (ix,iy)=(%4d,%4d)",ix,iy)); | |
745 | } | |
746 | } | |
747 | ||
748 | //_____________________________________________________________________________ | |
749 | void | |
750 | AliMUONTriggerSegmentationV2::SetPadSize(float,float) | |
751 | { | |
752 | AliFatal("Not Implemented"); | |
753 | } | |
754 | ||
755 | //_____________________________________________________________________________ | |
756 | Int_t | |
757 | AliMUONTriggerSegmentationV2::SigGenCond(Float_t,Float_t,Float_t) | |
758 | { | |
759 | AliFatal("Not Implemented"); | |
760 | return 0; | |
761 | } | |
762 | ||
763 | //_____________________________________________________________________________ | |
764 | void | |
765 | AliMUONTriggerSegmentationV2::SigGenInit(Float_t,Float_t,Float_t) | |
766 | { | |
767 | AliFatal("Not Implemented"); | |
768 | } | |
769 | ||
9ff9fab7 | 770 | |
771 | ||
772 | ||
773 |