]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDAltroMapping.h
Added reading of conditions.csv, the configuration file
[u/mrichter/AliRoot.git] / FMD / AliFMDAltroMapping.h
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  */
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 */
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 //
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 //
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  */
52 class AliFMDAltroMapping : public AliAltroMapping
53 {
54 public:
55   /** Constructor */
56   AliFMDAltroMapping();
57   /** Destructor */
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;
130 protected:
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();
136   
137   ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data 
138 };
139
140 #endif
141 //____________________________________________________________________
142 //
143 // Local Variables:
144 //   mode: C++
145 // End:
146 //
147 // EOF
148 //