ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthLinks
AthLinks
tools
IdentContIndex.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHLINKS_TOOLS_IDENTCONTINDEX_H
6
# define ATHLINKS_TOOLS_IDENTCONTINDEX_H
7
21
22
class
IdentContIndex
23
{
24
public
:
26
27
IdentContIndex
();
28
IdentContIndex
(
unsigned
short
collHash
,
unsigned
short
objIndex
);
29
IdentContIndex
(
unsigned
int
hashAndIndex
);
31
33
34
unsigned
short
collHash
()
const
;
36
unsigned
short
objIndex
()
const
;
38
unsigned
int
hashAndIndex
()
const
;
40
bool
isValid
()
const
;
42
44
45
46
void
setHashAndIndex
(
unsigned
int
hashAndIndex
);
48
void
setCollHash
(
unsigned
short
hash);
50
void
setObjIndex
(
unsigned
short
index
);
52
53
private
:
54
unsigned
short
m_collHash
;
55
unsigned
short
m_objIndex
;
56
};
57
58
59
60
// inline definitions
61
62
inline
63
IdentContIndex::IdentContIndex
()
64
:
65
m_collHash
(0xFFFF),
66
m_objIndex
(0xFFFF)
67
{}
68
69
inline
70
IdentContIndex::IdentContIndex
(
unsigned
short
collHash
,
unsigned
short
objIndex
)
71
:
72
m_collHash
(
collHash
),
73
m_objIndex
(
objIndex
)
74
{}
75
76
inline
77
IdentContIndex::IdentContIndex
(
unsigned
int
hashAndIndex
)
78
{
79
setHashAndIndex
(
hashAndIndex
);
80
}
81
82
83
inline
84
unsigned
short
85
IdentContIndex::collHash
()
const
86
{
87
return
(
m_collHash
);
88
}
89
90
inline
91
unsigned
short
92
IdentContIndex::objIndex
()
const
93
{
94
return
(
m_objIndex
);
95
}
96
97
inline
98
unsigned
int
99
IdentContIndex::hashAndIndex
()
const
100
{
101
// Concatenate hash and index
102
unsigned
int
result = (
m_collHash
<< 16) +
m_objIndex
;
103
return
(result);
104
}
105
106
inline
107
bool
108
IdentContIndex::isValid
()
const
109
{
110
// is valid if both hash and index are not default values
111
return
(
m_collHash
!= 0xFFFF &&
m_objIndex
!= 0xFFFF);
112
}
113
114
115
inline
116
void
117
IdentContIndex::setHashAndIndex
(
unsigned
int
hashAndIndex
)
118
{
119
// Extract hash and index
120
m_collHash
=
static_cast<
unsigned
short
>
(
hashAndIndex
>> 16);
121
m_objIndex
=
static_cast<
unsigned
short
>
(
hashAndIndex
& 0xFFFF);
122
}
123
124
inline
125
void
126
IdentContIndex::setCollHash
(
unsigned
short
hash)
127
{
128
m_collHash
= hash;
129
}
130
131
inline
132
void
133
IdentContIndex::setObjIndex
(
unsigned
short
index
)
134
{
135
m_objIndex
=
index
;
136
}
137
138
#endif
// not ATHLINKS_TOOLS_IDENTCONTINDEX_H
IdentContIndex::objIndex
unsigned short objIndex() const
object index in collection
Definition
IdentContIndex.h:92
IdentContIndex::setHashAndIndex
void setHashAndIndex(unsigned int hashAndIndex)
Setters of hash, obj index and combined index.
Definition
IdentContIndex.h:117
IdentContIndex::m_collHash
unsigned short m_collHash
Definition
IdentContIndex.h:54
IdentContIndex::setCollHash
void setCollHash(unsigned short hash)
set object index in collection
Definition
IdentContIndex.h:126
IdentContIndex::setObjIndex
void setObjIndex(unsigned short index)
set combined index
Definition
IdentContIndex.h:133
IdentContIndex::hashAndIndex
unsigned int hashAndIndex() const
combined index
Definition
IdentContIndex.h:99
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition
IdentContIndex.h:85
IdentContIndex::m_objIndex
unsigned short m_objIndex
Definition
IdentContIndex.h:55
IdentContIndex::isValid
bool isValid() const
check that both fields are set
Definition
IdentContIndex.h:108
IdentContIndex::IdentContIndex
IdentContIndex()
Constructors.
Definition
IdentContIndex.h:63
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0