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