]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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. * | |
8c343c7c | 14 | **************************************************************************/ |
15 | ||
e516b01d | 16 | |
30178c30 | 17 | /* $Id$ */ |
a9e2aefa | 18 | |
d1525c79 | 19 | |
a9e2aefa | 20 | #include "AliMUONGlobalTrigger.h" |
eba3379e | 21 | #include <assert.h> |
22 | #include "AliLog.h" | |
23 | #include "AliMUONLocalStruct.h" | |
a9e2aefa | 24 | |
5398f946 | 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 | |
30 | /// (Ch. Finck) | |
31 | /// \author Ph. Crochet | |
32 | ||
33 | /// \cond CLASSIMP | |
925e6570 | 34 | ClassImp(AliMUONGlobalTrigger) |
5398f946 | 35 | /// \endcond |
8d7dfec2 | 36 | |
a9e2aefa | 37 | //---------------------------------------------------------------------- |
38 | AliMUONGlobalTrigger::AliMUONGlobalTrigger() | |
8d7dfec2 | 39 | : TObject(), |
8d4fefab | 40 | fSingleLpt(0), |
41 | fSingleHpt(0), | |
42 | ||
8d7dfec2 | 43 | fPairUnlikeLpt(0), |
44 | fPairUnlikeHpt(0), | |
8d7dfec2 | 45 | |
46 | fPairLikeLpt(0), | |
ad705f30 | 47 | fPairLikeHpt(0) |
8d7dfec2 | 48 | { |
5398f946 | 49 | /// Default constructor |
a9e2aefa | 50 | } |
5398f946 | 51 | |
e9b63742 | 52 | //---------------------------------------------------------------------- |
30178c30 | 53 | AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig) |
5398f946 | 54 | : TObject(theMUONGlobalTrig), |
e9b63742 | 55 | |
8d4fefab | 56 | fSingleLpt(theMUONGlobalTrig.fSingleLpt), |
57 | fSingleHpt(theMUONGlobalTrig.fSingleHpt), | |
5398f946 | 58 | |
59 | fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt), | |
60 | fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt), | |
5398f946 | 61 | |
62 | fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt), | |
ad705f30 | 63 | fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt) |
5398f946 | 64 | { |
65 | /// Copy constructor | |
66 | } | |
67 | ||
68 | //---------------------------------------------------------------------- | |
69 | AliMUONGlobalTrigger::~AliMUONGlobalTrigger() | |
70 | { | |
71 | /// Destructor | |
e9b63742 | 72 | } |
73 | ||
74 | //---------------------------------------------------------------------- | |
30178c30 | 75 | AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig) |
e9b63742 | 76 | { |
5398f946 | 77 | /// Assignement operator; |
78 | /// equal operator (useful for non-pointer member in TClonesArray) | |
8d7dfec2 | 79 | |
30178c30 | 80 | if (this == &theMUONGlobalTrig) |
e9b63742 | 81 | return *this; |
30178c30 | 82 | |
83 | // base class assignement | |
84 | TObject::operator=(theMUONGlobalTrig); | |
e9b63742 | 85 | |
8d4fefab | 86 | fSingleLpt = theMUONGlobalTrig.fSingleLpt; |
87 | fSingleHpt = theMUONGlobalTrig.fSingleHpt; | |
e9b63742 | 88 | |
30178c30 | 89 | fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt; |
90 | fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt; | |
e9b63742 | 91 | |
30178c30 | 92 | fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt; |
93 | fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt; | |
e9b63742 | 94 | |
95 | return *this; | |
96 | } | |
97 | ||
1908473e | 98 | //----------------------------------------------------------- |
8d4fefab | 99 | void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse) |
1908473e | 100 | { |
101 | /// Set class members from global response | |
8d4fefab | 102 | /// coming from rawdata & global trigger board |
1908473e | 103 | /// [US:2, LS:2, Single:2] with [Hpt, Lpt] |
104 | /// remove Apt | |
105 | ||
106 | // don't have the information anymore of the sign | |
8d4fefab | 107 | fSingleLpt = globalResponse & 0x1; |
108 | fSingleHpt = (globalResponse >> 1) & 0x1; | |
1908473e | 109 | |
110 | fPairUnlikeLpt = (globalResponse >> 4) & 0x1; | |
111 | fPairUnlikeHpt = (globalResponse >> 5) & 0x1; | |
112 | ||
113 | fPairLikeLpt = (globalResponse >> 2) & 0x1; | |
114 | fPairLikeHpt = (globalResponse >> 3) & 0x1; | |
115 | ||
116 | } | |
8d7dfec2 | 117 | //----------------------------------------------------------- |
118 | Int_t AliMUONGlobalTrigger::GetGlobalPattern() const | |
119 | { | |
5398f946 | 120 | /// Global trigger pattern calculation |
121 | /// from class member values | |
402fb06e | 122 | |
8d7dfec2 | 123 | Int_t gloTrigPat = 0; |
402fb06e | 124 | |
8d4fefab | 125 | if (SingleLpt()) gloTrigPat|= 0x1; |
126 | if (SingleHpt()) gloTrigPat|= 0x2; | |
8d7dfec2 | 127 | |
8d4fefab | 128 | if (PairLikeLpt()) gloTrigPat|= 0x4; |
129 | if (PairLikeHpt()) gloTrigPat|= 0x8; | |
130 | ||
131 | if (PairUnlikeLpt()) gloTrigPat|= 0x10; | |
132 | if (PairUnlikeHpt()) gloTrigPat|= 0x20; | |
8d7dfec2 | 133 | |
134 | return gloTrigPat; | |
8d7dfec2 | 135 | } |
402fb06e | 136 | |
1908473e | 137 | //----------------------------------------------------------- |
138 | UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const | |
139 | { | |
140 | /// Global trigger response | |
141 | /// from class member values | |
142 | /// [US:2, LS:2, Single:2] with [Hpt, Lpt] | |
143 | /// remove Apt | |
144 | ||
145 | UChar_t response = 0; | |
146 | UChar_t respUS = 0; | |
147 | UChar_t respLS = 0; | |
148 | UChar_t respS = 0; | |
149 | ||
8d4fefab | 150 | if (SingleLpt()) respS |= 0x1; |
151 | if (SingleHpt()) respS |= 0x2; | |
1908473e | 152 | |
153 | if (PairLikeLpt()) respLS |= 0x1; | |
ad705f30 | 154 | if (PairLikeHpt()) respLS |= 0x2; |
1908473e | 155 | respLS <<= 2; |
156 | ||
157 | if (PairUnlikeLpt()) respUS |= 0x1; | |
158 | if (PairUnlikeHpt()) respUS |= 0x2; | |
159 | respUS <<= 4; | |
160 | ||
161 | response = respUS | respLS | respS; | |
162 | ||
163 | return response; | |
164 | ||
165 | } | |
eba3379e | 166 | //---------------------------------------------------------------------- |
167 | void AliMUONGlobalTrigger::Print(Option_t* opt) const | |
168 | { | |
169 | // | |
170 | // Printing Global Trigger information | |
171 | // | |
172 | TString sopt(opt); | |
173 | sopt.ToUpper(); | |
174 | if ( sopt.Contains("FULL") ) { | |
175 | ||
ad705f30 | 176 | printf("=============================================\n"); |
177 | printf(" Global Trigger output Low pt High pt\n"); | |
8d4fefab | 178 | printf(" number of Single :\t"); |
179 | printf("%i\t%i\t",SingleLpt(),SingleHpt()); | |
eba3379e | 180 | printf("\n"); |
181 | ||
182 | printf(" number of UnlikeSign pair :\t"); | |
ad705f30 | 183 | printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt()); |
eba3379e | 184 | printf("\n"); |
185 | ||
186 | printf(" number of LikeSign pair :\t"); | |
ad705f30 | 187 | printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt()); |
eba3379e | 188 | printf("\n"); |
189 | ||
ad705f30 | 190 | printf("=============================================\n"); |
eba3379e | 191 | } |
192 | } | |
402fb06e | 193 | |
194 |