1 #ifndef ALIFMDALTROMAPPING_H
2 #define ALIFMDALTROMAPPING_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
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.
15 #ifndef ALIALTROMAPPING_H
16 # include <AliAltroMapping.h>
18 #ifndef ALIFMDUSHORTMAP_H
19 # include "AliFMDUShortMap.h"
25 // Map hardware address to detector coordinates.
27 // The hardware address consist of a DDL number and 12bits of ALTRO
28 // addresses. The ALTRO address are formatted as follows.
31 // |---------------|---------|------------|
32 // | Board # | ALTRO # | Channel # |
33 // +---------------+---------+------------+
36 //____________________________________________________________________
37 /** @class AliFMDAltroMapping
38 @brief Class that encodes a map to/from ALTRO hardware address to
39 FMD detector coordinates.
41 The hardware address consist of a DDL number and 12bits of ALTRO
42 addresses. The ALTRO address are formatted as follows.
45 |---------------|---------|------------|
46 | Board # | ALTRO # | Channel # |
47 +---------------+---------+------------+
52 class AliFMDAltroMapping : public AliAltroMapping
58 virtual ~AliFMDAltroMapping() {}
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 base of strip #
66 @return @c true on success, false otherwise */
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;
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;
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 */
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;
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 */
114 Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring);
115 /** Get the pad-row (or sector) corresponding to hardware address
116 @param hwaddr hardware address
117 @return Sector number */
118 Int_t GetPadRow(Int_t hwaddr) const;
119 /** Get the pad (or strip) corresponding to hardware address
120 @param hwaddr hardware address
121 @return Strip number */
122 Int_t GetPad(Int_t hwaddr) const;
123 /** Get the sector (or ring) corresponding to hardware address
124 @param hwaddr hardware address
125 @return Ring ID as an integer */
126 Int_t GetSector(Int_t hwaddr) const;
127 /** Print map to standard out
128 @param option Option string (hw, or det) */
129 void Print(Option_t* option="hw") const;
131 /** Read map from file - not used
132 @return @c true on success */
133 virtual Bool_t ReadMapping();
134 /** Create the inverse mapping arrays */
135 virtual Bool_t CreateInvMapping();
137 ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data
141 //____________________________________________________________________