Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mircho Nikolaev Rodozov
VecGeom
Commits
415d0e9f
Commit
415d0e9f
authored
Mar 25, 2019
by
Mihaela Gheata
Committed by
Mihaela Gheata
Mar 25, 2019
Browse files
[VECGEOM-520] Early return enabled in DistanceToOut
parent
2b134ab0
Changes
1
Hide whitespace changes
Inline
Side-by-side
volumes/kernel/MultiUnionImplementation.h
View file @
415d0e9f
...
...
@@ -145,7 +145,7 @@ struct MultiUnionImplementation {
// requested limit or than the current distance
if
(
hitbox
.
second
>
vecCore
::
math
::
Min
(
stepMax
,
distance
))
return
true
;
// Compute distance to the cluster (in both ToIn or ToOut assumptions)
auto
distance_crt
=
munion
.
fVolumes
[
hitbox
.
first
]
->
DistanceToIn
(
point
,
direction
,
stepMax
);
auto
distance_crt
=
munion
.
fVolumes
[
hitbox
.
first
]
->
DistanceToIn
(
point
,
direction
,
stepMax
);
if
(
distance_crt
<
distance
)
distance
=
distance_crt
;
return
false
;
};
...
...
@@ -166,7 +166,7 @@ struct MultiUnionImplementation {
// Locate the component containing the point
int
comp
;
InsideComponent
(
munion
,
point
,
comp
);
if
(
comp
<
0
)
distance
=
-
1.
;
// Point not inside
if
(
comp
<
0
)
return
;
// Point not inside
// Compute distance to exit current component
distance
=
-
eps
;
Real_v
dstep
=
1.
;
...
...
@@ -274,13 +274,13 @@ struct MultiUnionImplementation {
Vector3D
<
Real_v
>
local
=
munion
.
fVolumes
[
comp
]
->
GetTransformation
()
->
Transform
(
point
);
Vector3D
<
Real_v
>
ldir
;
valid
=
munion
.
fVolumes
[
comp
]
->
Normal
(
local
,
ldir
);
valid
=
munion
.
fVolumes
[
comp
]
->
Normal
(
local
,
ldir
);
if
(
valid
)
direction
=
munion
.
fVolumes
[
comp
]
->
GetTransformation
()
->
InverseTransformDirection
(
ldir
);
return
direction
;
}
};
// end MultiUnionImplementation
}
}
//
End global
namespace
}
// namespace VECGEOM_IMPL_NAMESPACE
}
// namespace
vecgeom
#endif // VECGEOM_VOLUMES_KERNEL_MULTIUNIONIMPLEMENTATION_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment