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
1cd0af1a
Commit
1cd0af1a
authored
10 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Add default handle constructors to VolSurface and VolPlane
parent
ae0a1e47
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDRec/include/DDRec/Surface.h
+31
-7
31 additions, 7 deletions
DDRec/include/DDRec/Surface.h
DDRec/src/Surface.cpp
+17
-9
17 additions, 9 deletions
DDRec/src/Surface.cpp
with
48 additions
and
16 deletions
DDRec/include/DDRec/Surface.h
+
31
−
7
View file @
1cd0af1a
...
...
@@ -73,14 +73,16 @@ namespace DD4hep {
double
_th_i
;
double
_th_o
;
SurfaceMaterial
_innerMat
;
SurfaceMaterial
_outerMat
;
SurfaceMaterial
_outerMat
;
Geometry
::
Volume
_vol
;
/// default c'tor.
SurfaceData
();
/// Standard c'tor for initialization.
SurfaceData
(
SurfaceType
type
,
double
thickness_inner
,
double
thickness_outer
,
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
)
;
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
,
Geometry
::
Volume
vol
/*= Geometry::Volume() */
);
/// Default destructor
virtual
~
SurfaceData
()
{}
...
...
@@ -96,6 +98,7 @@ namespace DD4hep {
_th_o
=
c
.
_th_o
;
_innerMat
=
c
.
_innerMat
;
_outerMat
=
c
.
_innerMat
;
_vol
=
c
.
_vol
;
}
}
;
...
...
@@ -110,8 +113,6 @@ namespace DD4hep {
protected:
Geometry
::
Volume
_vol
;
/// setter for daughter classes
virtual
void
setU
(
const
Vector3D
&
u
)
{
object
<
SurfaceData
>
().
_u
=
u
;
}
...
...
@@ -128,13 +129,26 @@ namespace DD4hep {
///default c'tor
VolSurface
()
{
}
/// Constructor to be used with an existing object
VolSurface
(
SurfaceData
*
p
)
:
Geometry
::
Handle
<
SurfaceData
>
(
p
)
{
}
/// Constructor to be used with an existing object
VolSurface
(
const
VolSurface
&
e
)
:
Geometry
::
Handle
<
SurfaceData
>
(
e
)
{
}
/// Constructor to be used with an existing object
template
<
typename
Q
>
VolSurface
(
const
Handle
<
Q
>&
e
)
:
Geometry
::
Handle
<
SurfaceData
>
(
e
)
{
}
/// Standrad c'tor for initialization.
VolSurface
(
Geometry
::
Volume
vol
,
SurfaceType
type
,
double
thickness_inner
,
double
thickness_outer
,
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
=
Vector3D
(
0.
,
0.
,
0.
)
)
;
/// the volume to which this surface is attached.
Geometry
::
Volume
volume
()
const
{
return
_vol
;
}
Geometry
::
Volume
volume
()
const
{
return
ptr
()
->
_vol
;
}
/// The id of this surface - always 0 for VolSurfaces
virtual
long64
id
()
const
{
return
0
;
}
...
...
@@ -262,6 +276,16 @@ namespace DD4hep {
///default c'tor
VolPlane
()
:
VolSurface
()
{
}
/// Constructor to be used with an existing object
VolPlane
(
SurfaceData
*
p
)
:
VolSurface
(
p
)
{
}
/// Constructor to be used with an existing object
template
<
typename
Q
>
VolPlane
(
const
Handle
<
Q
>&
e
)
:
VolSurface
(
e
)
{
}
/// copy c'tor
VolPlane
(
const
VolSurface
&
vs
)
:
VolSurface
(
vs
)
{
}
...
...
This diff is collapsed.
Click to expand it.
DDRec/src/Surface.cpp
+
17
−
9
View file @
1cd0af1a
...
...
@@ -38,12 +38,14 @@ namespace DD4hep {
_th_i
(
0.
),
_th_o
(
0.
),
_innerMat
(
MaterialData
()
),
_outerMat
(
MaterialData
()
)
{
_outerMat
(
MaterialData
()
),
_vol
()
{
}
SurfaceData
::
SurfaceData
(
SurfaceType
type
,
double
thickness_inner
,
double
thickness_outer
,
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
)
:
_type
(
type
)
,
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
,
Volume
vol
)
:
_type
(
type
)
,
_u
(
u
)
,
_v
(
v
)
,
_n
(
n
)
,
...
...
@@ -51,7 +53,9 @@ namespace DD4hep {
_th_i
(
thickness_inner
),
_th_o
(
thickness_outer
),
_innerMat
(
MaterialData
()
),
_outerMat
(
MaterialData
()
)
{
_outerMat
(
MaterialData
()
),
_vol
(
vol
)
{
}
...
...
@@ -60,9 +64,7 @@ namespace DD4hep {
VolSurface
::
VolSurface
(
Volume
vol
,
SurfaceType
type
,
double
thickness_inner
,
double
thickness_outer
,
Vector3D
u
,
Vector3D
v
,
Vector3D
n
,
Vector3D
o
)
:
Geometry
::
Handle
<
SurfaceData
>
(
new
SurfaceData
(
type
,
thickness_inner
,
thickness_outer
,
u
,
v
,
n
,
o
)
)
,
_vol
(
vol
)
{
Geometry
::
Handle
<
SurfaceData
>
(
new
SurfaceData
(
type
,
thickness_inner
,
thickness_outer
,
u
,
v
,
n
,
o
,
vol
)
)
{
}
...
...
@@ -238,7 +240,7 @@ namespace DD4hep {
list
=
det
.
extension
<
VolSurfaceList
>
()
;
}
catch
(
std
::
runtime_error
e
){
}
catch
(
const
std
::
runtime_error
&
e
){
list
=
det
.
addExtension
<
VolSurfaceList
>
(
new
VolSurfaceList
)
;
}
...
...
@@ -421,8 +423,9 @@ namespace DD4hep {
Volume
theVol
=
_volSurf
.
volume
()
;
if
(
!
findVolume
(
pv
,
theVol
,
pVList
)
){
std
::
stringstream
sst
;
sst
<<
" ***** ERROR: Volume "
<<
theVol
.
name
()
<<
" not found for DetElement "
<<
_det
.
name
()
<<
" with surface "
;
throw
std
::
runtime_error
(
sst
.
str
()
)
;
theVol
=
_volSurf
.
volume
()
;
std
::
stringstream
sst
;
sst
<<
" ***** ERROR: Volume "
<<
theVol
.
name
()
<<
" not found for DetElement "
<<
_det
.
name
()
<<
" with surface "
;
throw
std
::
runtime_error
(
sst
.
str
()
)
;
}
// std::cout << " **** Surface::initialize() # placements for surface = " << pVList.size()
...
...
@@ -831,3 +834,8 @@ namespace DD4hep {
}
// namespace
}
// namespace
#include
"DD4hep/Handle.inl"
typedef
DD4hep
::
DDRec
::
SurfaceData
SurfaceData
;
DD4HEP_INSTANTIATE_HANDLE_UNNAMED
(
SurfaceData
);
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