]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONChannelsBlockStruct.h
Applying fixes and updates (Indra)
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONChannelsBlockStruct.h
1 #ifndef ALIHLTMUONCHANNELSBLOCKSTRUCT_H
2 #define ALIHLTMUONCHANNELSBLOCKSTRUCT_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   AliHLTMUONChannelsBlockStruct.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Definition of internal dimuon HLT block structure containing
13  *         debugging information about channels that belong to reconstructed
14  *         hit clusters.
15  * 
16  * The structures are defined with C linkage since C generally gives us more
17  * binary compatibility between compilers.
18  */
19
20 #include "AliHLTMUONDataTypes.h"
21 #include <ostream>
22
23 extern "C"
24 {
25
26 /**
27  * Gives the fired channel/pad information which was considered during
28  * hit reconstruction and correlated into a common cluster.
29  */
30 struct AliHLTMUONChannelStruct
31 {
32         AliHLTInt32_t fClusterId;   // ID corresponding to the cluster this
33                                     // channel is part of. -1 == invalid.
34
35         AliHLTUInt16_t fManu;        // The MANU address on electronics.
36         AliHLTUInt16_t fChannelAddress; // The channel address on electronics.
37         AliHLTUInt16_t fSignal;      // ADC value of signal.
38         AliHLTUInt32_t fRawDataWord; // The raw data word as found in the DDL stream.
39 };
40
41 /**
42  * AliHLTMUONChannelBlockStruct defines the format of the internal channel
43  * data block corresponding to clusters on the tracking chambers.
44  */
45 struct AliHLTMUONChannelsBlockStruct
46 {
47         AliHLTMUONDataBlockHeader fHeader; // Common data block header
48
49         // Array of cluster channels/pads.
50 #ifndef __SUNPRO_CC
51         AliHLTMUONChannelStruct fChannel[/*fHeader.fNrecords*/];
52 #else
53         AliHLTMUONChannelStruct fChannel[1];
54 #endif
55 };
56
57 } // extern "C"
58
59
60 /**
61  * Stream operator for usage with std::ostream classes which prints the
62  * AliHLTMUONChannelStruct in the following format:
63  *   {fClusterId = xx, fManu = yy, fChannelAddress = zz, fSignal = ww,
64  *    fRawDataWord = 0xXXXXXXXX}
65  */
66 std::ostream& operator << (
67                 std::ostream& stream, const AliHLTMUONChannelStruct& channel
68         );
69
70 /**
71  * Stream operator for usage with std::ostream classes which prints the
72  * AliHLTMUONChannelsBlockStruct in the following format:
73  *   {fHeader = xx, fChannel[] = [{..}, {..}, ...]}
74  */
75 std::ostream& operator << (
76                 std::ostream& stream, const AliHLTMUONChannelsBlockStruct& block
77         );
78
79
80 inline bool operator == (
81                 const AliHLTMUONChannelStruct& a,
82                 const AliHLTMUONChannelStruct& b
83         )
84 {
85         return a.fClusterId == b.fClusterId and a.fManu == b.fManu and
86                 a.fChannelAddress == b.fChannelAddress and
87                 a.fSignal == b.fSignal and a.fRawDataWord == b.fRawDataWord;
88 }
89
90 inline bool operator != (
91                 const AliHLTMUONChannelStruct& a,
92                 const AliHLTMUONChannelStruct& b
93         )
94 {
95         return not operator == (a, b);
96 }
97
98
99 bool operator == (
100                 const AliHLTMUONChannelsBlockStruct& a,
101                 const AliHLTMUONChannelsBlockStruct& b
102         );
103
104 inline bool operator != (
105                 const AliHLTMUONChannelsBlockStruct& a,
106                 const AliHLTMUONChannelsBlockStruct& b
107         )
108 {
109         return not operator == (a, b);
110 }
111
112 #endif // ALIHLTMUONCHANNELSBLOCKSTRUCT_H