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