]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDAltroMapping.h
Added shuttle preprocessor code from Hans Dalsgaard (with several
[u/mrichter/AliRoot.git] / FMD / AliFMDAltroMapping.h
CommitLineData
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 52class AliFMDAltroMapping : public AliAltroMapping
53{
54public:
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 /** Here to take care of a a misspelling in base class
110 @param sector Sector number
111 @param str Strip number
112 @param ring Ring ID as an integer
113 @return Hardware address */
57c3c593 114 Int_t GetHWAdress(Int_t sector, Int_t str, Int_t ring) const
115 {
1e8f773e 116 return GetHWAddress(sector, str, ring);
57c3c593 117 }
9f662337 118 /** convert a partial detector index into a hardware address
119 @param sector Sector number
120 @param str Strip number
121 @param ring Ring ID as an integer
122 @return Hardware address */
57c3c593 123 Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring) const;
9f662337 124 /** Get the pad-row (or sector) corresponding to hardware address
125 @param hwaddr hardware address
126 @return Sector number */
57c3c593 127 Int_t GetPadRow(Int_t hwaddr) const;
9f662337 128 /** Get the pad (or strip) corresponding to hardware address
129 @param hwaddr hardware address
130 @return Strip number */
57c3c593 131 Int_t GetPad(Int_t hwaddr) const;
9f662337 132 /** Get the sector (or ring) corresponding to hardware address
133 @param hwaddr hardware address
134 @return Ring ID as an integer */
57c3c593 135 Int_t GetSector(Int_t hwaddr) const;
f6449cc0 136 /** Print map to standard out
137 @param option Option string (hw, or det) */
138 void Print(Option_t* option="hw") const;
57c3c593 139protected:
9f662337 140 /** Read map from file - not used
141 @return @c true on success */
57c3c593 142 virtual Bool_t ReadMapping();
9f662337 143 /** Clear map in memory */
57c3c593 144 virtual void DeleteMappingArrays();
145
146 ClassDef(AliFMDAltroMapping, 1) // Read raw FMD Altro data
147};
148
149#endif
150//____________________________________________________________________
151//
152// Local Variables:
153// mode: C++
154// End:
155//
156// EOF
157//