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
54929bf2
Commit
54929bf2
authored
10 years ago
by
Frank Gaede
Browse files
Options
Downloads
Patches
Plain Diff
- added dumpdetector utility
shows all DetElements in model incl. #surfaces
parent
8781a4bc
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
UtilityApps/CMakeLists.txt
+5
-2
5 additions, 2 deletions
UtilityApps/CMakeLists.txt
UtilityApps/src/dumpdetector.cpp
+92
-0
92 additions, 0 deletions
UtilityApps/src/dumpdetector.cpp
with
97 additions
and
2 deletions
UtilityApps/CMakeLists.txt
+
5
−
2
View file @
54929bf2
...
...
@@ -25,6 +25,9 @@ target_link_libraries(print_materials DD4hepCore DD4hepRec)
add_executable
(
materialScan src/materialScan.cpp
)
target_link_libraries
(
materialScan DD4hepCore DD4hepRec
)
#-----------------------------------------------------------------------------------
add_executable
(
dumpdetector src/dumpdetector.cpp
)
target_link_libraries
(
dumpdetector DD4hepCore DD4hepRec
)
#-----------------------------------------------------------------------------------
root_generate_dictionary
(
G__teve src/EvNavHandler.h LINKDEF src/LinkDef.h
)
...
...
@@ -43,12 +46,12 @@ target_link_libraries( teveDisplay DD4hepCore ${ROOT_EVE_LIBRARIES} DD4hepRec ${
#--- install target-------------------------------------
if
(
DD4HEP_USE_LCIO
)
install
(
TARGETS geoDisplay geoConverter geoPluginRun teveDisplay print_materials materialScan test_surfaces
install
(
TARGETS geoDisplay geoConverter geoPluginRun teveDisplay print_materials materialScan
dumpdetector
test_surfaces
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
else
()
install
(
TARGETS geoDisplay geoConverter geoPluginRun teveDisplay print_materials materialScan
install
(
TARGETS geoDisplay geoConverter geoPluginRun teveDisplay print_materials materialScan
d umpdetector
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
...
...
This diff is collapsed.
Click to expand it.
UtilityApps/src/dumpdetector.cpp
0 → 100644
+
92
−
0
View file @
54929bf2
// $Id:$
//====================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------
//
// Simple program to dump the complete DetElement hierarchy
//
// Author : F.Gaede, CERN/DESY
// Date : 07 Nov 2014
//====================================================================
#include
"DD4hep/LCDD.h"
#include
"DD4hep/DD4hepUnits.h"
#include
"DDRec/Surface.h"
#include
"DDRec/DetectorSurfaces.h"
#include
"DDRec/SurfaceManager.h"
#include
<list>
using
namespace
std
;
using
namespace
DD4hep
;
using
namespace
DD4hep
::
Geometry
;
using
namespace
DD4hep
::
DDRec
;
using
namespace
DDSurfaces
;
using
namespace
dd4hep
;
//=============================================================================
int
main
(
int
argc
,
char
**
argv
){
if
(
argc
!=
2
)
{
std
::
cout
<<
" usage: dumpdetector compact.xml "
<<
std
::
endl
;
exit
(
1
)
;
}
std
::
string
inFile
=
argv
[
1
]
;
LCDD
&
lcdd
=
LCDD
::
getInstance
();
lcdd
.
fromCompact
(
inFile
);
DetElement
world
=
lcdd
.
world
()
;
std
::
cout
<<
"############################################################################### "
<<
std
::
endl
<<
std
::
endl
;
//------------------ 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 ---------
for
(
std
::
list
<
DetElement
>::
const_iterator
it
=
dets
.
begin
()
;
it
!=
dets
.
end
()
;
++
it
){
DetElement
de
=
(
*
it
)
;
SurfaceManager
surfMan
(
de
)
;
const
SurfaceList
&
sL
=
surfMan
.
surfaceList
()
;
std
::
cout
<<
"DetElement: "
<<
de
.
name
()
<<
"[ path: "
<<
de
.
placementPath
()
<<
"]
\t
surfaces : "
<<
(
sL
.
empty
()
?
0
:
sL
.
size
()
)
<<
std
::
endl
;
// for( SurfaceList::const_iterator it = sL.begin() ; it != sL.end() ; ++it ){
// Surface* surf = *it ;
// std::cout << " ------------------------- "
// << " surface: " << *surf << std::endl
// << " ------------------------- " << std::endl ;
// }
}
std
::
cout
<<
"############################################################################### "
<<
std
::
endl
<<
std
::
endl
;
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