* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
- **************************************************************************/
+ **************************************************************************/
+
-/*
+/* $Id$ */
-*/
#include "AliMUONGlobalTrigger.h"
+#include "AliLog.h"
+#include "AliMUONLocalStruct.h"
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONGlobalTrigger
+/// Global Trigger algorithm data output.
+/// Built from Local and Regional algorithms. \n
+/// Update for copy & assigment operator,
+/// add SetGlobalPattern and GetGlobalPattern method for rawdata
+/// (Ch. Finck)
+/// \author Ph. Crochet
+//-----------------------------------------------------------------------------
+
+/// \cond CLASSIMP
+ClassImp(AliMUONGlobalTrigger)
+/// \endcond
-ClassImp(AliMUONGlobalTrigger);
//----------------------------------------------------------------------
AliMUONGlobalTrigger::AliMUONGlobalTrigger()
-{
-// constructor
- fSinglePlusLpt = 0;
- fSinglePlusHpt = 0;
- fSinglePlusApt = 0;
-
- fSingleMinusLpt = 0;
- fSingleMinusHpt = 0;
- fSingleMinusApt = 0;
-
- fSingleUndefLpt = 0;
- fSingleUndefHpt = 0;
- fSingleUndefApt = 0;
-
- fPairUnlikeLpt = 0;
- fPairUnlikeHpt = 0;
- fPairUnlikeApt = 0;
+ : TObject(),
+ fSingleLpt(0),
+ fSingleHpt(0),
+
+ fPairUnlikeLpt(0),
+ fPairUnlikeHpt(0),
+
+ fPairLikeLpt(0),
+ fPairLikeHpt(0)
+{
+ /// Default constructor
+ AliDebug(1,Form("this=%p",this));
+}
+
+//----------------------------------------------------------------------
+AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
+ : TObject(theMUONGlobalTrig),
- fPairLikeLpt = 0;
- fPairLikeHpt = 0;
- fPairLikeApt = 0;
+ fSingleLpt(theMUONGlobalTrig.fSingleLpt),
+ fSingleHpt(theMUONGlobalTrig.fSingleHpt),
+
+ fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
+ fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
+
+ fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
+ fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
+{
+ /// Copy constructor
+ AliDebug(1,Form("this=%p copy ctor",this));
+
}
+
//----------------------------------------------------------------------
-AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& MUONGlobalTrig):TObject(MUONGlobalTrig)
+AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
{
-// copy constructor
- fSinglePlusLpt = MUONGlobalTrig.fSinglePlusLpt;
- fSinglePlusHpt = MUONGlobalTrig.fSinglePlusHpt;
- fSinglePlusApt = MUONGlobalTrig.fSinglePlusApt;
-
- fSingleMinusLpt = MUONGlobalTrig.fSingleMinusLpt;
- fSingleMinusHpt = MUONGlobalTrig.fSingleMinusHpt;
- fSingleMinusApt = MUONGlobalTrig.fSingleMinusApt;
-
- fSingleUndefLpt = MUONGlobalTrig.fSingleUndefLpt;
- fSingleUndefHpt = MUONGlobalTrig.fSingleUndefHpt;
- fSingleUndefApt = MUONGlobalTrig.fSingleUndefApt;
-
- fPairUnlikeLpt = MUONGlobalTrig.fPairUnlikeLpt;
- fPairUnlikeHpt = MUONGlobalTrig.fPairUnlikeHpt;
- fPairUnlikeApt = MUONGlobalTrig.fPairUnlikeApt;
-
- fPairLikeLpt = MUONGlobalTrig.fPairLikeLpt;
- fPairLikeHpt = MUONGlobalTrig.fPairLikeHpt;
- fPairLikeApt = MUONGlobalTrig.fPairLikeApt;
+ /// Destructor
+ AliDebug(1,Form("this=%p",this));
}
//----------------------------------------------------------------------
-AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& MUONGlobalTrig)
+AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
{
-// equal operator (useful for non-pointer member in TClonesArray)
- if (this == &MUONGlobalTrig)
+ /// Assignement operator;
+ /// equal operator (useful for non-pointer member in TClonesArray)
+
+ if (this == &theMUONGlobalTrig)
return *this;
+
+ // base class assignement
+ TObject::operator=(theMUONGlobalTrig);
- fSinglePlusLpt = MUONGlobalTrig.fSinglePlusLpt;
- fSinglePlusHpt = MUONGlobalTrig.fSinglePlusHpt;
- fSinglePlusApt = MUONGlobalTrig.fSinglePlusApt;
-
- fSingleMinusLpt = MUONGlobalTrig.fSingleMinusLpt;
- fSingleMinusHpt = MUONGlobalTrig.fSingleMinusHpt;
- fSingleMinusApt = MUONGlobalTrig.fSingleMinusApt;
+ fSingleLpt = theMUONGlobalTrig.fSingleLpt;
+ fSingleHpt = theMUONGlobalTrig.fSingleHpt;
- fSingleUndefLpt = MUONGlobalTrig.fSingleUndefLpt;
- fSingleUndefHpt = MUONGlobalTrig.fSingleUndefHpt;
- fSingleUndefApt = MUONGlobalTrig.fSingleUndefApt;
+ fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
+ fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
- fPairUnlikeLpt = MUONGlobalTrig.fPairUnlikeLpt;
- fPairUnlikeHpt = MUONGlobalTrig.fPairUnlikeHpt;
- fPairUnlikeApt = MUONGlobalTrig.fPairUnlikeApt;
-
- fPairLikeLpt = MUONGlobalTrig.fPairLikeLpt;
- fPairLikeHpt = MUONGlobalTrig.fPairLikeHpt;
- fPairLikeApt = MUONGlobalTrig.fPairLikeApt;
+ fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
+ fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
return *this;
}
-//----------------------------------------------------------------------
-AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus,
- Int_t *singleMinus,
- Int_t *singleUndef,
- Int_t *pairUnlike, Int_t *pairLike)
+//-----------------------------------------------------------
+void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
{
-// Set the Global Trigger object
- fSinglePlusLpt = singlePlus[0];
- fSinglePlusHpt = singlePlus[1];
- fSinglePlusApt = singlePlus[2];
-
- fSingleMinusLpt = singleMinus[0];
- fSingleMinusHpt = singleMinus[1];
- fSingleMinusApt = singleMinus[2];
-
- fSingleUndefLpt = singleUndef[0];
- fSingleUndefHpt = singleUndef[1];
- fSingleUndefApt = singleUndef[2];
-
- fPairUnlikeLpt = pairUnlike[0];
- fPairUnlikeHpt = pairUnlike[1];
- fPairUnlikeApt = pairUnlike[2];
-
- fPairLikeLpt = pairLike[0];
- fPairLikeHpt = pairLike[1];
- fPairLikeApt = pairLike[2];
+ /// Set class members from global response
+ /// coming from rawdata & global trigger board
+ /// [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;
+
+ fPairUnlikeLpt = (globalResponse >> 4) & 0x1;
+ fPairUnlikeHpt = (globalResponse >> 5) & 0x1;
+
+ fPairLikeLpt = (globalResponse >> 2) & 0x1;
+ fPairLikeHpt = (globalResponse >> 3) & 0x1;
+
}
+//-----------------------------------------------------------
+UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
+{
+ /// Global trigger response
+ /// from class member values
+ /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
+ Int_t response = 0;
+ if (SingleLpt()) response|= 0x1;
+ if (SingleHpt()) response|= 0x2;
+ if (PairLikeLpt()) response|= 0x4;
+ if (PairLikeHpt()) response|= 0x8;
+
+ if (PairUnlikeLpt()) response|= 0x10;
+ if (PairUnlikeHpt()) response|= 0x20;
+ return response;
+}
+//----------------------------------------------------------------------
+void AliMUONGlobalTrigger::Print(Option_t*) const
+{
+ ///
+ /// Printing Global Trigger information
+ ///
+ printf("=============================================\n");
+ printf(" Global Trigger output Low pt High pt\n");
+ printf(" Single :\t");
+ printf("%i\t%i\t",SingleLpt(),SingleHpt());
+ printf("\n");
+
+ printf(" UnlikeSign pair :\t");
+ printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
+ printf("\n");
+
+ printf(" LikeSign pair :\t");
+ printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
+ printf("\n");
+
+ printf("=============================================\n");
+}