]>
Commit | Line | Data |
---|---|---|
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. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ||
17 | /* $Id$ */ | |
18 | ||
19 | ||
20 | #include "AliMUONGlobalTrigger.h" | |
21 | #include <assert.h> | |
22 | #include "AliLog.h" | |
23 | #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 | |
30 | /// (Ch. Finck) | |
31 | /// \author Ph. Crochet | |
32 | ||
33 | /// \cond CLASSIMP | |
34 | ClassImp(AliMUONGlobalTrigger) | |
35 | /// \endcond | |
36 | ||
37 | //---------------------------------------------------------------------- | |
38 | AliMUONGlobalTrigger::AliMUONGlobalTrigger() | |
39 | : TObject(), | |
40 | fSinglePlusLpt(0), | |
41 | fSinglePlusHpt(0), | |
42 | fSinglePlusApt(0), | |
43 | ||
44 | fSingleMinusLpt(0), | |
45 | fSingleMinusHpt(0), | |
46 | fSingleMinusApt(0), | |
47 | ||
48 | fSingleUndefLpt(0), | |
49 | fSingleUndefHpt(0), | |
50 | fSingleUndefApt(0), | |
51 | ||
52 | fPairUnlikeLpt(0), | |
53 | fPairUnlikeHpt(0), | |
54 | fPairUnlikeApt(0), | |
55 | ||
56 | fPairLikeLpt(0), | |
57 | fPairLikeHpt(0), | |
58 | fPairLikeApt(0) | |
59 | { | |
60 | /// Default constructor | |
61 | } | |
62 | ||
63 | //---------------------------------------------------------------------- | |
64 | AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig) | |
65 | : TObject(theMUONGlobalTrig), | |
66 | ||
67 | fSinglePlusLpt(theMUONGlobalTrig.fSinglePlusLpt), | |
68 | fSinglePlusHpt(theMUONGlobalTrig.fSinglePlusHpt), | |
69 | fSinglePlusApt(theMUONGlobalTrig.fSinglePlusApt), | |
70 | ||
71 | fSingleMinusLpt(theMUONGlobalTrig.fSingleMinusLpt), | |
72 | fSingleMinusHpt(theMUONGlobalTrig.fSingleMinusHpt), | |
73 | fSingleMinusApt(theMUONGlobalTrig.fSingleMinusApt), | |
74 | ||
75 | fSingleUndefLpt(theMUONGlobalTrig.fSingleUndefLpt), | |
76 | fSingleUndefHpt(theMUONGlobalTrig.fSingleUndefHpt), | |
77 | fSingleUndefApt(theMUONGlobalTrig.fSingleUndefApt), | |
78 | ||
79 | fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt), | |
80 | fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt), | |
81 | fPairUnlikeApt(theMUONGlobalTrig.fPairUnlikeApt), | |
82 | ||
83 | fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt), | |
84 | fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt), | |
85 | fPairLikeApt(theMUONGlobalTrig.fPairLikeApt) | |
86 | { | |
87 | /// Copy constructor | |
88 | } | |
89 | ||
90 | //---------------------------------------------------------------------- | |
91 | AliMUONGlobalTrigger::~AliMUONGlobalTrigger() | |
92 | { | |
93 | /// Destructor | |
94 | } | |
95 | ||
96 | //---------------------------------------------------------------------- | |
97 | AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig) | |
98 | { | |
99 | /// Assignement operator; | |
100 | /// equal operator (useful for non-pointer member in TClonesArray) | |
101 | ||
102 | if (this == &theMUONGlobalTrig) | |
103 | return *this; | |
104 | ||
105 | // base class assignement | |
106 | TObject::operator=(theMUONGlobalTrig); | |
107 | ||
108 | fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt; | |
109 | fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt; | |
110 | fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt; | |
111 | ||
112 | fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt; | |
113 | fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt; | |
114 | fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt; | |
115 | ||
116 | fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt; | |
117 | fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt; | |
118 | fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt; | |
119 | ||
120 | fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt; | |
121 | fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt; | |
122 | fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt; | |
123 | ||
124 | fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt; | |
125 | fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt; | |
126 | fPairLikeApt = theMUONGlobalTrig.fPairLikeApt; | |
127 | ||
128 | return *this; | |
129 | } | |
130 | ||
131 | //---------------------------------------------------------------------- | |
132 | AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus, | |
133 | Int_t *singleMinus, | |
134 | Int_t *singleUndef, | |
135 | Int_t *pairUnlike, Int_t *pairLike) | |
136 | : TObject(), | |
137 | ||
138 | fSinglePlusLpt(singlePlus[0]), | |
139 | fSinglePlusHpt(singlePlus[1]), | |
140 | fSinglePlusApt(singlePlus[2]), | |
141 | ||
142 | fSingleMinusLpt(singleMinus[0]), | |
143 | fSingleMinusHpt(singleMinus[1]), | |
144 | fSingleMinusApt(singleMinus[2]), | |
145 | ||
146 | fSingleUndefLpt(singleUndef[0]), | |
147 | fSingleUndefHpt(singleUndef[1]), | |
148 | fSingleUndefApt(singleUndef[2]), | |
149 | ||
150 | fPairUnlikeLpt(pairUnlike[0]), | |
151 | fPairUnlikeHpt(pairUnlike[1]), | |
152 | fPairUnlikeApt(pairUnlike[2]), | |
153 | ||
154 | fPairLikeLpt(pairLike[0]), | |
155 | fPairLikeHpt(pairLike[1]), | |
156 | fPairLikeApt(pairLike[2]) | |
157 | ||
158 | { | |
159 | /// Set the Global Trigger object | |
160 | } | |
161 | ||
162 | //----------------------------------------------------------- | |
163 | void AliMUONGlobalTrigger::SetGlobalPattern(Int_t gloTrigPat) | |
164 | { | |
165 | /// Set class member from global pattern | |
166 | /// coming from rawdata | |
167 | /// [Hpt, Lpt] with [+, -, LS, US] | |
168 | ||
169 | fSinglePlusLpt = (gloTrigPat ) & 0x1; | |
170 | fSinglePlusHpt = (gloTrigPat >> 1) & 0x1; | |
171 | fSinglePlusApt = (gloTrigPat >> 2) & 0x1; | |
172 | ||
173 | fSingleMinusLpt = (gloTrigPat >> 3) & 0x1; | |
174 | fSingleMinusHpt = (gloTrigPat >> 4) & 0x1; | |
175 | fSingleMinusApt = (gloTrigPat >> 5) & 0x1; | |
176 | ||
177 | fSingleUndefLpt = (gloTrigPat >> 6) & 0x1; | |
178 | fSingleUndefHpt = (gloTrigPat >> 7) & 0x1; | |
179 | fSingleUndefApt = (gloTrigPat >> 8) & 0x1; | |
180 | ||
181 | fPairUnlikeLpt = (gloTrigPat >> 9) & 0x1; | |
182 | fPairUnlikeHpt = (gloTrigPat >> 10) & 0x1; | |
183 | fPairUnlikeApt = (gloTrigPat >> 11) & 0x1; | |
184 | ||
185 | fPairLikeLpt = (gloTrigPat >> 12) & 0x1; | |
186 | fPairLikeHpt = (gloTrigPat >> 13) & 0x1; | |
187 | fPairLikeApt = (gloTrigPat >> 14) & 0x1; | |
188 | ||
189 | } | |
190 | //----------------------------------------------------------- | |
191 | void AliMUONGlobalTrigger::SetGlobalPattern(UShort_t globalResponse) | |
192 | { | |
193 | /// Set class member from global response | |
194 | /// coming from trigger electronics | |
195 | /// should be unformized with rawdata (->oct 06) | |
196 | /// [Hpt, Lpt, Apt] with [+, -, US, LS] | |
197 | fSinglePlusLpt = ((globalResponse & 0xC0) >> 6) == 2; | |
198 | fSinglePlusHpt = ((globalResponse & 0xC00) >> 10) == 2; | |
199 | fSinglePlusApt = ((globalResponse & 0xC) >> 2) == 2; | |
200 | ||
201 | fSingleMinusLpt = ((globalResponse & 0xC0) >> 6) == 1; | |
202 | fSingleMinusHpt = ((globalResponse & 0xC00) >> 10) == 1; | |
203 | fSingleMinusApt = ((globalResponse & 0xC) >> 2) == 1; | |
204 | ||
205 | fSingleUndefLpt = ((globalResponse & 0xC0) >> 6) == 3; | |
206 | fSingleUndefHpt = ((globalResponse & 0xC00) >> 10) == 3; | |
207 | fSingleUndefApt = ((globalResponse & 0xC) >> 2) == 3; | |
208 | ||
209 | fPairUnlikeLpt = (globalResponse & 0x10) >> 4; | |
210 | fPairUnlikeHpt = (globalResponse & 0x100) >> 8; | |
211 | fPairUnlikeApt = (globalResponse & 0x1); | |
212 | ||
213 | fPairLikeLpt = (globalResponse & 0x20) >> 5; | |
214 | fPairLikeHpt = (globalResponse & 0x200) >> 9; | |
215 | fPairLikeApt = (globalResponse & 0x2) >> 1; | |
216 | ||
217 | } | |
218 | //----------------------------------------------------------- | |
219 | void AliMUONGlobalTrigger::SetFromGlobalResponse(UChar_t globalResponse) | |
220 | { | |
221 | /// Set class members from global response | |
222 | /// coming from rawdata | |
223 | /// [US:2, LS:2, Single:2] with [Hpt, Lpt] | |
224 | /// remove Apt | |
225 | ||
226 | // don't have the information anymore of the sign | |
227 | fSinglePlusLpt = fSingleMinusLpt = globalResponse & 0x1; | |
228 | fSinglePlusHpt = fSingleMinusHpt = (globalResponse >> 1) & 0x1; | |
229 | ||
230 | fPairUnlikeLpt = (globalResponse >> 4) & 0x1; | |
231 | fPairUnlikeHpt = (globalResponse >> 5) & 0x1; | |
232 | ||
233 | fPairLikeLpt = (globalResponse >> 2) & 0x1; | |
234 | fPairLikeHpt = (globalResponse >> 3) & 0x1; | |
235 | ||
236 | } | |
237 | //----------------------------------------------------------- | |
238 | Int_t AliMUONGlobalTrigger::GetGlobalPattern() const | |
239 | { | |
240 | /// Global trigger pattern calculation | |
241 | /// from class member values | |
242 | ||
243 | Int_t gloTrigPat = 0; | |
244 | ||
245 | if (SinglePlusLpt()) gloTrigPat|= 0x1; | |
246 | if (SinglePlusHpt()) gloTrigPat|= 0x2; | |
247 | if (SinglePlusApt()) gloTrigPat|= 0x4; | |
248 | ||
249 | if (SingleMinusLpt()) gloTrigPat|= 0x8; | |
250 | if (SingleMinusHpt()) gloTrigPat|= 0x10; | |
251 | if (SingleMinusApt()) gloTrigPat|= 0x20; | |
252 | ||
253 | if (SingleUndefLpt()) gloTrigPat|= 0x40; | |
254 | if (SingleUndefHpt()) gloTrigPat|= 0x80; | |
255 | if (SingleUndefApt()) gloTrigPat|= 0x100; | |
256 | ||
257 | if (PairUnlikeLpt()) gloTrigPat|= 0x200; | |
258 | if (PairUnlikeHpt()) gloTrigPat|= 0x400; | |
259 | if (PairUnlikeApt()) gloTrigPat|= 0x800; | |
260 | ||
261 | if (PairLikeLpt()) gloTrigPat|= 0x1000; | |
262 | if (PairLikeHpt()) gloTrigPat|= 0x2000; | |
263 | if (PairLikeApt()) gloTrigPat|= 0x4000; | |
264 | ||
265 | return gloTrigPat; | |
266 | ||
267 | } | |
268 | ||
269 | ||
270 | //----------------------------------------------------------- | |
271 | UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const | |
272 | { | |
273 | /// Global trigger response | |
274 | /// from class member values | |
275 | /// [US:2, LS:2, Single:2] with [Hpt, Lpt] | |
276 | /// remove Apt | |
277 | ||
278 | UChar_t response = 0; | |
279 | UChar_t respUS = 0; | |
280 | UChar_t respLS = 0; | |
281 | UChar_t respS = 0; | |
282 | ||
283 | if (SinglePlusLpt() || SingleMinusLpt()) respS |= 0x1; | |
284 | if (SinglePlusHpt() || SingleMinusHpt()) respS |= 0x2; | |
285 | ||
286 | if (PairLikeLpt()) respLS |= 0x1; | |
287 | if (PairLikeHpt()) respLS |= 0x1; | |
288 | respLS <<= 2; | |
289 | ||
290 | if (PairUnlikeLpt()) respUS |= 0x1; | |
291 | if (PairUnlikeHpt()) respUS |= 0x2; | |
292 | respUS <<= 4; | |
293 | ||
294 | response = respUS | respLS | respS; | |
295 | ||
296 | return response; | |
297 | ||
298 | } | |
299 | //---------------------------------------------------------------------- | |
300 | void AliMUONGlobalTrigger::Print(Option_t* opt) const | |
301 | { | |
302 | // | |
303 | // Printing Global Trigger information | |
304 | // | |
305 | TString sopt(opt); | |
306 | sopt.ToUpper(); | |
307 | if ( sopt.Contains("FULL") ) { | |
308 | ||
309 | printf("===================================================\n"); | |
310 | printf(" Global Trigger output Low pt High pt All\n"); | |
311 | printf(" number of Single Plus :\t"); | |
312 | printf("%i\t%i\t%i\t",SinglePlusLpt(),SinglePlusHpt(),SinglePlusApt()); | |
313 | printf("\n"); | |
314 | ||
315 | printf(" number of Single Minus :\t"); | |
316 | printf("%i\t%i\t%i\t",SingleMinusLpt(),SingleMinusHpt(),SingleMinusApt()); | |
317 | printf("\n"); | |
318 | ||
319 | printf(" number of Single Undefined :\t"); | |
320 | printf("%i\t%i\t%i\t",SingleUndefLpt(),SingleUndefHpt(),SingleUndefApt()); | |
321 | printf("\n"); | |
322 | ||
323 | printf(" number of UnlikeSign pair :\t"); | |
324 | printf("%i\t%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt(),PairUnlikeApt()); | |
325 | printf("\n"); | |
326 | ||
327 | printf(" number of LikeSign pair :\t"); | |
328 | printf("%i\t%i\t%i\t",PairLikeLpt(),PairLikeHpt(),PairLikeApt()); | |
329 | printf("\n"); | |
330 | ||
331 | printf("===================================================\n"); | |
332 | } | |
333 | } | |
334 | ||
335 |