]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | /// \ingroup sim | |
9 | /// \class AliMUONLocalTriggerBoard | |
10 | /// \brief Implementation of local trigger board objects | |
11 | /// | |
12 | /// A local trigger board has as input a bit pattern and returns | |
13 | /// the local trigger response after comparison w/ a LUT | |
14 | /// | |
15 | /// \author Rachid Guernane (LPCCFd) | |
16 | ||
17 | #include "AliMUONTriggerBoard.h" | |
18 | ||
19 | class AliMUONTriggerLut; | |
20 | ||
21 | class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard | |
22 | { | |
23 | public: | |
24 | ||
25 | enum ESwitch { | |
26 | kX2d = 0, | |
27 | kX2m, | |
28 | kX2u, | |
29 | kOR0, | |
30 | kOR1, | |
31 | kENY, | |
32 | kZeroAllYLSB, | |
33 | kZeroDown, | |
34 | kZeroMiddle, | |
35 | kZeroUp }; | |
36 | ||
37 | AliMUONLocalTriggerBoard(); | |
38 | AliMUONLocalTriggerBoard(const char *name, Int_t a, AliMUONTriggerLut* lut); | |
39 | virtual ~AliMUONLocalTriggerBoard() {;} | |
40 | ||
41 | Bool_t HasLUT() const { return (fLUT != 0); } | |
42 | ||
43 | void SetLUT(AliMUONTriggerLut* lut) { fLUT = lut; } | |
44 | void SetCoinc44(Int_t coinc44=0) { fCoinc44 = coinc44; } | |
45 | ||
46 | virtual void Setbit(Int_t strip, Int_t cathode, Int_t chamber); | |
47 | virtual void SetbitM(Int_t strip, Int_t cathode, Int_t chamber); | |
48 | ||
49 | virtual void Pattern(Option_t *option = "X Y") const; // default option displays X then Y bp | |
50 | ||
51 | virtual void Reset(); | |
52 | ||
53 | virtual void SetSwitch(Int_t i, Int_t value) {fSwitch[i] = value;} | |
54 | ||
55 | virtual UShort_t GetSwitch(Int_t i) const {return fSwitch[i];} | |
56 | ||
57 | virtual void SetTC(Bool_t con) {fTC = con;} | |
58 | ||
59 | virtual Bool_t GetTC() const {return fTC;} | |
60 | ||
61 | virtual void SetNumber(Int_t nb) {fNumber = nb;} | |
62 | ||
63 | virtual Int_t GetNumber() const {return fNumber;} | |
64 | ||
65 | virtual void Module(char *mod); | |
66 | ||
67 | virtual void GetX34(UShort_t *X) const {for (Int_t i=0;i<2;i++) X[i] = fXY[0][i+2];} | |
68 | ||
69 | virtual void SetX34(UShort_t *X) {for (Int_t i=0;i<2;i++) fXY[0][i+2] = X[i];} | |
70 | ||
71 | virtual void GetY(UShort_t *Y) const {for (Int_t i=0;i<4;i++) Y[i] = fXY[1][i];} | |
72 | ||
73 | virtual void SetY(UShort_t *Y) {for (Int_t i=0;i<4;i++) fXY[1][i] = Y[i];} | |
74 | ||
75 | 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];} | |
76 | ||
77 | virtual UShort_t GetXY(Int_t i, Int_t j) const {return fXY[i][j];} | |
78 | ||
79 | 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];} | |
80 | ||
81 | virtual void Conf() const; | |
82 | ||
83 | virtual void Response(); | |
84 | ||
85 | virtual void Mask(Int_t index, UShort_t value); | |
86 | ||
87 | virtual void TrigX(Int_t ch1q[16], Int_t ch2q[16], Int_t ch3q[32], Int_t ch4q[32]); | |
88 | ||
89 | virtual void Sort2x5(Int_t dev1[6], Int_t dev2[6], | |
90 | Int_t minDev[6], Int_t &dev1GTdev2); | |
91 | ||
92 | virtual void TrigY(Int_t y1[16], Int_t y2[16], Int_t y3[16], Int_t y4[16], | |
93 | Int_t y3u[16], Int_t y3d[16], Int_t y4u[16], Int_t y4d[16]); | |
94 | ||
95 | 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];} | |
96 | ||
97 | 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];} | |
98 | ||
99 | virtual void Scan(Option_t *option = "") const; | |
100 | ||
101 | virtual Int_t GetI() const; | |
102 | ||
103 | virtual void LocalTrigger(); | |
104 | ||
105 | virtual Int_t Triggered() const {return fOutput;} | |
106 | ||
107 | virtual Int_t GetStripX11() const {return fStripX11;} | |
108 | ||
109 | virtual Int_t GetStripY11() const {return fStripY11;} | |
110 | ||
111 | virtual Int_t GetDev() const {return fDev;} | |
112 | ||
113 | virtual void SetCrate(TString crate) {fCrate = crate;} | |
114 | ||
115 | virtual TString GetCrate() const {return fCrate;} | |
116 | ||
117 | protected: | |
118 | AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right); | |
119 | AliMUONLocalTriggerBoard& operator = (const AliMUONLocalTriggerBoard& right); | |
120 | ||
121 | static const Int_t fgkCircuitId[234]; // old numbering (to be removed) | |
122 | ||
123 | virtual void Resp(Option_t *option) const; // local trigger info before ("I") and after ("F") LUT | |
124 | ||
125 | virtual void BP(Option_t *option) const; // display X/Y bp | |
126 | ||
127 | private: | |
128 | ||
129 | Int_t fNumber; ///< Board number | |
130 | ||
131 | TString fCrate; ///< Crate name | |
132 | ||
133 | UShort_t fSwitch[10]; ///< Switch | |
134 | UShort_t fXY[2][4]; ///< Bit pattern | |
135 | UShort_t fXYU[2][4]; ///< Bit pattern UP | |
136 | UShort_t fXYD[2][4]; ///< Bit pattern DOWN | |
137 | UShort_t fMask[2][4]; ///< Mask | |
138 | ||
139 | Bool_t fTC; ///< Transverse connector | |
140 | ||
141 | Int_t fStripX11; ///< MT1 X position of the valid road | |
142 | ||
143 | Int_t fStripY11; ///< MT1 Y position of the valid road | |
144 | ||
145 | Int_t fDev; ///< Deviation in [0;+30] | |
146 | ||
147 | Int_t fLutLpt[2]; ///< Low Pt cuts estimated from LUT | |
148 | Int_t fLutHpt[2]; ///< High Pt cuts estimated from LUT | |
149 | Int_t fLutApt[2]; ///< All Pt cuts estimated from LUT | |
150 | ||
151 | // Outputs of the local logic | |
152 | Int_t fOutput; ///< Board has triggered | |
153 | Int_t fMinDevStrip[5]; ///< X (from algo) | |
154 | Int_t fMinDev[5]; ///< Dev (from algo) | |
155 | Int_t fCoordY[5]; ///< Y (from algo) | |
156 | ||
157 | AliMUONTriggerLut *fLUT; //!< Pointer to trigger LUT, that we do not own. | |
158 | Int_t fCoinc44; ///< Coinc 44 (0/1 = coinc34/coinc44) | |
159 | ||
160 | ClassDef(AliMUONLocalTriggerBoard,1) | |
161 | }; | |
162 | #endif |