]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGlobalTrigger.cxx
- Added test for track ID in track reference
[u/mrichter/AliRoot.git] / MUON / AliMUONGlobalTrigger.cxx
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.                  *
14  **************************************************************************/ 
15  
16
17 /* $Id$ */
18
19
20 #include "AliMUONGlobalTrigger.h"
21
22 ClassImp(AliMUONGlobalTrigger)
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
36 //----------------------------------------------------------------------
37 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
38   : TObject(),
39     fSinglePlusLpt(0),
40     fSinglePlusHpt(0),
41     fSinglePlusApt(0),
42   
43     fSingleMinusLpt(0),
44     fSingleMinusHpt(0),
45     fSingleMinusApt(0),
46   
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   //
62 }
63 //----------------------------------------------------------------------
64 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
65   : TObject(theMUONGlobalTrig)
66 {
67   //
68   // copy constructor
69   //
70   fSinglePlusLpt  = theMUONGlobalTrig.fSinglePlusLpt;
71   fSinglePlusHpt  = theMUONGlobalTrig.fSinglePlusHpt;
72   fSinglePlusApt  = theMUONGlobalTrig.fSinglePlusApt;
73   
74   fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
75   fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
76   fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
77   
78   fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
79   fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
80   fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
81   
82   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
83   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
84   fPairUnlikeApt  = theMUONGlobalTrig.fPairUnlikeApt;
85   
86   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
87   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
88   fPairLikeApt    = theMUONGlobalTrig.fPairLikeApt;
89 }
90
91 //----------------------------------------------------------------------
92 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
93 {
94   // assignement operator
95   //
96   // equal operator (useful for non-pointer member in TClonesArray)
97
98   if (this == &theMUONGlobalTrig)
99     return *this;
100     
101   // base class assignement
102   TObject::operator=(theMUONGlobalTrig);
103
104   fSinglePlusLpt  = theMUONGlobalTrig.fSinglePlusLpt;
105   fSinglePlusHpt  = theMUONGlobalTrig.fSinglePlusHpt;
106   fSinglePlusApt  = theMUONGlobalTrig.fSinglePlusApt;
107   
108   fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
109   fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
110   fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
111   
112   fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
113   fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
114   fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
115   
116   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
117   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
118   fPairUnlikeApt  = theMUONGlobalTrig.fPairUnlikeApt;
119   
120   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
121   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
122   fPairLikeApt    = theMUONGlobalTrig.fPairLikeApt;
123
124   return *this;
125 }
126
127 //----------------------------------------------------------------------
128 AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus, 
129                                            Int_t *singleMinus,
130                                            Int_t *singleUndef,
131                                            Int_t *pairUnlike, Int_t *pairLike)
132 {
133   //
134   // Set the Global Trigger object
135   //
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 }
156
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;
183
184 }
185
186 //-----------------------------------------------------------
187 Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
188 {
189
190   //
191   // global trigger pattern calculation
192   // from class member values
193   //
194   Int_t gloTrigPat = 0;
195
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 }
219
220
221