/* $Id$ */
-// ------------------
-// Class AliMUONGlobalTrigger
-// ------------------
-// Global Trigger algorithm data output
-// built from Local and Regional algorithms
#include "AliMUONGlobalTrigger.h"
ClassImp(AliMUONGlobalTrigger)
+
+/// ------------------
+/// Class AliMUONGlobalTrigger
+/// ------------------
+// Global Trigger algorithm data output
+// built from Local and Regional algorithms
+/// Ph. Crochet
+///
+/// update for copy & assigment operator
+/// add SetGlobalPattern and GetGlobalPattern method for rawdata
+/// Ch. Finck
+
+
//----------------------------------------------------------------------
AliMUONGlobalTrigger::AliMUONGlobalTrigger()
- : TObject()
-{
-// constructor
- fSinglePlusLpt = 0;
- fSinglePlusHpt = 0;
- fSinglePlusApt = 0;
-
- fSingleMinusLpt = 0;
- fSingleMinusHpt = 0;
- fSingleMinusApt = 0;
+ : TObject(),
+ fSinglePlusLpt(0),
+ fSinglePlusHpt(0),
+ fSinglePlusApt(0),
- fSingleUndefLpt = 0;
- fSingleUndefHpt = 0;
- fSingleUndefApt = 0;
+ fSingleMinusLpt(0),
+ fSingleMinusHpt(0),
+ fSingleMinusApt(0),
- fPairUnlikeLpt = 0;
- fPairUnlikeHpt = 0;
- fPairUnlikeApt = 0;
-
- fPairLikeLpt = 0;
- fPairLikeHpt = 0;
- fPairLikeApt = 0;
+ fSingleUndefLpt(0),
+ fSingleUndefHpt(0),
+ fSingleUndefApt(0),
+
+ fPairUnlikeLpt(0),
+ fPairUnlikeHpt(0),
+ fPairUnlikeApt(0),
+
+ fPairLikeLpt(0),
+ fPairLikeHpt(0),
+ fPairLikeApt(0)
+{
+ //
+ // constructor
+ //
}
//----------------------------------------------------------------------
AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
: TObject(theMUONGlobalTrig)
{
-// copy constructor
+ //
+ // copy constructor
+ //
fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt;
fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt;
fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt;
//----------------------------------------------------------------------
AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
{
-// equal operator (useful for non-pointer member in TClonesArray)
+ // assignement operator
+ //
+ // equal operator (useful for non-pointer member in TClonesArray)
+
if (this == &theMUONGlobalTrig)
return *this;
Int_t *singleUndef,
Int_t *pairUnlike, Int_t *pairLike)
{
-// Set the Global Trigger object
+ //
+ // Set the Global Trigger object
+ //
fSinglePlusLpt = singlePlus[0];
fSinglePlusHpt = singlePlus[1];
fSinglePlusApt = singlePlus[2];
fPairLikeApt = pairLike[2];
}
+//-----------------------------------------------------------
+void AliMUONGlobalTrigger:: SetGlobalPattern(Int_t gloTrigPat)
+{
+ //
+ // set class member from global pattern
+ // coming from rawdata
+ //
+ fSinglePlusLpt = (gloTrigPat ) & 0x1;
+ fSinglePlusHpt = (gloTrigPat >> 1) & 0x1;
+ fSinglePlusApt = (gloTrigPat >> 2) & 0x1;
+
+ fSingleMinusLpt = (gloTrigPat >> 3) & 0x1;
+ fSingleMinusHpt = (gloTrigPat >> 4) & 0x1;
+ fSingleMinusApt = (gloTrigPat >> 5) & 0x1;
+
+ fSingleUndefLpt = (gloTrigPat >> 6) & 0x1;
+ fSingleUndefHpt = (gloTrigPat >> 7) & 0x1;
+ fSingleUndefApt = (gloTrigPat >> 8) & 0x1;
+
+ fPairUnlikeLpt = (gloTrigPat >> 9) & 0x1;
+ fPairUnlikeHpt = (gloTrigPat >> 10) & 0x1;
+ fPairUnlikeApt = (gloTrigPat >> 11) & 0x1;
+
+ fPairLikeLpt = (gloTrigPat >> 12) & 0x1;
+ fPairLikeHpt = (gloTrigPat >> 13) & 0x1;
+ fPairLikeApt = (gloTrigPat >> 14) & 0x1;
+}
+//-----------------------------------------------------------
+Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
+{
+ //
+ // global trigger pattern calculation
+ // from class member values
+ //
+ Int_t gloTrigPat = 0;
+ if (SinglePlusLpt()) gloTrigPat|= 0x1;
+ if (SinglePlusHpt()) gloTrigPat|= 0x2;
+ if (SinglePlusApt()) gloTrigPat|= 0x4;
+
+ if (SingleMinusLpt()) gloTrigPat|= 0x8;
+ if (SingleMinusHpt()) gloTrigPat|= 0x10;
+ if (SingleMinusApt()) gloTrigPat|= 0x20;
+
+ if (SingleUndefLpt()) gloTrigPat|= 0x40;
+ if (SingleUndefHpt()) gloTrigPat|= 0x80;
+ if (SingleUndefApt()) gloTrigPat|= 0x100;
+
+ if (PairUnlikeLpt()) gloTrigPat|= 0x200;
+ if (PairUnlikeHpt()) gloTrigPat|= 0x400;
+ if (PairUnlikeApt()) gloTrigPat|= 0x800;
+
+ if (PairLikeLpt()) gloTrigPat|= 0x1000;
+ if (PairLikeHpt()) gloTrigPat|= 0x2000;
+ if (PairLikeApt()) gloTrigPat|= 0x4000;
+
+ return gloTrigPat;
+
+}
/// \ingroup base
/// \class AliMUONGlobalTrigger
-/// \brief Reconstructed global trigger object
+/// \brief global trigger object
+/// \author Ph. Crochet
#include <TObject.h>
Int_t PairLikeHpt() const {return fPairLikeHpt ;}
Int_t PairLikeApt() const {return fPairLikeApt ;}
+ void SetGlobalPattern(Int_t globalPattern);
+ Int_t GetGlobalPattern() const;
+
ClassDef(AliMUONGlobalTrigger,1) // reconstructed Global Trigger object
private:
/* $Id$ */
-// ------------------
-// Class AliMUONLocalTrigger
-// ------------------
-// Local Trigger algorithm data outputs
-// (contains local trigger decision and bit patterns)
+
#include "AliMUONLocalTrigger.h"
#include <assert.h>
#include "AliLog.h"
+#include "AliMUONLocalStruct.h"
ClassImp(AliMUONLocalTrigger)
+
+/// ------------------
+/// Class AliMUONLocalTrigger
+/// ------------------
+/// Local Trigger algorithm data outputs
+/// (contains local trigger decision and bit patterns)
+/// Ph. Crochet
+///
+/// add SetLocalStruct method for rawdata
+/// Ch. Finck
+
//----------------------------------------------------------------------
AliMUONLocalTrigger::AliMUONLocalTrigger()
- : TObject(), fDigits(0)
+ : TObject(),
+ fLoCircuit(0),
+ fLoStripX(0),
+ fLoDev(0),
+ fLoStripY(0),
+ fLoLpt(0),
+ fLoHpt(0),
+ fLoApt(0),
+
+ fX1Pattern(0),
+ fX2Pattern(0),
+ fX3Pattern(0),
+ fX4Pattern(0),
+
+ fY1Pattern(0),
+ fY2Pattern(0),
+ fY3Pattern(0),
+ fY4Pattern(0),
+
+ fLoDecision(0),
+ fDigits(0)
{
-// constructor
- fLoCircuit = 0;
- fLoStripX = 0;
- fLoDev = 0;
- fLoStripY = 0;
- fLoLpt = 0;
- fLoHpt = 0;
- fLoApt = 0;
-
- fX1Pattern = 0;
- fX2Pattern = 0;
- fX3Pattern = 0;
- fX4Pattern = 0;
-
- fY1Pattern = 0;
- fY2Pattern = 0;
- fY3Pattern = 0;
- fY4Pattern = 0;
-
- fLoDecision = 0;
+ //
+ // constructor
+ //
}
//----------------------------------------------------------------------
AliMUONLocalTrigger::AliMUONLocalTrigger(const AliMUONLocalTrigger& theMUONLocalTrig)
: TObject(theMUONLocalTrig)
{
-// copy constructor (useful for TClonesArray)
+ //
+ // copy constructor (useful for TClonesArray)
+ //
fLoCircuit = theMUONLocalTrig.fLoCircuit;
fLoStripX = theMUONLocalTrig.fLoStripX;
fLoDev = theMUONLocalTrig.fLoDev;
//----------------------------------------------------------------------
AliMUONLocalTrigger& AliMUONLocalTrigger::operator=(const AliMUONLocalTrigger& theMUONLocalTrig)
{
-// equal operator (useful for non-pointer member in TClonesArray)
+ // assigment operator
+ //
+ // equal operator (useful for non-pointer member in TClonesArray)
+
if (this == &theMUONLocalTrig)
return *this;
//----------------------------------------------------------------------
AliMUONLocalTrigger::AliMUONLocalTrigger(const Int_t* localtr, const TArrayI& digits)
{
-// add a local trigger object
+ //
+ // add a local trigger object
+ //
fLoCircuit = localtr[0];
fLoStripX = localtr[1];
fLoDev = localtr[2];
//----------------------------------------------------------------------
Char_t AliMUONLocalTrigger::GetLoDecision()
{
-// returns local trigger decision
+ // get local decision
+ // from H(L)pt
+ // returns local trigger decision
+
fLoDecision = (fLoLpt & 0x3);
fLoDecision |= (fLoHpt << 2) & 0xC;
//----------------------------------------------------------------------
void AliMUONLocalTrigger::GetDigit(
- Int_t i, Int_t& chamber, Int_t& cathode, Int_t& digit
- ) const
+ Int_t i, Int_t& chamber, Int_t& cathode, Int_t& digit) const
{
// Returns the i'th digit that fired this circuit.
// The number of digits can be found with NumberOfDigits(), that is
}
//----------------------------------------------------------------------
-Int_t AliMUONLocalTrigger::EncodeDigitNumber(
- Int_t chamber, Int_t cathode, Int_t digit
- )
+Int_t AliMUONLocalTrigger::EncodeDigitNumber(Int_t chamber, Int_t cathode,
+ Int_t digit)
{
// Encodes a 32-bit digit number from digit information to be stored
// in internal integer arrays. Note that the value of the digit parameter
}
//----------------------------------------------------------------------
-void AliMUONLocalTrigger::DecodeDigitNumber(
- Int_t digitnumber,
- Int_t& chamber, Int_t& cathode, Int_t& digit
- )
+void AliMUONLocalTrigger::DecodeDigitNumber(Int_t digitnumber, Int_t& chamber,
+ Int_t& cathode, Int_t& digit)
{
// Decodes a digit number into information about the digit.
// One can subsequently fetch the digit with
digit = digitnumber & 0x7FFFFFF;
}
+//----------------------------------------------------------------------
+void AliMUONLocalTrigger::SetLocalStruct(Int_t loCircuit, AliMUONLocalStruct& localStruct)
+{
+ //
+ // Set local trigger info from rawdata localStruct
+ //
+
+ // set id'
+ SetLoCircuit(loCircuit);
+
+ // set X, Y dev
+ SetLoStripX((Int_t)localStruct.GetXPos());
+ SetLoStripY((Int_t)localStruct.GetYPos());
+ SetLoDev((Int_t)localStruct.GetXDev());
+
+ // set L(H)pt
+ SetLoLpt(localStruct.GetLpt());
+ SetLoHpt(localStruct.GetHpt());
+
+ // set pattern X
+ SetX1Pattern(localStruct.GetX1());
+ SetX2Pattern(localStruct.GetX2());
+ SetX3Pattern(localStruct.GetX3());
+ SetX4Pattern(localStruct.GetX4());
+
+ // set pattern Y
+ SetY1Pattern(localStruct.GetY1());
+ SetY2Pattern(localStruct.GetY2());
+ SetY3Pattern(localStruct.GetY3());
+ SetY4Pattern(localStruct.GetY4());
+
+}
/// \ingroup base
/// \class AliMUONLocalTrigger
/// \brief Reconstructed Local Trigger object
+/// \author Ph. Crochet
#include <TObject.h>
#include <TArrayI.h>
+class AliMUONLocalStruct;
+
class AliMUONLocalTrigger : public TObject {
public:
AliMUONLocalTrigger();
void SetY3Pattern(UShort_t pat) {fY3Pattern = pat;}
void SetY4Pattern(UShort_t pat) {fY4Pattern = pat;}
+ void SetLocalStruct(Int_t loCircuit, AliMUONLocalStruct& localStruct);
+
// data link
Int_t NumberOfDigits() const { return fDigits.GetSize(); }
Int_t GetDigitNumber(Int_t i) const { return fDigits[i]; }
- void GetDigit(Int_t i, Int_t& chamber, Int_t& cathode, Int_t& digit) const;
+ void GetDigit(Int_t i, Int_t& chamber, Int_t& cathode, Int_t& digit) const;
static Int_t EncodeDigitNumber(Int_t chamber, Int_t cathode, Int_t digit);
- static void DecodeDigitNumber(Int_t digitnumber, Int_t& chamber, Int_t& cathode, Int_t& digit);
+ static void DecodeDigitNumber(Int_t digitnumber, Int_t& chamber, Int_t& cathode, Int_t& digit);
private:
Int_t fLoCircuit; // circuit number
UShort_t fX2Pattern; // X strip pattern for chamber 12
UShort_t fX3Pattern; // X strip pattern for chamber 21
UShort_t fX4Pattern; // X strip pattern for chamber 22
-
+
UShort_t fY1Pattern; // Y strip pattern for chamber 11
UShort_t fY2Pattern; // Y strip pattern for chamber 12
UShort_t fY3Pattern; // Y strip pattern for chamber 21
UShort_t fY4Pattern; // Y strip pattern for chamber 22
+
Char_t fLoDecision; // local decision word (4 bits)
TArrayI fDigits; // List of digit numbers from which this object was created.