HMPID: Packing the number of photons and the charge in opposite order (A.Mastroserio)
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCMapping.h
CommitLineData
7dceaa9b 1// -*- Mode: C++ -*-
7e914051 2// $Id$
7dceaa9b 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 */
31class AliHLTTPCMapping : public AliHLTLogging {
32public:
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 */
a74855c2 49 UInt_t GetPad(UInt_t HWAddress) const;
7dceaa9b 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 */
a74855c2 56 UInt_t GetRow(UInt_t HWAddress) const;
7dceaa9b 57
d2f725e4 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
7dceaa9b 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
a74855c2 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;
7dceaa9b 92
93
94 /** size of mapping arrays */
a74855c2 95 static const UInt_t fgkMapping0Size=3200; // see above
7dceaa9b 96 /** size of mapping array for patch 1 */
a74855c2 97 static const UInt_t fgkMapping1Size=3584; // see above
7dceaa9b 98 /** size of mapping array for patch 2 */
a74855c2 99 static const UInt_t fgkMapping2Size=3200; // see above
7dceaa9b 100 /** size of mapping array for patch 3 */
a74855c2 101 static const UInt_t fgkMapping3Size=3328; // see above
7dceaa9b 102 /** size of mapping array for patch 4 */
a74855c2 103 static const UInt_t fgkMapping4Size=3328; // see above
7dceaa9b 104 /** size of mapping array for patch 5 */
a74855c2 105 static const UInt_t fgkMapping5Size=3328; // see above
7dceaa9b 106
a74855c2 107 /** row mapping array for patch 0 */
7dceaa9b 108 static UInt_t fgRowMapping0[fgkMapping0Size]; // see above
a74855c2 109 /** pad mapping array for patch 0 */
7dceaa9b 110 static UInt_t fgPadMapping0[fgkMapping0Size]; // see above
a74855c2 111 /** row mapping array for patch 1 */
7dceaa9b 112 static UInt_t fgRowMapping1[fgkMapping1Size]; // see above
a74855c2 113 /** pad mapping array for patch 1 */
7dceaa9b 114 static UInt_t fgPadMapping1[fgkMapping1Size]; // see above
a74855c2 115 /** row mapping array for patch 2 */
7dceaa9b 116 static UInt_t fgRowMapping2[fgkMapping2Size]; // see above
a74855c2 117 /** pad mapping array for patch 2 */
7dceaa9b 118 static UInt_t fgPadMapping2[fgkMapping2Size]; // see above
a74855c2 119 /** row mapping array for patch 3 */
7dceaa9b 120 static UInt_t fgRowMapping3[fgkMapping3Size]; // see above
a74855c2 121 /** pad mapping array for patch 3 */
7dceaa9b 122 static UInt_t fgPadMapping3[fgkMapping3Size]; // see above
a74855c2 123 /** row mapping array for patch 4 */
7dceaa9b 124 static UInt_t fgRowMapping4[fgkMapping4Size]; // see above
a74855c2 125 /** pad mapping array for patch 4 */
7dceaa9b 126 static UInt_t fgPadMapping4[fgkMapping4Size]; // see above
a74855c2 127 /** row mapping array for patch 5 */
7dceaa9b 128 static UInt_t fgRowMapping5[fgkMapping5Size]; // see above
a74855c2 129 /** pad mapping array for patch 5 */
7dceaa9b 130 static UInt_t fgPadMapping5[fgkMapping5Size]; // see above
131
a74855c2 132 /** current row mapping array */
133 UInt_t *fCurrentRowMapping; //!transient
134 /** current pad mapping array */
135 UInt_t *fCurrentPadMapping; //!transient
7dceaa9b 136
137 /** Number of hardware adresses */
d2f725e4 138 UInt_t fNHWAdd; //!transient
7dceaa9b 139
140 /** Maximum number of hardware addresses */
d2f725e4 141 UInt_t fMaxHWAdd; //!transient
142
143 /** The row offset of the patch*/
144 Int_t fRowOffset; //!transient
7dceaa9b 145
d2f725e4 146 ClassDef(AliHLTTPCMapping, 1)
7dceaa9b 147};
148#endif // ALIHLTTPCMAPPING_H