Adding code to patch St1 HV mapping
[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"
ac809573 15#include "AliMpLocalBoard.h"
be972727 16
17class AliMUONTriggerLut;
18
19class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard
20{
21 public:
e44235aa 22
be972727 23 AliMUONLocalTriggerBoard();
ac809573 24 AliMUONLocalTriggerBoard(AliMpLocalBoard* mpLocalBoard);
25
71a2d3aa 26 virtual ~AliMUONLocalTriggerBoard();
e44235aa 27
71a2d3aa 28 /// Return true if LUT is set
29 Bool_t HasLUT() const { return (fLUT != 0); }
30
31 /// Set LUT
32 void SetLUT(AliMUONTriggerLut* lut) { fLUT = lut; }
33 /// Set Coinc 44 (0/1 = coinc34/coinc44)
34 void SetCoinc44(Int_t coinc44=0) { fCoinc44 = coinc44; }
e93b11d0 35
be972727 36 virtual void Setbit(Int_t strip, Int_t cathode, Int_t chamber);
8af755f4 37 virtual void SetbitM(Int_t strip, Int_t cathode, Int_t chamber);
be972727 38
57e2ad1a 39 virtual void Pattern(const Option_t *option = "X Y") const; // default option displays X then Y bp
be972727 40
41 virtual void Reset();
00d46f24 42 virtual void ResetResponse();
be972727 43
be972727 44
71a2d3aa 45 /// Return i-th Switch value
ac809573 46 virtual UShort_t GetSwitch(Int_t i) const {return (UShort_t)fMpLocalBoard->GetSwitch(i);}
be972727 47
71a2d3aa 48 /// Return Transverse connector
ac809573 49 virtual Bool_t GetTC() const {return fMpLocalBoard->GetTC();}
8af755f4 50
71a2d3aa 51 /// Return Board number
ac809573 52 virtual Int_t GetNumber() const;
53
54 /// Return Crate name
55 virtual TString GetCrate() const {return fMpLocalBoard->GetCrate();}
56
8af755f4 57
71a2d3aa 58 /// Return X34
f4678817 59 virtual void GetX34(UShort_t *X) const {for (Int_t i=0;i<2;i++) X[i] = fXY[0][i+2];}
be972727 60
71a2d3aa 61 /// Set X34
be972727 62 virtual void SetX34(UShort_t *X) {for (Int_t i=0;i<2;i++) fXY[0][i+2] = X[i];}
63
71a2d3aa 64 /// Return Y
f4678817 65 virtual void GetY(UShort_t *Y) const {for (Int_t i=0;i<4;i++) Y[i] = fXY[1][i];}
be972727 66
71a2d3aa 67 /// Set Y
be972727 68 virtual void SetY(UShort_t *Y) {for (Int_t i=0;i<4;i++) fXY[1][i] = Y[i];}
69
71a2d3aa 70 /// Return XY
f4678817 71 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 72
71a2d3aa 73 /// Return XY
f4678817 74 virtual UShort_t GetXY(Int_t i, Int_t j) const {return fXY[i][j];}
be972727 75
71a2d3aa 76 /// Set XY
be972727 77 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];}
78
e44235aa 79 virtual void Conf() const;
be972727 80
81 virtual void Response();
82
41922e78 83 virtual void Mask(Int_t index, UShort_t value);
be972727 84
e93b11d0 85 virtual void TrigX(Int_t ch1q[16], Int_t ch2q[16], Int_t ch3q[32], Int_t ch4q[32]);
be972727 86
87 virtual void Sort2x5(Int_t dev1[6], Int_t dev2[6],
88 Int_t minDev[6], Int_t &dev1GTdev2);
89
90 virtual void TrigY(Int_t y1[16], Int_t y2[16], Int_t y3[16], Int_t y4[16],
e93b11d0 91 Int_t y3u[16], Int_t y3d[16], Int_t y4u[16], Int_t y4d[16]);
be972727 92
71a2d3aa 93 /// Set XYU
be972727 94 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];}
95
00d46f24 96 /// Return XYU
97 virtual void GetXYU(UShort_t V[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) V[i][j] = fXYU[i][j];}
98
71a2d3aa 99 /// Set XYD
be972727 100 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];}
101
00d46f24 102 /// Return XYD
103 virtual void GetXYD(UShort_t V[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) V[i][j] = fXYD[i][j];}
104
e44235aa 105 virtual void Scan(Option_t *option = "") const;
be972727 106
e44235aa 107 virtual Int_t GetI() const;
be972727 108
109 virtual void LocalTrigger();
110
71a2d3aa 111 /// Return info if Board has triggered
f4678817 112 virtual Int_t Triggered() const {return fOutput;}
be972727 113
71a2d3aa 114 /// Return MT1 X position of the valid road
f4678817 115 virtual Int_t GetStripX11() const {return fStripX11;}
be972727 116
71a2d3aa 117 /// Return MT1 Y position of the valid road
f4678817 118 virtual Int_t GetStripY11() const {return fStripY11;}
be972727 119
8aac6cce 120 /// Return Deviation
f4678817 121 virtual Int_t GetDev() const {return fDev;}
8aac6cce 122
123 /// Return Sign of Deviation
124 virtual Int_t GetSdev() const {return fMinDev[4];}
125
5a8d50e9 126 /// Return Trigger in Y
8aac6cce 127 virtual Int_t GetTrigY() const {return fTrigY;}
5a8d50e9 128
129 virtual Bool_t IsTrigY() const;
130
131 virtual Bool_t IsTrigX() const;
00d46f24 132
133 AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right);
134 AliMUONLocalTriggerBoard& operator = (const AliMUONLocalTriggerBoard& right);
135
136 virtual Bool_t IsNull() const;
be972727 137
be972727 138 protected:
139
71a2d3aa 140 static const Int_t fgkCircuitId[234]; ///< old numbering (to be removed)
141
142 virtual void Resp(Option_t *option) const; ///< local trigger info before ("I") and after ("F") LUT
be972727 143
57e2ad1a 144 virtual void BP(const Option_t *option) const; ///< display X/Y bp
be972727 145
146 private:
ac809573 147 AliMpLocalBoard* fMpLocalBoard; ///< pointer to the local board mapping
8af755f4 148
829425a5 149 UShort_t fXY[2][4]; ///< Bit pattern
150 UShort_t fXYU[2][4]; ///< Bit pattern UP
151 UShort_t fXYD[2][4]; ///< Bit pattern DOWN
152 UShort_t fMask[2][4]; ///< Mask
be972727 153
829425a5 154 Int_t fStripX11; ///< MT1 X position of the valid road
be972727 155
829425a5 156 Int_t fStripY11; ///< MT1 Y position of the valid road
be972727 157
8aac6cce 158 Int_t fDev; ///< X deviation as in table 3-1 of Local Trigger Board PRR
159 Int_t fTrigY; ///< Trigger in Y
160
829425a5 161 Int_t fLutLpt[2]; ///< Low Pt cuts estimated from LUT
162 Int_t fLutHpt[2]; ///< High Pt cuts estimated from LUT
be972727 163
164// Outputs of the local logic
829425a5 165 Int_t fOutput; ///< Board has triggered
166 Int_t fMinDevStrip[5]; ///< X (from algo)
167 Int_t fMinDev[5]; ///< Dev (from algo)
168 Int_t fCoordY[5]; ///< Y (from algo)
e93b11d0 169
829425a5 170 AliMUONTriggerLut *fLUT; //!< Pointer to trigger LUT, that we do not own.
e93b11d0 171 Int_t fCoinc44; ///< Coinc 44 (0/1 = coinc34/coinc44)
be972727 172
d0d71b34 173 ClassDef(AliMUONLocalTriggerBoard,2) //Implementation of local trigger board objects
be972727 174};
175#endif