4 #ifndef ALIHLTTPCMAPPING_H
5 #define ALIHLTTPCMAPPING_H
6 /* This file is property of and copyright by the ALICE HLT Project *
7 * ALICE Experiment at CERN, All rights reserved. *
8 * See cxx source for full Copyright notice */
10 /** @file AliHLTTPCMapping.h
11 @author Kenneth Aamodt
13 @brief Mapping class for TPC.
16 // see below for class documentation
18 // refer to README to build package
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22 #include "AliHLTLogging.h"
25 * @class AliHLTTPCMapping
26 * This is a mapping class for the TPC. It contains the mappping for all six partitions in static arrays.
27 * This ensures that the asci files containing the mapping numbers is only read once per partition.
28 * The only two methods interesting for the users are GetPad(hwaddress) and GetRow(hwaddress).
31 class AliHLTTPCMapping : public AliHLTLogging {
33 /** standard constructor */
34 AliHLTTPCMapping(UInt_t patch);
36 /** standard destructor */
37 virtual ~AliHLTTPCMapping();
40 * Create mapping for the given patch.
42 void InitializeMap(UInt_t patch);
45 * Get the pad number belonging to hardware address.
46 * @param HWAddress The hardware address of the given pad
47 * @return Pad number of given HWAddress
49 UInt_t GetPad(UInt_t HWAddress) const;
52 * Get the row number belonging to hardware address.
53 * @param HWAddress The hardware address of the given pad you are on.
54 * @return Row number of hardware address (Pad).
56 UInt_t GetRow(UInt_t HWAddress) const;
59 * Checks if the hw address is valid
60 * @param HWAddress The hardware address of the pad
61 * @return kTRUE if valid HWAddress
63 Bool_t IsValidHWAddress(UInt_t HWAddress) const;
66 * Method which returns the row offset of the patch.
67 * @return row offset of patch.
69 Int_t GetRowOffset() const {return fRowOffset;}
72 /** standard constructor prohibited, pad no always required */
74 /** copy constructor prohibited */
75 AliHLTTPCMapping(const AliHLTTPCMapping&);
76 /** assignment operator prohibited */
77 AliHLTTPCMapping& operator=(const AliHLTTPCMapping&);
79 //Flags to check if mapping is done for the six patches
80 /** flag to check if mapping is done for patch 0 */
81 static Bool_t fgMapping0IsDone;
82 /** flag to check if mapping is done for patch 1 */
83 static Bool_t fgMapping1IsDone;
84 /** flag to check if mapping is done for patch 2 */
85 static Bool_t fgMapping2IsDone;
86 /** flag to check if mapping is done for patch 3 */
87 static Bool_t fgMapping3IsDone;
88 /** flag to check if mapping is done for patch 4 */
89 static Bool_t fgMapping4IsDone;
90 /** flag to check if mapping is done for patch 5 */
91 static Bool_t fgMapping5IsDone;
94 /** size of mapping arrays */
95 static const UInt_t fgkMapping0Size=3200; // see above
96 /** size of mapping array for patch 1 */
97 static const UInt_t fgkMapping1Size=3584; // see above
98 /** size of mapping array for patch 2 */
99 static const UInt_t fgkMapping2Size=3200; // see above
100 /** size of mapping array for patch 3 */
101 static const UInt_t fgkMapping3Size=3328; // see above
102 /** size of mapping array for patch 4 */
103 static const UInt_t fgkMapping4Size=3328; // see above
104 /** size of mapping array for patch 5 */
105 static const UInt_t fgkMapping5Size=3328; // see above
107 /** row mapping array for patch 0 */
108 static UInt_t fgRowMapping0[fgkMapping0Size]; // see above
109 /** pad mapping array for patch 0 */
110 static UInt_t fgPadMapping0[fgkMapping0Size]; // see above
111 /** row mapping array for patch 1 */
112 static UInt_t fgRowMapping1[fgkMapping1Size]; // see above
113 /** pad mapping array for patch 1 */
114 static UInt_t fgPadMapping1[fgkMapping1Size]; // see above
115 /** row mapping array for patch 2 */
116 static UInt_t fgRowMapping2[fgkMapping2Size]; // see above
117 /** pad mapping array for patch 2 */
118 static UInt_t fgPadMapping2[fgkMapping2Size]; // see above
119 /** row mapping array for patch 3 */
120 static UInt_t fgRowMapping3[fgkMapping3Size]; // see above
121 /** pad mapping array for patch 3 */
122 static UInt_t fgPadMapping3[fgkMapping3Size]; // see above
123 /** row mapping array for patch 4 */
124 static UInt_t fgRowMapping4[fgkMapping4Size]; // see above
125 /** pad mapping array for patch 4 */
126 static UInt_t fgPadMapping4[fgkMapping4Size]; // see above
127 /** row mapping array for patch 5 */
128 static UInt_t fgRowMapping5[fgkMapping5Size]; // see above
129 /** pad mapping array for patch 5 */
130 static UInt_t fgPadMapping5[fgkMapping5Size]; // see above
132 /** current row mapping array */
133 UInt_t *fCurrentRowMapping; //!transient
134 /** current pad mapping array */
135 UInt_t *fCurrentPadMapping; //!transient
137 /** Number of hardware adresses */
138 UInt_t fNHWAdd; //!transient
140 /** Maximum number of hardware addresses */
141 UInt_t fMaxHWAdd; //!transient
143 /** The row offset of the patch*/
144 Int_t fRowOffset; //!transient
146 ClassDef(AliHLTTPCMapping, 1)
148 #endif // ALIHLTTPCMAPPING_H