]>
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" |
21 | ||
925e6570 | 22 | ClassImp(AliMUONGlobalTrigger) |
8d7dfec2 | 23 | |
24 | /// ------------------ | |
25 | /// Class AliMUONGlobalTrigger | |
26 | /// ------------------ | |
27 | // Global Trigger algorithm data output | |
28 | // built from Local and Regional algorithms | |
29 | /// Ph. Crochet | |
30 | /// | |
31 | /// update for copy & assigment operator | |
32 | /// add SetGlobalPattern and GetGlobalPattern method for rawdata | |
33 | /// Ch. Finck | |
34 | ||
35 | ||
a9e2aefa | 36 | //---------------------------------------------------------------------- |
37 | AliMUONGlobalTrigger::AliMUONGlobalTrigger() | |
8d7dfec2 | 38 | : TObject(), |
39 | fSinglePlusLpt(0), | |
40 | fSinglePlusHpt(0), | |
41 | fSinglePlusApt(0), | |
a9e2aefa | 42 | |
8d7dfec2 | 43 | fSingleMinusLpt(0), |
44 | fSingleMinusHpt(0), | |
45 | fSingleMinusApt(0), | |
a9e2aefa | 46 | |
8d7dfec2 | 47 | fSingleUndefLpt(0), |
48 | fSingleUndefHpt(0), | |
49 | fSingleUndefApt(0), | |
50 | ||
51 | fPairUnlikeLpt(0), | |
52 | fPairUnlikeHpt(0), | |
53 | fPairUnlikeApt(0), | |
54 | ||
55 | fPairLikeLpt(0), | |
56 | fPairLikeHpt(0), | |
57 | fPairLikeApt(0) | |
58 | { | |
59 | // | |
60 | // constructor | |
61 | // | |
a9e2aefa | 62 | } |
e9b63742 | 63 | //---------------------------------------------------------------------- |
30178c30 | 64 | AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig) |
65 | : TObject(theMUONGlobalTrig) | |
e9b63742 | 66 | { |
8d7dfec2 | 67 | // |
68 | // copy constructor | |
69 | // | |
30178c30 | 70 | fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt; |
71 | fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt; | |
72 | fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt; | |
e9b63742 | 73 | |
30178c30 | 74 | fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt; |
75 | fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt; | |
76 | fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt; | |
e9b63742 | 77 | |
30178c30 | 78 | fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt; |
79 | fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt; | |
80 | fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt; | |
e9b63742 | 81 | |
30178c30 | 82 | fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt; |
83 | fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt; | |
84 | fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt; | |
e9b63742 | 85 | |
30178c30 | 86 | fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt; |
87 | fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt; | |
88 | fPairLikeApt = theMUONGlobalTrig.fPairLikeApt; | |
e9b63742 | 89 | } |
90 | ||
91 | //---------------------------------------------------------------------- | |
30178c30 | 92 | AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig) |
e9b63742 | 93 | { |
8d7dfec2 | 94 | // assignement operator |
95 | // | |
96 | // equal operator (useful for non-pointer member in TClonesArray) | |
97 | ||
30178c30 | 98 | if (this == &theMUONGlobalTrig) |
e9b63742 | 99 | return *this; |
30178c30 | 100 | |
101 | // base class assignement | |
102 | TObject::operator=(theMUONGlobalTrig); | |
e9b63742 | 103 | |
30178c30 | 104 | fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt; |
105 | fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt; | |
106 | fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt; | |
e9b63742 | 107 | |
30178c30 | 108 | fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt; |
109 | fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt; | |
110 | fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt; | |
e9b63742 | 111 | |
30178c30 | 112 | fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt; |
113 | fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt; | |
114 | fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt; | |
e9b63742 | 115 | |
30178c30 | 116 | fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt; |
117 | fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt; | |
118 | fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt; | |
e9b63742 | 119 | |
30178c30 | 120 | fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt; |
121 | fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt; | |
122 | fPairLikeApt = theMUONGlobalTrig.fPairLikeApt; | |
e9b63742 | 123 | |
124 | return *this; | |
125 | } | |
126 | ||
a9e2aefa | 127 | //---------------------------------------------------------------------- |
128 | AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus, | |
129 | Int_t *singleMinus, | |
130 | Int_t *singleUndef, | |
131 | Int_t *pairUnlike, Int_t *pairLike) | |
132 | { | |
8d7dfec2 | 133 | // |
134 | // Set the Global Trigger object | |
135 | // | |
a9e2aefa | 136 | fSinglePlusLpt = singlePlus[0]; |
137 | fSinglePlusHpt = singlePlus[1]; | |
138 | fSinglePlusApt = singlePlus[2]; | |
139 | ||
140 | fSingleMinusLpt = singleMinus[0]; | |
141 | fSingleMinusHpt = singleMinus[1]; | |
142 | fSingleMinusApt = singleMinus[2]; | |
143 | ||
144 | fSingleUndefLpt = singleUndef[0]; | |
145 | fSingleUndefHpt = singleUndef[1]; | |
146 | fSingleUndefApt = singleUndef[2]; | |
147 | ||
148 | fPairUnlikeLpt = pairUnlike[0]; | |
149 | fPairUnlikeHpt = pairUnlike[1]; | |
150 | fPairUnlikeApt = pairUnlike[2]; | |
151 | ||
152 | fPairLikeLpt = pairLike[0]; | |
153 | fPairLikeHpt = pairLike[1]; | |
154 | fPairLikeApt = pairLike[2]; | |
155 | } | |
402fb06e | 156 | |
8d7dfec2 | 157 | //----------------------------------------------------------- |
158 | void AliMUONGlobalTrigger:: SetGlobalPattern(Int_t gloTrigPat) | |
159 | { | |
160 | // | |
161 | // set class member from global pattern | |
162 | // coming from rawdata | |
163 | // | |
164 | fSinglePlusLpt = (gloTrigPat ) & 0x1; | |
165 | fSinglePlusHpt = (gloTrigPat >> 1) & 0x1; | |
166 | fSinglePlusApt = (gloTrigPat >> 2) & 0x1; | |
167 | ||
168 | fSingleMinusLpt = (gloTrigPat >> 3) & 0x1; | |
169 | fSingleMinusHpt = (gloTrigPat >> 4) & 0x1; | |
170 | fSingleMinusApt = (gloTrigPat >> 5) & 0x1; | |
171 | ||
172 | fSingleUndefLpt = (gloTrigPat >> 6) & 0x1; | |
173 | fSingleUndefHpt = (gloTrigPat >> 7) & 0x1; | |
174 | fSingleUndefApt = (gloTrigPat >> 8) & 0x1; | |
175 | ||
176 | fPairUnlikeLpt = (gloTrigPat >> 9) & 0x1; | |
177 | fPairUnlikeHpt = (gloTrigPat >> 10) & 0x1; | |
178 | fPairUnlikeApt = (gloTrigPat >> 11) & 0x1; | |
179 | ||
180 | fPairLikeLpt = (gloTrigPat >> 12) & 0x1; | |
181 | fPairLikeHpt = (gloTrigPat >> 13) & 0x1; | |
182 | fPairLikeApt = (gloTrigPat >> 14) & 0x1; | |
402fb06e | 183 | |
8d7dfec2 | 184 | } |
402fb06e | 185 | |
8d7dfec2 | 186 | //----------------------------------------------------------- |
187 | Int_t AliMUONGlobalTrigger::GetGlobalPattern() const | |
188 | { | |
402fb06e | 189 | |
8d7dfec2 | 190 | // |
191 | // global trigger pattern calculation | |
192 | // from class member values | |
193 | // | |
194 | Int_t gloTrigPat = 0; | |
402fb06e | 195 | |
8d7dfec2 | 196 | if (SinglePlusLpt()) gloTrigPat|= 0x1; |
197 | if (SinglePlusHpt()) gloTrigPat|= 0x2; | |
198 | if (SinglePlusApt()) gloTrigPat|= 0x4; | |
199 | ||
200 | if (SingleMinusLpt()) gloTrigPat|= 0x8; | |
201 | if (SingleMinusHpt()) gloTrigPat|= 0x10; | |
202 | if (SingleMinusApt()) gloTrigPat|= 0x20; | |
203 | ||
204 | if (SingleUndefLpt()) gloTrigPat|= 0x40; | |
205 | if (SingleUndefHpt()) gloTrigPat|= 0x80; | |
206 | if (SingleUndefApt()) gloTrigPat|= 0x100; | |
207 | ||
208 | if (PairUnlikeLpt()) gloTrigPat|= 0x200; | |
209 | if (PairUnlikeHpt()) gloTrigPat|= 0x400; | |
210 | if (PairUnlikeApt()) gloTrigPat|= 0x800; | |
211 | ||
212 | if (PairLikeLpt()) gloTrigPat|= 0x1000; | |
213 | if (PairLikeHpt()) gloTrigPat|= 0x2000; | |
214 | if (PairLikeApt()) gloTrigPat|= 0x4000; | |
215 | ||
216 | return gloTrigPat; | |
217 | ||
218 | } | |
402fb06e | 219 | |
220 | ||
221 |