Managed the 234 local boards inside the class & simplified the code
[u/mrichter/AliRoot.git] / MUON / AliMUONLocalTriggerBoard.h
CommitLineData
be972727 1#ifndef ALIMUONLOCALTRIGGERBOARD_H
2#define ALIMUONLOCALTRIGGERBOARD_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
c1975ba7 8/// \ingroup trigger
f4678817 9/// \class AliMUONLocalTriggerBoard
10/// \brief Implementation of local trigger board objects
11///
71a2d3aa 12// Author Rachid Guernane (LPCCFd)
be972727 13
14#include "AliMUONTriggerBoard.h"
15
16class AliMUONTriggerLut;
17
18class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard
19{
20 public:
e44235aa 21
71a2d3aa 22 /// \todo add comment
e44235aa 23 enum ESwitch {
24 kX2d = 0,
25 kX2m,
26 kX2u,
27 kOR0,
28 kOR1,
29 kENY,
30 kZeroAllYLSB,
31 kZeroDown,
32 kZeroMiddle,
33 kZeroUp };
34
be972727 35 AliMUONLocalTriggerBoard();
41922e78 36 AliMUONLocalTriggerBoard(const char *name, Int_t a, AliMUONTriggerLut* lut);
71a2d3aa 37 virtual ~AliMUONLocalTriggerBoard();
e44235aa 38
71a2d3aa 39 /// Return true if LUT is set
40 Bool_t HasLUT() const { return (fLUT != 0); }
41
42 /// Set LUT
43 void SetLUT(AliMUONTriggerLut* lut) { fLUT = lut; }
44 /// Set Coinc 44 (0/1 = coinc34/coinc44)
45 void SetCoinc44(Int_t coinc44=0) { fCoinc44 = coinc44; }
e93b11d0 46
be972727 47 virtual void Setbit(Int_t strip, Int_t cathode, Int_t chamber);
8af755f4 48 virtual void SetbitM(Int_t strip, Int_t cathode, Int_t chamber);
be972727 49
e44235aa 50 virtual void Pattern(Option_t *option = "X Y") const; // default option displays X then Y bp
be972727 51
52 virtual void Reset();
53
71a2d3aa 54 /// Set i-th Switch value
be972727 55 virtual void SetSwitch(Int_t i, Int_t value) {fSwitch[i] = value;}
56
71a2d3aa 57 /// Return i-th Switch value
f4678817 58 virtual UShort_t GetSwitch(Int_t i) const {return fSwitch[i];}
be972727 59
71a2d3aa 60 /// Set Transverse connector
be972727 61 virtual void SetTC(Bool_t con) {fTC = con;}
62
71a2d3aa 63 /// Return Transverse connector
f4678817 64 virtual Bool_t GetTC() const {return fTC;}
be972727 65
71a2d3aa 66 /// Set Board number
e44235aa 67 virtual void SetNumber(Int_t nb) {fNumber = nb;}
8af755f4 68
71a2d3aa 69 /// Return Board number
e44235aa 70 virtual Int_t GetNumber() const {return fNumber;}
8af755f4 71
be972727 72 virtual void Module(char *mod);
73
71a2d3aa 74 /// Return X34
f4678817 75 virtual void GetX34(UShort_t *X) const {for (Int_t i=0;i<2;i++) X[i] = fXY[0][i+2];}
be972727 76
71a2d3aa 77 /// Set X34
be972727 78 virtual void SetX34(UShort_t *X) {for (Int_t i=0;i<2;i++) fXY[0][i+2] = X[i];}
79
71a2d3aa 80 /// Return Y
f4678817 81 virtual void GetY(UShort_t *Y) const {for (Int_t i=0;i<4;i++) Y[i] = fXY[1][i];}
be972727 82
71a2d3aa 83 /// Set Y
be972727 84 virtual void SetY(UShort_t *Y) {for (Int_t i=0;i<4;i++) fXY[1][i] = Y[i];}
85
71a2d3aa 86 /// Return XY
f4678817 87 virtual void GetXY(UShort_t XY[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) XY[i][j] = fXY[i][j];}
be972727 88
71a2d3aa 89 /// Return XY
f4678817 90 virtual UShort_t GetXY(Int_t i, Int_t j) const {return fXY[i][j];}
be972727 91
71a2d3aa 92 /// Set XY
be972727 93 virtual void SetXY(UShort_t XY[2][4]) {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) fXY[i][j] = XY[i][j];}
94
e44235aa 95 virtual void Conf() const;
be972727 96
97 virtual void Response();
98
41922e78 99 virtual void Mask(Int_t index, UShort_t value);
be972727 100
e93b11d0 101 virtual void TrigX(Int_t ch1q[16], Int_t ch2q[16], Int_t ch3q[32], Int_t ch4q[32]);
be972727 102
103 virtual void Sort2x5(Int_t dev1[6], Int_t dev2[6],
104 Int_t minDev[6], Int_t &dev1GTdev2);
105
106 virtual void TrigY(Int_t y1[16], Int_t y2[16], Int_t y3[16], Int_t y4[16],
e93b11d0 107 Int_t y3u[16], Int_t y3d[16], Int_t y4u[16], Int_t y4d[16]);
be972727 108
71a2d3aa 109 /// Set XYU
be972727 110 virtual void SetXYU(UShort_t V[2][4]) {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) fXYU[i][j] = V[i][j];}
111
71a2d3aa 112 /// Set XYD
be972727 113 virtual void SetXYD(UShort_t V[2][4]) {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) fXYD[i][j] = V[i][j];}
114
e44235aa 115 virtual void Scan(Option_t *option = "") const;
be972727 116
e44235aa 117 virtual Int_t GetI() const;
be972727 118
119 virtual void LocalTrigger();
120
71a2d3aa 121 /// Return info if Board has triggered
f4678817 122 virtual Int_t Triggered() const {return fOutput;}
be972727 123
71a2d3aa 124 /// Return MT1 X position of the valid road
f4678817 125 virtual Int_t GetStripX11() const {return fStripX11;}
be972727 126
71a2d3aa 127 /// Return MT1 Y position of the valid road
f4678817 128 virtual Int_t GetStripY11() const {return fStripY11;}
be972727 129
8aac6cce 130 /// Return Deviation
f4678817 131 virtual Int_t GetDev() const {return fDev;}
8aac6cce 132
133 /// Return Sign of Deviation
134 virtual Int_t GetSdev() const {return fMinDev[4];}
135
136 /// Return Sign of Deviation
137 virtual Int_t GetTrigY() const {return fTrigY;}
be972727 138
71a2d3aa 139 /// Set Crate name
e44235aa 140 virtual void SetCrate(TString crate) {fCrate = crate;}
f4678817 141
71a2d3aa 142 /// Return Crate name
e44235aa 143 virtual TString GetCrate() const {return fCrate;}
8af755f4 144
be972727 145 protected:
146
71a2d3aa 147 static const Int_t fgkCircuitId[234]; ///< old numbering (to be removed)
148
149 virtual void Resp(Option_t *option) const; ///< local trigger info before ("I") and after ("F") LUT
be972727 150
71a2d3aa 151 virtual void BP(Option_t *option) const; ///< display X/Y bp
be972727 152
153 private:
71a2d3aa 154 /// Not implemented
155 AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right);
156 /// Not implemented
157 AliMUONLocalTriggerBoard& operator = (const AliMUONLocalTriggerBoard& right);
be972727 158
829425a5 159 Int_t fNumber; ///< Board number
be972727 160
829425a5 161 TString fCrate; ///< Crate name
8af755f4 162
829425a5 163 UShort_t fSwitch[10]; ///< Switch
164 UShort_t fXY[2][4]; ///< Bit pattern
165 UShort_t fXYU[2][4]; ///< Bit pattern UP
166 UShort_t fXYD[2][4]; ///< Bit pattern DOWN
167 UShort_t fMask[2][4]; ///< Mask
be972727 168
829425a5 169 Bool_t fTC; ///< Transverse connector
be972727 170
829425a5 171 Int_t fStripX11; ///< MT1 X position of the valid road
be972727 172
829425a5 173 Int_t fStripY11; ///< MT1 Y position of the valid road
be972727 174
8aac6cce 175 Int_t fDev; ///< X deviation as in table 3-1 of Local Trigger Board PRR
176 Int_t fTrigY; ///< Trigger in Y
177
829425a5 178 Int_t fLutLpt[2]; ///< Low Pt cuts estimated from LUT
179 Int_t fLutHpt[2]; ///< High Pt cuts estimated from LUT
be972727 180
181// Outputs of the local logic
829425a5 182 Int_t fOutput; ///< Board has triggered
183 Int_t fMinDevStrip[5]; ///< X (from algo)
184 Int_t fMinDev[5]; ///< Dev (from algo)
185 Int_t fCoordY[5]; ///< Y (from algo)
e93b11d0 186
829425a5 187 AliMUONTriggerLut *fLUT; //!< Pointer to trigger LUT, that we do not own.
e93b11d0 188 Int_t fCoinc44; ///< Coinc 44 (0/1 = coinc34/coinc44)
be972727 189
190 ClassDef(AliMUONLocalTriggerBoard,1)
191};
192#endif