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
eb14a567
Commit
eb14a567
authored
2 years ago
by
Markus Frank
Committed by
MarkusFrankATcernch
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Roll-back GeoHandler
parent
b5ff351c
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
DDCore/include/DD4hep/GeoHandler.h
+11
-2
11 additions, 2 deletions
DDCore/include/DD4hep/GeoHandler.h
DDCore/src/GeoHandler.cpp
+27
-36
27 additions, 36 deletions
DDCore/src/GeoHandler.cpp
with
38 additions
and
38 deletions
DDCore/include/DD4hep/GeoHandler.h
+
11
−
2
View file @
eb14a567
...
@@ -48,6 +48,17 @@ namespace dd4hep {
...
@@ -48,6 +48,17 @@ namespace dd4hep {
*/
*/
class
GeoHandlerTypes
{
class
GeoHandlerTypes
{
public:
public:
#if 0
typedef std::set<const TGeoVolume*> ConstVolumeSet;
typedef std::map<SensitiveDetector, ConstVolumeSet> SensitiveVolumes;
typedef std::map<Region, ConstVolumeSet> RegionVolumes;
typedef std::map<LimitSet, ConstVolumeSet> LimitVolumes;
typedef std::map<int, std::set<const TGeoNode*> > Data;
typedef std::set<SensitiveDetector> SensitiveDetectorSet;
typedef std::set<Region> RegionSet;
typedef std::set<LimitSet> LimitSetSet;
typedef std::set<TNamed*> ObjectSet;
#endif
/// Data container to store information obtained during the geometry scan
/// Data container to store information obtained during the geometry scan
/**
/**
* \author M.Frank
* \author M.Frank
...
@@ -90,8 +101,6 @@ namespace dd4hep {
...
@@ -90,8 +101,6 @@ namespace dd4hep {
GeoHandler
&
i_collect
(
const
TGeoNode
*
parent
,
GeoHandler
&
i_collect
(
const
TGeoNode
*
parent
,
const
TGeoNode
*
node
,
const
TGeoNode
*
node
,
int
level
,
Region
rg
,
LimitSet
ls
);
int
level
,
Region
rg
,
LimitSet
ls
);
/// Assemble summary of the current node
void
i_collect_node
(
const
TGeoNode
*
node
,
GeometryInfo
&
info
);
private:
private:
/// Never call Copy constructor
/// Never call Copy constructor
...
...
This diff is collapsed.
Click to expand it.
DDCore/src/GeoHandler.cpp
+
27
−
36
View file @
eb14a567
...
@@ -87,48 +87,39 @@ GeoHandler& GeoHandler::collect(DetElement element) {
...
@@ -87,48 +87,39 @@ GeoHandler& GeoHandler::collect(DetElement element) {
return
i_collect
(
par_node
,
element
.
placement
().
ptr
(),
0
,
Region
(),
LimitSet
());
return
i_collect
(
par_node
,
element
.
placement
().
ptr
(),
0
,
Region
(),
LimitSet
());
}
}
/// Assemble summary of the current node
void
GeoHandler
::
i_collect_node
(
const
TGeoNode
*
n
,
GeometryInfo
&
info
)
{
TGeoVolume
*
v
=
n
->
GetVolume
();
if
(
v
)
{
Material
mat
(
v
->
GetMedium
());
Volume
vol
(
v
);
// Note : assemblies and the world do not have a real volume nor a material
if
(
info
.
volumeSet
.
find
(
vol
)
==
info
.
volumeSet
.
end
())
{
info
.
volumeSet
.
emplace
(
vol
);
info
.
volumes
.
emplace_back
(
vol
);
}
if
(
mat
.
isValid
()
)
info
.
materials
.
emplace
(
mat
);
if
(
dynamic_cast
<
Volume
::
Object
*>
(
v
))
{
VisAttr
vis
=
vol
.
visAttributes
();
//Region reg = vol.region();
//LimitSet lim = vol.limitSet();
//SensitiveDetector det = vol.sensitiveDetector();
if
(
vis
.
isValid
())
info
.
vis
.
emplace
(
vis
);
//if ( lim.isValid() ) info.limits[lim.ptr()].emplace(v);
//if ( reg.isValid() ) info.regions[reg.ptr()].emplace(v);
//if ( det.isValid() ) info.sensitives[det.ptr()].emplace(v);
}
collectSolid
(
info
,
v
->
GetName
(),
n
->
GetName
(),
v
->
GetShape
(),
n
->
GetMatrix
());
}
}
GeoHandler
&
GeoHandler
::
collect
(
DetElement
element
,
GeometryInfo
&
info
)
{
GeoHandler
&
GeoHandler
::
collect
(
DetElement
element
,
GeometryInfo
&
info
)
{
DetElement
par
=
element
.
parent
();
DetElement
par
=
element
.
parent
();
TGeoNode
*
place
=
element
.
placement
().
ptr
();
TGeoNode
*
par_node
=
par
.
isValid
()
?
par
.
placement
().
ptr
()
:
nullptr
;
TGeoNode
*
par_node
=
par
.
isValid
()
?
par
.
placement
().
ptr
()
:
nullptr
;
m_data
->
clear
();
m_data
->
clear
();
i_collect_node
(
place
,
info
);
i_collect
(
par_node
,
element
.
placement
().
ptr
(),
0
,
Region
(),
LimitSet
());
i_collect
(
par_node
,
place
,
0
,
Region
(),
LimitSet
());
for
(
auto
i
=
m_data
->
rbegin
();
i
!=
m_data
->
rend
();
++
i
)
{
for
(
auto
i
=
m_data
->
rbegin
();
i
!=
m_data
->
rend
();
++
i
)
{
const
auto
&
mapped
=
(
*
i
).
second
;
const
auto
&
mapped
=
(
*
i
).
second
;
for
(
const
TGeoNode
*
n
:
mapped
)
{
for
(
const
TGeoNode
*
n
:
mapped
)
{
i_collect_node
(
n
,
info
);
TGeoVolume
*
v
=
n
->
GetVolume
();
if
(
v
)
{
Material
mat
(
v
->
GetMedium
());
Volume
vol
(
v
);
// Note : assemblies and the world do not have a real volume nor a material
if
(
info
.
volumeSet
.
find
(
vol
)
==
info
.
volumeSet
.
end
())
{
info
.
volumeSet
.
emplace
(
vol
);
info
.
volumes
.
emplace_back
(
vol
);
}
if
(
mat
.
isValid
()
)
info
.
materials
.
emplace
(
mat
);
if
(
dynamic_cast
<
Volume
::
Object
*>
(
v
))
{
VisAttr
vis
=
vol
.
visAttributes
();
//Region reg = vol.region();
//LimitSet lim = vol.limitSet();
//SensitiveDetector det = vol.sensitiveDetector();
if
(
vis
.
isValid
())
info
.
vis
.
emplace
(
vis
);
//if ( lim.isValid() ) info.limits[lim.ptr()].emplace(v);
//if ( reg.isValid() ) info.regions[reg.ptr()].emplace(v);
//if ( det.isValid() ) info.sensitives[det.ptr()].emplace(v);
}
collectSolid
(
info
,
v
->
GetName
(),
n
->
GetName
(),
v
->
GetShape
(),
n
->
GetMatrix
());
}
}
}
}
}
return
*
this
;
return
*
this
;
...
...
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