]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGlobalTrigger.cxx
renamed CorrectionMatrix class
[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 #include <assert.h>
22 #include "AliLog.h"
23 #include "AliMUONLocalStruct.h"
24
25 ClassImp(AliMUONGlobalTrigger)
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
39 //----------------------------------------------------------------------
40 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
41   : TObject(),
42     fSinglePlusLpt(0),
43     fSinglePlusHpt(0),
44     fSinglePlusApt(0),
45   
46     fSingleMinusLpt(0),
47     fSingleMinusHpt(0),
48     fSingleMinusApt(0),
49   
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   //
65 }
66 //----------------------------------------------------------------------
67 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
68   : TObject(theMUONGlobalTrig)
69 {
70   //
71   // copy constructor
72   //
73   fSinglePlusLpt  = theMUONGlobalTrig.fSinglePlusLpt;
74   fSinglePlusHpt  = theMUONGlobalTrig.fSinglePlusHpt;
75   fSinglePlusApt  = theMUONGlobalTrig.fSinglePlusApt;
76   
77   fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
78   fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
79   fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
80   
81   fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
82   fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
83   fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
84   
85   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
86   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
87   fPairUnlikeApt  = theMUONGlobalTrig.fPairUnlikeApt;
88   
89   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
90   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
91   fPairLikeApt    = theMUONGlobalTrig.fPairLikeApt;
92 }
93
94 //----------------------------------------------------------------------
95 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
96 {
97   // assignement operator
98   //
99   // equal operator (useful for non-pointer member in TClonesArray)
100
101   if (this == &theMUONGlobalTrig)
102     return *this;
103     
104   // base class assignement
105   TObject::operator=(theMUONGlobalTrig);
106
107   fSinglePlusLpt  = theMUONGlobalTrig.fSinglePlusLpt;
108   fSinglePlusHpt  = theMUONGlobalTrig.fSinglePlusHpt;
109   fSinglePlusApt  = theMUONGlobalTrig.fSinglePlusApt;
110   
111   fSingleMinusLpt = theMUONGlobalTrig.fSingleMinusLpt;
112   fSingleMinusHpt = theMUONGlobalTrig.fSingleMinusHpt;
113   fSingleMinusApt = theMUONGlobalTrig.fSingleMinusApt;
114   
115   fSingleUndefLpt = theMUONGlobalTrig.fSingleUndefLpt;
116   fSingleUndefHpt = theMUONGlobalTrig.fSingleUndefHpt;
117   fSingleUndefApt = theMUONGlobalTrig.fSingleUndefApt;
118   
119   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
120   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
121   fPairUnlikeApt  = theMUONGlobalTrig.fPairUnlikeApt;
122   
123   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
124   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
125   fPairLikeApt    = theMUONGlobalTrig.fPairLikeApt;
126
127   return *this;
128 }
129
130 //----------------------------------------------------------------------
131 AliMUONGlobalTrigger::AliMUONGlobalTrigger(Int_t *singlePlus, 
132                                            Int_t *singleMinus,
133                                            Int_t *singleUndef,
134                                            Int_t *pairUnlike, Int_t *pairLike)
135 {
136   //
137   // Set the Global Trigger object
138   //
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 }
159
160 //-----------------------------------------------------------
161 void 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;
186
187 }
188
189 //-----------------------------------------------------------
190 Int_t AliMUONGlobalTrigger::GetGlobalPattern() const
191 {
192
193   //
194   // global trigger pattern calculation
195   // from class member values
196   //
197   Int_t gloTrigPat = 0;
198
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 }
222
223 //----------------------------------------------------------------------
224 void 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 }
258
259