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"
22 ClassImp(AliMUONGlobalTrigger)
24 /// ------------------
25 /// Class AliMUONGlobalTrigger
26 /// ------------------
27 // Global Trigger algorithm data output
28 // built from Local and Regional algorithms
31 /// update for copy & assigment operator
32 /// add SetGlobalPattern and GetGlobalPattern method for rawdata
36 //----------------------------------------------------------------------
37 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
63 //----------------------------------------------------------------------
64 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
65 : TObject(theMUONGlobalTrig)
70 fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt;
71 fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt;
72 fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt;
74 fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
75 fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
76 fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
78 fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
79 fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
80 fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
82 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
83 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
84 fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt;
86 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
87 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
88 fPairLikeApt = theMUONGlobalTrig.fPairLikeApt;
91 //----------------------------------------------------------------------
92 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
94 // assignement operator
96 // equal operator (useful for non-pointer member in TClonesArray)
98 if (this == &theMUONGlobalTrig)
101 // base class assignement
102 TObject::operator=(theMUONGlobalTrig);
104 fSinglePlusLpt = theMUONGlobalTrig.fSinglePlusLpt;
105 fSinglePlusHpt = theMUONGlobalTrig.fSinglePlusHpt;
106 fSinglePlusApt = theMUONGlobalTrig.fSinglePlusApt;
108 fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
109 fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
110 fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
112 fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
113 fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
114 fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
116 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
117 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
118 fPairUnlikeApt = theMUONGlobalTrig.fPairUnlikeApt;
120 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
121 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
122 fPairLikeApt = theMUONGlobalTrig.fPairLikeApt;
127 //----------------------------------------------------------------------
128 AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus,
131 Int_t *pairUnlike, Int_t *pairLike)
134 // Set the Global Trigger object
136 fSinglePlusLpt = singlePlus[0];
137 fSinglePlusHpt = singlePlus[1];
138 fSinglePlusApt = singlePlus[2];
140 fSingleMinusLpt = singleMinus[0];
141 fSingleMinusHpt = singleMinus[1];
142 fSingleMinusApt = singleMinus[2];
144 fSingleUndefLpt = singleUndef[0];
145 fSingleUndefHpt = singleUndef[1];
146 fSingleUndefApt = singleUndef[2];
148 fPairUnlikeLpt = pairUnlike[0];
149 fPairUnlikeHpt = pairUnlike[1];
150 fPairUnlikeApt = pairUnlike[2];
152 fPairLikeLpt = pairLike[0];
153 fPairLikeHpt = pairLike[1];
154 fPairLikeApt = pairLike[2];
157 //-----------------------------------------------------------
158 void AliMUONGlobalTrigger:: SetGlobalPattern(Int_t gloTrigPat)
161 // set class member from global pattern
162 // coming from rawdata
164 fSinglePlusLpt = (gloTrigPat ) & 0x1;
165 fSinglePlusHpt = (gloTrigPat >> 1) & 0x1;
166 fSinglePlusApt = (gloTrigPat >> 2) & 0x1;
168 fSingleMinusLpt = (gloTrigPat >> 3) & 0x1;
169 fSingleMinusHpt = (gloTrigPat >> 4) & 0x1;
170 fSingleMinusApt = (gloTrigPat >> 5) & 0x1;
172 fSingleUndefLpt = (gloTrigPat >> 6) & 0x1;
173 fSingleUndefHpt = (gloTrigPat >> 7) & 0x1;
174 fSingleUndefApt = (gloTrigPat >> 8) & 0x1;
176 fPairUnlikeLpt = (gloTrigPat >> 9) & 0x1;
177 fPairUnlikeHpt = (gloTrigPat >> 10) & 0x1;
178 fPairUnlikeApt = (gloTrigPat >> 11) & 0x1;
180 fPairLikeLpt = (gloTrigPat >> 12) & 0x1;
181 fPairLikeHpt = (gloTrigPat >> 13) & 0x1;
182 fPairLikeApt = (gloTrigPat >> 14) & 0x1;
186 //-----------------------------------------------------------
187 Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
191 // global trigger pattern calculation
192 // from class member values
194 Int_t gloTrigPat = 0;
196 if (SinglePlusLpt()) gloTrigPat|= 0x1;
197 if (SinglePlusHpt()) gloTrigPat|= 0x2;
198 if (SinglePlusApt()) gloTrigPat|= 0x4;
200 if (SingleMinusLpt()) gloTrigPat|= 0x8;
201 if (SingleMinusHpt()) gloTrigPat|= 0x10;
202 if (SingleMinusApt()) gloTrigPat|= 0x20;
204 if (SingleUndefLpt()) gloTrigPat|= 0x40;
205 if (SingleUndefHpt()) gloTrigPat|= 0x80;
206 if (SingleUndefApt()) gloTrigPat|= 0x100;
208 if (PairUnlikeLpt()) gloTrigPat|= 0x200;
209 if (PairUnlikeHpt()) gloTrigPat|= 0x400;
210 if (PairUnlikeApt()) gloTrigPat|= 0x800;
212 if (PairLikeLpt()) gloTrigPat|= 0x1000;
213 if (PairLikeHpt()) gloTrigPat|= 0x2000;
214 if (PairLikeApt()) gloTrigPat|= 0x4000;