Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
29ea12fe
Commit
29ea12fe
authored
11 years ago
by
Christian Grefe
Browse files
Options
Downloads
Patches
Plain Diff
Updated example to use Readout as IDDecoder
parent
ef5409ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/Segmentation/SegmentationTest.cpp
+5
-7
5 additions, 7 deletions
examples/Segmentation/SegmentationTest.cpp
with
5 additions
and
7 deletions
examples/Segmentation/SegmentationTest.cpp
+
5
−
7
View file @
29ea12fe
...
...
@@ -6,10 +6,8 @@
*/
#include
"DD4hep/LCDD.h"
#include
"DD4hep/BitField64.h"
#include
"DDSegmentation/CellIDDecoder.h"
#include
"DDSegmentation/CellIDDecoderFactory.h"
#include
"DDSegmentation/BitField64.h"
using
namespace
std
;
using
namespace
DD4hep
;
...
...
@@ -22,9 +20,9 @@ int main(int argc, char** argv) {
lcdd
.
fromCompact
(
argv
[
1
]);
lcdd
.
apply
(
"DD4hepVolumeManager"
,
0
,
0
);
CellIDDecoder
idDecoder
=
CellIDDecoderFactory
::
getCellIDDecoder
(
"MuonBarrelHits"
);
Readout
ro
=
lcdd
.
readout
(
"MuonBarrelHits"
);
BitField64
idEncoder
(
idDecoder
.
fieldDescription
());
BitField64
idEncoder
(
ro
.
idSpec
()
.
fieldDescription
());
idEncoder
[
"system"
]
=
10
;
idEncoder
[
"barrel"
]
=
0
;
idEncoder
[
"layer"
]
=
15
;
...
...
@@ -33,8 +31,8 @@ int main(int argc, char** argv) {
idEncoder
[
"x"
]
=
13
;
idEncoder
[
"y"
]
=
-
10
;
long64
cellID
=
idEncoder
.
getValue
();
Position
lp
=
idDecode
r
.
getLocalPosition
(
cellID
);
Position
gp
=
idDecode
r
.
getPosition
(
cellID
);
Position
lp
=
r
o
.
getLocalPosition
(
cellID
);
Position
gp
=
r
o
.
getPosition
(
cellID
);
std
::
cout
<<
"Local position: "
<<
lp
.
x
()
<<
", "
<<
lp
.
y
()
<<
", "
<<
lp
.
z
()
<<
std
::
endl
;
std
::
cout
<<
"Global position: "
<<
gp
.
x
()
<<
", "
<<
gp
.
y
()
<<
", "
<<
gp
.
z
()
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment