]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONMansoTracksBlockStruct.h
Getting rid of zero length arrays in the block structure declarations since this...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONMansoTracksBlockStruct.h
1 #ifndef ALIHLTMUONMANSOTRACKSBLOCKSTRUCT_H
2 #define ALIHLTMUONMANSOTRACKSBLOCKSTRUCT_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   AliHLTMUONMansoTracksBlockStruct.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Definition of internal dimuon HLT tracks data block structure
13  *         generated by the Manso algorithm.
14  * 
15  * The structures are defined with C linkage since C generally gives us more
16  * binary compatibility between compilers.
17  */
18
19 #include "AliHLTMUONRecHitsBlockStruct.h"
20
21 extern "C"
22 {
23
24 /**
25  * Track structure containing information about a partial track generated by
26  * the Manso algorithm.
27  */
28 struct AliHLTMUONMansoTrackStruct
29 {
30         AliHLTInt32_t fId; // Each Manso track should have an ID number unique
31                            // for a given event. -1 == invalid.
32
33         AliHLTInt32_t fTrigRec; // The associated trigger record ID used as the
34                                 // seed for the Manso algorithm.
35
36         // The flags word constains the following bit fields (bit 31 is most
37         // significant):
38         // bits:  [31][30][29 --- 4][  3   ][  2   ][  1   ][  0   ]
39         // field:  -   +   reserved  hst[3]  hst[2]  hst[1]  hst[0]
40         // Where fields hst[i] indicates if fHit[i] has been filled/set.
41         // Reserved bits should be set to zero.
42         // Particle sign: if '-' is set then particle has minus sign.
43         //                if '+' is set then particle has negative sign.
44         // Either '+' or '-' should be set and if neither then the particle
45         // sign is unknown.
46         AliHLTUInt32_t fFlags;
47
48         AliHLTFloat32_t fPx; // Particle's momentum X component in GeV/c.
49         AliHLTFloat32_t fPy; // Particle's momentum Y component in GeV/c.
50         AliHLTFloat32_t fPz; // Particle's momentum Z component in GeV/c.
51         AliHLTFloat32_t fChi2; // The chi squared of the fit of fHit points to
52                                // the track model.
53
54         // Particle hit coordinates on tracking chambers 7 to 10.
55         // fHit[0] is for chamber 7 fHit[1] for chamber 8 etc...
56         AliHLTMUONRecHitStruct fHit[4];
57 };
58
59 /**
60  * AliHLTMUONMansoTracksBlockStruct defines the format of the internal
61  * Manso tracks data block.
62  */
63 struct AliHLTMUONMansoTracksBlockStruct
64 {
65         AliHLTMUONDataBlockHeader fHeader; // Common data block header.
66
67         // Array of Manso tracks.
68         //AliHLTMUONMansoTrackStruct fTrack[/*fHeader.fNrecords*/];
69 };
70
71 } // extern "C"
72
73
74 /**
75  * Stream operator for usage with std::ostream classes which prints the track
76  * information in the following format:
77  *  {fId = xx, fTrigRec = yy, fFlags = 0xZZ, fPx = uu, fPy = vv, fPz = ww,
78  *   fChi2 = ss, fHit[0] = {...}, fHit[1] = {...}, fHit[2] = {...},
79  *   fHit[3] = {...}}
80  */
81 std::ostream& operator << (
82                 std::ostream& stream, const AliHLTMUONMansoTrackStruct& trigrec
83         );
84
85 /**
86  * Stream operator for usage with std::ostream classes which prints the
87  * AliHLTMUONMansoTracksBlockStruct in the following format:
88  *   {fHeader = xx, fTrack[] = [{..}, {..}, ...]}
89  */
90 std::ostream& operator << (
91                 std::ostream& stream, const AliHLTMUONMansoTracksBlockStruct& block
92         );
93
94
95 inline bool operator == (
96                 const AliHLTMUONMansoTrackStruct& a,
97                 const AliHLTMUONMansoTrackStruct& b
98         )
99 {
100         return a.fId == b.fId and a.fTrigRec == b.fTrigRec
101                 and a.fFlags == b.fFlags and a.fPx == b.fPx and a.fPy == b.fPy
102                 and a.fPz == b.fPz and a.fChi2 == b.fChi2
103                 and a.fHit[0] == b.fHit[0] and a.fHit[1] == b.fHit[1]
104                 and a.fHit[2] == b.fHit[2] and a.fHit[3] == b.fHit[3];
105 }
106
107 inline bool operator != (
108                 const AliHLTMUONMansoTrackStruct& a,
109                 const AliHLTMUONMansoTrackStruct& b
110         )
111 {
112         return not operator == (a, b);
113 }
114
115
116 bool operator == (
117                 const AliHLTMUONMansoTracksBlockStruct& a,
118                 const AliHLTMUONMansoTracksBlockStruct& b
119         );
120
121 inline bool operator != (
122                 const AliHLTMUONMansoTracksBlockStruct& a,
123                 const AliHLTMUONMansoTracksBlockStruct& b
124         )
125 {
126         return not operator == (a, b);
127 }
128
129 #endif // ALIHLTMUONMANSOTRACKSBLOCKSTRUCT_H