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
3b37765d
Commit
3b37765d
authored
10 years ago
by
Frank Gaede
Browse files
Options
Downloads
Patches
Plain Diff
- allow to use Assemblies in createPlacedEnvelope()
-> drivers can call this method also w/o defining a shape for the envelope
parent
e9ba3adc
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/XML/Utilities.h
+3
-1
3 additions, 1 deletion
DDCore/include/XML/Utilities.h
DDCore/src/XML/Utilities.cpp
+20
-11
20 additions, 11 deletions
DDCore/src/XML/Utilities.cpp
with
23 additions
and
12 deletions
DDCore/include/XML/Utilities.h
+
3
−
1
View file @
3b37765d
...
@@ -24,7 +24,8 @@ namespace DD4hep {
...
@@ -24,7 +24,8 @@ namespace DD4hep {
/** Create an envelope volume that is placed into the world volume ( the parent volume of sdet) from an xml
/** Create an envelope volume that is placed into the world volume ( the parent volume of sdet) from an xml
* element <envelope/> with child nodes <shape/> and optionally <position/> and <rotation/>.
* element <envelope/> with child nodes <shape/> and optionally <position/> and <rotation/>. For special cases
* no volume but an assembly can be created with <shape type="Assembly"/>.
* Example: <br>
* Example: <br>
* <p>
* <p>
* <envelope vis="ILD_ECALVis">
* <envelope vis="ILD_ECALVis">
...
@@ -32,6 +33,7 @@ namespace DD4hep {
...
@@ -32,6 +33,7 @@ namespace DD4hep {
* dz="2.*TPC_Ecal_Hcal_barrel_halfZ" material = "Air" />
* dz="2.*TPC_Ecal_Hcal_barrel_halfZ" material = "Air" />
* <rotation x="0*deg" y="0*deg" z="90*deg-180*deg/8"/>
* <rotation x="0*deg" y="0*deg" z="90*deg-180*deg/8"/>
* </envelope>
* </envelope>
* </p>
*
*
* @author S.Lu DESY, F. Gaede CERN/DESY
* @author S.Lu DESY, F. Gaede CERN/DESY
* @version $Id:$
* @version $Id:$
...
...
This diff is collapsed.
Click to expand it.
DDCore/src/XML/Utilities.cpp
+
20
−
11
View file @
3b37765d
...
@@ -44,9 +44,7 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd
...
@@ -44,9 +44,7 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd
xml_comp_t
x_env
=
x_det
.
child
(
DD4hep
::
XML
::
Strng_t
(
"envelope"
)
)
;
xml_comp_t
x_env
=
x_det
.
child
(
DD4hep
::
XML
::
Strng_t
(
"envelope"
)
)
;
xml_comp_t
x_shape
=
x_env
.
child
(
_U
(
shape
)
);
xml_comp_t
x_shape
=
x_env
.
child
(
_U
(
shape
)
);
Material
env_mat
=
lcdd
.
material
(
x_shape
.
materialStr
()
);
bool
useRot
=
false
;
bool
useRot
=
false
;
bool
usePos
=
false
;
bool
usePos
=
false
;
Position
pos
;
Position
pos
;
...
@@ -63,20 +61,31 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd
...
@@ -63,20 +61,31 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd
rot
=
RotationZYX
(
env_rot
.
z
(),
env_rot
.
y
(),
env_rot
.
x
()
)
;
rot
=
RotationZYX
(
env_rot
.
z
(),
env_rot
.
y
(),
env_rot
.
x
()
)
;
}
}
Volume
envelope
;
// ---- create a shape from the specified xml element --------
if
(
x_shape
.
typeStr
()
==
"Assembly"
){
Box
env_solid
=
xml_comp_t
(
x_shape
).
createShape
();
envelope
=
Assembly
(
det_name
+
"_assembly"
)
;
if
(
!
env_solid
.
isValid
()
){
}
else
{
// ---- create a shape from the specified xml element --------
Box
env_solid
=
xml_comp_t
(
x_shape
).
createShape
();
throw
std
::
runtime_error
(
std
::
string
(
" Cannot create envelope volume : "
)
+
x_shape
.
typeStr
()
+
if
(
!
env_solid
.
isValid
()
){
std
::
string
(
" for detector "
)
+
det_name
)
;
}
throw
std
::
runtime_error
(
std
::
string
(
" Cannot create envelope volume : "
)
+
x_shape
.
typeStr
()
+
std
::
string
(
" for detector "
)
+
det_name
)
;
Volume
envelope
(
det_name
+
"_envelope"
,
env_solid
,
env_mat
);
}
Material
env_mat
=
lcdd
.
material
(
x_shape
.
materialStr
()
);
envelope
=
Volume
(
det_name
+
"_envelope"
,
env_solid
,
env_mat
);
}
PlacedVolume
env_pv
;
PlacedVolume
env_pv
;
Volume
mother
=
lcdd
.
pickMotherVolume
(
sdet
);
Volume
mother
=
lcdd
.
pickMotherVolume
(
sdet
);
...
...
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