Fixing destructor
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONDataTypes.h
CommitLineData
dc4f7fda 1#ifndef ALIHLTMUONDATATYPES_H
2#define ALIHLTMUONDATATYPES_H
3/**************************************************************************
4 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
5 * *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18/* $Id$ */
19
20/**
21 * @file AliHLTMUONDataTypes.h
22 * @author Artur Szostak <artursz@iafrica.com>
23 * @date
24 * @brief Declaration of basic data types used in HLT/MUON module.
25 *
26 * The types and structs are defined with C linkage since C generally gives us
27 * more binary compatibility between compilers.
28 */
29
30#include "AliHLTDataTypes.h"
31#include <ostream>
32
33extern "C"
34{
35
dc4f7fda 36/**
37 * The common internal dimuon HLT data block header.
38 * These headers help to identify the data block when it is written to disk and
39 * helps to check the integrity of the data blocks in the system.
40 */
41struct AliHLTMUONDataBlockHeader
42{
43 AliHLTUInt16_t fType; // The type of the data block. Must contain a value
44 // defined by AliHLTMUONDataBlockType.
45 AliHLTUInt16_t fRecordWidth; // The number of bytes each record uses.
46 AliHLTUInt32_t fNrecords; // Number of records in this data block.
47};
48
b4d2a4c4 49/**
50 * The field structure of a single row of the AliHLTMUONHitReconstructor component's
51 * lookup table.
52 */
53struct AliHLTMUONHitRecoLutRow
54{
55 AliHLTInt32_t fDetElemId; // The detector element ID of the pad.
56 AliHLTInt32_t fIX, fIY; // The X,Y number of the pad.
57 AliHLTFloat32_t fRealX, fRealY, fRealZ; // The real coordinate of the pad.
58 AliHLTFloat32_t fHalfPadSize; // half padsize in X for bending and Y for nonbending
59 AliHLTInt32_t fPlane; // The plane and PCB zone ID numbers.
60 AliHLTFloat32_t fPed, fSigma, fA0, fA1; // Calibration values
61 AliHLTInt32_t fThres, fSat; //Calibration values
62};
63
64/**
65 * The field structure of a single row of the AliHLTMUONTriggerReconstructor component's
66 * lookup table.
67 */
68struct AliHLTMUONTriggerRecoLutRow
69{
a090ff22 70 AliHLTUInt32_t fIdFlags; /// The chamber and detector element identifier packed in AliHLTMUONRecHitStruct::fFlags format.
b4d2a4c4 71 AliHLTFloat32_t fX; // Global X coordinate of channel.
72 AliHLTFloat32_t fY; // Global Y coordinate of channel.
73 AliHLTFloat32_t fZ; // Global Z coordinate of channel.
74};
75
c95cf30c 76/**
77 * The lookup table structure for the AliHLTMUONTriggerReconstructor component.
78 * The LUT is used for translating from channel addresses to geometrical positions
79 * and other relevant information of the strips in the trigger chambers.
80 */
81struct AliHLTMUONTriggerRecoLookupTable
82{
83 // [regional header index][local board ID][chamber][cathode - X/Y][bit set in bit pattern]
84 AliHLTMUONTriggerRecoLutRow fRow[8][16][4][2][16];
85};
86
dc4f7fda 87} // extern "C"
88
89
90/**
6253e09b 91 * The sign/charge of a particle.
dc4f7fda 92 */
93enum AliHLTMUONParticleSign
94{
95 kSignMinus = -1,
96 kSignUnknown = 0,
97 kSignPlus = 1
98};
99
100/**
101 * The chamber names of the dimuon spectrometer.
102 */
103enum AliHLTMUONChamberName
104{
5ae4dba9 105 kUnknownChamber = -1,
dc4f7fda 106 kChamber1 = 0,
107 kChamber2 = 1,
108 kChamber3 = 2,
109 kChamber4 = 3,
110 kChamber5 = 4,
111 kChamber6 = 5,
112 kChamber7 = 6,
113 kChamber8 = 7,
114 kChamber9 = 8,
115 kChamber10 = 9,
116 kChamber11 = 10,
117 kChamber12 = 11,
118 kChamber13 = 12,
119 kChamber14 = 13
120};
121
122/**
123 * The internal data block type codes.
124 */
125enum AliHLTMUONDataBlockType
126{
127 kUnknownDataBlock = 0,
128 kTriggerRecordsDataBlock = 1000,
129 kTrigRecsDebugDataBlock = 1001,
dc4f7fda 130 kRecHitsDataBlock = 2000,
131 kClustersDataBlock = 2001,
132 kChannelsDataBlock = 2002,
133 kMansoTracksDataBlock = 3000,
90a74d7a 134 kMansoCandidatesDataBlock = 3001,
135 kSinglesDecisionDataBlock = 4000,
136 kPairsDecisionDataBlock = 4001
dc4f7fda 137};
138
139
140/**
141 * Stream operator to be able to print AliHLTMUONParticleSign with human
142 * readable names to some stream object like cout (standard output).
143 */
144inline std::ostream& operator << (std::ostream& stream, AliHLTMUONParticleSign sign)
145{
146 switch (sign)
147 {
148 case kSignMinus: stream << "kSignMinus"; break;
149 case kSignUnknown: stream << "kSignUnknown"; break;
150 case kSignPlus: stream << "kSignPlus"; break;
151 default: stream << "INVALID";
152 }
153 return stream;
154}
155
156/**
157 * Stream operator to be able to print AliHLTMUONChamberName with human
158 * readable names to some stream object like cout (standard output).
159 */
160inline std::ostream& operator << (std::ostream& stream, AliHLTMUONChamberName chamber)
161{
162 switch (chamber)
163 {
5ae4dba9 164 case kUnknownChamber: stream << "kUnknownChamber"; break;
165 case kChamber1: stream << "kChamber1"; break;
166 case kChamber2: stream << "kChamber2"; break;
167 case kChamber3: stream << "kChamber3"; break;
168 case kChamber4: stream << "kChamber4"; break;
169 case kChamber5: stream << "kChamber5"; break;
170 case kChamber6: stream << "kChamber6"; break;
171 case kChamber7: stream << "kChamber7"; break;
172 case kChamber8: stream << "kChamber8"; break;
173 case kChamber9: stream << "kChamber9"; break;
174 case kChamber10: stream << "kChamber10"; break;
175 case kChamber11: stream << "kChamber11"; break;
176 case kChamber12: stream << "kChamber12"; break;
177 case kChamber13: stream << "kChamber13"; break;
178 case kChamber14: stream << "kChamber14"; break;
179 default: stream << "INVALID";
dc4f7fda 180 }
181 return stream;
182}
183
184/**
185 * Stream operator to be able to print AliHLTMUONDataBlockType with human
186 * readable names to some stream object like cout (standard output).
187 */
188inline std::ostream& operator << (std::ostream& stream, AliHLTMUONDataBlockType type)
189{
190 switch (type)
191 {
c8ec7c7e 192 case kUnknownDataBlock: stream << "kUnknownDataBlock"; break;
193 case kTriggerRecordsDataBlock: stream << "kTriggerRecordsDataBlock"; break;
194 case kTrigRecsDebugDataBlock: stream << "kTrigRecsDebugDataBlock"; break;
c8ec7c7e 195 case kRecHitsDataBlock: stream << "kRecHitsDataBlock"; break;
196 case kClustersDataBlock: stream << "kClustersDataBlock"; break;
197 case kChannelsDataBlock: stream << "kChannelsDataBlock"; break;
198 case kMansoTracksDataBlock: stream << "kMansoTracksDataBlock"; break;
90a74d7a 199 case kMansoCandidatesDataBlock: stream << "kMansoCandidatesDataBlock"; break;
200 case kSinglesDecisionDataBlock: stream << "kSinglesDecisionDataBlock"; break;
201 case kPairsDecisionDataBlock: stream << "kPairsDecisionDataBlock"; break;
c8ec7c7e 202 default: stream << "INVALID";
dc4f7fda 203 }
204 return stream;
205}
206
207/**
208 * Stream operator for usage with std::ostream classes which prints the common
209 * data block header in the following format:
210 * {fType = xx, fRecordWidth = yy, fNrecords = zz}
211 */
212inline std::ostream& operator << (
213 std::ostream& stream, const AliHLTMUONDataBlockHeader& header
214 )
215{
216 stream << "{fType = " << AliHLTMUONDataBlockType(header.fType)
217 << ", fRecordWidth = " << header.fRecordWidth
218 << ", fNrecords = " << header.fNrecords << "}";
219 return stream;
220}
221
222
223inline bool operator == (
224 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
225 )
226{
227 return a.fType == b.fType and a.fRecordWidth == b.fRecordWidth
228 and a.fNrecords == b.fNrecords;
229}
230
231inline bool operator != (
232 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
233 )
234{
235 return not operator == (a, b);
236}
237
238#endif // ALIHLTMUONDATATYPES_H