]>
Commit | Line | Data |
---|---|---|
57c3c593 | 1 | #ifndef ALIFMDALTROMAPPING_H |
2 | #define ALIFMDALTROMAPPING_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * Latest changes by Christian Holm Christensen <cholm@nbi.dk> | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
c2fc1258 | 10 | /** @file AliFMDAltroMapping.h |
11 | @author Christian Holm Christensen <cholm@nbi.dk> | |
12 | @date Sun Mar 26 18:28:11 2006 | |
13 | @brief Map HW address to detector coordinates and back again. | |
14 | */ | |
57c3c593 | 15 | #ifndef ALIALTROMAPPING_H |
16 | # include <AliAltroMapping.h> | |
17 | #endif | |
18 | #ifndef ALIFMDUSHORTMAP_H | |
19 | # include "AliFMDUShortMap.h" | |
20 | #endif | |
21 | #ifndef ROOT_TArrayI | |
22 | # include <TArrayI.h> | |
23 | #endif | |
02a27b50 | 24 | // |
25 | // Map hardware address to detector coordinates. | |
26 | // | |
27 | // The hardware address consist of a DDL number and 12bits of ALTRO | |
28 | // addresses. The ALTRO address are formatted as follows. | |
29 | // | |
30 | // 12 7 4 0 | |
31 | // |---------------|---------|------------| | |
32 | // | Board # | ALTRO # | Channel # | | |
33 | // +---------------+---------+------------+ | |
34 | // | |
35 | // | |
9f662337 | 36 | //____________________________________________________________________ |
37 | /** @class AliFMDAltroMapping | |
38 | @brief Class that encodes a map to/from ALTRO hardware address to | |
39 | FMD detector coordinates. | |
40 | ||
41 | The hardware address consist of a DDL number and 12bits of ALTRO | |
42 | addresses. The ALTRO address are formatted as follows. | |
43 | @verbatim | |
44 | 12 7 4 0 | |
45 | |---------------|---------|------------| | |
46 | | Board # | ALTRO # | Channel # | | |
47 | +---------------+---------+------------+ | |
48 | @endverbatim | |
49 | ||
50 | @ingroup FMD_base | |
51 | */ | |
57c3c593 | 52 | class AliFMDAltroMapping : public AliAltroMapping |
53 | { | |
54 | public: | |
9f662337 | 55 | /** Constructor */ |
57c3c593 | 56 | AliFMDAltroMapping(); |
02a27b50 | 57 | /** Destructor */ |
58 | virtual ~AliFMDAltroMapping() {} | |
9f662337 | 59 | /** Map a hardware address into a detector index. |
60 | @param ddl Hardware DDL number | |
61 | @param hwaddr Hardware address. | |
62 | @param det On return, the detector # | |
63 | @param ring On return, the ring ID | |
64 | @param sec On return, the sector # | |
f6449cc0 | 65 | @param str On return, the base of strip # |
9f662337 | 66 | @return @c true on success, false otherwise */ |
57c3c593 | 67 | Bool_t Hardware2Detector(UInt_t ddl, UInt_t hwaddr, |
68 | UShort_t& det, Char_t& ring, | |
69 | UShort_t& sec, UShort_t& str) const; | |
f6449cc0 | 70 | /** Map a hardware address into a detector index. |
71 | @param ddl Hardware DDL number | |
72 | @param board FEC number | |
73 | @param altro ALTRO number | |
74 | @param channel Channel number | |
75 | @param det On return, the detector # | |
76 | @param ring On return, the ring ID | |
77 | @param sec On return, the sector # | |
78 | @param str On return, the base of strip # | |
79 | @return @c true on success, false otherwise */ | |
80 | Bool_t Hardware2Detector(UInt_t ddl, UInt_t board, | |
81 | UInt_t altro, UInt_t channel, | |
82 | UShort_t& det, Char_t& ring, | |
83 | UShort_t& sec, UShort_t& str) const; | |
84 | /** Map a detector index into a hardware address. | |
85 | @param det The detector # | |
86 | @param ring The ring ID | |
87 | @param sec The sector # | |
88 | @param str The strip # | |
89 | @param ddl On return, hardware DDL number | |
90 | @param board On return, the FEC board address (local to DDL) | |
91 | @param altro On return, the ALTRO number (local to FEC) | |
92 | @param channel On return, the channel number (local to ALTRO) | |
93 | @return @c true on success, false otherwise */ | |
94 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, | |
95 | UShort_t sec, UShort_t str, | |
96 | UInt_t& ddl, UInt_t& board, | |
97 | UInt_t& altro, UInt_t& channel) const; | |
9f662337 | 98 | /** Map a detector index into a hardware address. |
99 | @param det The detector # | |
100 | @param ring The ring ID | |
101 | @param sec The sector # | |
102 | @param str The strip # | |
103 | @param ddl On return, hardware DDL number | |
104 | @param hwaddr On return, hardware address. | |
105 | @return @c true on success, false otherwise */ | |
57c3c593 | 106 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, |
107 | UShort_t sec, UShort_t str, | |
108 | UInt_t& ddl, UInt_t& hwaddr) const; | |
9f662337 | 109 | /** convert a partial detector index into a hardware address |
110 | @param sector Sector number | |
111 | @param str Strip number | |
112 | @param ring Ring ID as an integer | |
113 | @return Hardware address */ | |
573322da | 114 | Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring); |
9f662337 | 115 | /** Get the pad-row (or sector) corresponding to hardware address |
116 | @param hwaddr hardware address | |
117 | @return Sector number */ | |
57c3c593 | 118 | Int_t GetPadRow(Int_t hwaddr) const; |
9f662337 | 119 | /** Get the pad (or strip) corresponding to hardware address |
120 | @param hwaddr hardware address | |
121 | @return Strip number */ | |
57c3c593 | 122 | Int_t GetPad(Int_t hwaddr) const; |
9f662337 | 123 | /** Get the sector (or ring) corresponding to hardware address |
124 | @param hwaddr hardware address | |
125 | @return Ring ID as an integer */ | |
57c3c593 | 126 | Int_t GetSector(Int_t hwaddr) const; |
f6449cc0 | 127 | /** Print map to standard out |
128 | @param option Option string (hw, or det) */ | |
129 | void Print(Option_t* option="hw") const; | |
57c3c593 | 130 | protected: |
9f662337 | 131 | /** Read map from file - not used |
132 | @return @c true on success */ | |
57c3c593 | 133 | virtual Bool_t ReadMapping(); |
573322da | 134 | /** Create the inverse mapping arrays */ |
135 | virtual Bool_t CreateInvMapping(); | |
57c3c593 | 136 | |
573322da | 137 | ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data |
57c3c593 | 138 | }; |
139 | ||
140 | #endif | |
141 | //____________________________________________________________________ | |
142 | // | |
143 | // Local Variables: | |
144 | // mode: C++ | |
145 | // End: | |
146 | // | |
147 | // EOF | |
148 | // |