]>
Commit | Line | Data |
---|---|---|
053e588f | 1 | #ifndef ALIHLTMUONTRIGGERRECORDSBLOCKSTRUCT_H |
2 | #define ALIHLTMUONTRIGGERRECORDSBLOCKSTRUCT_H | |
3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
1d8ae082 | 6 | // $Id$ |
053e588f | 7 | |
8 | /** | |
9 | * @file AliHLTMUONTriggerRecordsBlockStruct.h | |
10 | * @author Artur Szostak <artursz@iafrica.com> | |
1d8ae082 | 11 | * @date 18 May 2007 |
053e588f | 12 | * @brief Definition of internal dimuon HLT trigger record data block structure. |
1d8ae082 | 13 | * |
053e588f | 14 | * The structures are defined with C linkage since C generally gives us more |
15 | * binary compatibility between compilers. | |
16 | */ | |
17 | ||
18 | #include "AliHLTMUONRecHitsBlockStruct.h" | |
19 | ||
20 | extern "C" | |
21 | { | |
22 | ||
23 | /** | |
e800d035 | 24 | * Trigger record structures containing information decoded from the dimuon |
25 | * spectrometer's hardware trigger electronics. | |
053e588f | 26 | */ |
27 | struct AliHLTMUONTriggerRecordStruct | |
28 | { | |
b08ffe98 | 29 | AliHLTInt32_t fId; // Each trigger record should have an ID number unique |
30 | // for a given event. -1 == invalid. | |
053e588f | 31 | |
32 | // The flags word constains the following bit fields (bit 31 is most | |
33 | // significant): | |
34 | // bits: [31][30][29 --- 4][ 3 ][ 2 ][ 1 ][ 0 ] | |
35 | // field: - + reserved hst[3] hst[2] hst[1] hst[0] | |
36 | // Where fields hst[i] indicates if fHit[i] has been filled/set. | |
37 | // Reserved bits should be set to zero. | |
38 | // Particle sign: if '-' is set then particle has minus sign. | |
39 | // if '+' is set then particle has negative sign. | |
40 | // Either '+' or '-' should be set and if neither then the particle | |
41 | // sign is unknown. | |
42 | AliHLTUInt32_t fFlags; | |
43 | ||
44 | AliHLTFloat32_t fPx; // Particle momentum X component in GeV/c. | |
45 | AliHLTFloat32_t fPy; // Particle momentum Y component in GeV/c. | |
46 | AliHLTFloat32_t fPz; // Particle momentum Z component in GeV/c. | |
47 | ||
48 | // Particle hit coordinates on trigger chambers 11 to 14. | |
49 | AliHLTMUONRecHitStruct fHit[4]; | |
50 | }; | |
51 | ||
52 | /** | |
ffebb0e6 | 53 | * AliHLTMUONTriggerRecordsBlockStruct defines the format of the internal |
053e588f | 54 | * trigger records data block. |
55 | */ | |
56 | struct AliHLTMUONTriggerRecordsBlockStruct | |
57 | { | |
58 | AliHLTMUONDataBlockHeader fHeader; // Common data block header | |
59 | ||
60 | // Array of trigger records. | |
23ad6161 | 61 | //AliHLTMUONTriggerRecordStruct fTriggerRecord[/*fHeader.fNrecords*/]; |
053e588f | 62 | }; |
63 | ||
64 | } // extern "C" | |
65 | ||
66 | ||
67 | /** | |
68 | * Stream operator for usage with std::ostream classes which prints the trigger | |
69 | * record in the following format: | |
70 | * {fId = xx, fFlags = 0xYY, fPx = uu, fPy = vv, fPz = ww, fHit[0] = {...}, | |
71 | * fHit[1] = {...}, fHit[2] = {...}, fHit[3] = {...}} | |
72 | */ | |
73 | std::ostream& operator << ( | |
74 | std::ostream& stream, const AliHLTMUONTriggerRecordStruct& trigrec | |
75 | ); | |
76 | ||
77 | /** | |
78 | * Stream operator for usage with std::ostream classes which prints the | |
79 | * AliHLTMUONTriggerRecordsBlockStruct in the following format: | |
80 | * {fHeader = xx, fTriggerRecord[] = [{..}, {..}, ...]} | |
81 | */ | |
82 | std::ostream& operator << ( | |
83 | std::ostream& stream, const AliHLTMUONTriggerRecordsBlockStruct& block | |
84 | ); | |
85 | ||
86 | ||
87 | inline bool operator == ( | |
88 | const AliHLTMUONTriggerRecordStruct& a, | |
89 | const AliHLTMUONTriggerRecordStruct& b | |
90 | ) | |
91 | { | |
92 | return a.fId == b.fId and a.fFlags == b.fFlags | |
93 | and a.fPx == b.fPx and a.fPy == b.fPy and a.fPz == b.fPz | |
94 | and a.fHit[0] == b.fHit[0] and a.fHit[1] == b.fHit[1] | |
95 | and a.fHit[2] == b.fHit[2] and a.fHit[3] == b.fHit[3]; | |
96 | } | |
97 | ||
98 | inline bool operator != ( | |
99 | const AliHLTMUONTriggerRecordStruct& a, | |
100 | const AliHLTMUONTriggerRecordStruct& b | |
101 | ) | |
102 | { | |
103 | return not operator == (a, b); | |
104 | } | |
105 | ||
106 | ||
107 | bool operator == ( | |
108 | const AliHLTMUONTriggerRecordsBlockStruct& a, | |
109 | const AliHLTMUONTriggerRecordsBlockStruct& b | |
110 | ); | |
111 | ||
112 | inline bool operator != ( | |
113 | const AliHLTMUONTriggerRecordsBlockStruct& a, | |
114 | const AliHLTMUONTriggerRecordsBlockStruct& b | |
115 | ) | |
116 | { | |
117 | return not operator == (a, b); | |
118 | } | |
119 | ||
120 | #endif // ALIHLTMUONTRIGGERRECORDSBLOCKSTRUCT_H |