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