]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONTriggerChannelsBlockStruct.h
Minor cleanup of code.
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONTriggerChannelsBlockStruct.h
1 #ifndef ALIHLTMUONTRIGGERCHANNELSBLOCKSTRUCT_H
2 #define ALIHLTMUONTRIGGERCHANNELSBLOCKSTRUCT_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   AliHLTMUONTriggerChannelsBlockStruct.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 trigger records.
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 #include <ostream>
21
22 extern "C"
23 {
24
25 /**
26  * Gives the fired channel/strip information which was considered during
27  * hit reconstruction on trigger chambers and correlated into a common cluster.
28  */
29 struct AliHLTMUONTriggerChannelStruct
30 {
31         AliHLTInt32_t fTrigRecId; // ID corresponding to the trigger records this
32                                   // channel is part of. -1 == invalid.
33                                   
34         AliHLTUInt16_t fChamber; // The chamber this hit corresponds to.
35                                  // In the range [11..14].
36                                  
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  * AliHLTMUONTriggerChannelsBlockStruct defines the format of the internal
43  * channel data block corresponding to clusters on the trigger chambers.
44  */
45 struct AliHLTMUONTriggerChannelsBlockStruct
46 {
47         AliHLTMUONDataBlockHeader fHeader; // Common data block header
48
49         // Array of trigger channels/strips.
50 #ifndef __SUNPRO_CC
51         AliHLTMUONTriggerChannelStruct fChannel[/*fHeader.fNrecords*/];
52 #else
53         AliHLTMUONTriggerChannelStruct 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  * AliHLTMUONTriggerChannelStruct in the following format:
63  *   {fTrigRecId = xx, fChamber = yy, fSignal = zz, fRawDataWord = 0xXXXXXXXX}
64  */
65 std::ostream& operator << (
66                 std::ostream& stream, const AliHLTMUONTriggerChannelStruct& channel
67         );
68
69 /**
70  * Stream operator for usage with std::ostream classes which prints the
71  * AliHLTMUONTriggerChannelsBlockStruct in the following format:
72  *   {fHeader = xx, fChannel[] = [{..}, {..}, ...]}
73  */
74 std::ostream& operator << (
75                 std::ostream& stream,
76                 const AliHLTMUONTriggerChannelsBlockStruct& block
77         );
78
79
80 inline bool operator == (
81                 const AliHLTMUONTriggerChannelStruct& a,
82                 const AliHLTMUONTriggerChannelStruct& b
83         )
84 {
85         return a.fTrigRecId == b.fTrigRecId and a.fChamber == b.fChamber and
86                 a.fSignal == b.fSignal and a.fRawDataWord == b.fRawDataWord;
87 }
88
89 inline bool operator != (
90                 const AliHLTMUONTriggerChannelStruct& a,
91                 const AliHLTMUONTriggerChannelStruct& b
92         )
93 {
94         return not operator == (a, b);
95 }
96
97
98 bool operator == (
99                 const AliHLTMUONTriggerChannelsBlockStruct& a,
100                 const AliHLTMUONTriggerChannelsBlockStruct& b
101         );
102
103 inline bool operator != (
104                 const AliHLTMUONTriggerChannelsBlockStruct& a,
105                 const AliHLTMUONTriggerChannelsBlockStruct& b
106         )
107 {
108         return not operator == (a, b);
109 }
110
111 #endif // ALIHLTMUONTRIGGERCHANNELSBLOCKSTRUCT_H