Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Detector
Manage
Activity
Members
Labels
Plan
Issues
38
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
42
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
Detector
Commits
129c58cc
Commit
129c58cc
authored
4 years ago
by
Ben Couturier
Browse files
Options
Downloads
Patches
Plain Diff
Improved loop
parent
72f63c1c
No related branches found
No related tags found
1 merge request
!38
WIP: Added tool to display volumes and materials between two points
Pipeline
#1624855
failed with stages
Stage: build
Stage: test
in 1 minute and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/src/Checker.cpp
+7
-10
7 additions, 10 deletions
Core/src/Checker.cpp
with
7 additions
and
10 deletions
Core/src/Checker.cpp
+
7
−
10
View file @
129c58cc
...
...
@@ -48,24 +48,21 @@ static long dd4hep_find_intersections( dd4hep::Detector& description, int argc,
nav
->
SetCurrentPoint
(
start_point
.
X
(),
start_point
.
Y
(),
start_point
.
Z
()
);
nav
->
SetCurrentDirection
(
direction
.
X
(),
direction
.
Y
(),
direction
.
Z
()
);
bool
reached_end
=
false
;
double
distancesq
=
(
end_point
-
start_point
).
mag2
();
while
(
!
reached_end
)
{
nav
->
FindNextBoundaryAndStep
(
10
);
double
prev_distancesq
=
distancesq
;
do
{
prev_distancesq
=
distancesq
;
nav
->
FindNextBoundaryAndStep
(
std
::
sqrt
(
distancesq
)
);
auto
c
=
nav
->
GetCurrentPoint
();
ROOT
::
Math
::
XYZPoint
current
(
c
[
0
],
c
[
1
],
c
[
2
]
);
std
::
ostringstream
os
;
os
<<
current
<<
" - "
<<
nav
->
GetCurrentNode
()
->
GetName
()
<<
" - "
<<
nav
->
GetCurrentNode
()
->
GetVolume
()
->
GetMaterial
()
->
GetName
();
dd4hep
::
printout
(
dd4hep
::
INFO
,
"find-_intersec"
,
"%s"
,
os
.
str
().
c_str
()
);
double
prev_distancesq
=
distancesq
;
dd4hep
::
printout
(
dd4hep
::
INFO
,
"find_intersec"
,
"%s"
,
os
.
str
().
c_str
()
);
distancesq
=
(
end_point
-
current
).
mag2
();
if
(
distancesq
>
prev_distancesq
)
{
reached_end
=
true
;
}
}
}
while
(
distancesq
>
0.1
);
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