33 #include <Riostream.h>
44 for (Int_t i=0;i<16;i++) fRegionalResponse[i] = 0;
45 for (Int_t i=0;i< 4;i++) fGlobalInput[i] = 0;
46 for (Int_t i=0;i< 4;i++) fMask[i] = 0xffffffff;
56 for (Int_t i=0;i< 4;i++)
fMask[i] = 0xffffffff;
69 if ( index >= 0 && index < 4 )
75 AliError(Form(
"Index %d out of bounds (max %d)",index,3));
94 for (Int_t i = 0; i < 16; ++i)
102 for (Int_t i=0;i<4;i++)
106 for (Int_t j=0;j<rank;j++)
108 UShort_t lthres =
Algo(t[2*j],t[2*j+1],
"LPT");
110 UShort_t hthres =
Algo(t[2*j],t[2*j+1],
"HPT"); hthres <<= 4;
112 t[ip] = lthres | hthres;
119 UChar_t sLpt, sHpt, lsLpt, lsHpt, usLpt, usHpt;
120 sLpt = ((t[0] & 0xC) != 0);
121 sHpt = ((t[0] & 0xC0) != 0);
122 lsLpt = ((t[0] & 0x1) != 0);
123 lsHpt = ((t[0] & 0x10) != 0);
124 usLpt = ((t[0] & 0x2 ) != 0);
125 usHpt = ((t[0] & 0x20) != 0);
136 fResponse = sLpt | sHpt | lsLpt | lsHpt | usLpt |usHpt;
147 TBits a(8), b(8); a.Set(8,&i); b.Set(8,&j);
149 TBits trg1(2), trg2(2), trg(2);
151 if (!strcmp(thres,
"LPT"))
153 trg1[0] = a[2]; trg1[1] = a[3];
154 trg2[0] = b[2]; trg2[1] = b[3];
158 trg1[0] = a[6]; trg1[1] = a[7];
159 trg2[0] = b[6]; trg2[1] = b[7];
162 TBits trgLS1(1), trgUS1(1), trgLS2(1), trgUS2(1), trgLS(1), trgUS(1);
164 if (!strcmp(thres,
"LPT"))
166 trgLS1[0] = a[0]; trgUS1[0] = a[1];
167 trgLS2[0] = b[0]; trgUS2[0] = b[1];
171 trgLS1[0] = a[4]; trgUS1[0] = a[5];
172 trgLS2[0] = b[4]; trgUS2[0] = b[5];
175 trgLS[0] = ( trg1[0] & trg2[0] ) | ( trg1[1] & trg2[1] ) | trgLS1[0] | trgLS2[0];
176 trgUS[0] = ( trg1[0] & trg2[1] ) | ( trg1[1] & trg2[0] ) | trgUS1[0] | trgUS2[0];
178 trg[0] = trg1[0] | trg2[0];
179 trg[1] = trg1[1] | trg2[1];
204 for (Int_t iReg = 0; iReg < 16; iReg++) {
212 fGlobalInput[2] |= ((regRespInv & 0xF0) >> 4) << (4*iReg);
217 fGlobalInput[3] |= ((regRespInv & 0xF0) >> 4) << (4*(iReg-8));
231 for (Int_t i = 0; i < 4; i++) {
246 for (Int_t iReg = 0; iReg < 16; iReg++) {
278 iS[0] = (Int_t)w.TestBitNumber(1);
279 iS[1] = (Int_t)w.TestBitNumber(2);
281 Int_t iPU[2] = {w[5],w[6]};
282 Int_t iPL[2] = {w[3],w[4]};
284 printf(
"============================================\n");
285 printf(
" Global Trigger output Low pt High pt\n");
286 printf(
" number of Single :\t");
287 for (Int_t i=0; i<2; i++)
printf(
"%i\t",iS[i]);
289 printf(
" number of UnlikeSign pair :\t");
290 for (Int_t i=0; i<2; i++)
printf(
"%i\t",iPU[i]);
292 printf(
" number of LikeSign pair :\t");
293 for (Int_t i=0; i<2; i++)
printf(
"%i\t",iPL[i]);
295 printf(
"===================================================\n");
309 for (Int_t i = 0; i < 4; i++) {
311 rsi[2*i] = rs[2*i+1];
312 rsi[2*i+1] = rs[2*i];
315 rsi[2*i+1] = rs[2*i+1];
318 UShort_t regRespInv = 0;
319 rsi.Get(®RespInv);
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void Scan(Option_t *option) const
scan response of regional boards
UShort_t fResponse
RESPONSE.
UInt_t fMask[4]
Mask for the global input.
void BuildGlobalInput()
Build the 4 words (32bits) global input.
UShort_t InvertPairBits(Int_t iReg)
virtual ~AliMUONGlobalTriggerBoard()
virtual void Response()
virtual method for derivated classes
UShort_t fRegionalResponse[16]
Regional board responses.
Trigger board base class.
void MaskGlobalInput()
Apply masks to global input.
virtual UShort_t Algo(UShort_t i, UShort_t j, const char *thres)
response of the algorithm
void RecomputeRegional(UInt_t globalInput[4])
UInt_t fGlobalInput[4]
Global input.
AliMUONGlobalTriggerBoard()
void Mask(Int_t index, UInt_t mask)
Set mask for global input (from regional boards)