]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONLocalTriggerBoard.h
Update pr task: drathee
[u/mrichter/AliRoot.git] / MUON / AliMUONLocalTriggerBoard.h
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 trigger 
9 /// \class AliMUONLocalTriggerBoard
10 /// \brief Implementation of local trigger board objects
11 ///
12 //  Author Rachid Guernane (LPCCFd)
13
14 #include "AliMUONTriggerBoard.h"
15 #include "AliMpLocalBoard.h"
16
17 class AliMUONTriggerLut;
18
19 class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard 
20 {
21    public: 
22        
23       AliMUONLocalTriggerBoard();
24       AliMUONLocalTriggerBoard(AliMpLocalBoard* mpLocalBoard);
25
26       virtual ~AliMUONLocalTriggerBoard();
27       
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; }
35     
36       virtual void     SetbitM(Int_t strip, Int_t cathode, Int_t chamber);
37
38       virtual void     Pattern(const Option_t *option = "X Y") const; // default option displays X then Y bp
39
40       virtual void     Reset();
41       virtual void     ResetResponse();
42
43
44                        /// Return i-th Switch value
45       virtual UShort_t GetSwitch(Int_t i) const {return (UShort_t)fMpLocalBoard->GetSwitch(i);}
46
47                        /// Return Transverse connector
48       virtual Bool_t   GetTC() const {return fMpLocalBoard->GetTC();}
49
50                        /// Return Board number
51       virtual Int_t    GetNumber() const { return fMpLocalBoard->GetId(); }
52     
53       /// Is notified (copy boards are not)
54       virtual Bool_t    IsNotified() const { return fMpLocalBoard->IsNotified(); }
55
56                        /// Return Crate name
57       virtual TString  GetCrate() const {return fMpLocalBoard->GetCrate();}
58
59                        /// Return XY
60       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];}
61
62                        /// Return XY
63       virtual UShort_t GetXY(Int_t i, Int_t j) const {return fXY[i][j];} 
64
65                        /// Set XY
66       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];}
67
68       virtual void     Conf() const;
69
70       virtual void     Response();
71
72       virtual void     Mask(Int_t index, UShort_t value);
73
74       virtual void     TrigX(Int_t ch1q[16], Int_t ch2q[16], Int_t ch3q[32], Int_t ch4q[32]);
75       
76       virtual void     Sort2x5(Int_t dev1[6], Int_t dev2[6],
77                                Int_t minDev[6], Int_t &dev1GTdev2);
78       
79       virtual void     TrigY(Int_t y1[16], Int_t y2[16], Int_t y3[16], Int_t y4[16],
80                              Int_t y3u[16], Int_t y3d[16], Int_t y4u[16], Int_t y4d[16]);
81
82                        /// Set XYU
83       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];}
84
85                        /// Return XYU
86       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];}
87
88                        /// Set XYD
89       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];}
90
91                        /// Return XYD
92       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];}
93
94       virtual void     Scan(Option_t *option = "") const;
95
96       virtual Int_t    GetI() const;
97
98       virtual void     LocalTrigger();
99
100                        /// Return info if Board has triggered
101       virtual Int_t    Triggered() const {return fOutput;}
102
103                        /// Return MT1 X position of the valid road
104       virtual Int_t    GetStripX11() const {return fStripX11;}
105
106                        /// Return MT1 Y position of the valid road
107       virtual Int_t    GetStripY11() const {return fStripY11;}
108
109                        /// Return Deviation 
110       virtual Int_t    GetDev() const {return fDev;}
111
112                        /// Return Sign of Deviation 
113       virtual Int_t    GetSdev() const {return fMinDev[4];}
114       
115                        /// Return Trigger in Y
116       virtual Int_t    GetTrigY() const {return fTrigY;}
117
118       virtual Bool_t   IsTrigY() const;
119
120       virtual Bool_t   IsTrigX() const;
121
122       AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right);
123       AliMUONLocalTriggerBoard&  operator = (const AliMUONLocalTriggerBoard& right);
124
125       virtual Bool_t IsNull() const;
126       
127    protected:
128
129       static const Int_t fgkCircuitId[234]; ///< old numbering (to be removed)
130
131       virtual void     Resp(Option_t *option) const; ///< local trigger info before ("I") and after ("F") LUT
132
133       virtual void     BP(const Option_t *option) const;   ///< display X/Y bp
134
135    private:
136       AliMpLocalBoard*  fMpLocalBoard; ///< pointer to the local board mapping 
137
138       UShort_t fXY[2][4];         ///< Bit pattern
139       UShort_t fXYU[2][4];        ///< Bit pattern UP
140       UShort_t fXYD[2][4];        ///< Bit pattern DOWN
141       UShort_t fMask[2][4];       ///< Mask
142
143       Int_t    fStripX11;         ///< MT1 X position of the valid road 
144
145       Int_t    fStripY11;         ///< MT1 Y position of the valid road
146
147       Int_t    fDev;              ///< X deviation as in table 3-1 of Local Trigger Board PRR
148       Int_t    fTrigY;            ///< Trigger in Y
149       
150       Int_t    fLutLpt[2];        ///< Low Pt cuts estimated from LUT
151       Int_t    fLutHpt[2];        ///< High Pt cuts estimated from LUT
152
153 //    Outputs of the local logic
154       Int_t    fOutput;           ///< Board has triggered
155       Int_t    fMinDevStrip[5];   ///< X (from algo)
156       Int_t    fMinDev[5];        ///< Dev (from algo)
157       Int_t    fCoordY[5];        ///< Y (from algo)
158       
159       AliMUONTriggerLut *fLUT;    //!< Pointer to trigger LUT, that we do not own.
160       Int_t    fCoinc44;          ///< Coinc 44 (0/1 = coinc34/coinc44)
161       
162       ClassDef(AliMUONLocalTriggerBoard,2) //Implementation of local trigger board objects
163 };
164 #endif