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 // don't have the information anymore of the sign
116 fSingleLpt = globalResponse & 0x1;
117 fSingleHpt = (globalResponse >> 1) & 0x1;
119 fPairUnlikeLpt = (globalResponse >> 4) & 0x1;
120 fPairUnlikeHpt = (globalResponse >> 5) & 0x1;
122 fPairLikeLpt = (globalResponse >> 2) & 0x1;
123 fPairLikeHpt = (globalResponse >> 3) & 0x1;
127 //-----------------------------------------------------------
128 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
130 /// Global trigger response
131 /// from class member values
132 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
136 if (SingleLpt()) response|= 0x1;
137 if (SingleHpt()) response|= 0x2;
139 if (PairLikeLpt()) response|= 0x4;
140 if (PairLikeHpt()) response|= 0x8;
142 if (PairUnlikeLpt()) response|= 0x10;
143 if (PairUnlikeHpt()) response|= 0x20;
148 //-----------------------------------------------------------
149 void AliMUONGlobalTrigger::SetFromGlobalInput(UInt_t *globalInput)
151 /// Global trigger board input
152 /// 4 words each of 32 bits
154 for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
158 //----------------------------------------------------------------------
159 void AliMUONGlobalTrigger::Print(Option_t*) const
162 /// Printing Global Trigger information
164 printf("=============================================\n");
165 printf(" Global Trigger output Low pt High pt\n");
166 printf(" Single :\t");
167 printf("%i\t%i\t",SingleLpt(),SingleHpt());
170 printf(" UnlikeSign pair :\t");
171 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
174 printf(" LikeSign pair :\t");
175 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
178 printf("=============================================\n");