]>
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 | |
24 | ||
9f662337 | 25 | //____________________________________________________________________ |
26 | /** @class AliFMDAltroMapping | |
27 | @brief Class that encodes a map to/from ALTRO hardware address to | |
28 | FMD detector coordinates. | |
29 | ||
30 | The hardware address consist of a DDL number and 12bits of ALTRO | |
31 | addresses. The ALTRO address are formatted as follows. | |
32 | @verbatim | |
33 | 12 7 4 0 | |
34 | |---------------|---------|------------| | |
35 | | Board # | ALTRO # | Channel # | | |
36 | +---------------+---------+------------+ | |
37 | @endverbatim | |
38 | ||
39 | @ingroup FMD_base | |
40 | */ | |
57c3c593 | 41 | class AliFMDAltroMapping : public AliAltroMapping |
42 | { | |
43 | public: | |
9f662337 | 44 | /** Constructor */ |
57c3c593 | 45 | AliFMDAltroMapping(); |
9f662337 | 46 | /** Map a hardware address into a detector index. |
47 | @param ddl Hardware DDL number | |
48 | @param hwaddr Hardware address. | |
49 | @param det On return, the detector # | |
50 | @param ring On return, the ring ID | |
51 | @param sec On return, the sector # | |
52 | @param str On return, the strip # | |
53 | @return @c true on success, false otherwise */ | |
57c3c593 | 54 | Bool_t Hardware2Detector(UInt_t ddl, UInt_t hwaddr, |
55 | UShort_t& det, Char_t& ring, | |
56 | UShort_t& sec, UShort_t& str) const; | |
9f662337 | 57 | /** Map a detector index into a hardware address. |
58 | @param det The detector # | |
59 | @param ring The ring ID | |
60 | @param sec The sector # | |
61 | @param str The strip # | |
62 | @param ddl On return, hardware DDL number | |
63 | @param hwaddr On return, hardware address. | |
64 | @return @c true on success, false otherwise */ | |
57c3c593 | 65 | Bool_t Detector2Hardware(UShort_t det, Char_t ring, |
66 | UShort_t sec, UShort_t str, | |
67 | UInt_t& ddl, UInt_t& hwaddr) const; | |
9f662337 | 68 | /** Here to take care of a a misspelling in base class |
69 | @param sector Sector number | |
70 | @param str Strip number | |
71 | @param ring Ring ID as an integer | |
72 | @return Hardware address */ | |
57c3c593 | 73 | Int_t GetHWAdress(Int_t sector, Int_t str, Int_t ring) const |
74 | { | |
1e8f773e | 75 | return GetHWAddress(sector, str, ring); |
57c3c593 | 76 | } |
9f662337 | 77 | /** convert a partial detector index into a hardware address |
78 | @param sector Sector number | |
79 | @param str Strip number | |
80 | @param ring Ring ID as an integer | |
81 | @return Hardware address */ | |
57c3c593 | 82 | Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring) const; |
9f662337 | 83 | /** Get the pad-row (or sector) corresponding to hardware address |
84 | @param hwaddr hardware address | |
85 | @return Sector number */ | |
57c3c593 | 86 | Int_t GetPadRow(Int_t hwaddr) const; |
9f662337 | 87 | /** Get the pad (or strip) corresponding to hardware address |
88 | @param hwaddr hardware address | |
89 | @return Strip number */ | |
57c3c593 | 90 | Int_t GetPad(Int_t hwaddr) const; |
9f662337 | 91 | /** Get the sector (or ring) corresponding to hardware address |
92 | @param hwaddr hardware address | |
93 | @return Ring ID as an integer */ | |
57c3c593 | 94 | Int_t GetSector(Int_t hwaddr) const; |
95 | protected: | |
9f662337 | 96 | /** Read map from file - not used |
97 | @return @c true on success */ | |
57c3c593 | 98 | virtual Bool_t ReadMapping(); |
9f662337 | 99 | /** Clear map in memory */ |
57c3c593 | 100 | virtual void DeleteMappingArrays(); |
101 | ||
102 | ClassDef(AliFMDAltroMapping, 1) // Read raw FMD Altro data | |
103 | }; | |
104 | ||
105 | #endif | |
106 | //____________________________________________________________________ | |
107 | // | |
108 | // Local Variables: | |
109 | // mode: C++ | |
110 | // End: | |
111 | // | |
112 | // EOF | |
113 | // |