]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In trigger classes:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Apr 2009 16:05:11 +0000 (16:05 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Apr 2009 16:05:11 +0000 (16:05 +0000)
- The trivial change is the initialisation of the global input masks
  to 0xFFFFFFFF
- The change to unify the format of the global trigger output word
  with the one written in the raw data:
  shifting the  first six bits of the global trigger by 1 bit and
  leaving the first bit (LSB) to have the value 0 or 1, which tells which
  of the single low/high pt bit is sent to the CTP, since this one takes only
  5 bits from the MUON trigger.
- Reverse change which was done once for the inversion of the bits in
  the global input words. Tests with the latest cosmic runs, showed that
  it is not necessary to invert the global inputs before applying the masks.
  It seems it was a misunderstanding, but I will let the code doing
  the inversion as it is, only not doing the inversion finally.
(Bogdan)

MUON/AliMUONGlobalTrigger.cxx
MUON/AliMUONGlobalTriggerBoard.cxx

index dab6de5c1f487d25902883722da84cf0406f56bf..ec84fd69ca0025717a6aab325b8309946e98921d 100644 (file)
@@ -112,15 +112,14 @@ void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
   /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
   /// remove Apt
 
-  // don't have the information anymore of the sign
-  fSingleLpt = globalResponse & 0x1;
-  fSingleHpt = (globalResponse >> 1) & 0x1;
+  fSingleLpt = (globalResponse >> 1) & 0x1;
+  fSingleHpt = (globalResponse >> 2) & 0x1;
 
-  fPairUnlikeLpt = (globalResponse >> 4)  & 0x1;
-  fPairUnlikeHpt = (globalResponse >> 5)  & 0x1;
+  fPairLikeLpt = (globalResponse >> 3)  & 0x1;
+  fPairLikeHpt = (globalResponse >> 4)  & 0x1;
   
-  fPairLikeLpt = (globalResponse >> 2)  & 0x1;
-  fPairLikeHpt = (globalResponse >> 3)  & 0x1;
+  fPairUnlikeLpt = (globalResponse >> 5)  & 0x1;
+  fPairUnlikeHpt = (globalResponse >> 6)  & 0x1;
   
 }
 
@@ -131,16 +130,16 @@ UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
   /// from class member values
   /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
 
-  Int_t response = 0;
+  UChar_t response = 0;
 
-  if (SingleLpt())     response|= 0x1;
-  if (SingleHpt())     response|= 0x2;
+  if (SingleLpt())     response|= 0x2;
+  if (SingleHpt())     response|= 0x4;
 
-  if (PairLikeLpt())   response|= 0x4;
-  if (PairLikeHpt())   response|= 0x8;
+  if (PairLikeLpt())   response|= 0x8;
+  if (PairLikeHpt())   response|= 0x10;
  
-  if (PairUnlikeLpt()) response|= 0x10;
-  if (PairUnlikeHpt()) response|= 0x20;
+  if (PairUnlikeLpt()) response|= 0x20;
+  if (PairUnlikeHpt()) response|= 0x40;
 
   return response;
 }
index c2ed96ece4ebd45b6a8af876e19b099a9d1b9de9..e2e412c317a3a9542b4b257dde29fec01c634ae3 100644 (file)
@@ -43,6 +43,7 @@ AliMUONGlobalTriggerBoard::AliMUONGlobalTriggerBoard(): AliMUONTriggerBoard()
 
    for (Int_t i=0;i<16;i++) fRegionalResponse[i] = 0;
    for (Int_t i=0;i< 4;i++) fGlobalInput[i] = 0;
+   for (Int_t i=0;i< 4;i++) fMask[i] = 0xffffffff;
 }
 
 //___________________________________________
@@ -52,6 +53,7 @@ AliMUONGlobalTriggerBoard::AliMUONGlobalTriggerBoard(const char *name, Int_t a)
 
    for (Int_t i=0;i<16;i++) fRegionalResponse[i] = 0;
    for (Int_t i=0;i< 4;i++) fGlobalInput[i] = 0;
+   for (Int_t i=0;i< 4;i++) fMask[i] = 0xffffffff;
 }
 
 //___________________________________________
@@ -122,11 +124,14 @@ void AliMUONGlobalTriggerBoard::Response()
    usLpt = ((t[0] & 0x2 ) != 0);
    usHpt = ((t[0] & 0x20) != 0);
 
-   sHpt  <<= 1;
-   lsLpt <<= 2;
-   lsHpt <<= 3;
-   usLpt <<= 4;
-   usHpt <<= 5;
+   // LSB is zero (trigger choice to send to CTP: sLpt or sHpt)
+
+   sLpt  <<= 1;
+   sHpt  <<= 2;
+   lsLpt <<= 3;
+   lsHpt <<= 4;
+   usLpt <<= 5;
+   usHpt <<= 6;
 
    fResponse = sLpt | sHpt | lsLpt | lsHpt | usLpt |usHpt;
    
@@ -199,11 +204,15 @@ void AliMUONGlobalTriggerBoard::BuildGlobalInput()
   TBits rs(8), rsi(8);
   for (Int_t iReg = 0; iReg < 16; iReg++) {
 
-    // invert bit in regional response
+    // invert bits in regional response ?
     rs.Set(8,&fRegionalResponse[iReg]);
     for (Int_t i = 0; i < 4; i++) {
-      rsi[2*i]   = rs[2*i+1];
-      rsi[2*i+1] = rs[2*i];
+      // ... YES
+      //rsi[2*i]   = rs[2*i+1];
+      //rsi[2*i+1] = rs[2*i];
+      // ... NO
+      rsi[2*i]   = rs[2*i];
+      rsi[2*i+1] = rs[2*i+1];
     }
     regRespInv = 0;
     rsi.Get(&regRespInv);
@@ -254,7 +263,7 @@ void AliMUONGlobalTriggerBoard::MaskGlobalInput()
       // Hpt
       fRegionalResponse[iReg] |= ((gitmp[3] >> (4*(iReg-8))) & 0xF) << 4;
     }
-    // invert bit in regional response
+    // invert bits in regional response ?
     rs.Set(8,&fRegionalResponse[iReg]);
     for (Int_t i = 0; i < 4; i++) {
       rsi[2*i]   = rs[2*i+1];
@@ -262,7 +271,8 @@ void AliMUONGlobalTriggerBoard::MaskGlobalInput()
     }
     regRespInv = 0;
     rsi.Get(&regRespInv);
-    fRegionalResponse[iReg] = regRespInv;
+    // uncomment if ... YES
+    //fRegionalResponse[iReg] = regRespInv;
   }
 
 }
@@ -271,7 +281,7 @@ void AliMUONGlobalTriggerBoard::MaskGlobalInput()
 void AliMUONGlobalTriggerBoard::Scan(Option_t*) const
 {
   /// print global trigger output 
-  TBits w(6); w.Set(6,&fResponse);
+  TBits w(7); w.Set(7,&fResponse);
 
 // TRG[1:0]
 // 00 noth
@@ -281,11 +291,11 @@ void AliMUONGlobalTriggerBoard::Scan(Option_t*) const
 
    Int_t iS[2] = {0,0};
 
-   iS[0] = (Int_t)w.TestBitNumber(0);
-   iS[1] = (Int_t)w.TestBitNumber(1);
+   iS[0] = (Int_t)w.TestBitNumber(1);
+   iS[1] = (Int_t)w.TestBitNumber(2);
 
-   Int_t iPU[2] = {w[4],w[5]};
-   Int_t iPL[2] = {w[2],w[3]};
+   Int_t iPU[2] = {w[5],w[6]};
+   Int_t iPL[2] = {w[3],w[4]};
 
    printf("============================================\n");
    printf(" Global Trigger output       Low pt  High pt\n");