Fixing compilation problem. fBlock was not dereferenced in BlockHeader() method.
[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
36typedef signed char AliHLTInt8_t;
37typedef signed int AliHLTInt32_t;
38typedef float AliHLTFloat32_t;
39typedef double AliHLTFloat64_t;
40
41/**
42 * The common internal dimuon HLT data block header.
43 * These headers help to identify the data block when it is written to disk and
44 * helps to check the integrity of the data blocks in the system.
45 */
46struct AliHLTMUONDataBlockHeader
47{
48 AliHLTUInt16_t fType; // The type of the data block. Must contain a value
49 // defined by AliHLTMUONDataBlockType.
50 AliHLTUInt16_t fRecordWidth; // The number of bytes each record uses.
51 AliHLTUInt32_t fNrecords; // Number of records in this data block.
52};
53
54} // extern "C"
55
56
57/**
58 * The sign of a particle.
59 */
60enum AliHLTMUONParticleSign
61{
62 kSignMinus = -1,
63 kSignUnknown = 0,
64 kSignPlus = 1
65};
66
67/**
68 * The chamber names of the dimuon spectrometer.
69 */
70enum AliHLTMUONChamberName
71{
72 kChamber1 = 0,
73 kChamber2 = 1,
74 kChamber3 = 2,
75 kChamber4 = 3,
76 kChamber5 = 4,
77 kChamber6 = 5,
78 kChamber7 = 6,
79 kChamber8 = 7,
80 kChamber9 = 8,
81 kChamber10 = 9,
82 kChamber11 = 10,
83 kChamber12 = 11,
84 kChamber13 = 12,
85 kChamber14 = 13
86};
87
88/**
89 * The internal data block type codes.
90 */
91enum AliHLTMUONDataBlockType
92{
93 kUnknownDataBlock = 0,
94 kTriggerRecordsDataBlock = 1000,
95 kTrigRecsDebugDataBlock = 1001,
c8ec7c7e 96 kTriggerChannelsDataBlock = 1002,
dc4f7fda 97 kRecHitsDataBlock = 2000,
98 kClustersDataBlock = 2001,
99 kChannelsDataBlock = 2002,
100 kMansoTracksDataBlock = 3000,
90a74d7a 101 kMansoCandidatesDataBlock = 3001,
102 kSinglesDecisionDataBlock = 4000,
103 kPairsDecisionDataBlock = 4001
dc4f7fda 104};
105
106
107/**
108 * Stream operator to be able to print AliHLTMUONParticleSign with human
109 * readable names to some stream object like cout (standard output).
110 */
111inline std::ostream& operator << (std::ostream& stream, AliHLTMUONParticleSign sign)
112{
113 switch (sign)
114 {
115 case kSignMinus: stream << "kSignMinus"; break;
116 case kSignUnknown: stream << "kSignUnknown"; break;
117 case kSignPlus: stream << "kSignPlus"; break;
118 default: stream << "INVALID";
119 }
120 return stream;
121}
122
123/**
124 * Stream operator to be able to print AliHLTMUONChamberName with human
125 * readable names to some stream object like cout (standard output).
126 */
127inline std::ostream& operator << (std::ostream& stream, AliHLTMUONChamberName chamber)
128{
129 switch (chamber)
130 {
131 case kChamber1: stream << "kChamber1"; break;
132 case kChamber2: stream << "kChamber2"; break;
133 case kChamber3: stream << "kChamber3"; break;
134 case kChamber4: stream << "kChamber4"; break;
135 case kChamber5: stream << "kChamber5"; break;
136 case kChamber6: stream << "kChamber6"; break;
137 case kChamber7: stream << "kChamber7"; break;
138 case kChamber8: stream << "kChamber8"; break;
139 case kChamber9: stream << "kChamber9"; break;
140 case kChamber10: stream << "kChamber10"; break;
141 case kChamber11: stream << "kChamber11"; break;
142 case kChamber12: stream << "kChamber12"; break;
143 case kChamber13: stream << "kChamber13"; break;
144 case kChamber14: stream << "kChamber14"; break;
145 default: stream << "INVALID";
146 }
147 return stream;
148}
149
150/**
151 * Stream operator to be able to print AliHLTMUONDataBlockType with human
152 * readable names to some stream object like cout (standard output).
153 */
154inline std::ostream& operator << (std::ostream& stream, AliHLTMUONDataBlockType type)
155{
156 switch (type)
157 {
c8ec7c7e 158 case kUnknownDataBlock: stream << "kUnknownDataBlock"; break;
159 case kTriggerRecordsDataBlock: stream << "kTriggerRecordsDataBlock"; break;
160 case kTrigRecsDebugDataBlock: stream << "kTrigRecsDebugDataBlock"; break;
161 case kTriggerChannelsDataBlock: stream << "kTriggerChannelsDataBlock"; break;
162 case kRecHitsDataBlock: stream << "kRecHitsDataBlock"; break;
163 case kClustersDataBlock: stream << "kClustersDataBlock"; break;
164 case kChannelsDataBlock: stream << "kChannelsDataBlock"; break;
165 case kMansoTracksDataBlock: stream << "kMansoTracksDataBlock"; break;
90a74d7a 166 case kMansoCandidatesDataBlock: stream << "kMansoCandidatesDataBlock"; break;
167 case kSinglesDecisionDataBlock: stream << "kSinglesDecisionDataBlock"; break;
168 case kPairsDecisionDataBlock: stream << "kPairsDecisionDataBlock"; break;
c8ec7c7e 169 default: stream << "INVALID";
dc4f7fda 170 }
171 return stream;
172}
173
174/**
175 * Stream operator for usage with std::ostream classes which prints the common
176 * data block header in the following format:
177 * {fType = xx, fRecordWidth = yy, fNrecords = zz}
178 */
179inline std::ostream& operator << (
180 std::ostream& stream, const AliHLTMUONDataBlockHeader& header
181 )
182{
183 stream << "{fType = " << AliHLTMUONDataBlockType(header.fType)
184 << ", fRecordWidth = " << header.fRecordWidth
185 << ", fNrecords = " << header.fNrecords << "}";
186 return stream;
187}
188
189
190inline bool operator == (
191 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
192 )
193{
194 return a.fType == b.fType and a.fRecordWidth == b.fRecordWidth
195 and a.fNrecords == b.fNrecords;
196}
197
198inline bool operator != (
199 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
200 )
201{
202 return not operator == (a, b);
203}
204
205#endif // ALIHLTMUONDATATYPES_H