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
771a8fe4
Commit
771a8fe4
authored
11 years ago
by
Frank Gaede
Browse files
Options
Downloads
Patches
Plain Diff
- modified to use SurfaceManager class
(up to now now real test - just prints all surfaces ...)
parent
2a3e38cb
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/ILDExDet/src/test_surfaces.cc
+15
-64
15 additions, 64 deletions
examples/ILDExDet/src/test_surfaces.cc
with
15 additions
and
64 deletions
examples/ILDExDet/src/test_surfaces.cc
+
15
−
64
View file @
771a8fe4
#include
"DD4hep/LCDD.h"
#include
"DD4hep/LCDD.h"
#include
"DD4hep/TGeoUnits.h"
#include
"DD4hep/Detector.h"
#include
"DD4hep/Volumes.h"
#include
"DDRec/Surface.h"
#include
"DDRec/Surface.h"
#include
"DDRec/DetectorSurfaces.h"
#include
"DDRec/SurfaceManager.h"
// // #include "TGeoManager.h"
// #include "DD4hep/TGeoUnits.h"
// //---- GEAR ----
// #include "DD4hep/Detector.h"
// #include "gear/GEAR.h"
// #include "DD4hep/Volumes.h"
// #include "gearxml/GearXML.h"
// #include "gearimpl/Util.h"
// #include "gearimpl/ConstantBField.h"
// #include "gearimpl/GearMgrImpl.h"
// #include "geartgeo/TGeoGearPointProperties.h"
// #include "geartgeo/TGeoGearDistanceProperties.h"
#include
<list>
using
namespace
std
;
using
namespace
std
;
using
namespace
DD4hep
;
using
namespace
DD4hep
;
...
@@ -23,7 +15,7 @@ using namespace DD4hep::Geometry;
...
@@ -23,7 +15,7 @@ using namespace DD4hep::Geometry;
using
namespace
DD4hep
::
DDRec
;
using
namespace
DD4hep
::
DDRec
;
using
namespace
DDSurfaces
;
using
namespace
DDSurfaces
;
using
namespace
tgeo
;
//
using namespace tgeo ;
//=============================================================================
//=============================================================================
...
@@ -40,66 +32,25 @@ int main(int argc, char** argv ){
...
@@ -40,66 +32,25 @@ int main(int argc, char** argv ){
lcdd
.
fromCompact
(
inFile
);
lcdd
.
fromCompact
(
inFile
);
// gear::GearMgr* gearMgr = createGearMgr( lcdd ) ;
DetElement
world
=
lcdd
.
world
()
;
DetElement
world
=
lcdd
.
world
()
;
std
::
cout
<<
" **** detector "
<<
lcdd
.
header
().
name
()
<<
" to Gear
\n
"
<<
" Iterating over all DetElements: "
<<
std
::
endl
;
// create a list of all surfaces in the detector:
SurfaceManager
surfMan
(
world
)
;
const
SurfaceList
&
sL
=
surfMan
.
surfaceList
()
;
//------------------ breadth first tree traversal ---------
std
::
list
<
DetElement
>
dets
;
std
::
list
<
DetElement
>
daugs
;
std
::
list
<
DetElement
>
gdaugs
;
daugs
.
push_back
(
world
)
;
while
(
!
daugs
.
empty
()
)
{
for
(
std
::
list
<
DetElement
>::
iterator
li
=
daugs
.
begin
()
;
li
!=
daugs
.
end
()
;
++
li
){
DetElement
dau
=
*
li
;
DetElement
::
Children
chMap
=
dau
.
children
()
;
for
(
DetElement
::
Children
::
const_iterator
it
=
chMap
.
begin
()
;
it
!=
chMap
.
end
()
;
++
it
){
DetElement
de
=
(
*
it
).
second
;
gdaugs
.
push_back
(
de
)
;
}
}
dets
.
splice
(
dets
.
end
()
,
daugs
)
;
daugs
.
splice
(
daugs
.
end
()
,
gdaugs
)
;
}
//------------------ end tree traversal ---------
std
::
cout
<<
" **** # DetElements found "
<<
dets
.
size
()
<<
std
::
endl
;
for
(
st
d
::
list
<
DetElement
>::
iterator
li
=
dets
.
begin
()
;
l
i
!=
det
s
.
end
()
;
++
l
i
)
{
for
(
SurfaceLi
st
::
const_
iterator
it
=
sL
.
begin
()
;
i
t
!=
s
L
.
end
()
;
++
i
t
){
DetElement
det
=
(
*
li
)
;
Surface
&
surf
=
**
it
;
if
(
!
volSurfaceList
(
det
)
->
empty
()
)
{
std
::
cout
<<
" ------------------------- "
<<
" surface: "
<<
surf
<<
std
::
endl
std
::
cout
<<
" detector "
<<
det
.
name
()
<<
" id: "
<<
det
.
id
()
<<
" has "
<<
volSurfaceList
(
det
)
->
size
()
<<
" surfaces "
<<
std
::
endl
;
<<
" ------------------------- "
<<
std
::
endl
;
// take first surface for now :
VolSurface
volSurf
=
volSurfaceList
(
det
)
->
front
()
;
Surface
*
surf
=
new
Surface
(
det
,
volSurf
)
;
std
::
cout
<<
" ------------------------- "
<<
" surface: "
<<
*
surf
<<
std
::
endl
<<
" ------------------------- "
<<
std
::
endl
;
}
}
}
return
0
;
return
0
;
}
}
...
...
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