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
18cc84dd
Commit
18cc84dd
authored
11 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Remove bug reported by P.Kostka
parent
a889f3a0
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
DDExamples/CLICSiDSimu/src/SteppingAction.cpp
+30
-21
30 additions, 21 deletions
DDExamples/CLICSiDSimu/src/SteppingAction.cpp
with
30 additions
and
21 deletions
DDExamples/CLICSiDSimu/src/SteppingAction.cpp
+
30
−
21
View file @
18cc84dd
...
...
@@ -71,29 +71,38 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep) {
}
Geant4VolumeManager
volMgr
=
Geant4Mapping
::
instance
().
volumeManager
();
const
G4VPhysicalVolume
*
pv
=
step
.
volume
(
step
.
post
);
Geometry
::
PlacedVolume
place
=
volMgr
.
placement
(
pv
);
if
(
!
place
.
isValid
()
)
{
::
printf
(
" --> Severe ERROR: incomplete placement map from Geant4 conversion.
\n
"
);
}
else
{
VolumeID
id
=
volMgr
.
volumeID
(
step
.
postTouchable
());
if
(
id
==
Geant4VolumeManager
::
InvalidPath
)
{
::
printf
(
" --> Severe ERROR: Invalid placement path: touchable corrupted?
\n
"
);
}
else
if
(
id
==
Geant4VolumeManager
::
Insensitive
)
{
::
printf
(
" --> WARNING: Only sensitive volumes may be decoded.
\n
"
);
}
else
if
(
id
==
Geant4VolumeManager
::
NonExisting
)
{
::
printf
(
" --> WARNING: non existing placement path.
\n
"
);
if
(
pv
)
{
// If the post step is no longer connected to a physical volume it does not make sense to follow
// it's properties!
Geometry
::
PlacedVolume
place
=
volMgr
.
placement
(
pv
);
if
(
!
place
.
isValid
()
)
{
::
printf
(
" --> Severe ERROR: incomplete placement map from Geant4 conversion.
\n
"
);
}
else
{
std
::
stringstream
str
;
Geant4VolumeManager
::
VolIDDescriptor
dsc
;
Geant4VolumeManager
::
VolIDFields
&
fields
=
dsc
.
second
;
volMgr
.
volumeDescriptor
(
step
.
postTouchable
(),
dsc
);
for
(
Geant4VolumeManager
::
VolIDFields
::
iterator
i
=
fields
.
begin
();
i
!=
fields
.
end
();
++
i
)
str
<<
(
*
i
).
first
->
name
()
<<
"="
<<
(
*
i
).
second
<<
" "
;
::
printf
(
" --> CellID: %X [%X] -> %s
\n
"
,
id
,
dsc
.
first
,
str
.
str
().
c_str
());
VolumeID
id
=
volMgr
.
volumeID
(
step
.
postTouchable
());
if
(
id
==
Geant4VolumeManager
::
InvalidPath
)
{
::
printf
(
" --> Severe ERROR: Invalid placement path: touchable corrupted?
\n
"
);
}
else
if
(
id
==
Geant4VolumeManager
::
Insensitive
)
{
::
printf
(
" --> WARNING: Only sensitive volumes may be decoded.
\n
"
);
}
else
if
(
id
==
Geant4VolumeManager
::
NonExisting
)
{
::
printf
(
" --> WARNING: non existing placement path.
\n
"
);
}
else
{
std
::
stringstream
str
;
Geant4VolumeManager
::
VolIDDescriptor
dsc
;
Geant4VolumeManager
::
VolIDFields
&
fields
=
dsc
.
second
;
volMgr
.
volumeDescriptor
(
step
.
postTouchable
(),
dsc
);
for
(
Geant4VolumeManager
::
VolIDFields
::
iterator
i
=
fields
.
begin
();
i
!=
fields
.
end
();
++
i
)
str
<<
(
*
i
).
first
->
name
()
<<
"="
<<
(
*
i
).
second
<<
" "
;
::
printf
(
" --> CellID: %X [%X] -> %s
\n
"
,
id
,
dsc
.
first
,
str
.
str
().
c_str
());
}
}
}
else
{
Position
pos
=
step
.
postPos
();
::
printf
(
" --> Geant4 post-step point is not connected to a physical volume. "
"Last position: x=%.3f y=%.3f z=%.3f
\n
"
,
pos
.
X
(),
pos
.
Y
(),
pos
.
Z
());
}
}
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