new functionality and new class added
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerGUIboard.h
CommitLineData
905654c2 1#ifndef ALIMUONTRIGGERGUIBOARD_H
2#define ALIMUONTRIGGERGUIBOARD_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/// \ingroup evaluation
8/// \class AliMUONTriggerGUIboard
9/// \brief Trigger GUI utility class: single board object
37391c63 10// Author Bogdan Vulpescu, LPC Clermont-Ferrand
905654c2 11
8b067dfe 12#include "AliMpPad.h"
13
905654c2 14#include <TString.h>
15#include <TObject.h>
16
8b067dfe 17class TClonesArray;
905654c2 18class TBox;
19
20class AliMUONTriggerGUIboard : public TObject
21{
22
23public:
24
8b067dfe 25 AliMUONTriggerGUIboard();
905654c2 26 virtual ~AliMUONTriggerGUIboard();
27
8b067dfe 28 /// get the standard name of this board
905654c2 29 Char_t *GetBoardName() const { return (Char_t*)(fName->Data()); };
8b067dfe 30 /// get the name of the crate containing this board
31 Char_t *GetCrateName() const { return (Char_t*)(fCrateName->Data()); };
32 /// get the working status of this board
905654c2 33 UShort_t GetStatus() const { return fStatus; };
8b067dfe 34 /// get the number of this board
905654c2 35 Int_t GetNumber() const { return fID; };
8b067dfe 36 /// get the id of the detector element
37 Int_t GetDetElemId() const { return fDetElemId; };
38 /// get the id of the circuit
39 Int_t GetIdCircuit() const { return fIdCircuit; };
40 /// get detector side (Left=0 , Right=1)
41 Int_t GetSide() const;
42 /// get line
43 Int_t GetLine() const;
44 /// get column
45 Int_t GetCol() const;
905654c2 46
905654c2 47 /// set the working status of this board
48 void SetStatus(UShort_t s) { fStatus = s; };
49 /// set the standard name of this board
8b067dfe 50 void SetBoardName(const Char_t *name) { fName = new TString(name); };
51 /// set the name of the crate containing this board
52 void SetCrateName(const Char_t *name) { fCrateName = new TString(name); };
905654c2 53 /// set the number of the detector element containing this board
54 void SetDetElemId(Int_t id) { fDetElemId = id; };
8b067dfe 55 /// set the number of this board
56 void SetNumber(Int_t id) { fID = id; }
57
58 /// add a mapping x-pad
59 void AddPadX(const AliMpPad &pad, Int_t ich)
60 {
61 new ((*fPadsX[ich])[fNPadsX[ich]++]) AliMpPad(pad);
62 }
63 /// add a mapping y-pad
64 void AddPadY(const AliMpPad &pad, Int_t ich)
65 {
66 new ((*fPadsY[ich])[fNPadsY[ich]++]) AliMpPad(pad);
67 }
68 /// create the display geometry from the mapping pads
69 void MakeGeometry();
70
905654c2 71 /// set an x-strip digit in a chamber with amplitude = amp
72 void SetDigitX(Int_t imt, Int_t is, Int_t amp) {
73 fXDig[imt][is] = (UChar_t)amp; };
74 /// set a y-strip digit in a chamber with amplitude = amp
75 void SetDigitY(Int_t imt, Int_t is, Int_t amp) {
76 fYDig[imt][is] = (UChar_t)amp; };
905654c2 77 /// get neighbouring boards with common y strips
78 UChar_t GetYOver() const { return fYOver; };
905654c2 79 /// get the board position inside the detector element in y direction
80 UChar_t GetPosition() const { return fPosition; };
81 /// get the digit amplitude for an x-strip in a given chamber
82 Int_t GetXDig(Int_t imt, Int_t is) const { return fXDig[imt][is]; };
83 /// get the digit amplitude for a y-strip in a given chamber
84 Int_t GetYDig(Int_t imt, Int_t is) const { return fYDig[imt][is]; };
85
8b067dfe 86 /// set x-strip box for display
905654c2 87 void SetXDigBox(Int_t imt, Int_t is, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
8b067dfe 88 /// set y-strip box for display
905654c2 89 void SetYDigBox(Int_t imt, Int_t is, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
8b067dfe 90
91 /// get x-strip box for display
905654c2 92 TBox *GetXDigBox(Int_t imt, Int_t is) const { return fXDigBox[imt][is]; };
8b067dfe 93 /// get y-strip box for display
905654c2 94 TBox *GetYDigBox(Int_t imt, Int_t is) const { return fYDigBox[imt][is]; };
95
96 /// get x-center of the board in chamber imt
97 Float_t GetXCenter(Int_t imt) const { return fXCenter[imt]; };
98 /// get y-center of the board in chamber imt
99 Float_t GetYCenter(Int_t imt) const { return fYCenter[imt]; };
100 /// get z-center of the board in chamber imt
101 Float_t GetZCenter(Int_t imt) const { return fZCenter[imt]; };
102 /// get x-width of the board in chamber imt
103 Float_t GetXWidth(Int_t imt) const { return fXWidth[imt]; };
104 /// get y-width of the board in chamber imt
105 Float_t GetYWidth(Int_t imt) const { return fYWidth[imt]; };
106
107 /// get x-index in detector element for an x-strip
108 Int_t GetXSix() const { return fXSix; };
109 /// get first y-index in detector element for an x-strip
110 Int_t GetXSiy1() const { return fXSiy1; };
111 /// get last y-index in detector element for an x-strip
112 Int_t GetXSiy2() const { return fXSiy2; };
113 /// get first x-index in detector element for a y-strip
114 Int_t GetYSix1() const { return fYSix1; };
115 /// get last x-index in detector element for a y-strip
116 Int_t GetYSix2() const { return fYSix2; };
117 /// get y-index in detector element for a y-strip
118 Int_t GetYSiy() const { return fYSiy; };
119 /// get number of x strips
120 Int_t GetNStripX() const { return GetXSiy2() - GetXSiy1() + 1; };
121 /// get number of y strips
122 Int_t GetNStripY() const { return GetYSix2() - GetYSix1() + 1; };
905654c2 123
124 /// set true if this board has a gui active
125 void SetOpen(Bool_t open) { fIsOpen = open; };
126 /// true if this board has a gui active
127 Bool_t IsOpen() const { return fIsOpen; };
128
8b067dfe 129 /// delete the set x-digits
905654c2 130 void ClearXDigits();
8b067dfe 131 /// delete the set y-digits
905654c2 132 void ClearYDigits();
133
8b067dfe 134 /// print information on this board
135 void PrintBoard() const;
136
905654c2 137private:
138
139 enum { kNMT = 4, kNS = 16 }; ///< constants
140
37391c63 141 /// Not implemented
142 AliMUONTriggerGUIboard (const AliMUONTriggerGUIboard& board);
143 /// Not implemented
144 AliMUONTriggerGUIboard& operator=(const AliMUONTriggerGUIboard& board);
145
905654c2 146 TString *fName; ///< Board name LCxLxBx or RCxLxBx
8b067dfe 147 TString *fCrateName; ///< Crate name
148 Int_t fID; ///< Board array number
905654c2 149 UShort_t fStatus; ///< Board status
150 UChar_t fPosition; ///< Y-boards position
151 UChar_t fYOver; ///< Y-boards with common y-strips
152
153 Float_t fXCenter[kNMT]; ///< X-center of the board
154 Float_t fYCenter[kNMT]; ///< Y-center of the board
155 Float_t fZCenter[kNMT]; ///< Z-center of the board
156 Float_t fXWidth[kNMT]; ///< X-width of the board
157 Float_t fYWidth[kNMT]; ///< Y-width of the board
158
159 Int_t fXSix; ///< X-strips ix index in the board
160 Int_t fXSiy1; ///< X-strips first iy index in the board
161 Int_t fXSiy2; ///< X-strips last iy index in the board
162
163 Int_t fYSix1; ///< Y-strips first ix index in the board
164 Int_t fYSix2; ///< Y-strips last ix index in the board
165 Int_t fYSiy; ///< Y-strips iy index in the board
166
167 Int_t fDetElemId; ///< Detector element ID (modulo 100)
168
169 Int_t fIdCircuit; ///< Circuit number
170
171 UChar_t fXDig[kNMT][kNS]; ///< X-digits amplitude, set by GUI
172 UChar_t fYDig[kNMT][kNS]; ///< Y-digits amplitude, set by GUI
173
174 TBox *fXDigBox[kNMT][kNS]; ///< X-digits boxes
175 TBox *fYDigBox[kNMT][kNS]; ///< Y-digits boxes
176
177 Bool_t fIsOpen; ///< Selection flag for the digits map
178
8b067dfe 179 /// adding pads from mapping to calculate the board geometry
180 Int_t fNPadsX[kNMT]; ///< nr of added mapping pads in x
181 Int_t fNPadsY[kNMT]; ///< nr of added mapping pads in y
182 TClonesArray *fPadsX[kNMT]; ///< array of mapping pads in x
183 TClonesArray *fPadsY[kNMT]; ///< array of mapping pads in y
184
185 ClassDef(AliMUONTriggerGUIboard,2) //Trigger GUI utility class: single board object
905654c2 186
187};
188
189#endif