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 //-----------------------------------------------------------------------------
19 /// \class AliMUONLocalTriggerBoard
20 /// A local trigger board has as input a bit pattern and returns
21 /// the local trigger response after comparison w/ a LUT
22 /// \todo Change member functions comments in capital letters to normal text
24 /// \author Rachid Guernane (LPCCFd)
25 //-----------------------------------------------------------------------------
28 #include "AliMUONLocalTriggerBoard.h"
29 #include "AliMUONTriggerLut.h"
34 #include <Riostream.h>
39 ClassImp(AliMUONLocalTriggerBoard)
42 const Int_t AliMUONLocalTriggerBoard::fgkCircuitId[234] =
44 111, 121, 131, 141, 151, 161, 171,
45 211, 212, 221, 222, 231, 232, 241, 242, 251, 252, 261, 262, 271,
46 311, 312, 321, 322, 331, 332, 341, 342, 351, 352, 361, 362, 371,
47 411, 412, 413, 421, 422, 423, 424, 431, 432, 433, 434, 441, 442, 451, 452, 461, 462, 471,
48 521, 522, 523, 524, 531, 532, 533, 534, 541, 542, 551, 552, 561, 562, 571,
49 611, 612, 613, 621, 622, 623, 624, 631, 632, 633, 634, 641, 642, 651, 652, 661, 662, 671,
50 711, 712, 721, 722, 731, 732, 741, 742, 751, 752, 761, 762, 771,
51 811, 812, 821, 822, 831, 832, 841, 842, 851, 852, 861, 862, 871,
52 911, 921, 931, 941, 951, 961, 971,
53 -111, -121, -131, -141, -151, -161, -171,
54 -211, -212, -221, -222, -231, -232, -241, -242, -251, -252, -261, -262, -271,
55 -311, -312, -321, -322, -331, -332, -341, -342, -351, -352, -361, -362, -371,
56 -411, -412, -413, -421, -422, -423, -424, -431, -432, -433, -434, -441, -442, -451, -452, -461, -462, -471,
57 -521, -522, -523, -524, -531, -532, -533, -534, -541, -542, -551, -552, -561, -562, -571,
58 -611, -612, -613, -621, -622, -623, -624, -631, -632, -633, -634, -641, -642, -651, -652, -661, -662, -671,
59 -711, -712, -721, -722, -731, -732, -741, -742, -751, -752, -761, -762, -771,
60 -811, -812, -821, -822, -831, -832, -841, -842, -851, -852, -861, -862, -871,
61 -911, -921, -931, -941, -951, -961, -971
64 //___________________________________________
65 AliMUONLocalTriggerBoard::AliMUONLocalTriggerBoard()
66 : AliMUONTriggerBoard(),
76 /// default constructor
79 for (Int_t i=0; i<2; i++)
80 for (Int_t j=0; j<4; j++)
82 fXY[i][j] = fXYU[i][j] = fXYD[i][j] = 0;
87 for (Int_t i=0; i<5; i++) fMinDevStrip[i] = fMinDev[i] = fCoordY[i] = 0;
89 for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
92 //___________________________________________
93 AliMUONLocalTriggerBoard::AliMUONLocalTriggerBoard(AliMpLocalBoard* mpLocalBoard)
94 : AliMUONTriggerBoard(mpLocalBoard->GetName(), mpLocalBoard->GetSlot()),
95 fMpLocalBoard(mpLocalBoard),
104 /// Standard constructor
107 for (Int_t i=0; i<2; i++)
108 for (Int_t j=0; j<4; j++)
110 fXY[i][j] = fXYU[i][j] = fXYD[i][j] = 0;
112 fMask[i][j] = 0xFFFF;
115 for (Int_t i=0; i<5; i++) fMinDevStrip[i] = fMinDev[i] = fCoordY[i] = 0;
117 for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
120 //___________________________________________
121 AliMUONLocalTriggerBoard::AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right) :
122 AliMUONTriggerBoard(right),
123 fMpLocalBoard(right.fMpLocalBoard),
124 fStripX11(right.fStripX11),
125 fStripY11(right.fStripY11),
127 fTrigY(right.fTrigY),
128 fOutput(right.fOutput),
130 fCoinc44(right.fCoinc44)
135 for (Int_t i=0; i<2; i++) {
136 for (Int_t j=0; j<4; j++) {
137 fXY[i][j] = right.fXY[i][j];
138 fXYU[i][j] = right.fXYU[i][j];
139 fXYD[i][j] = right.fXYD[i][j];
141 fMask[i][j] = right.fMask[i][j];
145 for (Int_t i=0; i<2; i++) {
146 fLutLpt[i] = right.fLutLpt[i];
147 fLutHpt[i] = right.fLutHpt[i];
150 for (Int_t i=0; i<5; i++) {
151 fMinDevStrip[i] = right.fMinDevStrip[i];
152 fMinDev[i] = right.fMinDev[i];
153 fCoordY[i] = right.fCoordY[i];
157 //___________________________________________
158 AliMUONLocalTriggerBoard& AliMUONLocalTriggerBoard::operator=(const AliMUONLocalTriggerBoard& right)
160 /// Assigment operator;
166 // base class assignement
167 AliMUONTriggerBoard::operator=(right);
169 fMpLocalBoard = right.fMpLocalBoard;
170 fStripX11 = right.fStripX11;
171 fStripY11 = right.fStripY11;
173 fTrigY = right.fTrigY;
174 fOutput = right.fOutput;
176 fCoinc44 = right.fCoinc44;
178 for (Int_t i=0; i<2; i++) {
179 for (Int_t j=0; j<4; j++) {
180 fXY[i][j] = right.fXY[i][j];
181 fXYU[i][j] = right.fXYU[i][j];
182 fXYD[i][j] = right.fXYD[i][j];
184 fMask[i][j] = right.fMask[i][j];
188 for (Int_t i=0; i<2; i++) {
189 fLutLpt[i] = right.fLutLpt[i];
190 fLutHpt[i] = right.fLutHpt[i];
193 for (Int_t i=0; i<5; i++) {
194 fMinDevStrip[i] = right.fMinDevStrip[i];
195 fMinDev[i] = right.fMinDev[i];
196 fCoordY[i] = right.fCoordY[i];
202 //___________________________________________
203 AliMUONLocalTriggerBoard::~AliMUONLocalTriggerBoard()
209 //___________________________________________
210 Int_t AliMUONLocalTriggerBoard::GetNumber() const
212 /// return board number for notified boards
214 if (fMpLocalBoard->IsNotified())
215 return fMpLocalBoard->GetId();
220 //___________________________________________
221 void AliMUONLocalTriggerBoard::Reset()
225 for (Int_t i=0; i<2; i++)
226 for (Int_t j=0; j<4; j++)
227 fXY[i][j] = fXYU[i][j] = fXYD[i][j] = 0;
232 //___________________________________________
233 void AliMUONLocalTriggerBoard::ResetResponse()
235 /// reset board response
239 for (Int_t i=0; i<5; i++) fMinDevStrip[i] = fMinDev[i] = fCoordY[i] = 0;
248 for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
252 //___________________________________________
253 void AliMUONLocalTriggerBoard::Setbit(Int_t strip, Int_t cathode, Int_t chamber)
255 /// 0 .. LBS : N-1 .. MSB
258 UShort_t xy = fXY[cathode][chamber], mask = fMask[cathode][chamber];
263 Int_t s = strip - int(strip / 16) * 16;
273 fXY[cathode][chamber] = value;
276 //___________________________________________
277 void AliMUONLocalTriggerBoard::SetbitM(Int_t strip, Int_t cathode, Int_t chamber)
279 /// 0 .. LBS : N-1 .. MSB
282 UShort_t xy = fXY[cathode][chamber], mask = fMask[cathode][chamber];
287 w.SetBitNumber(strip);
295 fXY[cathode][chamber] = value;
299 //___________________________________________
300 void AliMUONLocalTriggerBoard::Pattern(const Option_t *option) const
302 /// print bit pattern
306 if (op.Contains("X")) BP("X");
308 if (op.Contains("Y")) BP("Y");
312 //___________________________________________
313 void AliMUONLocalTriggerBoard::BP(const Option_t *option) const
315 /// Respect the old printout format
317 const Int_t kModuleId[126] =
318 {11,12,13,14,15,16,17, // right side of the chamber
319 21,22,23,24,25,26,27,
320 31,32,33,34,35,36,37,
321 41,42,43,44,45,46,47,
322 51,52,53,54,55,56,57,
323 61,62,63,64,65,66,67,
324 71,72,73,74,75,76,77,
325 81,82,83,84,85,86,87,
326 91,92,93,94,95,96,97,
327 -11,-12,-13,-14,-15,-16,-17, // right side of chamber
328 -21,-22,-23,-24,-25,-26,-27,
329 -31,-32,-33,-34,-35,-36,-37,
330 -41,-42,-43,-44,-45,-46,-47,
331 -51,-52,-53,-54,-55,-56,-57,
332 -61,-62,-63,-64,-65,-66,-67,
333 -71,-72,-73,-74,-75,-76,-77,
334 -81,-82,-83,-84,-85,-86,-87,
335 -91,-92,-93,-94,-95,-96,-97};
337 const Int_t kNstripY[126]=
338 { 8, 8, 8, 8, 8, 8,16, // right side of the chamber
340 16,16,16,16,16, 8,16,
341 16,16,16,16,16, 8,16,
343 16,16,16,16,16, 8,16,
344 16,16,16,16,16, 8,16,
347 8, 8, 8, 8, 8, 8,16, // left side of the chamber
349 16,16,16,16,16, 8,16,
350 16,16,16,16,16, 8,16,
352 16,16,16,16,16, 8,16,
353 16,16,16,16,16, 8,16,
355 8, 8, 8, 8, 8, 8,16};
359 TString nn = GetName();
361 if (op.Contains("X"))
363 printf("-------- TRIGGER INPUT ---------\n");
364 printf("--- warning: switchs not activated at this level ---\n");
365 printf("===============================================================\n");
366 printf(" 5432109876543210");
368 const char *x[4] = {"XMC11","XMC12","XMC21","XMC22"};
369 const char *s[4] = {" ",
374 for (Int_t ch=0; ch<4; ch++)
376 printf("\n %s%s", x[ch], s[ch]);
378 UShort_t xy = fXY[0][ch];
380 TBits w(16); w.Set(16,&xy);
385 UShort_t xyd = fXYD[0][ch], xyu = fXYU[0][ch];
386 TBits dw(16), uw(16); dw.Set(16,&xyd); uw.Set(16,&xyu);
390 for (Int_t i=0;i<16;i++) ew[i+8] = w[i];
392 for (Int_t i=0;i<8;i++)
394 ew[i] = dw[i+8]; // 8 MSB
403 printf("10987654321098765432109876543210\n");
406 if (op.Contains("Y"))
408 printf("---------------------------------------------------------------\n");
411 /* OLD NUMBERING STYLE */
413 Int_t idCircuit = 0, absidModule = 0;
415 if (!(nn.Contains("Int")))
417 idCircuit = fgkCircuitId[GetI()];
418 absidModule = TMath::Abs(Int_t(idCircuit/10));
423 for (Int_t i=0; i<63; i++)
425 if (kModuleId[i]==absidModule)
432 Int_t nStrip = kNstripY[iModule];
433 for (Int_t istrip=nStrip-1; istrip>=0; istrip--) {
434 if (istrip>9) printf("%i",istrip-10*Int_t(istrip/10));
435 if (istrip<10) printf("%i",istrip);
445 TBits v11(8); v11.Set(8,&xyval);
450 TBits v12(8); v12.Set(8,&xyval);
455 TBits v21(8); v21.Set(8,&xyval);
460 TBits v22(8); v22.Set(8,&xyval);
467 TBits v11(16); v11.Set(16,&xyval);
472 TBits v12(16); v12.Set(16,&xyval);
477 TBits v21(16); v21.Set(16,&xyval);
482 TBits v22(16); v22.Set(16,&xyval);
488 printf("---------------------------------------------------------------");
489 printf("\n upper part of circuit %i",idCircuit);
492 TBits wu21(16); wu21.Set(16,&xyval);
496 TBits wu22(16); wu22.Set(16,&xyval);
498 printf("\n lower part of circuit %i",idCircuit);
501 TBits wl21(16); wl21.Set(16,&xyval);
505 TBits wl22(16); wl22.Set(16,&xyval);
508 printf("===============================================================\n");
512 //___________________________________________
513 void AliMUONLocalTriggerBoard::TrigX(Int_t ch1q[16], Int_t ch2q[16], Int_t ch3q[32], Int_t ch4q[32])
515 /// note : coinc44 = flag 0 or 1 (0 coincidence -> 3/4, 1 coincidence -> 4/4) \n
516 ///--------------------------------------------------------- \n
517 /// step # 1 : declustering, reduction DS, calculate sgle & dble \n
518 ///---------------------------------------------------------
519 Int_t ch1e[19], ch2e[20], ch3e[35], ch4e[36];
520 Int_t sgleHit1[31], sgleHit2[63];
521 Int_t dbleHit1[31], dbleHit2[63];
527 for (i=0; i<31; i++) {
531 for (i=0; i<63; i++) {
536 //--- inititialize che using chq
537 //--- switch zero_down, zero_middle & zero_up added 30/05/07
538 //--- fSwitch[7/8/9] = zero_down/zero_middle/zero_up
539 for (i=0; i<19; i++) {
540 if (i<1||i>16) ch1e[i]=0;
541 else ch1e[i]=ch1q[i-1];
543 for (i=0; i<20; i++) {
544 if (i<2||i>17) ch2e[i]=0;
545 else ch2e[i]=ch2q[i-2];
547 for (i=0; i<35; i++) {
548 if (i<1||i>32) ch3e[i]=0;
549 else if (i>=1 && i<=8) ch3e[i]=ch3q[i-1]&!GetSwitch(7);
550 else if (i>=9 && i<=24) ch3e[i]=ch3q[i-1]&!GetSwitch(8);
551 else if (i>=25 && i<=32) ch3e[i]=ch3q[i-1]&!GetSwitch(9);
553 for (i=0; i<36; i++) {
554 if (i<2||i>33) ch4e[i]=0;
555 else if (i>=2 && i<=9) ch4e[i]=ch4q[i-2]&!GetSwitch(7);
556 else if (i>=10 && i<=25) ch4e[i]=ch4q[i-2]&!GetSwitch(8);
557 else if (i>=26 && i<=33) ch4e[i]=ch4q[i-2]&!GetSwitch(9);
560 //--- calculate dble & sgle first station
561 for (i=0; i<=15; i++) {
562 sgleHit1[2*i] = (!ch1e[i+1]|(ch1e[i]^ch1e[i+2])) &
563 (!ch2e[i+2] | (ch2e[i+1]^ch2e[i+3]));
565 dbleHit1[2*i] = ch1e[i+1]&!(ch1e[i+2]^ch1e[i]) &
566 (ch2e[i+2] | (!ch2e[i]&ch2e[i+1]) | (ch2e[i+3]&!ch2e[i+4]));
569 for (i=0; i<=14; i++) {
570 sgleHit1[2*i+1] = (!ch1e[i+1]|!ch1e[i+2]|(ch1e[i]^ch1e[i+3])) &
571 (!ch2e[i+2] | !ch2e[i+3] | (ch2e[i+1]^ch2e[i+4]));
572 dbleHit1[2*i+1] = ch1e[i+1]&ch1e[i+2]&!(ch1e[i]^ch1e[i+3]) &
573 ((ch2e[i+2]&(!ch2e[i+1]|!ch2e[i])) |
574 (ch2e[i+3]&(ch2e[i+2]|!ch2e[i+4]|!ch2e[i+5])));
577 //--- calculate dble & sgle second station
578 for (i=0; i<=31; i++) {
579 sgleHit2[2*i] = (!ch3e[i+1]|(ch3e[i]^ch3e[i+2])) &
580 (!ch4e[i+2] | (ch4e[i+1]^ch4e[i+3]));
581 dbleHit2[2*i] = ch3e[i+1]&!(ch3e[i+2]^ch3e[i]) &
582 (ch4e[i+2] | (!ch4e[i]&ch4e[i+1]) | (ch4e[i+3]&!ch4e[i+4]));
585 for (i=0; i<=30; i++) {
586 sgleHit2[2*i+1] = (!ch3e[i+1]|!ch3e[i+2]|(ch3e[i]^ch3e[i+3])) &
587 (!ch4e[i+2] | !ch4e[i+3] | (ch4e[i+1]^ch4e[i+4]));
588 dbleHit2[2*i+1] = ch3e[i+1]&ch3e[i+2]&!(ch3e[i]^ch3e[i+3]) &
589 ((ch4e[i+2]&(!ch4e[i+1]|!ch4e[i])) |
590 (ch4e[i+3]&((ch4e[i+2]|!ch4e[i+4])|!ch4e[i+5])));
594 if(AliDebugLevel()==3||AliDebugLevel()==5) {
595 printf("===============================================================\n");
596 printf(" X plane after sgle and dble \n");
597 printf(" 0987654321098765432109876543210");
599 for (istrip=30; istrip>=0; istrip--) printf("%i",(!sgleHit1[istrip]));
601 for (istrip=30; istrip>=0; istrip--) printf("%i",dbleHit1[istrip]);
603 for (istrip=62; istrip>=0; istrip--) printf("%i",(!sgleHit2[istrip]));
605 for (istrip=62; istrip>=0; istrip--) printf("%i",dbleHit2[istrip]);
606 printf("\n 210987654321098765432109876543210987654321098765432109876543210\n");
609 //---------------------------------------------------------
610 // step # 2 : coincidence 3/4
611 //---------------------------------------------------------
612 Int_t rearImage[31][31];
613 for (i=0; i<31; i++) {
614 for (j=0; j<31; j++) {
619 Int_t notOr1=!dbleHit1[30] & !dbleHit1[29] & !dbleHit1[28] & !dbleHit1[27] &
620 !dbleHit1[26] & !dbleHit1[25] & !dbleHit1[24] & !dbleHit1[23] &
621 !dbleHit1[22] & !dbleHit1[21] & !dbleHit1[20] & !dbleHit1[19] &
622 !dbleHit1[18] & !dbleHit1[17] & !dbleHit1[16] & !dbleHit1[15] &
623 !dbleHit1[14] & !dbleHit1[13] & !dbleHit1[12] & !dbleHit1[11] &
624 !dbleHit1[10] & !dbleHit1[9] & !dbleHit1[8] & !dbleHit1[7] &
625 !dbleHit1[6] & !dbleHit1[5] & !dbleHit1[4] & !dbleHit1[3] &
626 !dbleHit1[2] & !dbleHit1[1] & !dbleHit1[0] & !fCoinc44;
628 Int_t notOr2= !dbleHit2[62] & !dbleHit2[61] & !dbleHit2[60] & !dbleHit2[59] &
629 !dbleHit2[58] & !dbleHit2[57] & !dbleHit2[56] & !dbleHit2[55] &
630 !dbleHit2[54] & !dbleHit2[53] & !dbleHit2[52] & !dbleHit2[51] &
631 !dbleHit2[50] & !dbleHit2[49] & !dbleHit2[48] & !dbleHit2[47] &
632 !dbleHit2[46] & !dbleHit2[45] & !dbleHit2[44] & !dbleHit2[43] &
633 !dbleHit2[42] & !dbleHit2[41] & !dbleHit2[40] & !dbleHit2[39] &
634 !dbleHit2[38] & !dbleHit2[37] & !dbleHit2[36] & !dbleHit2[35] &
635 !dbleHit2[34] & !dbleHit2[33] & !dbleHit2[32] & !dbleHit2[31] &
636 !dbleHit2[30] & !dbleHit2[29] & !dbleHit2[28] & !dbleHit2[27] &
637 !dbleHit2[26] & !dbleHit2[25] & !dbleHit2[24] & !dbleHit2[23] &
638 !dbleHit2[22] & !dbleHit2[21] & !dbleHit2[20] & !dbleHit2[19] &
639 !dbleHit2[18] & !dbleHit2[17] & !dbleHit2[16] & !dbleHit2[15] &
640 !dbleHit2[14] & !dbleHit2[13] & !dbleHit2[12] & !dbleHit2[11] &
641 !dbleHit2[10] & !dbleHit2[9] & !dbleHit2[8] & !dbleHit2[7] &
642 !dbleHit2[6] & !dbleHit2[5] & !dbleHit2[4] & !dbleHit2[3] &
643 !dbleHit2[2] & !dbleHit2[1] & !dbleHit2[0] & !fCoinc44;
646 for (i=0; i<31; i++) {
647 sgleHit1[i] = !sgleHit1[i]¬Or1;
649 for (i=0; i<63; i++) {
650 sgleHit2[i] = !sgleHit2[i]¬Or2;
654 for (i=0; i<31; i++){
655 Int_t tmpSgleHit2[31];
656 Int_t tmpDbleHit2[31];
657 for (j=0; j<31; j++){
658 tmpSgleHit2[j] = sgleHit2[i+j+1];
659 tmpDbleHit2[j] = dbleHit2[i+j+1];
662 for (Int_t k=0; k<31; k++) {
663 rearImage[i][k]=(sgleHit1[i]&tmpDbleHit2[k])|
664 (dbleHit1[i]&(tmpSgleHit2[k]|tmpDbleHit2[k]));
669 if(AliDebugLevel()==3||AliDebugLevel()==5) {
670 printf("===============================================================\n");
671 for (i=30; i>=0; i--) {
673 for (istrip=31; istrip>=0; istrip--) printf("%i",rearImage[i][istrip]);
678 //---------------------------------------------------------
679 // step # 3 : calculate deviation
680 //---------------------------------------------------------
682 for (i=0; i<31; i++) {
683 for (j=0; j<6; j++) {
688 for (i=0; i<31; i++){
689 Int_t leftDev[5], rightDev[5];
690 Int_t orL1, andL1, andL2, orR1, orR2, andR1, andR2, andR3;
692 // calculate Left deviation
693 orL1=rearImage[i][16]|rearImage[i][18]|rearImage[i][20]|rearImage[i][22];
694 andL1=!rearImage[i][17]&!rearImage[i][19]&!rearImage[i][21] & !orL1;
695 andL2=!rearImage[i][23]&!rearImage[i][24]&!rearImage[i][25]&!rearImage[i][26];
697 leftDev[0] = (rearImage[i][16]|!rearImage[i][17]) &
698 (rearImage[i][16]|rearImage[i][18]|(!rearImage[i][19]&
699 (rearImage[i][20]|!rearImage[i][21]))) &
700 (orL1|(!rearImage[i][23]&(rearImage[i][24]|!rearImage[i][25]))) &
701 (orL1|rearImage[i][24]|rearImage[i][26]|(!rearImage[i][27]&
702 (rearImage[i][28]|!rearImage[i][29])));
704 leftDev[1] = !rearImage[i][16] &
705 !(!rearImage[i][17]&!rearImage[i][18]&!rearImage[i][21]&!rearImage[i][22] &
706 (!rearImage[i][25]&!rearImage[i][26]&(rearImage[i][27]|rearImage[i][28]))) &
707 (rearImage[i][17]|rearImage[i][18] | (!rearImage[i][19]&!rearImage[i][20])) &
708 (rearImage[i][17]|rearImage[i][18]|rearImage[i][21]|rearImage[i][22] |
709 (!rearImage[i][23]&!rearImage[i][24]));
711 leftDev[2] = (!rearImage[i][16]&!rearImage[i][17]&!rearImage[i][18]) &
712 (rearImage[i][19]|rearImage[i][20]|rearImage[i][21]|rearImage[i][22] | andL2);
717 !rearImage[i][27]&!rearImage[i][28]&!rearImage[i][29]&!rearImage[i][30] &
720 // calculate Right deviation
721 orR1=rearImage[i][8]|rearImage[i][10]|rearImage[i][12]|rearImage[i][14];
722 orR2=rearImage[i][8]|rearImage[i][9]|rearImage[i][10]|rearImage[i][11];
723 andR1=!rearImage[i][12]&!rearImage[i][13]&!rearImage[i][14]&!rearImage[i][15];
725 !rearImage[i][8]&!rearImage[i][9]&!rearImage[i][10]&!rearImage[i][11] & andR1;
726 andR3=!rearImage[i][4]&!rearImage[i][5]&!rearImage[i][6]&!rearImage[i][7];
728 rightDev[0] = !rearImage[i][15]&(rearImage[i][14]|!rearImage[i][13]) &
729 ((rearImage[i][12]|rearImage[i][14]|(!rearImage[i][11]&
730 (rearImage[i][10]|!rearImage[i][9]))) &
731 ((orR1|(!rearImage[i][7]&(rearImage[i][6]|!rearImage[i][5]))) &
732 (orR1|rearImage[i][4]|rearImage[i][6]|(!rearImage[i][3]&(rearImage[i][2]|
733 !rearImage[i][1])))));
735 rightDev[1] = !rearImage[i][15]&!rearImage[i][14] &
736 !(!rearImage[i][4]&!rearImage[i][5]&!rearImage[i][8]&!rearImage[i][9] &
737 (!rearImage[i][12]&!rearImage[i][13]&(rearImage[i][2]|rearImage[i][3]))) &
738 (rearImage[i][12]|rearImage[i][13] | (!rearImage[i][10]&!rearImage[i][11])) &
739 (rearImage[i][8]|rearImage[i][9]|rearImage[i][12]|rearImage[i][13] |
740 (!rearImage[i][6]&!rearImage[i][7]));
742 rightDev[2] = andR1 & (orR2 | andR3);
745 !rearImage[i][0]&!rearImage[i][1]&!rearImage[i][2]&!rearImage[i][3] &
748 // compare Left & Right deviations
749 Int_t tmpLeftDev=0, tmpRightDev=0;
751 tmpLeftDev = tmpLeftDev + Int_t(leftDev[j]<<j);
752 tmpRightDev = tmpRightDev + Int_t(rightDev[j]<<j);
755 // assign mimimum deviation do dev[][]
756 if (tmpLeftDev < tmpRightDev ){
757 for (j=0; j<5; j++){ dev[i][j]=leftDev[j];}
760 for (j=0; j<5; j++){ dev[i][j]=rightDev[j];}
766 if(AliDebugLevel()==3||AliDebugLevel()==5) {
767 printf("===============================================================\n");
768 for (i=30; i>=0; i--) {
770 for (istrip=5; istrip>=0; istrip--) printf("%i",dev[i][istrip]);
775 //---------------------------------------------------------
776 // step # 4 : sort deviation
777 //---------------------------------------------------------
778 Int_t bga1[16], bga2[8], bga3[4], bga4[2], bga5;
779 Int_t tmpbga1[16][6], tmpbga2[8][6], tmpbga3[4][6], tmpbga4[2][6], tmpbga5[6];
780 Int_t tmpMax[6]={1,1,1,1,1,0};
782 for (i=0; i<15; i++) {
783 Sort2x5(dev[2*i],dev[2*i+1],tmpbga1[i],bga1[i]);
785 Sort2x5(dev[30],tmpMax,tmpbga1[15],bga1[15]);
788 if(AliDebugLevel()==3||AliDebugLevel()==5) {
789 printf("===============================================================\n");
790 printf(" sorting : 1st level \n");
791 for (i=15; i>=0; i--) {
792 printf("\t %i \t",bga1[i]);
793 for (j=5; j>=0; j--) printf("%i",tmpbga1[i][j]);
798 for (i=0; i<8; i++) {
799 Sort2x5(tmpbga1[2*i],tmpbga1[2*i+1],tmpbga2[i],bga2[i]);
803 if(AliDebugLevel()==3||AliDebugLevel()==5) {
804 printf("===============================================================\n");
805 printf(" sorting : 2nd level \n");
806 for (i=7; i>=0; i--) {
807 printf("\t %i \t",bga2[i]);
808 for (j=5; j>=0; j--) printf("%i",tmpbga1[i][j]);
813 for (i=0; i<4; i++) {
814 Sort2x5(tmpbga2[2*i],tmpbga2[2*i+1],tmpbga3[i],bga3[i]);
818 if(AliDebugLevel()==3||AliDebugLevel()==5) {
819 printf("===============================================================\n");
820 printf(" sorting : 3rd level \n");
821 for (i=3; i>=0; i--) {
822 printf("\t %i \t",bga3[i]);
823 for (j=5; j>=0; j--) printf("%i",tmpbga3[i][j]);
828 for (i=0; i<2; i++) {
829 Sort2x5(tmpbga3[2*i],tmpbga3[2*i+1],tmpbga4[i],bga4[i]);
833 if(AliDebugLevel()==3||AliDebugLevel()==5) {
834 printf("===============================================================\n");
835 printf(" sorting : 4th level \n");
836 for (i=1; i>=0; i--) {
837 printf("\t %i \t",bga4[i]);
838 for (j=5; j>=0; j--) printf("%i",tmpbga4[i][j]);
843 Sort2x5(tmpbga4[0],tmpbga4[1],tmpbga5,bga5);
845 // coding from 6 to 5 bits
846 fMinDev[4] = tmpbga5[5] | tmpbga5[4];
847 for (i=0; i<4; i++) {
848 fMinDev[i]=tmpbga5[i] & !tmpbga5[4];
851 // find address of strip with minimum deviation
852 fMinDevStrip[4]=bga5;
853 if (bga5<=1) fMinDevStrip[3]=bga4[bga5];
855 Int_t tmpAd=fMinDevStrip[3]+fMinDevStrip[4]*2;
856 if (tmpAd<=3) fMinDevStrip[2]=bga3[tmpAd];
858 tmpAd=fMinDevStrip[2]+fMinDevStrip[3]*2+fMinDevStrip[4]*4;
859 if (tmpAd<=7) fMinDevStrip[1]=bga2[tmpAd];
861 tmpAd=fMinDevStrip[1]+fMinDevStrip[2]*2+fMinDevStrip[3]*4+fMinDevStrip[4]*8;
862 if (tmpAd<=15) fMinDevStrip[0]=bga1[tmpAd];
864 if(AliDebugLevel()==3||AliDebugLevel()==5) {
865 printf("===============================================================\n");
866 printf("minDevStrip = ");
867 for (i=4; i>=0; i--) printf("%i",fMinDevStrip[i]);
868 printf(" minDev = ");
869 for (i=4; i>=0; i--) printf("%i",fMinDev[i]);
871 printf("===============================================================\n");
876 //___________________________________________
877 void AliMUONLocalTriggerBoard::Sort2x5(Int_t dev1[6], Int_t dev2[6],
878 Int_t minDev[6], Int_t &dev1GTdev2)
880 /// returns minimun between dev1 and dev2
881 Int_t tmpDev1=0, tmpDev2=0;
883 for (Int_t j=0; j<5; j++)
885 tmpDev1 += Int_t(dev1[j]<<j);
886 tmpDev2 += Int_t(dev2[j]<<j);
889 if (tmpDev1<=tmpDev2)
891 for (Int_t j=0; j<=5; j++) minDev[j]=dev1[j];
896 for (Int_t j=0; j<=5; j++) minDev[j]=dev2[j];
901 //___________________________________________
902 void AliMUONLocalTriggerBoard::TrigY(Int_t y1[16], Int_t y2[16], Int_t y3[16], Int_t y4[16],
903 Int_t y3u[16], Int_t y3d[16], Int_t y4u[16], Int_t y4d[16])
905 /// note : resMid = 1 -> cancel \n
906 ///---------------------------------------------------------\n
907 /// step # 1 : prehandling Y \n
908 ///---------------------------------------------------------
914 y3[i]=y3[i]&!GetSwitch(8);
915 y4[i]=y4[i]&!GetSwitch(8);
918 // 10/29/04 fZeroAllYLSB added
919 // for (i=0; i<8; i++)
921 // y1[i] = y1[i]&!fSwitch[6];
922 // y2[i] = y2[i]&!fSwitch[6];
923 // y3[i] = y3[i]&!fSwitch[6];
924 // y4[i] = y4[i]&!fSwitch[6];
927 Int_t ch1[16], ch2[16], ch3[16], ch4[16];
929 Int_t tmpy3to16[16], tmpy4to16[16];
930 Int_t tmpy3uto16[16], tmpy3dto16[16], tmpy4uto16[16], tmpy4dto16[16];
932 ch1[2*i] = (y1[i]&GetSwitch(1)) | (y1[2*i]&!GetSwitch(1));
933 ch1[2*i+1] = (y1[i]&GetSwitch(1)) | (y1[2*i+1]&!GetSwitch(1));
935 ch2[2*i] = (y2[i]&GetSwitch(1)) | (y2[2*i]&!GetSwitch(1));
936 ch2[2*i+1] = (y2[i]&GetSwitch(1)) | (y2[2*i+1]&!GetSwitch(1));
938 tmpy3to16[2*i ] = (y3[i]&GetSwitch(1)) | (y3[2*i ]&!GetSwitch(1));
939 tmpy3to16[2*i+1] = (y3[i]&GetSwitch(1)) | (y3[2*i+1]&!GetSwitch(1));
941 tmpy4to16[2*i ] = (y4[i]&GetSwitch(1)) | (y4[2*i ]&!GetSwitch(1));
942 tmpy4to16[2*i+1] = (y4[i]&GetSwitch(1)) | (y4[2*i+1]&!GetSwitch(1));
944 tmpy3uto16[2*i ] = (y3u[i]&GetSwitch(2)) | (y3u[2*i ]&!GetSwitch(2));
945 tmpy3uto16[2*i+1] = (y3u[i]&GetSwitch(2)) | (y3u[2*i+1]&!GetSwitch(2));
947 tmpy4uto16[2*i ] = (y4u[i]&GetSwitch(2)) | (y4u[2*i ]&!GetSwitch(2));
948 tmpy4uto16[2*i+1] = (y4u[i]&GetSwitch(2)) | (y4u[2*i+1]&!GetSwitch(2));
950 tmpy3dto16[2*i ] = (y3d[i]&GetSwitch(0)) | (y3d[2*i ]&!GetSwitch(0));
951 tmpy3dto16[2*i+1] = (y3d[i]&GetSwitch(0)) | (y3d[2*i+1]&!GetSwitch(0));
953 tmpy4dto16[2*i ] = (y4d[i]&GetSwitch(0)) | (y4d[2*i ]&!GetSwitch(0));
954 tmpy4dto16[2*i+1] = (y4d[i]&GetSwitch(0)) | (y4d[2*i+1]&!GetSwitch(0));
957 for (i=0; i<16; i++) ch3[i] = ch4[i] = 0;
959 if (GetSwitch(3)==0&&GetSwitch(4)==0){
960 for (i=0; i<16; i++){
961 ch3[i] = tmpy3to16[i];
962 ch4[i] = tmpy4to16[i];
965 if (GetSwitch(3)==0&&GetSwitch(4)==1){
966 for (i=0; i<16; i++){
967 ch3[i] = tmpy3dto16[i]|tmpy3to16[i];
968 ch4[i] = tmpy4dto16[i]|tmpy4to16[i];
971 if (GetSwitch(3)==1&&GetSwitch(4)==0){
972 for (i=0; i<16; i++){
973 ch3[i] = tmpy3uto16[i]|tmpy3to16[i];
974 ch4[i] = tmpy4uto16[i]|tmpy4to16[i];
977 if (GetSwitch(3)==1&&GetSwitch(4)==1){
978 for (i=0; i<16; i++){
979 ch3[i] = tmpy3dto16[i]|tmpy3to16[i]|tmpy3uto16[i];
980 ch4[i] = tmpy4dto16[i]|tmpy4to16[i]|tmpy4uto16[i];
985 if(AliDebugLevel()==4||AliDebugLevel()==5) {
986 printf("===============================================================\n");
987 printf(" Y plane after PreHandling x2m x2u x2d orMud %i %i %i %i %i \n",
988 GetSwitch(1),GetSwitch(2), GetSwitch(0),GetSwitch(3),GetSwitch(4));
990 for (istrip=15; istrip>=0; istrip--) {
991 if (istrip>9) printf("%i",istrip-10*Int_t(istrip/10));
992 if (istrip<10) printf("%i",istrip);
995 for (istrip=15; istrip>=0; istrip--) printf("%i",ch1[istrip]);
997 for (istrip=15; istrip>=0; istrip--) printf("%i",ch2[istrip]);
999 for (istrip=15; istrip>=0; istrip--) printf("%i",ch3[istrip]);
1000 printf("\n YMC22 ");
1001 for (istrip=15; istrip>=0; istrip--) printf("%i",ch4[istrip]);
1006 //---------------------------------------------------------
1007 // step # 2 : calculate sgle and dble, apply DS reduction
1008 //---------------------------------------------------------
1009 Int_t sgle1[16], dble1[16];
1010 Int_t sgle2[16], dble2[16];
1012 // Calculate simple and double hits
1013 for (i=0; i<16; i++) {
1014 dble1[i] = ch1[i] & ch2[i];
1015 dble2[i] = ch3[i] & ch4[i];
1017 sgle1[i] = (ch1[i]|ch2[i]);
1018 sgle2[i] = (ch3[i]|ch4[i]);
1022 if(AliDebugLevel()==4||AliDebugLevel()==5) {
1023 printf("===============================================================\n");
1024 printf(" Y plane after sgle dble \n");
1026 for (istrip=15; istrip>=0; istrip--) {
1027 if (istrip>9) printf("%i",istrip-10*Int_t(istrip/10));
1028 if (istrip<10) printf("%i",istrip);
1030 printf("\n SGLE1 ");
1031 for (istrip=15; istrip>=0; istrip--) printf("%i",sgle1[istrip]);
1032 printf("\n DBLE1 ");
1033 for (istrip=15; istrip>=0; istrip--) printf("%i",dble1[istrip]);
1034 printf("\n SGLE2 ");
1035 for (istrip=15; istrip>=0; istrip--) printf("%i",sgle2[istrip]);
1036 printf("\n DBLE2 ");
1037 for (istrip=15; istrip>=0; istrip--) printf("%i",dble2[istrip]);
1043 Int_t notOr1, notOr2;
1045 notOr1=!dble1[15] & !dble1[14] & !dble1[13] & !dble1[12] &
1046 !dble1[11] & !dble1[10] & !dble1[9] & !dble1[8] &
1047 !dble1[7] & !dble1[6] & !dble1[5] & !dble1[4] &
1048 !dble1[3] & !dble1[2] & !dble1[1] & !dble1[0];
1050 notOr2=!dble2[15] & !dble2[14] & !dble2[13] & !dble2[12] &
1051 !dble2[11] & !dble2[10] & !dble2[9] & !dble2[8] &
1052 !dble2[7] & !dble2[6] & !dble2[5] & !dble2[4] &
1053 !dble2[3] & !dble2[2] & !dble2[1] & !dble2[0];
1055 for (i=0; i<16; i++) {
1056 sgle1[i] = sgle1[i] & notOr1 & !fCoinc44;
1057 sgle2[i] = sgle2[i] & notOr2 & !fCoinc44;
1060 //---------------------------------------------------------
1061 // step # 3 : 3/4 coincidence
1062 //---------------------------------------------------------
1063 Int_t frontImage[16];
1065 for (i=1; i<15; i++) {
1066 frontImage[i] = ((dble1[i] | sgle1[i]) &
1067 (dble2[i+1] | dble2[i] | dble2[i-1])) |
1068 (dble1[i] & (sgle2[i+1] | sgle2[i] | sgle2[i-1]));
1070 frontImage[0] = ((dble1[0] | sgle1[0]) &
1071 (dble2[1] | dble2[0])) | (dble1[0] & (sgle2[1] | sgle2[0]));
1073 frontImage[15] = ((dble1[15] | sgle1[15]) &
1074 (dble2[15] | dble2[14])) | (dble1[15] & (sgle2[15] | sgle2[14]));
1078 if(AliDebugLevel()==4||AliDebugLevel()==5) {
1079 printf("===============================================================\n");
1080 printf(" Y plane frontImage\n");
1082 for (istrip=15; istrip>=0; istrip--) {
1083 if (istrip>9) printf("%i",istrip-10*Int_t(istrip/10));
1084 if (istrip<10) printf("%i",istrip);
1087 for (istrip=15; istrip>=0; istrip--) printf("%i",frontImage[istrip]);
1092 //---------------------------------------------------------
1093 // step # 4 : Y position
1094 //---------------------------------------------------------
1095 Int_t or1, or2, and1, and2, and3;
1097 or1 = frontImage[7]|frontImage[5]|frontImage[3]|frontImage[1];
1098 or2 = frontImage[7]|frontImage[6]|frontImage[5]|frontImage[4];
1099 and1 = !frontImage[3]&!frontImage[2]&!frontImage[1]&!frontImage[0];
1100 and2 = !frontImage[7]&!frontImage[6]&!frontImage[5]&!frontImage[4] & and1;
1101 and3 = !frontImage[11]&!frontImage[10]&!frontImage[9]&!frontImage[8];
1103 fCoordY[0] = !frontImage[0]&(frontImage[1]|!frontImage[2]) &
1104 (frontImage[3]|frontImage[1]|(!frontImage[4]&(frontImage[5]|!frontImage[6]))) &
1105 (or1|(!frontImage[8]&(frontImage[9]|!frontImage[10]))) &
1106 (or1|frontImage[11]|frontImage[9]|(!frontImage[12]&(frontImage[13]|!frontImage[14])));
1108 fCoordY[1] = !frontImage[0]&!frontImage[1] &
1109 !(!frontImage[11]&!frontImage[10]&!frontImage[7]&!frontImage[6] &
1110 !frontImage[3]&!frontImage[2]&(frontImage[13]|frontImage[12])) &
1111 (frontImage[3]|frontImage[2] | (!frontImage[5]&!frontImage[4])) &
1112 (frontImage[7]|frontImage[6]|frontImage[3]|frontImage[2] |
1113 (!frontImage[9]&!frontImage[8]));
1115 fCoordY[2] = and1 & (or2 | and3);
1119 fCoordY[4] = !frontImage[15]&!frontImage[14]&!frontImage[13]&!frontImage[12] &
1123 //___________________________________________
1124 void AliMUONLocalTriggerBoard::LocalTrigger()
1126 /// L0 trigger after LUT
1131 Bool_t xOutput = IsTrigX();
1132 Bool_t yOutput = IsTrigY();
1135 for (Int_t i=0; i<5; i++) iStripX += static_cast<int>( fMinDevStrip[i] << i );
1136 for (Int_t i=0; i<4; i++) deviation += static_cast<int>( fMinDev[i] << i );
1138 fStripX11 = iStripX;
1141 for (Int_t i=0; i<4; i++) iStripY += static_cast<int>( fCoordY[i] << i );
1142 fStripY11 = iStripY;
1143 fTrigY = fCoordY[4];
1146 // cout << " Local Trigger " << " " << fNumber << " " <<
1147 // xOutput << " " << yOutput << " " << fDev << " " << fStripX11 << " " <<
1148 // fTrigY << " " << fStripY11 << "\n";
1150 if (xOutput && yOutput){ // trigger in X and Y
1154 if ( !fMinDev[4] && deviation ) sign=-1;
1155 if ( !fMinDev[4] && !deviation ) sign= 0;
1156 if ( fMinDev[4] == 1 ) sign=+1;
1160 // calculate deviation in [0;+30]
1163 // GET LUT OUTPUT FOR icirc/istripX1/deviation/istripY
1164 fLUT->GetLutOutput(GetNumber(), fStripX11, deviation, fStripY11, fLutLpt, fLutHpt);
1167 fResponse = fLutLpt[0] +
1168 static_cast<int>(fLutLpt[1]<<1) +
1169 static_cast<int>(fLutHpt[0]<<2) +
1170 static_cast<int>(fLutHpt[1]<<3);
1174 //___________________________________________
1175 Int_t AliMUONLocalTriggerBoard::GetI() const
1180 const Int_t kMaxfields = 2; char **fields = new char*[kMaxfields];
1182 for (Int_t i = 0; i < kMaxfields; i++)
1183 fields[i] = new char[1];
1185 char s[100]; strncpy(s, GetName(), 99);
1189 for (char *token = strtok(s, "B");
1191 token = strtok(NULL, " "))
1193 delete [] fields[numlines];
1194 fields[numlines] = new char[strlen(token)+1];
1195 strcpy(fields[numlines++], token);
1198 TString l(fields[0]);
1202 Int_t lL = atoi(&l[4]), cC = atoi(&l[2]), sS = (copy=='R') ? +1 : -1;
1204 const char *b[4] = {"12", "34", "56", "78"};
1208 for (Int_t i=0; i<4; i++) if (!strcmp(fields[1],b[i])) {ib = i; break;} ib++;
1211 lL -= 9; lL = abs(lL); lL++;
1213 Int_t code = 100 * lL + 10 * cC + ib;
1219 for (Int_t i=0; i<234; i++) if (fgkCircuitId[i] == code) {ic = i; break;}
1226 //___________________________________________
1227 void AliMUONLocalTriggerBoard::Mask(Int_t index, UShort_t mask)
1231 if ( index >= 0 && index < 2*4 )
1239 AliError(Form("Index %d out of bounds (max %d)",index,8));
1243 //___________________________________________
1244 void AliMUONLocalTriggerBoard::Scan(Option_t *option) const
1248 TString op = option;
1250 if (op.Contains("CONF")) Conf();
1252 if (op.Contains("BITP")) Pattern();
1254 if (op.Contains("RESPI")) Resp("I");
1256 if (op.Contains("RESPF")) Resp("F");
1258 if (op.Contains("RESPO")) Resp("O");
1260 if (op.Contains("ALL"))
1269 //___________________________________________
1270 void AliMUONLocalTriggerBoard::Conf() const
1274 cout << "Switch(" << GetName() << ")"
1275 << " x2d = " << GetSwitch(0)
1276 << " x2m = " << GetSwitch(1)
1277 << " x2u = " << GetSwitch(2)
1278 << " OR[0] = " << GetSwitch(3)
1279 << " OR[1] = " << GetSwitch(4)
1280 << " EN-Y = " << GetSwitch(5)
1281 << " ZERO-ALLY-LSB = " << GetSwitch(6)
1282 << " ZERO-down = " << GetSwitch(7)
1283 << " ZERO-middle = " << GetSwitch(8)
1284 << " ZERO-up = " << GetSwitch(9)
1285 << " trans. conn. " << GetTC()
1286 << " Slot = " << fSlot
1290 //___________________________________________
1291 void AliMUONLocalTriggerBoard::Resp(Option_t *option) const
1295 TString op = option;
1297 if (op.Contains("I"))
1299 // print Local trigger output before the LuT step
1300 printf("===============================================================\n");
1301 printf("-------- TRIGGER OUTPUT --------\n");
1302 printf("minDevStrip = ");
1303 for (Int_t i=4; i>=0; i--) printf("%i",fMinDevStrip[i]);
1304 printf(" minDev = ");
1305 for (Int_t i=4; i>=0; i--) printf("%i",fMinDev[i]);
1306 printf(" coordY = ");
1307 for (Int_t i=4; i>=0; i--) printf("%i",fCoordY[i]);
1310 if (op.Contains("O")){
1311 printf("-- Output --\n");
1312 printf("Coinc44 %i\n", fCoinc44);
1313 printf("StripX11 %i StripY11 %i Dev %i TrigY %i\n", fStripX11, fStripY11, fDev, fTrigY);
1314 printf("LutLpt %i %i LutHpt %i %i\n", fLutLpt[0], fLutLpt[1], fLutHpt[0], fLutHpt[1]);
1315 printf("Response %i\n", fOutput);
1320 //___________________________________________
1321 void AliMUONLocalTriggerBoard::Response()
1327 for (Int_t i=4; i>=0; i--) fCoordY[i] = 1;
1328 return; // Do nothing if strip pattern is null
1331 Int_t xX1[16], xX2[16], xXX3[32], xXX4[32];
1333 TBits x1(16), x2(16), x3(16), x4(16);
1337 xyv = fXY[0][0]; x1.Set(16,&xyv);
1338 xyv = fXY[0][1]; x2.Set(16,&xyv);
1339 xyv = fXY[0][2]; x3.Set(16,&xyv);
1340 xyv = fXY[0][3]; x4.Set(16,&xyv);
1342 TBits x3u(16), x4u(16), x3d(16), x4d(16);
1344 xyv = fXYU[0][2]; x3u.Set(16,&xyv);
1345 xyv = fXYU[0][3]; x4u.Set(16,&xyv);
1347 xyv = fXYD[0][2]; x3d.Set(16,&xyv);
1348 xyv = fXYD[0][3]; x4d.Set(16,&xyv);
1350 for (Int_t i=0;i<16;i++)
1359 for (Int_t i=0;i<8;i++)
1364 xXX3[i+24] = x3u[i];
1365 xXX4[i+24] = x4u[i];
1368 // Int_t coinc44 = 0;
1370 TrigX(xX1, xX2, xXX3, xXX4);
1372 Int_t yY1[16], yY2[16], yY3[16], yY4[16];
1374 Int_t yY3U[16], yY3D[16], yY4U[16], yY4D[16];
1376 TBits y1(16), y2(16), y3(16), y4(16);
1378 TBits y3u(16), y3d(16), y4u(16), y4d(16);
1380 xyv = fXY[1][0]; y1.Set(16,&xyv);
1381 xyv = fXY[1][1]; y2.Set(16,&xyv);
1382 xyv = fXY[1][2]; y3.Set(16,&xyv);
1383 xyv = fXY[1][3]; y4.Set(16,&xyv);
1385 xyv = fXYU[1][2]; y3u.Set(16,&xyv);
1386 xyv = fXYD[1][2]; y3d.Set(16,&xyv);
1387 xyv = fXYU[1][3]; y4u.Set(16,&xyv);
1388 xyv = fXYD[1][3]; y4d.Set(16,&xyv);
1390 for (Int_t i=0;i<16;i++)
1404 TrigY(yY1, yY2, yY3, yY4, yY3U, yY3D, yY4U, yY4D);
1406 // ASIGN fLutLpt, fLutHpt
1410 //___________________________________________
1411 Bool_t AliMUONLocalTriggerBoard::IsTrigY() const
1413 /// Return the response of non-bending plane
1415 Bool_t output = kFALSE;
1417 for (Int_t i=0; i<4; i++) iStripY += static_cast<int>( fCoordY[i] << i );
1419 if (fCoordY[4]==1 && iStripY==15) output=kFALSE; // no trigger in Y
1420 else output=kTRUE; // trigger in Y
1425 //___________________________________________
1426 Bool_t AliMUONLocalTriggerBoard::IsTrigX() const
1428 /// Return the response of bending plane
1430 Int_t deviation = 0;
1431 Bool_t output = kFALSE;
1433 for (Int_t i=0; i<4; i++) deviation += static_cast<int>( fMinDev[i] << i );
1435 if (fMinDev[4]==1 && !deviation) output=kFALSE; // no trigger in X
1436 else output=kTRUE; // trigger in X
1441 //___________________________________________
1442 Bool_t AliMUONLocalTriggerBoard::IsNull() const
1444 /// Check if board has fired strips in the first station
1445 for (Int_t icath=0; icath<2; icath++){
1446 for(Int_t ich=0; ich<2; ich++){
1447 if ( fXY[icath][ich] ) return kFALSE;