]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONRecHitsBlockStruct.h
Minor cleanup of code.
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONRecHitsBlockStruct.h
1 #ifndef ALIHLTMUONRECHITSBLOCKSTRUCT_H
2 #define ALIHLTMUONRECHITSBLOCKSTRUCT_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /**
9  * @file   AliHLTMUONRecHitsBlockStruct.h
10  * @author Indranil Das <indra.das@saha.ac.in>,
11  *         Artur Szostak <artursz@iafrica.com>
12  * @date   
13  * @brief  Definition of internal dimuon HLT reconstructed hit data block structure.
14  * 
15  * The structures are defined with C linkage since C generally gives us more
16  * binary compatibility between compilers.
17  */
18
19 #include "AliHLTMUONDataTypes.h"
20
21 extern "C"
22 {
23
24 /**
25  * A 3D reconstructed hit point structure.
26  * These are used to store the hits reconstructed on the tracking or trigger
27  * chambers.
28  * Reconstructed hit values of (0, 0, 0) indicate an invalid or nil hit.
29  */
30 struct AliHLTMUONRecHitStruct
31 {
32         AliHLTFloat32_t fX; // X coordinate.
33         AliHLTFloat32_t fY; // Y coordinate.
34         AliHLTFloat32_t fZ; // Z coordinate.
35 };
36
37 /**
38  * AliHLTMUONRecHitsBlockStruct defines the format of the internal
39  * reconstructed hit data block.
40  */
41 struct AliHLTMUONRecHitsBlockStruct
42 {
43         AliHLTMUONDataBlockHeader fHeader; // Common data block header
44
45         // Array of reconstructed hits.
46 #ifndef __SUNPRO_CC
47         AliHLTMUONRecHitStruct fHit[/*fHeader.fNrecords*/];
48 #else
49         AliHLTMUONRecHitStruct fHit[1];
50 #endif
51 };
52
53 } // extern "C"
54
55
56 /**
57  * Stream operator for usage with std::ostream classes which prints the
58  * reconstructed hit in the following format: {fX = xx, fY = yy, fZ = zz}
59  */
60 inline std::ostream& operator << (
61                 std::ostream& stream, const AliHLTMUONRecHitStruct& hit
62         )
63 {
64         stream  << "{fX = " << hit.fX << ", fY = " << hit.fY << ", fZ = "
65                 << hit.fZ << "}";
66         return stream;
67 }
68
69 /**
70  * Stream operator for usage with std::ostream classes which prints the
71  * AliHLTMUONRecHitsBlockStruct in the following format:
72  *   {fHeader = xx, fHit[] = [{..}, {..}, ...]}
73  */
74 std::ostream& operator << (
75                 std::ostream& stream, const AliHLTMUONRecHitsBlockStruct& block
76         );
77
78
79 inline bool operator == (
80                 const AliHLTMUONRecHitStruct& a, const AliHLTMUONRecHitStruct& b
81         )
82 {
83         return a.fX == b.fX and a.fY == b.fY and a.fZ == b.fZ;
84 }
85
86 inline bool operator != (
87                 const AliHLTMUONRecHitStruct& a, const AliHLTMUONRecHitStruct& b
88         )
89 {
90         return not operator == (a, b);
91 }
92
93
94 bool operator == (
95                 const AliHLTMUONRecHitsBlockStruct& a,
96                 const AliHLTMUONRecHitsBlockStruct& b
97         );
98
99 inline bool operator != (
100                 const AliHLTMUONRecHitsBlockStruct& a,
101                 const AliHLTMUONRecHitsBlockStruct& b
102         )
103 {
104         return not operator == (a, b);
105 }
106
107 #endif // ALIHLTMUONRECHITSBLOCKSTRUCT_H