]>
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 # | |
65 | @param str On return, the strip # | |
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; | |
9f662337 | 70 | /** Map a detector index into a hardware address. |
71 | @param det The detector # | |
72 | @param ring The ring ID | |
73 | @param sec The sector # | |
74 | @param str The strip # | |
75 | @param ddl On return, hardware DDL number | |
76 | @param hwaddr On return, hardware address. | |
77 | @return @c true on success, false otherwise */ | |
57c3c593 | 78 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, |
79 | UShort_t sec, UShort_t str, | |
80 | UInt_t& ddl, UInt_t& hwaddr) const; | |
9f662337 | 81 | /** Here to take care of a a misspelling in base class |
82 | @param sector Sector number | |
83 | @param str Strip number | |
84 | @param ring Ring ID as an integer | |
85 | @return Hardware address */ | |
57c3c593 | 86 | Int_t GetHWAdress(Int_t sector, Int_t str, Int_t ring) const |
87 | { | |
1e8f773e | 88 | return GetHWAddress(sector, str, ring); |
57c3c593 | 89 | } |
9f662337 | 90 | /** convert a partial detector index into a hardware address |
91 | @param sector Sector number | |
92 | @param str Strip number | |
93 | @param ring Ring ID as an integer | |
94 | @return Hardware address */ | |
57c3c593 | 95 | Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring) const; |
9f662337 | 96 | /** Get the pad-row (or sector) corresponding to hardware address |
97 | @param hwaddr hardware address | |
98 | @return Sector number */ | |
57c3c593 | 99 | Int_t GetPadRow(Int_t hwaddr) const; |
9f662337 | 100 | /** Get the pad (or strip) corresponding to hardware address |
101 | @param hwaddr hardware address | |
102 | @return Strip number */ | |
57c3c593 | 103 | Int_t GetPad(Int_t hwaddr) const; |
9f662337 | 104 | /** Get the sector (or ring) corresponding to hardware address |
105 | @param hwaddr hardware address | |
106 | @return Ring ID as an integer */ | |
57c3c593 | 107 | Int_t GetSector(Int_t hwaddr) const; |
108 | protected: | |
9f662337 | 109 | /** Read map from file - not used |
110 | @return @c true on success */ | |
57c3c593 | 111 | virtual Bool_t ReadMapping(); |
9f662337 | 112 | /** Clear map in memory */ |
57c3c593 | 113 | virtual void DeleteMappingArrays(); |
114 | ||
115 | ClassDef(AliFMDAltroMapping, 1) // Read raw FMD Altro data | |
116 | }; | |
117 | ||
118 | #endif | |
119 | //____________________________________________________________________ | |
120 | // | |
121 | // Local Variables: | |
122 | // mode: C++ | |
123 | // End: | |
124 | // | |
125 | // EOF | |
126 | // |