+void AliMUONGlobalTriggerBoard::BuildGlobalInput()
+{
+ /// build the 4 words (32bits) global input from the regional responses
+ /// the order of regional responses is:
+ /// 1R, 2R, 2-3R, 3R, 4R, 5R, 6R, 7R, 1L, 2L, 2-3L, 3L, 4L, 5L, 6L, 7L
+
+ for (Int_t i=0;i< 4;i++) fGlobalInput[i] = 0;
+
+ UShort_t regRespInv;
+ for (Int_t iReg = 0; iReg < 16; iReg++) {
+
+ regRespInv = InvertPairBits(iReg);
+
+ if (iReg < 8) { // right
+ // Lpt word
+ fGlobalInput[0] |= (regRespInv & 0x0F) << (4*iReg);
+ // Hpt word
+ fGlobalInput[2] |= ((regRespInv & 0xF0) >> 4) << (4*iReg);
+ } else { // left
+ // Lpt word
+ fGlobalInput[1] |= (regRespInv & 0x0F) << (4*(iReg-8));
+ // Hpt word
+ fGlobalInput[3] |= ((regRespInv & 0xF0) >> 4) << (4*(iReg-8));
+ }
+
+ }
+
+}
+
+//___________________________________________
+void AliMUONGlobalTriggerBoard::MaskGlobalInput()
+{
+ /// Apply masks to global input and recalculate regional inputs before
+ /// applying the global response
+
+ UInt_t gitmp[4];
+ for (Int_t i = 0; i < 4; i++) {
+ fGlobalInput[i] &= fMask[i];
+ gitmp[i] = fGlobalInput[i];
+ }
+
+ RecomputeRegional(gitmp);
+}
+
+
+//___________________________________________
+void AliMUONGlobalTriggerBoard::RecomputeRegional(UInt_t gitmp[4])
+{
+ //
+ /// Recomput regional response from global input
+ //
+ for (Int_t iReg = 0; iReg < 16; iReg++) {
+ fRegionalResponse[iReg] = 0;
+ if (iReg < 8) { // right
+ // Lpt
+ fRegionalResponse[iReg] |= (gitmp[0] >> (4*iReg)) & 0xF;
+ // Hpt
+ fRegionalResponse[iReg] |= ((gitmp[2] >> (4*iReg)) & 0xF) << 4;
+ } else { // left
+ // Lpt
+ fRegionalResponse[iReg] |= (gitmp[1] >> (4*(iReg-8))) & 0xF;
+ // Hpt
+ fRegionalResponse[iReg] |= ((gitmp[3] >> (4*(iReg-8))) & 0xF) << 4;
+ }
+
+ fRegionalResponse[iReg] = InvertPairBits(iReg);
+ }
+}
+
+//___________________________________________
+void AliMUONGlobalTriggerBoard::Scan(Option_t*) const