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