]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONTriggerRecordsBlockStruct.h
Moved some typedefs to AliHLTDataTypes.h for common use.
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONTriggerRecordsBlockStruct.h
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
6 /* $Id$ */
7
8 /**
9  * @file   AliHLTMUONTriggerRecordsBlockStruct.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Definition of internal dimuon HLT trigger record data block structure.
13  * 
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 /**
24  * Trigger record structures containing information decoded from the dimuon
25  * spectrometer's hardware trigger electronics.
26  */
27 struct AliHLTMUONTriggerRecordStruct
28 {
29         AliHLTInt32_t fId; // Each trigger record should have an ID number unique
30                            // for a given event. -1 == invalid.
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 /**
53  * AliHLTMUONTriggerRecordsBlockStruct defines the format of the internal
54  * trigger records data block.
55  */
56 struct AliHLTMUONTriggerRecordsBlockStruct
57 {
58         AliHLTMUONDataBlockHeader fHeader; // Common data block header
59
60         // Array of trigger records.
61 #ifndef __SUNPRO_CC
62         AliHLTMUONTriggerRecordStruct fTriggerRecord[/*fHeader.fNrecords*/];
63 #else
64         AliHLTMUONTriggerRecordStruct fTriggerRecord[1];
65 #endif
66 };
67
68 } // extern "C"
69
70
71 /**
72  * Stream operator for usage with std::ostream classes which prints the trigger
73  * record in the following format:
74  *  {fId = xx, fFlags = 0xYY, fPx = uu, fPy = vv, fPz = ww, fHit[0] = {...},
75  *   fHit[1] = {...}, fHit[2] = {...}, fHit[3] = {...}}
76  */
77 std::ostream& operator << (
78                 std::ostream& stream, const AliHLTMUONTriggerRecordStruct& trigrec
79         );
80
81 /**
82  * Stream operator for usage with std::ostream classes which prints the
83  * AliHLTMUONTriggerRecordsBlockStruct in the following format:
84  *   {fHeader = xx, fTriggerRecord[] = [{..}, {..}, ...]}
85  */
86 std::ostream& operator << (
87                 std::ostream& stream, const AliHLTMUONTriggerRecordsBlockStruct& block
88         );
89
90
91 inline bool operator == (
92                 const AliHLTMUONTriggerRecordStruct& a,
93                 const AliHLTMUONTriggerRecordStruct& b
94         )
95 {
96         return a.fId == b.fId and a.fFlags == b.fFlags
97                 and a.fPx == b.fPx and a.fPy == b.fPy and a.fPz == b.fPz
98                 and a.fHit[0] == b.fHit[0] and a.fHit[1] == b.fHit[1]
99                 and a.fHit[2] == b.fHit[2] and a.fHit[3] == b.fHit[3];
100 }
101
102 inline bool operator != (
103                 const AliHLTMUONTriggerRecordStruct& a,
104                 const AliHLTMUONTriggerRecordStruct& b
105         )
106 {
107         return not operator == (a, b);
108 }
109
110
111 bool operator == (
112                 const AliHLTMUONTriggerRecordsBlockStruct& a,
113                 const AliHLTMUONTriggerRecordsBlockStruct& b
114         );
115
116 inline bool operator != (
117                 const AliHLTMUONTriggerRecordsBlockStruct& a,
118                 const AliHLTMUONTriggerRecordsBlockStruct& b
119         )
120 {
121         return not operator == (a, b);
122 }
123
124 #endif // ALIHLTMUONTRIGGERRECORDSBLOCKSTRUCT_H