In AliMpPad:
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONPairsDecisionBlockStruct.h
CommitLineData
90a74d7a 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
21extern "C"
22{
23
24/**
25 * Structure contains information about the trigger decision for a pair of tracks.
26 */
27struct 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 */
55struct AliHLTMUONPairsDecisionBlockStruct
56{
57 AliHLTMUONDataBlockHeader fHeader; // Common data block header.
58
18ce6ea1 59 // Number of unlike sign pt triggers for both tracks having any pt.
60 AliHLTUInt32_t fNunlikeAnyPt;
61
90a74d7a 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
18ce6ea1 70 // Number of like sign pt triggers where both tracks have any pt.
71 AliHLTUInt32_t fNlikeAnyPt;
72
90a74d7a 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.
e83e889b 94#ifndef __SUNPRO_CC
90a74d7a 95 AliHLTMUONPairDecisionStruct fDecision[/*fHeader.fNrecords*/];
e83e889b 96#else
97 AliHLTMUONPairDecisionStruct fDecision[1];
98#endif
90a74d7a 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:
18ce6ea1 107 * {fTrackAId = xx, fTrackBId = yy, fTriggerBits = 0xZZ, fInvMass = ww}
90a74d7a 108 */
109inline 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
18ce6ea1 116 << ", fInvMass = " << trig.fInvMass << "}";
90a74d7a 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 */
127std::ostream& operator << (
128 std::ostream& stream,
129 const AliHLTMUONPairsDecisionBlockStruct& block
130 );
131
132
133inline bool operator == (
134 const AliHLTMUONPairDecisionStruct& a,
135 const AliHLTMUONPairDecisionStruct& b
136 )
137{
138 return a.fTrackAId == b.fTrackAId and a.fTrackBId == b.fTrackBId
18ce6ea1 139 and a.fTriggerBits == b.fTriggerBits
90a74d7a 140 and a.fTriggerBits == b.fTriggerBits;
141}
142
143inline bool operator != (
144 const AliHLTMUONPairDecisionStruct& a,
145 const AliHLTMUONPairDecisionStruct& b
146 )
147{
148 return not operator == (a, b);
149}
150
151
152bool operator == (
153 const AliHLTMUONPairsDecisionBlockStruct& a,
154 const AliHLTMUONPairsDecisionBlockStruct& b
155 );
156
157inline bool operator != (
158 const AliHLTMUONPairsDecisionBlockStruct& a,
159 const AliHLTMUONPairsDecisionBlockStruct& b
160 )
161{
162 return not operator == (a, b);
163}
164
165#endif // ALIHLTMUONPAIRSDECISIONBLOCKSTRUCT_H