]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGlobalTrigger.cxx
libTPCsim depends on libTPCrec since ALiTPCDigitizer uses AliTPCReconstructor::Stream...
[u/mrichter/AliRoot.git] / MUON / AliMUONGlobalTrigger.cxx
index a30244cc034777b86ecd3779a4c1a7190995acd6..ec84fd69ca0025717a6aab325b8309946e98921d 100644 (file)
 
 
 #include "AliMUONGlobalTrigger.h"
-#include <assert.h>
 #include "AliLog.h"
 #include "AliMUONLocalStruct.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONGlobalTrigger
 /// Global Trigger algorithm data output.
 /// Built from Local and Regional algorithms.                          \n 
@@ -29,6 +29,7 @@
 /// add SetGlobalPattern and GetGlobalPattern method for rawdata 
 /// (Ch. Finck)
 /// \author Ph. Crochet
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONGlobalTrigger)
@@ -47,6 +48,8 @@ AliMUONGlobalTrigger::AliMUONGlobalTrigger()
     fPairLikeHpt(0)
 { 
   /// Default constructor 
+      AliDebug(1,Form("this=%p",this));
+      for (Int_t i = 0; i < 4; i++) fInput[i] = 0;
 }
 
 //----------------------------------------------------------------------
@@ -63,12 +66,16 @@ AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGl
     fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
 {
   /// Copy constructor
+      AliDebug(1,Form("this=%p copy ctor",this));
+      for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
+
 }
 
 //----------------------------------------------------------------------
 AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
 {
   /// Destructor
+  AliDebug(1,Form("this=%p",this));
 }
 
 //----------------------------------------------------------------------
@@ -92,6 +99,8 @@ AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger
   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
 
+  for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
+
   return *this;
 }
 
@@ -103,36 +112,16 @@ 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;
   
 }
-//-----------------------------------------------------------
-Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
-{
-  /// Global trigger pattern calculation
-  /// from class member values
-
-  Int_t gloTrigPat = 0;
-
-  if (SingleLpt())     gloTrigPat|= 0x1;
-  if (SingleHpt())     gloTrigPat|= 0x2;
-
-  if (PairLikeLpt())   gloTrigPat|= 0x4;
-  if (PairLikeHpt())   gloTrigPat|= 0x8;
-  if (PairUnlikeLpt()) gloTrigPat|= 0x10;
-  if (PairUnlikeHpt()) gloTrigPat|= 0x20;
-
-  return gloTrigPat;
-}
 
 //-----------------------------------------------------------
 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
@@ -140,55 +129,53 @@ UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
   /// Global trigger response
   /// from class member values
   /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
-  /// remove Apt
 
   UChar_t response = 0;
-  UChar_t respUS  = 0;
-  UChar_t respLS  = 0;
-  UChar_t respS  = 0;
 
-  if (SingleLpt())  respS |= 0x1;
-  if (SingleHpt())  respS |= 0x2;
+  if (SingleLpt())     response|= 0x2;
+  if (SingleHpt())     response|= 0x4;
 
-  if (PairLikeLpt())    respLS |= 0x1;
-  if (PairLikeHpt())    respLS |= 0x2;
-  respLS <<= 2;
+  if (PairLikeLpt())   response|= 0x8;
+  if (PairLikeHpt())   response|= 0x10;
+  if (PairUnlikeLpt()) response|= 0x20;
+  if (PairUnlikeHpt()) response|= 0x40;
 
-  if (PairUnlikeLpt())  respUS |= 0x1;
-  if (PairUnlikeHpt())  respUS |= 0x2;
-  respUS <<= 4;
+  return response;
+}
 
-  response = respUS | respLS | respS;
+//-----------------------------------------------------------
+void AliMUONGlobalTrigger::SetFromGlobalInput(const UInt_t *globalInput)
+{
+  /// Global trigger board input
+  /// 4 words each of 32 bits
 
-  return response;
+  for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
 
 }
+
 //----------------------------------------------------------------------
-void AliMUONGlobalTrigger::Print(Option_t* opt) const
+void AliMUONGlobalTrigger::Print(Option_t*) const
 {
-  //
-  // Printing Global Trigger information
-  //
-  TString sopt(opt);
-  sopt.ToUpper();
-  if ( sopt.Contains("FULL") ) { 
-
+  ///
+  /// Printing Global Trigger information
+  ///
       printf("=============================================\n");
       printf(" Global Trigger output       Low pt  High pt\n");
-      printf(" number of Single           :\t");
+      printf(" Single                    :\t");
       printf("%i\t%i\t",SingleLpt(),SingleHpt());
       printf("\n");
       
-      printf(" number of UnlikeSign pair  :\t"); 
+      printf(" UnlikeSign pair           :\t"); 
       printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
       printf("\n");
       
-      printf(" number of LikeSign pair    :\t");  
+      printf(" LikeSign pair             :\t");  
       printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
       printf("\n");
       
       printf("=============================================\n");
-  }  
+
 }