DD4hep
1.32.0
Detector Description Toolkit for High Energy Physics
Main Page
Related Pages
Modules
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
u
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
b
d
g
o
p
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
x
Functions
_
c
d
g
h
i
l
m
n
o
p
r
s
u
Variables
Typedefs
_
a
c
d
e
f
g
j
l
o
p
r
s
t
u
v
x
Enumerations
Enumerator
Macros
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
DDCore
src
segmentations
BitField64.cpp
Go to the documentation of this file.
1
//==========================================================================
2
// AIDA Detector description implementation
3
//--------------------------------------------------------------------------
4
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5
// All rights reserved.
6
//
7
// For the licensing terms see $DD4hepINSTALL/LICENSE.
8
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9
//
10
//==========================================================================
11
#include <
DDSegmentation/BitField64.h
>
12
13
#include <cmath>
14
#include <ostream>
15
#include <sstream>
16
#include <string>
17
18
namespace
dd4hep
{
19
20
namespace
DDSegmentation {
21
22
23
std::string
BitField64::valueString
()
const
{
24
25
std::stringstream os ;
26
27
for
(
unsigned
i=0;i<
size
();i++){
28
29
if
( i != 0 ) os <<
","
;
30
31
os <<
_coder
->
fields
()[i].name() <<
":"
<<
_coder
->
get
(
_value
, i ) ;
32
33
}
34
return
os.str() ;
35
}
36
37
38
std::ostream&
operator<<
(std::ostream& os,
const
BitField64
& b){
39
40
os <<
" bitfield: 0x"
<< std::hex
// << std::ios::width(16) << std::ios::fill('0') <<
41
<< b.
_value
<< std::dec << std::endl ;
42
43
44
for
(
unsigned
i=0;i<b.
_coder
->
size
();i++){
45
46
const
BitFieldElement
& bv = b.
_coder
->
fields
()[i] ;
47
48
os <<
" "
<< bv.
name
()
49
<<
" ["
<< bv.
offset
() <<
":"
;
50
51
if
( bv.
isSigned
() ) os <<
"-"
;
52
53
os << bv.
width
() <<
"] : "
;
54
55
os << b.
_coder
->
get
( b.
_value
, i)
56
<< std::endl ;
57
58
}
59
60
return
os ;
61
}
62
63
}
// namespace
64
65
}
// namespace
dd4hep::DDSegmentation::BitFieldElement::offset
unsigned offset() const
Definition:
BitFieldCoder.h:63
dd4hep::DDSegmentation::BitFieldElement
Helper class for BitFieldCoder that corresponds to one field value.
Definition:
BitFieldCoder.h:31
dd4hep::DDSegmentation::BitField64::_value
CellID _value
Definition:
BitField64.h:227
dd4hep::DDSegmentation::BitFieldElement::isSigned
bool isSigned() const
Definition:
BitFieldCoder.h:69
dd4hep::DDSegmentation::BitFieldCoder::get
FieldID get(CellID bitfield, size_t idx) const
Definition:
BitFieldCoder.h:164
dd4hep::DDSegmentation::BitField64
A bit field of 64bits that allows convenient declaration.
Definition:
BitField64.h:107
dd4hep::DDSegmentation::BitFieldCoder::fields
const std::vector< BitFieldElement > & fields() const
Definition:
BitFieldCoder.h:217
dd4hep::DDSegmentation::BitField64::valueString
std::string valueString() const
Definition:
BitField64.cpp:23
BitField64.h
dd4hep::DDSegmentation::BitFieldElement::name
const std::string & name() const
Definition:
BitFieldCoder.h:60
dd4hep::DDSegmentation::BitFieldElement::width
unsigned width() const
Definition:
BitFieldCoder.h:66
dd4hep::DDSegmentation::BitField64::_coder
const BitFieldCoder * _coder
Definition:
BitField64.h:228
dd4hep::DDSegmentation::BitField64::size
size_t size() const
Definition:
BitField64.h:183
dd4hep
Namespace for the AIDA detector description toolkit.
Definition:
AlignmentsCalib.h:28
dd4hep::DDSegmentation::BitFieldCoder::size
size_t size() const
Definition:
BitFieldCoder.h:191
dd4hep::DDSegmentation::operator<<
std::ostream & operator<<(std::ostream &os, const BitField64 &b)
Definition:
BitField64.cpp:38
Generated on Wed May 7 2025 12:36:16 for DD4hep by
1.8.18