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 //*-- Author: Rachid Guernane (LPCCFd)
20 #include "AliMUONRegionalTriggerBoard.h"
24 #include <Riostream.h>
26 ClassImp(AliMUONRegionalTriggerBoard)
28 //___________________________________________
29 AliMUONRegionalTriggerBoard::AliMUONRegionalTriggerBoard()
31 for (Int_t i=0; i<16; i++) fLocalResponse[i] = 0;
34 //___________________________________________
35 AliMUONRegionalTriggerBoard::AliMUONRegionalTriggerBoard(const char *name, Int_t a) : AliMUONTriggerBoard(name, a)
37 for (Int_t i=0; i<16; i++) fLocalResponse[i] = 0;
40 //___________________________________________
41 void AliMUONRegionalTriggerBoard::Response()
45 for (Int_t i=0;i<16;i++) t[i] = fLocalResponse[i];
49 for (Int_t i=0;i<4;i++)
53 for (Int_t j=0;j<rank;j++)
55 UShort_t athres = Algo(t[2*j],t[2*j+1],"APT",i);
57 UShort_t lthres = Algo(t[2*j],t[2*j+1],"LPT",i); lthres <<= 4;
59 UShort_t hthres = Algo(t[2*j],t[2*j+1],"HPT",i); hthres <<= 8;
61 t[ip] = athres | lthres | hthres;
69 fResponse = t[0]; // 12-bit [H4:L4:A4]
72 //___________________________________________
73 UShort_t AliMUONRegionalTriggerBoard::Algo(UShort_t i, UShort_t j, char *thres, Int_t level)
75 TBits a(12), b(12); a.Set(12,&i); b.Set(12,&j);
77 TBits trg1(2), trg2(2), trg(2);
79 if (!strcmp(thres,"APT"))
83 trg1[0] = a[0]; trg1[1] = a[1];
84 trg2[0] = b[0]; trg2[1] = b[1];
88 trg1[0] = a[2]; trg1[1] = a[3];
89 trg2[0] = b[2]; trg2[1] = b[3];
92 else if (!strcmp(thres,"LPT"))
96 trg1[0] = a[2]; trg1[1] = a[3];
97 trg2[0] = b[2]; trg2[1] = b[3];
101 trg1[0] = a[6]; trg1[1] = a[7];
102 trg2[0] = b[6]; trg2[1] = b[7];
109 trg1[0] = a[4]; trg1[1] = a[5];
110 trg2[0] = b[4]; trg2[1] = b[5];
114 trg1[0] = a[10]; trg1[1] = a[11];
115 trg2[0] = b[10]; trg2[1] = b[11];
119 TBits trgLS1(1), trgUS1(1), trgLS2(1), trgUS2(1), trgLS(1), trgUS(1);
123 trgLS1[0] = trgUS1[0] = trgLS2[0] = trgUS2[0] = 0;
127 if (!strcmp(thres,"APT"))
129 trgLS1[0] = a[1]; trgUS1[0] = a[0];
130 trgLS2[0] = b[1]; trgUS2[0] = b[0];
132 else if (!strcmp(thres,"LPT"))
134 trgLS1[0] = a[5]; trgUS1[0] = a[4];
135 trgLS2[0] = b[5]; trgUS2[0] = b[4];
139 trgLS1[0] = a[9]; trgUS1[0] = a[8];
140 trgLS2[0] = b[9]; trgUS2[0] = b[8];
144 trgLS[0] = ( trg1[0] & trg2[0] ) | ( trg1[1] & trg2[1] ) | trgLS1[0] | trgLS2[0];
145 trgUS[0] = ( trg1[0] & trg2[1] ) | ( trg1[1] & trg2[0] ) | trgUS1[0] | trgUS2[0];
147 trg[0] = trg1[0] | trg2[0];
148 trg[1] = trg1[1] | trg2[1];
162 //___________________________________________
163 void AliMUONRegionalTriggerBoard::Scan(Option_t*)
165 for (Int_t i=0; i<16; i++)
168 b.Set(6,&fLocalResponse[i]);
170 cout << "Entry " << i << " is " << b << endl;
177 ClassImp(AliMUONRegionalTriggerBoard)