AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONLocalTrigger.cxx
Go to the documentation of this file.
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 /* $Id$ */
17 
18 
19 #include "AliMUONLocalTrigger.h"
20 #include "AliLog.h"
21 #include "AliMUONLocalStruct.h"
23 #include <Riostream.h>
24 #include <TArrayS.h>
25 
26 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 
34 using std::endl;
35 using std::cout;
39 
40 //----------------------------------------------------------------------
42  : TObject(),
43  fLoCircuit(0),
44  fLoStripX(0),
45  fLoDev(0),
46  fLoSdev(1),
47  fLoTrigY(1),
48  fLoStripY(15),
49  fLoLpt(0),
50  fLoHpt(0),
51 
52  fX1Pattern(0),
53  fX2Pattern(0),
54  fX3Pattern(0),
55  fX4Pattern(0),
56 
57  fY1Pattern(0),
58  fY2Pattern(0),
59  fY3Pattern(0),
60  fY4Pattern(0),
61 
62  fHitPatternFromResponse(0xFF),
63  fTriggerWithoutChamber(0)
64 {
66 }
67 //----------------------------------------------------------------------
69  : TObject(theMUONLocalTrig),
70  fLoCircuit(theMUONLocalTrig.fLoCircuit),
71  fLoStripX(theMUONLocalTrig.fLoStripX),
72  fLoDev(theMUONLocalTrig.fLoDev),
73  fLoSdev(theMUONLocalTrig.fLoSdev),
74  fLoTrigY(theMUONLocalTrig.fLoTrigY),
75  fLoStripY(theMUONLocalTrig.fLoStripY),
76  fLoLpt(theMUONLocalTrig.fLoLpt),
77  fLoHpt(theMUONLocalTrig.fLoHpt),
78 
79  fX1Pattern(theMUONLocalTrig.fX1Pattern),
80  fX2Pattern(theMUONLocalTrig.fX2Pattern),
81  fX3Pattern(theMUONLocalTrig.fX3Pattern),
82  fX4Pattern(theMUONLocalTrig.fX4Pattern),
83 
84  fY1Pattern(theMUONLocalTrig.fY1Pattern),
85  fY2Pattern(theMUONLocalTrig.fY2Pattern),
86  fY3Pattern(theMUONLocalTrig.fY3Pattern),
87  fY4Pattern(theMUONLocalTrig.fY4Pattern),
88 
89  fHitPatternFromResponse(theMUONLocalTrig.fHitPatternFromResponse),
90  fTriggerWithoutChamber(theMUONLocalTrig.fTriggerWithoutChamber)
91 {
93 
94 }
95 
96 //----------------------------------------------------------------------
98 {
100 }
101 
102 //----------------------------------------------------------------------
104 {
107 
108  if (this == &theMUONLocalTrig)
109  return *this;
110 
111  // base class assignement
112  TObject::operator=(theMUONLocalTrig);
113 
114  fLoCircuit = theMUONLocalTrig.fLoCircuit;
115  fLoStripX = theMUONLocalTrig.fLoStripX;
116  fLoDev = theMUONLocalTrig.fLoDev;
117  fLoSdev = theMUONLocalTrig.fLoSdev;
118  fLoTrigY = theMUONLocalTrig.fLoTrigY;
119  fLoStripY = theMUONLocalTrig.fLoStripY;
120  fLoLpt = theMUONLocalTrig.fLoLpt;
121  fLoHpt = theMUONLocalTrig.fLoHpt;
122 
123  fX1Pattern = theMUONLocalTrig.fX1Pattern;
124  fX2Pattern = theMUONLocalTrig.fX2Pattern;
125  fX3Pattern = theMUONLocalTrig.fX3Pattern;
126  fX4Pattern = theMUONLocalTrig.fX4Pattern;
127 
128  fY1Pattern = theMUONLocalTrig.fY1Pattern;
129  fY2Pattern = theMUONLocalTrig.fY2Pattern;
130  fY3Pattern = theMUONLocalTrig.fY3Pattern;
131  fY4Pattern = theMUONLocalTrig.fY4Pattern;
132 
135 
136  return *this;
137 }
138 
139 
140 //----------------------------------------------------------------------
142 {
146 
147  Char_t rv = (fLoLpt & 0x3);
148  rv |= (fLoHpt << 2) & 0xC;
149 
150  return rv;
151 }
152 
153 //___________________________________________
155 {
157  Short_t vec[4] = {static_cast<Short_t>(GetX1Pattern()), static_cast<Short_t>(GetX2Pattern()), static_cast<Short_t>(GetX3Pattern()), static_cast<Short_t>(GetX4Pattern())};
158  array.Set(4, vec);
159 }
160 
161 //___________________________________________
162 void AliMUONLocalTrigger::GetYPattern(TArrayS& array) const
163 {
165  Short_t vec[4] = {static_cast<Short_t>(GetY1Pattern()), static_cast<Short_t>(GetY2Pattern()), static_cast<Short_t>(GetY3Pattern()), static_cast<Short_t>(GetY4Pattern())};
166  array.Set(4, vec);
167 }
168 
169 //___________________________________________
170 Bool_t
172 {
174  return ( fX1Pattern == 0 &&
175  fX2Pattern == 0 &&
176  fX3Pattern == 0 &&
177  fX4Pattern == 0 &&
178  fY1Pattern == 0 &&
179  fY2Pattern == 0 &&
180  fY3Pattern == 0 &&
181  fY4Pattern == 0 );
182 }
183 
184 //----------------------------------------------------------------------
185 void AliMUONLocalTrigger::SetLocalStruct(Int_t loCircuit, AliMUONLocalStruct& localStruct)
186 {
188 
189  // set id'
190  SetLoCircuit(loCircuit);
191 
192  // set X, Y, dev, Sdev and TrigY
193  SetLoStripX((Int_t)localStruct.GetXPos());
194  SetLoStripY((Int_t)localStruct.GetYPos());
195  SetLoDev((Int_t)localStruct.GetXDev());
196  SetLoSdev((Int_t)localStruct.GetSXDev());
197  SetLoTrigY((Int_t)localStruct.GetTrigY());
198 
199  // set L(H)pt
200  SetLoLpt(localStruct.GetLpt());
201  SetLoHpt(localStruct.GetHpt());
202 
203  // set pattern X
204  SetX1Pattern(localStruct.GetX1());
205  SetX2Pattern(localStruct.GetX2());
206  SetX3Pattern(localStruct.GetX3());
207  SetX4Pattern(localStruct.GetX4());
208 
209  // set pattern Y
210  SetY1Pattern(localStruct.GetY1());
211  SetY2Pattern(localStruct.GetY2());
212  SetY3Pattern(localStruct.GetY3());
213  SetY4Pattern(localStruct.GetY4());
214 
215 }
216 
217 //----------------------------------------------------------------------
219 {
221 
222  // set id'
223  SetLoCircuit(loCircuit);
224 
225  // set X, Y, dev, Sdev and TrigY
226  SetLoStripX((Int_t)localStruct.GetXPos());
227  SetLoStripY((Int_t)localStruct.GetYPos());
228  SetLoDev((Int_t)localStruct.GetXDev());
229  SetLoSdev((Int_t)localStruct.GetSXDev());
230  SetLoTrigY((Int_t)localStruct.GetTrigY());
231 
232  // set L(H)pt
233  SetLoLpt(localStruct.GetLpt());
234  SetLoHpt(localStruct.GetHpt());
235 
236  // set pattern X
237  SetX1Pattern(localStruct.GetX1());
238  SetX2Pattern(localStruct.GetX2());
239  SetX3Pattern(localStruct.GetX3());
240  SetX4Pattern(localStruct.GetX4());
241 
242  // set pattern Y
243  SetY1Pattern(localStruct.GetY1());
244  SetY2Pattern(localStruct.GetY2());
245  SetY3Pattern(localStruct.GetY3());
246  SetY4Pattern(localStruct.GetY4());
247 
248 }
249 
250 namespace
251 {
252  const char* AsString(Int_t t)
253  {
254  switch (t)
255  {
256  case 0:
257  return "no";
258  break;
259  case 1:
260  return "minus";
261  break;
262  case 2:
263  return "plus";
264  break;
265  case 3:
266  return "undef";
267  break;
268  default:
269  return "";
270  break;
271  }
272  }
273 }
274 
275 //----------------------------------------------------------------------
276 void AliMUONLocalTrigger::Print(Option_t* opt) const
277 {
279 
280  TString sopt(opt);
281  sopt.ToUpper();
282 
283  cout << Form("Circuit %3d Decision %2d StripX %2d Dev %2d(%1d) StripY %2d Lpt %6s Hpt %6s",
285  LoStripX(), LoDev(), LoSdev(), LoStripY(),
286  AsString(LoLpt()),AsString(LoHpt())) << endl;
287 
288  if ( sopt.Contains("FULL") ) {
289 
290  cout << Form("Xpatterns = 0x %04x %04x %04x %04x",
292  cout << Form("Ypatterns = 0x %04x %04x %04x %04x",
294  }
295 }
296 
297 //----------------------------------------------------------------------
299 {
301 
302  Int_t deviation = LoDev();
303  Int_t sign = 0;
304  if ( !LoSdev() && deviation ) sign=-1;
305  if ( !LoSdev() && !deviation ) sign= 0;
306  if ( LoSdev() == 1 ) sign=+1;
307  deviation *= sign;
308  deviation += 15;
309  return deviation;
310 }
311 
312 //----------------------------------------------------------------------
314 {
316 
317  deviation -= 15;
318  if (deviation > 0) {
319  SetLoDev(deviation);
320  SetLoSdev(1);
321  } else {
322  SetLoDev(-deviation);
323  SetLoSdev(0);
324  }
325 }
326 
327 //----------------------------------------------------------------------
328 const char*
330 {
332 
333  return Form("LocalBoard%3d",LoCircuit());
334 }
335 
336 
337 //----------------------------------------------------------------------
339 {
341  Bool_t xTrig;
342  if ( LoSdev()==1 && LoDev()==0 &&
343  LoStripX()==0) xTrig=kFALSE; // no trigger in X
344  else xTrig = kTRUE; // trigger in X
345  return xTrig;
346 }
347 
348 
349 //----------------------------------------------------------------------
351 {
353  Bool_t yTrig;
354  if ( LoTrigY()==1 &&
355  LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y
356  else yTrig = kTRUE; // trigger in Y
357  return yTrig;
358 }
void GetYPattern(TArrayS &array) const
return Y pattern array
UShort_t fY2Pattern
Y strip pattern for chamber 12.
Light weight interface class to the local trigger card data.
AliMUONLocalTrigger & operator=(const AliMUONLocalTrigger &rhs)
Rawdata local card structure for trigger.
void SetY3Pattern(UShort_t pat)
Set Y strip pattern for chamber 21.
Int_t fLoStripY
Y strip in MT11.
void SetLoTrigY(Int_t loTrigY)
Set Trig Y.
Bool_t IsTrigY() const
Trigger response Y strips.
UShort_t GetY3() const
Return Y3.
void SetLoStripX(Int_t loStrX)
Set X strip in MT11.
TVectorD vec
Definition: AnalyzeLaser.C:8
Int_t GetHpt() const
Return HPT.
UShort_t fX2Pattern
X strip pattern for chamber 12.
Int_t fLoCircuit
Circuit number.
void SetLocalStruct(Int_t loCircuit, AliMUONLocalStruct &localStruct)
void SetX1Pattern(UShort_t pat)
Set X strip pattern for chamber 11.
Int_t fLoDev
Deviation.
UChar_t GetSXDev() const
Get Sign of X deviation.
void GetXPattern(TArrayS &array) const
return X pattern array
Int_t fLoHpt
High pt 0 : nothing, 1 : Minus, 2 : Plus, 3 : Undef.
UShort_t fY1Pattern
Y strip pattern for chamber 11.
Int_t LoLpt() const
Return Low pt.
UChar_t fTriggerWithoutChamber
Pattern of triggers after chamber removal.
Bool_t GetTrigY() const
Return TrigY.
void SetDeviation(Int_t deviation)
Int_t LoHpt() const
Return High p.
UShort_t GetX3Pattern() const
Return X strip pattern for chamber 21.
Int_t LoStripY() const
Return Y strip in MT11.
UShort_t GetY4() const
Return Y4.
UShort_t GetY4Pattern() const
Return Y strip pattern for chamber 22.
TObjArray * array
Definition: AnalyzeLaser.C:12
UShort_t GetX4Pattern() const
Return X strip pattern for chamber 22.
UShort_t GetX1() const
Return X1.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t LoStripX() const
Return X strip in MT11.
void SetY4Pattern(UShort_t pat)
Set Y strip pattern for chamber 22.
UShort_t GetX1Pattern() const
Return X strip pattern for chamber 11.
void SetLoLpt(Int_t loLpt)
Set Low pt.
virtual void Print(Option_t *opt="") const
void SetLoStripY(Int_t loStrY)
Set Y strip in MT11.
Int_t fLoLpt
Low pt 0 : nothing, 1 : Minus, 2 : Plus, 3 : Undef.
Reconstructed Local Trigger object.
virtual const char * GetName() const
UShort_t GetY1Pattern() const
Return Y strip pattern for chamber 11.
UShort_t GetY3Pattern() const
Return Y strip pattern for chamber 21.
void SetX3Pattern(UShort_t pat)
Set X strip pattern for chamber 21.
Int_t LoSdev() const
Return Sign of Deviation.
UShort_t fY4Pattern
Y strip pattern for chamber 22.
Bool_t GetSXDev() const
Get Sign of X deviation.
UShort_t GetY2() const
Return Y2.
UShort_t GetY2Pattern() const
Return Y strip pattern for chamber 12.
UShort_t fX1Pattern
X strip pattern for chamber 11.
Int_t fLoStripX
X strip in MT11.
Int_t LoDev() const
Return Deviation.
UShort_t fHitPatternFromResponse
Fired plane according to re-computed repsonse.
UShort_t GetY1() const
Return Y1.
void SetX2Pattern(UShort_t pat)
Set X strip pattern for chamber 12.
UShort_t fX4Pattern
X strip pattern for chamber 22.
void SetY2Pattern(UShort_t pat)
Set Y strip pattern for chamber 12.
Char_t GetLoDecision() const
void SetLoSdev(Int_t loSdev)
Set Sign of Deviation.
UShort_t fX3Pattern
X strip pattern for chamber 21.
Bool_t IsTrigX() const
Trigger response X strips.
Int_t LoTrigY() const
Return Trig Y.
UShort_t GetX2Pattern() const
Return X strip pattern for chamber 12.
void SetLoDev(Int_t loDev)
Set Deviation.
UChar_t GetXPos() const
Return Xpos.
void SetLoHpt(Int_t loHpt)
Set High pt.
UChar_t GetXDev() const
Get X deviation.
Int_t GetLpt() const
Return LPT.
UShort_t fY3Pattern
Y strip pattern for chamber 21.
Int_t fLoSdev
Sign of Deviation.
void SetX4Pattern(UShort_t pat)
Set X strip pattern for chamber 22.
void SetY1Pattern(UShort_t pat)
Set Y strip pattern for chamber 11.
UShort_t GetX3() const
Return X3.
UShort_t GetX4() const
Return X4.
Int_t LoCircuit() const
Return Circuit number.
void SetLoCircuit(Int_t loCir)
Set Circuit number.
UShort_t GetX2() const
Return X2.
UChar_t GetYPos() const
Return Upos.