Fixing coding violations and getting rid of warnings.
[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/**
6253e09b 58 * The sign/charge of a particle.
dc4f7fda 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{
5ae4dba9 72 kUnknownChamber = -1,
dc4f7fda 73 kChamber1 = 0,
74 kChamber2 = 1,
75 kChamber3 = 2,
76 kChamber4 = 3,
77 kChamber5 = 4,
78 kChamber6 = 5,
79 kChamber7 = 6,
80 kChamber8 = 7,
81 kChamber9 = 8,
82 kChamber10 = 9,
83 kChamber11 = 10,
84 kChamber12 = 11,
85 kChamber13 = 12,
86 kChamber14 = 13
87};
88
89/**
90 * The internal data block type codes.
91 */
92enum AliHLTMUONDataBlockType
93{
94 kUnknownDataBlock = 0,
95 kTriggerRecordsDataBlock = 1000,
96 kTrigRecsDebugDataBlock = 1001,
c8ec7c7e 97 kTriggerChannelsDataBlock = 1002,
dc4f7fda 98 kRecHitsDataBlock = 2000,
99 kClustersDataBlock = 2001,
100 kChannelsDataBlock = 2002,
101 kMansoTracksDataBlock = 3000,
90a74d7a 102 kMansoCandidatesDataBlock = 3001,
103 kSinglesDecisionDataBlock = 4000,
104 kPairsDecisionDataBlock = 4001
dc4f7fda 105};
106
107
108/**
109 * Stream operator to be able to print AliHLTMUONParticleSign with human
110 * readable names to some stream object like cout (standard output).
111 */
112inline std::ostream& operator << (std::ostream& stream, AliHLTMUONParticleSign sign)
113{
114 switch (sign)
115 {
116 case kSignMinus: stream << "kSignMinus"; break;
117 case kSignUnknown: stream << "kSignUnknown"; break;
118 case kSignPlus: stream << "kSignPlus"; break;
119 default: stream << "INVALID";
120 }
121 return stream;
122}
123
124/**
125 * Stream operator to be able to print AliHLTMUONChamberName with human
126 * readable names to some stream object like cout (standard output).
127 */
128inline std::ostream& operator << (std::ostream& stream, AliHLTMUONChamberName chamber)
129{
130 switch (chamber)
131 {
5ae4dba9 132 case kUnknownChamber: stream << "kUnknownChamber"; break;
133 case kChamber1: stream << "kChamber1"; break;
134 case kChamber2: stream << "kChamber2"; break;
135 case kChamber3: stream << "kChamber3"; break;
136 case kChamber4: stream << "kChamber4"; break;
137 case kChamber5: stream << "kChamber5"; break;
138 case kChamber6: stream << "kChamber6"; break;
139 case kChamber7: stream << "kChamber7"; break;
140 case kChamber8: stream << "kChamber8"; break;
141 case kChamber9: stream << "kChamber9"; break;
142 case kChamber10: stream << "kChamber10"; break;
143 case kChamber11: stream << "kChamber11"; break;
144 case kChamber12: stream << "kChamber12"; break;
145 case kChamber13: stream << "kChamber13"; break;
146 case kChamber14: stream << "kChamber14"; break;
147 default: stream << "INVALID";
dc4f7fda 148 }
149 return stream;
150}
151
152/**
153 * Stream operator to be able to print AliHLTMUONDataBlockType with human
154 * readable names to some stream object like cout (standard output).
155 */
156inline std::ostream& operator << (std::ostream& stream, AliHLTMUONDataBlockType type)
157{
158 switch (type)
159 {
c8ec7c7e 160 case kUnknownDataBlock: stream << "kUnknownDataBlock"; break;
161 case kTriggerRecordsDataBlock: stream << "kTriggerRecordsDataBlock"; break;
162 case kTrigRecsDebugDataBlock: stream << "kTrigRecsDebugDataBlock"; break;
163 case kTriggerChannelsDataBlock: stream << "kTriggerChannelsDataBlock"; break;
164 case kRecHitsDataBlock: stream << "kRecHitsDataBlock"; break;
165 case kClustersDataBlock: stream << "kClustersDataBlock"; break;
166 case kChannelsDataBlock: stream << "kChannelsDataBlock"; break;
167 case kMansoTracksDataBlock: stream << "kMansoTracksDataBlock"; break;
90a74d7a 168 case kMansoCandidatesDataBlock: stream << "kMansoCandidatesDataBlock"; break;
169 case kSinglesDecisionDataBlock: stream << "kSinglesDecisionDataBlock"; break;
170 case kPairsDecisionDataBlock: stream << "kPairsDecisionDataBlock"; break;
c8ec7c7e 171 default: stream << "INVALID";
dc4f7fda 172 }
173 return stream;
174}
175
176/**
177 * Stream operator for usage with std::ostream classes which prints the common
178 * data block header in the following format:
179 * {fType = xx, fRecordWidth = yy, fNrecords = zz}
180 */
181inline std::ostream& operator << (
182 std::ostream& stream, const AliHLTMUONDataBlockHeader& header
183 )
184{
185 stream << "{fType = " << AliHLTMUONDataBlockType(header.fType)
186 << ", fRecordWidth = " << header.fRecordWidth
187 << ", fNrecords = " << header.fNrecords << "}";
188 return stream;
189}
190
191
192inline bool operator == (
193 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
194 )
195{
196 return a.fType == b.fType and a.fRecordWidth == b.fRecordWidth
197 and a.fNrecords == b.fNrecords;
198}
199
200inline bool operator != (
201 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
202 )
203{
204 return not operator == (a, b);
205}
206
207#endif // ALIHLTMUONDATATYPES_H