1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 #include "AliMUONGlobalTrigger.h"
23 #include "AliMUONLocalStruct.h"
25 ClassImp(AliMUONGlobalTrigger)
27 /// ------------------
28 /// Class AliMUONGlobalTrigger
29 /// ------------------
30 // Global Trigger algorithm data output
31 // built from Local and Regional algorithms
34 /// update for copy & assigment operator
35 /// add SetGlobalPattern and GetGlobalPattern method for rawdata
39 //----------------------------------------------------------------------
40 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
66 //----------------------------------------------------------------------
67 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
68 : TObject(theMUONGlobalTrig)
73 fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt;
74 fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt;
75 fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt;
77 fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
78 fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
79 fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
81 fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
82 fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
83 fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
85 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
86 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
87 fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt;
89 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
90 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
91 fPairLikeApt = theMUONGlobalTrig.fPairLikeApt;
94 //----------------------------------------------------------------------
95 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
97 // assignement operator
99 // equal operator (useful for non-pointer member in TClonesArray)
101 if (this == &theMUONGlobalTrig)
104 // base class assignement
105 TObject::operator=(theMUONGlobalTrig);
107 fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt;
108 fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt;
109 fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt;
111 fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
112 fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
113 fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
115 fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
116 fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
117 fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
119 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
120 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
121 fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt;
123 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
124 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
125 fPairLikeApt = theMUONGlobalTrig.fPairLikeApt;
130 //----------------------------------------------------------------------
131 AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus,
134 Int_t *pairUnlike, Int_t *pairLike)
137 // Set the Global Trigger object
139 fSinglePlusLpt = singlePlus[0];
140 fSinglePlusHpt = singlePlus[1];
141 fSinglePlusApt = singlePlus[2];
143 fSingleMinusLpt = singleMinus[0];
144 fSingleMinusHpt = singleMinus[1];
145 fSingleMinusApt = singleMinus[2];
147 fSingleUndefLpt = singleUndef[0];
148 fSingleUndefHpt = singleUndef[1];
149 fSingleUndefApt = singleUndef[2];
151 fPairUnlikeLpt = pairUnlike[0];
152 fPairUnlikeHpt = pairUnlike[1];
153 fPairUnlikeApt = pairUnlike[2];
155 fPairLikeLpt = pairLike[0];
156 fPairLikeHpt = pairLike[1];
157 fPairLikeApt = pairLike[2];
160 //-----------------------------------------------------------
161 void AliMUONGlobalTrigger:: SetGlobalPattern(Int_t gloTrigPat)
164 // set class member from global pattern
165 // coming from rawdata
167 fSinglePlusLpt = (gloTrigPat ) & 0x1;
168 fSinglePlusHpt = (gloTrigPat >> 1) & 0x1;
169 fSinglePlusApt = (gloTrigPat >> 2) & 0x1;
171 fSingleMinusLpt = (gloTrigPat >> 3) & 0x1;
172 fSingleMinusHpt = (gloTrigPat >> 4) & 0x1;
173 fSingleMinusApt = (gloTrigPat >> 5) & 0x1;
175 fSingleUndefLpt = (gloTrigPat >> 6) & 0x1;
176 fSingleUndefHpt = (gloTrigPat >> 7) & 0x1;
177 fSingleUndefApt = (gloTrigPat >> 8) & 0x1;
179 fPairUnlikeLpt = (gloTrigPat >> 9) & 0x1;
180 fPairUnlikeHpt = (gloTrigPat >> 10) & 0x1;
181 fPairUnlikeApt = (gloTrigPat >> 11) & 0x1;
183 fPairLikeLpt = (gloTrigPat >> 12) & 0x1;
184 fPairLikeHpt = (gloTrigPat >> 13) & 0x1;
185 fPairLikeApt = (gloTrigPat >> 14) & 0x1;
189 //-----------------------------------------------------------
190 Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
194 // global trigger pattern calculation
195 // from class member values
197 Int_t gloTrigPat = 0;
199 if (SinglePlusLpt()) gloTrigPat|= 0x1;
200 if (SinglePlusHpt()) gloTrigPat|= 0x2;
201 if (SinglePlusApt()) gloTrigPat|= 0x4;
203 if (SingleMinusLpt()) gloTrigPat|= 0x8;
204 if (SingleMinusHpt()) gloTrigPat|= 0x10;
205 if (SingleMinusApt()) gloTrigPat|= 0x20;
207 if (SingleUndefLpt()) gloTrigPat|= 0x40;
208 if (SingleUndefHpt()) gloTrigPat|= 0x80;
209 if (SingleUndefApt()) gloTrigPat|= 0x100;
211 if (PairUnlikeLpt()) gloTrigPat|= 0x200;
212 if (PairUnlikeHpt()) gloTrigPat|= 0x400;
213 if (PairUnlikeApt()) gloTrigPat|= 0x800;
215 if (PairLikeLpt()) gloTrigPat|= 0x1000;
216 if (PairLikeHpt()) gloTrigPat|= 0x2000;
217 if (PairLikeApt()) gloTrigPat|= 0x4000;
223 //----------------------------------------------------------------------
224 void AliMUONGlobalTrigger::Print(Option_t* opt) const
227 // Printing Global Trigger information
231 if ( sopt.Contains("FULL") ) {
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());
239 printf(" number of Single Minus :\t");
240 printf("%i\t%i\t%i\t",SingleMinusLpt(),SingleMinusHpt(),SingleMinusApt());
243 printf(" number of Single Undefined :\t");
244 printf("%i\t%i\t%i\t",SingleUndefLpt(),SingleUndefHpt(),SingleUndefApt());
247 printf(" number of UnlikeSign pair :\t");
248 printf("%i\t%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt(),PairUnlikeApt());
251 printf(" number of LikeSign pair :\t");
252 printf("%i\t%i\t%i\t",PairLikeLpt(),PairLikeHpt(),PairLikeApt());
255 printf("===================================================\n");