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 /// \class AliMUONRegionalTriggerBoard
19 /// Dimuon regional trigger implementation:
20 /// - entry are local board responses
21 /// - output is 12-bit word
22 /// - algorithm is similar to the global one
23 /// \todo Change member functions comments in capital letters to normal text
25 /// \author Rachid Guernane (LPCCFd)
27 #include "AliMUONRegionalTriggerBoard.h"
33 #include <Riostream.h>
36 ClassImp(AliMUONRegionalTriggerBoard)
39 //___________________________________________
40 AliMUONRegionalTriggerBoard::AliMUONRegionalTriggerBoard()
42 /// Default constructor
43 for (Int_t i=0; i<16; i++) fLocalResponse[i] = 0;
46 //___________________________________________
47 AliMUONRegionalTriggerBoard::AliMUONRegionalTriggerBoard(const char *name, Int_t a) : AliMUONTriggerBoard(name, a)
49 /// Standard constructor
50 for (Int_t i=0; i<16; i++) fLocalResponse[i] = 0;
53 //___________________________________________
54 AliMUONRegionalTriggerBoard::~AliMUONRegionalTriggerBoard()
59 //___________________________________________
60 void AliMUONRegionalTriggerBoard::Response()
62 /// RESPONSE IS GIVEN FOLLOWING THE REGIONAL ALGORITHM
66 for (Int_t i=0;i<16;i++) t[i] = fLocalResponse[i] & fMask[i];
70 for (Int_t i=0;i<4;i++)
74 for (Int_t j=0;j<rank;j++)
76 UShort_t lthres = Algo(t[2*j],t[2*j+1],"LPT",i);
78 UShort_t hthres = Algo(t[2*j],t[2*j+1],"HPT",i); hthres <<= 4;
80 t[ip] = lthres | hthres;
88 fResponse = t[0]; // 8-bit [H4:L4]
91 //___________________________________________
92 UShort_t AliMUONRegionalTriggerBoard::Algo(UShort_t i, UShort_t j, char *thres, Int_t level)
94 /// IMPLEMENTATION OF THE REGIONAL ALGORITHM
95 /// SIMILAR TO THE GLOBAL ALGORITHM EXCEPT FOR THE
98 TBits a(8), b(8); a.Set(8,&i); b.Set(8,&j);
100 TBits trg1(2), trg2(2), trg(2);
102 if (!strcmp(thres,"LPT"))
106 trg1[0] = a[0]; trg1[1] = a[1];
107 trg2[0] = b[0]; trg2[1] = b[1];
111 trg1[0] = a[2]; trg1[1] = a[3];
112 trg2[0] = b[2]; trg2[1] = b[3];
119 trg1[0] = a[2]; trg1[1] = a[3];
120 trg2[0] = b[2]; trg2[1] = b[3];
124 trg1[0] = a[6]; trg1[1] = a[7];
125 trg2[0] = b[6]; trg2[1] = b[7];
129 TBits trgLS1(1), trgUS1(1), trgLS2(1), trgUS2(1), trgLS(1), trgUS(1);
133 trgLS1[0] = trgUS1[0] = trgLS2[0] = trgUS2[0] = 0;
137 if (!strcmp(thres,"LPT"))
139 trgLS1[0] = a[1]; trgUS1[0] = a[0];
140 trgLS2[0] = b[1]; trgUS2[0] = b[0];
144 trgLS1[0] = a[5]; trgUS1[0] = a[4];
145 trgLS2[0] = b[5]; trgUS2[0] = b[4];
149 trgLS[0] = ( trg1[0] & trg2[0] ) | ( trg1[1] & trg2[1] ) | trgLS1[0] | trgLS2[0];
150 trgUS[0] = ( trg1[0] & trg2[1] ) | ( trg1[1] & trg2[0] ) | trgUS1[0] | trgUS2[0];
152 trg[0] = trg1[0] | trg2[0];
153 trg[1] = trg1[1] | trg2[1];
168 //___________________________________________
169 void AliMUONRegionalTriggerBoard::Scan(Option_t*) const
171 /// SCAN LOCAL BOARD ENTRIES
173 for (Int_t i=0; i<16; i++)
176 b.Set(6,&fLocalResponse[i]);
178 cout << "Entry " << i << " is " << b << endl;
184 //___________________________________________
185 void AliMUONRegionalTriggerBoard::Mask(Int_t index, UShort_t mask)
189 if ( index>=0 && index < 16 )
195 AliError(Form("Index %d out of bounds (max %d)",index,16));