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
dccad222
Commit
dccad222
authored
10 years ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
Geant4SDAction: Catch exception when calling cellID
Create stringstream to avoid changing output format for cout
parent
2f2ebf89
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/plugins/Geant4SDActions.cpp
+20
-1
20 additions, 1 deletion
DDG4/plugins/Geant4SDActions.cpp
with
20 additions
and
1 deletion
DDG4/plugins/Geant4SDActions.cpp
+
20
−
1
View file @
dccad222
...
...
@@ -81,7 +81,26 @@ namespace DD4hep {
StepHandler
h
(
step
);
HitContribution
contrib
=
Hit
::
extractContribution
(
step
);
HitCollection
*
coll
=
collection
(
m_collectionID
);
long
long
int
cell
=
cellID
(
step
);
long
long
int
cell
;
try
{
cell
=
cellID
(
step
);
}
catch
(
std
::
runtime_error
&
e
)
{
std
::
stringstream
out
;
out
<<
std
::
setprecision
(
20
)
<<
std
::
scientific
;
out
<<
"ERROR: "
<<
e
.
what
()
<<
std
::
endl
;
out
<<
"Position: "
<<
"Pre ("
<<
std
::
setw
(
24
)
<<
step
->
GetPreStepPoint
()
->
GetPosition
()
<<
") "
<<
"Post ("
<<
std
::
setw
(
24
)
<<
step
->
GetPostStepPoint
()
->
GetPosition
()
<<
") "
<<
std
::
endl
;
out
<<
"Momentum: "
<<
" Pre ("
<<
std
::
setw
(
24
)
<<
step
->
GetPreStepPoint
()
->
GetMomentum
()
<<
") "
<<
" Post ("
<<
std
::
setw
(
24
)
<<
step
->
GetPostStepPoint
()
->
GetMomentum
()
<<
") "
<<
std
::
endl
;
std
::
cout
<<
out
;
return
true
;
}
Hit
*
hit
=
coll
->
find
<
Hit
>
(
CellIDCompare
<
Hit
>
(
cell
));
if
(
h
.
totalEnergy
()
<
std
::
numeric_limits
<
double
>::
epsilon
()
)
{
...
...
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