]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONPairsDecisionBlockStruct.h
Minor fixes to checking of data integrity in AliHLTMUONDataCheckerComponent and chang...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONPairsDecisionBlockStruct.h
1 #ifndef ALIHLTMUONPAIRSDECISIONBLOCKSTRUCT_H
2 #define ALIHLTMUONPAIRSDECISIONBLOCKSTRUCT_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   AliHLTMUONPairsDecisionBlockStruct.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Definition of internal dimuon HLT trigger decision data structure
13  *         containing decision information for pairs of tracks.
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  * Structure contains information about the trigger decision for a pair of tracks.
26  */
27 struct AliHLTMUONPairDecisionStruct
28 {
29         // The ID numbers of the tracks we are referring to.
30         // These could also be trigger record ID numbers.
31         AliHLTInt32_t fTrackAId;
32         AliHLTInt32_t fTrackBId;
33         
34         // The trigger bits have the following meaning:
35         // bit:  [31 --- 7][ 6 ][ 5 ][   4  ][3--2][1--0]
36         // field: reserved  hiM  loM  unlike  hipt  lopt
37         // Reserved bits should be set to zero.
38         // hiM == Pair passed the high invariant mass cut.
39         // loM == Pair passed the low invariant mass cut.
40         // unlike == is the pair an unlike sign pair.
41         // hipt: 0 if neither track has pt > high pt cut, 1 if either has
42         // and 2 if both have. A value of 3 is invalid.
43         // lopt: 0 if neither track has pt > lo pt cut, 1 if either has
44         // and 2 if both have. A value of 3 is invalid.
45         AliHLTUInt32_t fTriggerBits;
46         
47         AliHLTFloat32_t fInvMass; // Invariant mass of the track pair assuming
48                                   // they are both muons in (GeV/c^2)
49 };
50
51 /**
52  * AliHLTMUONPairsDecisionBlockStruct defines the format of the internal
53  * dimuon HLT decision data block for pairs of tracks.
54  */
55 struct AliHLTMUONPairsDecisionBlockStruct
56 {
57         AliHLTMUONDataBlockHeader fHeader; // Common data block header.
58         
59         // Number of unlike sign pt triggers for both tracks having any pt.
60         AliHLTUInt32_t fNunlikeAnyPt;
61         
62         // Number of unlike sign low pt triggers where both tracks have
63         // pt > low cut.
64         AliHLTUInt32_t fNunlikeLowPt;
65         
66         // Number of unlike sign high pt triggers where both tracks have
67         // pt > high cut.
68         AliHLTUInt32_t fNunlikeHighPt;
69         
70         // Number of like sign pt triggers where both tracks have any pt.
71         AliHLTUInt32_t fNlikeAnyPt;
72         
73         // Number of like sign low pt triggers where both tracks have
74         // pt > low cut.
75         AliHLTUInt32_t fNlikeLowPt;
76         
77         // Number of like sign high pt triggers where both tracks have
78         // pt > high cut.
79         AliHLTUInt32_t fNlikeHighPt;
80         
81         // Number of pairs that have invariant mass > low mass cut, any pt
82         // and unlike sign.
83         AliHLTUInt32_t fNmassAny;
84         
85         // Number of pairs that have invariant mass > low mass cut,
86         // pt > low pt cut and unlike sign.
87         AliHLTUInt32_t fNmassLow;
88         
89         // Number of pairs that have invariant mass > high mass cut,
90         // pt > high pt cut and unlike sign.
91         AliHLTUInt32_t fNmassHigh;
92
93         // Array of decisions for track pairs.
94         //AliHLTMUONPairDecisionStruct fDecision[/*fHeader.fNrecords*/];
95 };
96
97 } // extern "C"
98
99
100 /**
101  * Stream operator for usage with std::ostream classes which prints the
102  * trigger decision information for pairs of tracks in the following format:
103  *  {fTrackAId = xx, fTrackBId = yy, fTriggerBits = 0xZZ, fInvMass = ww}
104  */
105 inline std::ostream& operator << (
106                 std::ostream& stream, const AliHLTMUONPairDecisionStruct& trig
107         )
108 {
109         stream  << "{fTrackAId = " << trig.fTrackAId
110                 << ", fTrackBId = " << trig.fTrackBId << ", fTriggerBits = "
111                 << std::showbase << std::hex << trig.fTriggerBits << std::dec
112                 << ", fInvMass = " << trig.fInvMass << "}";
113         return stream;
114 }
115
116 /**
117  * Stream operator for usage with std::ostream classes which prints the
118  * AliHLTMUONPairsDecisionBlockStruct in the following format:
119  *   {fHeader = aa, fNunlikeLowPt = bb, fNunlikeHighPt = cc, fNlikeLowPt = dd,
120  *    fNlikeHighPt = ee, fNmassAny = ff, fNmassLow = gg, fNmassHigh = hh
121  *    fDecision[] = [{..}, {..}, ...]}
122  */
123 std::ostream& operator << (
124                 std::ostream& stream,
125                 const AliHLTMUONPairsDecisionBlockStruct& block
126         );
127
128
129 inline bool operator == (
130                 const AliHLTMUONPairDecisionStruct& a,
131                 const AliHLTMUONPairDecisionStruct& b
132         )
133 {
134         return a.fTrackAId == b.fTrackAId and a.fTrackBId == b.fTrackBId
135                 and a.fTriggerBits == b.fTriggerBits
136                 and a.fTriggerBits == b.fTriggerBits;
137 }
138
139 inline bool operator != (
140                 const AliHLTMUONPairDecisionStruct& a,
141                 const AliHLTMUONPairDecisionStruct& b
142         )
143 {
144         return not operator == (a, b);
145 }
146
147
148 bool operator == (
149                 const AliHLTMUONPairsDecisionBlockStruct& a,
150                 const AliHLTMUONPairsDecisionBlockStruct& b
151         );
152
153 inline bool operator != (
154                 const AliHLTMUONPairsDecisionBlockStruct& a,
155                 const AliHLTMUONPairsDecisionBlockStruct& b
156         )
157 {
158         return not operator == (a, b);
159 }
160
161 #endif // ALIHLTMUONPAIRSDECISIONBLOCKSTRUCT_H