]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONTrigRecsDebugBlockStruct.h
Refactoring code to extract common data block checking functionality into new base...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONTrigRecsDebugBlockStruct.h
1 #ifndef ALIHLTMUONTRIGRECSDEBUGBLOCKSTRUCT_H
2 #define ALIHLTMUONTRIGRECSDEBUGBLOCKSTRUCT_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   AliHLTMUONTrigRecsDebugBlockStruct.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Definition of internal dimuon HLT data structures for storing debugging
13  *         information about 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
21 extern "C"
22 {
23
24 /**
25  * Debug trigger record structures contain debug information about the trigger
26  * records that were decoded from the dimuon hardware trigger electronics.
27  */
28 struct AliHLTMUONTrigRecInfoStruct
29 {
30         AliHLTInt32_t fTrigRecId; // The corresponding trigger record ID this
31                                   // debug information corresponds to. -1 == invalid.
32
33         AliHLTInt32_t fDetElemId[4];  // Detector ID numbers from AliRoot geometry
34                                    // on which the hit clusters were found.
35                                    // fDetElemId[0] is for chamber 11, fDetElemId[1]
36                                    // for chamber 12 etc.
37
38         // The parameters used for momentum estimation:
39         AliHLTFloat32_t fZmiddle; // Particle momentum X component in GeV/c.
40         AliHLTFloat32_t fBl; // The integrated magnetic field in (T.m) tesla metres.
41 };
42
43 /**
44  * AliHLTMUONTrigRecsDebugBlockStruct defines the format of the internal
45  * data block for storing debugging information for trigger records.
46  */
47 struct AliHLTMUONTrigRecsDebugBlockStruct
48 {
49         AliHLTMUONDataBlockHeader fHeader; // Common data block header
50
51         // Array of trigger records.
52         //AliHLTMUONTrigRecInfoStruct fTrigRecInfo[/*fHeader.fNrecords*/];
53 };
54
55 } // extern "C"
56
57
58 /**
59  * Stream operator for usage with std::ostream classes which prints the trigger
60  * record debug information in the following format:
61  *  {fTrigRecId = xx, fDetElemId = [aa, bb, cc, dd], fZmiddle = yy, fBl = zz}
62  */
63 std::ostream& operator << (
64                 std::ostream& stream, const AliHLTMUONTrigRecInfoStruct& info
65         );
66
67 /**
68  * Stream operator for usage with std::ostream classes which prints the
69  * AliHLTMUONTrigRecsDebugBlockStruct in the following format:
70  *   {fHeader = xx, fTrigRecInfo[] = [{..}, {..}, ...]}
71  */
72 std::ostream& operator << (
73                 std::ostream& stream, const AliHLTMUONTrigRecsDebugBlockStruct& block
74         );
75
76
77 inline bool operator == (
78                 const AliHLTMUONTrigRecInfoStruct& a,
79                 const AliHLTMUONTrigRecInfoStruct& b
80         )
81 {
82         return a.fTrigRecId == b.fTrigRecId and a.fDetElemId == b.fDetElemId
83                 and a.fZmiddle == b.fZmiddle and a.fBl == b.fBl;
84 }
85
86 inline bool operator != (
87                 const AliHLTMUONTrigRecInfoStruct& a,
88                 const AliHLTMUONTrigRecInfoStruct& b
89         )
90 {
91         return not operator == (a, b);
92 }
93
94
95 bool operator == (
96                 const AliHLTMUONTrigRecsDebugBlockStruct& a,
97                 const AliHLTMUONTrigRecsDebugBlockStruct& b
98         );
99
100 inline bool operator != (
101                 const AliHLTMUONTrigRecsDebugBlockStruct& a,
102                 const AliHLTMUONTrigRecsDebugBlockStruct& b
103         )
104 {
105         return not operator == (a, b);
106 }
107
108 #endif // ALIHLTMUONTRIGRECSDEBUGBLOCKSTRUCT_H