1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 #include "AliMUONGlobalTrigger.h"
22 #include "AliMUONLocalStruct.h"
24 //-----------------------------------------------------------------------------
25 /// \class AliMUONGlobalTrigger
26 /// Global Trigger algorithm data output.
27 /// Built from Local and Regional algorithms. \n
28 /// Update for copy & assigment operator,
29 /// add SetGlobalPattern and GetGlobalPattern method for rawdata
31 /// \author Ph. Crochet
32 //-----------------------------------------------------------------------------
35 ClassImp(AliMUONGlobalTrigger)
38 //----------------------------------------------------------------------
39 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
50 /// Default constructor
51 AliDebug(1,Form("this=%p",this));
52 for (Int_t i = 0; i < 4; i++) fInput[i] = 0;
55 //----------------------------------------------------------------------
56 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
57 : TObject(theMUONGlobalTrig),
59 fSingleLpt(theMUONGlobalTrig.fSingleLpt),
60 fSingleHpt(theMUONGlobalTrig.fSingleHpt),
62 fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
63 fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
65 fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
66 fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
69 AliDebug(1,Form("this=%p copy ctor",this));
70 for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
74 //----------------------------------------------------------------------
75 AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
78 AliDebug(1,Form("this=%p",this));
81 //----------------------------------------------------------------------
82 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
84 /// Assignement operator;
85 /// equal operator (useful for non-pointer member in TClonesArray)
87 if (this == &theMUONGlobalTrig)
90 // base class assignement
91 TObject::operator=(theMUONGlobalTrig);
93 fSingleLpt = theMUONGlobalTrig.fSingleLpt;
94 fSingleHpt = theMUONGlobalTrig.fSingleHpt;
96 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
97 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
99 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
100 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
102 for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
107 //-----------------------------------------------------------
108 void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
110 /// Set class members from global response
111 /// coming from rawdata & global trigger board
112 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
115 fSingleLpt = (globalResponse >> 1) & 0x1;
116 fSingleHpt = (globalResponse >> 2) & 0x1;
118 fPairLikeLpt = (globalResponse >> 3) & 0x1;
119 fPairLikeHpt = (globalResponse >> 4) & 0x1;
121 fPairUnlikeLpt = (globalResponse >> 5) & 0x1;
122 fPairUnlikeHpt = (globalResponse >> 6) & 0x1;
126 //-----------------------------------------------------------
127 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
129 /// Global trigger response
130 /// from class member values
131 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
133 UChar_t response = 0;
135 if (SingleLpt()) response|= 0x2;
136 if (SingleHpt()) response|= 0x4;
138 if (PairLikeLpt()) response|= 0x8;
139 if (PairLikeHpt()) response|= 0x10;
141 if (PairUnlikeLpt()) response|= 0x20;
142 if (PairUnlikeHpt()) response|= 0x40;
147 //-----------------------------------------------------------
148 void AliMUONGlobalTrigger::SetFromGlobalInput(const UInt_t *globalInput)
150 /// Global trigger board input
151 /// 4 words each of 32 bits
153 for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
157 //----------------------------------------------------------------------
158 void AliMUONGlobalTrigger::Print(Option_t*) const
161 /// Printing Global Trigger information
163 printf("=============================================\n");
164 printf(" Global Trigger output Low pt High pt\n");
165 printf(" Single :\t");
166 printf("%i\t%i\t",SingleLpt(),SingleHpt());
169 printf(" UnlikeSign pair :\t");
170 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
173 printf(" LikeSign pair :\t");
174 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
177 printf("=============================================\n");