]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONMansoTracksBlockStruct.h
Compilation with CC on Solaris x86
[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 #ifndef __SUNPRO_CC
69         AliHLTMUONMansoTrackStruct fTrack[/*fHeader.fNrecords*/];
70 #else
71         AliHLTMUONMansoTrackStruct fTrack[1];
72 #endif
73 };
74
75 } // extern "C"
76
77
78 /**
79  * Stream operator for usage with std::ostream classes which prints the track
80  * information in the following format:
81  *  {fId = xx, fTrigRec = yy, fFlags = 0xZZ, fPx = uu, fPy = vv, fPz = ww,
82  *   fChi2 = ss, fHit[0] = {...}, fHit[1] = {...}, fHit[2] = {...},
83  *   fHit[3] = {...}}
84  */
85 std::ostream& operator << (
86                 std::ostream& stream, const AliHLTMUONMansoTrackStruct& trigrec
87         );
88
89 /**
90  * Stream operator for usage with std::ostream classes which prints the
91  * AliHLTMUONMansoTracksBlockStruct in the following format:
92  *   {fHeader = xx, fTrack[] = [{..}, {..}, ...]}
93  */
94 std::ostream& operator << (
95                 std::ostream& stream, const AliHLTMUONMansoTracksBlockStruct& block
96         );
97
98
99 inline bool operator == (
100                 const AliHLTMUONMansoTrackStruct& a,
101                 const AliHLTMUONMansoTrackStruct& b
102         )
103 {
104         return a.fId == b.fId and a.fTrigRec == b.fTrigRec
105                 and a.fFlags == b.fFlags and a.fPx == b.fPx and a.fPy == b.fPy
106                 and a.fPz == b.fPz and a.fChi2 == b.fChi2
107                 and a.fHit[0] == b.fHit[0] and a.fHit[1] == b.fHit[1]
108                 and a.fHit[2] == b.fHit[2] and a.fHit[3] == b.fHit[3];
109 }
110
111 inline bool operator != (
112                 const AliHLTMUONMansoTrackStruct& a,
113                 const AliHLTMUONMansoTrackStruct& b
114         )
115 {
116         return not operator == (a, b);
117 }
118
119
120 bool operator == (
121                 const AliHLTMUONMansoTracksBlockStruct& a,
122                 const AliHLTMUONMansoTracksBlockStruct& b
123         );
124
125 inline bool operator != (
126                 const AliHLTMUONMansoTracksBlockStruct& a,
127                 const AliHLTMUONMansoTracksBlockStruct& b
128         )
129 {
130         return not operator == (a, b);
131 }
132
133 #endif // ALIHLTMUONMANSOTRACKSBLOCKSTRUCT_H