]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONPairsDecisionBlockStruct.h
Minor cleanup of code.
[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 > low mass cut,
90         // pt > high pt cut and unlike sign.
91         AliHLTUInt32_t fNmassHigh;
92
93         // Array of decisions for track pairs.
94 #ifndef __SUNPRO_CC
95         AliHLTMUONPairDecisionStruct fDecision[/*fHeader.fNrecords*/];
96 #else
97         AliHLTMUONPairDecisionStruct fDecision[1];
98 #endif
99 };
100
101 } // extern "C"
102
103
104 /**
105  * Stream operator for usage with std::ostream classes which prints the
106  * trigger decision information for pairs of tracks in the following format:
107  *  {fTrackAId = xx, fTrackBId = yy, fTriggerBits = 0xZZ, fInvMass = ww}
108  */
109 inline std::ostream& operator << (
110                 std::ostream& stream, const AliHLTMUONPairDecisionStruct& trig
111         )
112 {
113         stream  << "{fTrackAId = " << trig.fTrackAId
114                 << ", fTrackBId = " << trig.fTrackBId << ", fTriggerBits = "
115                 << std::showbase << std::hex << trig.fTriggerBits << std::dec
116                 << ", fInvMass = " << trig.fInvMass << "}";
117         return stream;
118 }
119
120 /**
121  * Stream operator for usage with std::ostream classes which prints the
122  * AliHLTMUONPairsDecisionBlockStruct in the following format:
123  *   {fHeader = aa, fNunlikeLowPt = bb, fNunlikeHighPt = cc, fNlikeLowPt = dd,
124  *    fNlikeHighPt = ee, fNmassAny = ff, fNmassLow = gg, fNmassHigh = hh
125  *    fDecision[] = [{..}, {..}, ...]}
126  */
127 std::ostream& operator << (
128                 std::ostream& stream,
129                 const AliHLTMUONPairsDecisionBlockStruct& block
130         );
131
132
133 inline bool operator == (
134                 const AliHLTMUONPairDecisionStruct& a,
135                 const AliHLTMUONPairDecisionStruct& b
136         )
137 {
138         return a.fTrackAId == b.fTrackAId and a.fTrackBId == b.fTrackBId
139                 and a.fTriggerBits == b.fTriggerBits
140                 and a.fTriggerBits == b.fTriggerBits;
141 }
142
143 inline bool operator != (
144                 const AliHLTMUONPairDecisionStruct& a,
145                 const AliHLTMUONPairDecisionStruct& b
146         )
147 {
148         return not operator == (a, b);
149 }
150
151
152 bool operator == (
153                 const AliHLTMUONPairsDecisionBlockStruct& a,
154                 const AliHLTMUONPairsDecisionBlockStruct& b
155         );
156
157 inline bool operator != (
158                 const AliHLTMUONPairsDecisionBlockStruct& a,
159                 const AliHLTMUONPairsDecisionBlockStruct& b
160         )
161 {
162         return not operator == (a, b);
163 }
164
165 #endif // ALIHLTMUONPAIRSDECISIONBLOCKSTRUCT_H