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
e83cb2af
Commit
e83cb2af
authored
11 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
VolumeManager: Mask out local volume-id fields for the lookup of sensitive volumes.
parent
3acc424d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDCore/include/DD4hep/VolumeManager.h
+2
-0
2 additions, 0 deletions
DDCore/include/DD4hep/VolumeManager.h
DDCore/src/VolumeManager.cpp
+18
-13
18 additions, 13 deletions
DDCore/src/VolumeManager.cpp
with
20 additions
and
13 deletions
DDCore/include/DD4hep/VolumeManager.h
+
2
−
0
View file @
e83cb2af
...
...
@@ -185,6 +185,8 @@ namespace DD4hep {
Field
system
;
/// System identifier
VolumeID
sysID
;
/// Sub-detector mask
VolumeID
detMask
;
/// Population flags
int
flags
;
public:
...
...
This diff is collapsed.
Click to expand it.
DDCore/src/VolumeManager.cpp
+
18
−
13
View file @
e83cb2af
...
...
@@ -277,7 +277,9 @@ VolumeManager::Context::~Context() {
}
/// Default constructor
VolumeManager
::
Object
::
Object
(
LCDD
&
l
)
:
lcdd
(
l
),
top
(
0
),
sysID
(
0
),
flags
(
VolumeManager
::
NONE
)
{
VolumeManager
::
Object
::
Object
(
LCDD
&
l
)
:
lcdd
(
l
),
top
(
0
),
sysID
(
0
),
detMask
(
~
0x0ULL
),
flags
(
VolumeManager
::
NONE
)
{
}
/// Default destructor
...
...
@@ -298,13 +300,15 @@ VolumeManager::Object::~Object() {
/// Search the locally cached volumes for a matching ID
VolumeManager
::
Context
*
VolumeManager
::
Object
::
search
(
const
VolIdentifier
&
id
)
const
{
Context
*
context
=
0
;
Volumes
::
const_iterator
i
=
volumes
.
find
(
id
);
VolIdentifier
volume_id
(
id
);
volume_id
&=
detMask
;
Volumes
::
const_iterator
i
=
volumes
.
find
(
volume_id
);
if
(
i
!=
volumes
.
end
()
)
context
=
(
*
i
).
second
;
else
if
(
sysID
==
8
)
{
//for(i=volumes.begin(); i!=volumes.end();++i)
// cout << (void*)(*i).first << " " << (*i).second->placement.name() << endl;
}
//
else if ( sysID == 8 ) {
//
for(i=volumes.begin(); i!=volumes.end();++i)
//
cout << (void*)(*i).first << " " << (*i).second->placement.name() << endl;
//
}
return
context
;
}
...
...
@@ -323,10 +327,9 @@ VolumeManager::VolumeManager(LCDD& lcdd, const string& nam, DetElement elt, Read
assign
(
ptr
,
nam
,
"VolumeManager"
);
if
(
elt
.
isValid
()
)
{
Populator
p
(
lcdd
,
*
this
);
Object
&
o
=
_data
();
setDetector
(
elt
,
ro
);
o
.
top
=
ptr
;
o
.
flags
=
flags
;
ptr
->
top
=
ptr
;
ptr
->
flags
=
flags
;
p
.
populate
(
elt
);
}
}
...
...
@@ -363,10 +366,11 @@ VolumeManager VolumeManager::addSubdetector(DetElement detector, Readout ro) {
}
Object
&
mo
=
m
.
_data
();
m
.
setDetector
(
detector
,
ro
);
mo
.
top
=
o
.
top
;
mo
.
flags
=
o
.
flags
;
mo
.
system
=
field
;
mo
.
sysID
=
id
.
second
;
mo
.
top
=
o
.
top
;
mo
.
flags
=
o
.
flags
;
mo
.
system
=
field
;
mo
.
sysID
=
id
.
second
;
mo
.
detMask
=
mo
.
sysID
;
o
.
managers
[
mo
.
sysID
]
=
m
;
}
return
(
*
i
).
second
;
...
...
@@ -446,6 +450,7 @@ bool VolumeManager::adoptPlacement(VolumeID sys_id, Context* context) {
#endif
if
(
i
==
o
.
volumes
.
end
()
)
{
o
.
volumes
[
vid
]
=
context
;
o
.
detMask
|=
context
->
mask
;
//o.phys_volumes[pv.ptr()] = context;
err
<<
"Inserted new volume:"
<<
setw
(
6
)
<<
left
<<
o
.
volumes
.
size
()
<<
" Ptr:"
<<
(
void
*
)
context
->
placement
.
ptr
()
...
...
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