]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCMapping.h
code cleanup: check for valid channel address and row offset handled by TPC mapping...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCMapping.h
1 // -*- Mode: C++ -*-
2 // $Id$
3
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                               */
9
10 /** @file   AliHLTTPCMapping.h
11     @author Kenneth Aamodt
12     @date   
13     @brief  Mapping class for TPC.
14 */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
22 #include "AliHLTLogging.h"
23
24 /**
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).
29  * @ingroup alihlt_tpc
30  */
31 class AliHLTTPCMapping : public AliHLTLogging {
32 public:
33   /** standard constructor */
34   AliHLTTPCMapping(UInt_t patch);
35
36   /** standard destructor */
37   virtual ~AliHLTTPCMapping();
38  
39   /**
40    * Create mapping for the given patch.
41    */
42   void InitializeMap(UInt_t patch);
43
44   /**
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
48    */
49   UInt_t GetPad(UInt_t HWAddress) const;
50
51   /**
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).
55    */
56   UInt_t GetRow(UInt_t HWAddress) const;
57
58   /**
59    * Checks if the hw address is valid
60    * @param HWAddress    The hardware address of the pad
61    * @return kTRUE if valid HWAddress 
62    */
63   Bool_t IsValidHWAddress(UInt_t HWAddress) const;
64
65   /**
66    * Method which returns the row offset of the patch. 
67    * @return row offset of patch.
68   */
69   Int_t GetRowOffset() const {return fRowOffset;}
70
71  private:
72   /** standard constructor prohibited, pad no always required */
73   AliHLTTPCMapping();
74   /** copy constructor prohibited */
75   AliHLTTPCMapping(const AliHLTTPCMapping&);
76   /** assignment operator prohibited */
77   AliHLTTPCMapping& operator=(const AliHLTTPCMapping&);
78   
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;
92
93
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
106
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
131
132   /** current row mapping array */
133   UInt_t *fCurrentRowMapping;                                        //!transient
134   /** current pad mapping array */
135   UInt_t *fCurrentPadMapping;                                        //!transient
136
137   /** Number of hardware adresses */
138   UInt_t fNHWAdd;                                                    //!transient
139
140   /** Maximum number of hardware addresses */
141   UInt_t fMaxHWAdd;                                                  //!transient
142
143   /** The row offset of the patch*/
144   Int_t fRowOffset;                                                  //!transient
145
146   ClassDef(AliHLTTPCMapping, 1)
147 };
148 #endif // ALIHLTTPCMAPPING_H