Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
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
GeoModelDev
GeoModel
Commits
ed3f6298
Commit
ed3f6298
authored
3 years ago
by
Vakhtang Tsulaia
Browse files
Options
Downloads
Patches
Plain Diff
Introduced two new methods for GeoVFullPhysVol for accessing cached absolute positions
parent
8a25c826
No related branches found
No related tags found
1 merge request
!79
Introduced two new methods for GeoVFullPhysVol for accessing cached absolute positions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoVFullPhysVol.h
+16
-5
16 additions, 5 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoVFullPhysVol.h
GeoModelCore/GeoModelKernel/src/GeoVFullPhysVol.cxx
+25
-0
25 additions, 0 deletions
GeoModelCore/GeoModelKernel/src/GeoVFullPhysVol.cxx
with
41 additions
and
5 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoVFullPhysVol.h
+
16
−
5
View file @
ed3f6298
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration
*/
#ifndef GEOMODELKERNEL_GEOVFULLPHYSVOL_H
...
...
@@ -19,8 +19,22 @@ class GeoVFullPhysVol : public GeoVPhysVol
GeoVFullPhysVol
(
const
GeoVFullPhysVol
&
right
)
=
delete
;
GeoVFullPhysVol
&
operator
=
(
const
GeoVFullPhysVol
&
right
)
=
delete
;
/// Returns the absolute transform of the volume.
/// Returns the (default) absolute transform of the volume.
/// 1. When store=nullptr. This is considered a "serial case" when
/// the cached (default) absolute transform is kept as a data member of the
/// GeoVFullPhysVol class. If the local cache is empty, then it gets computed and stored.
///
/// 2. When store!=nullptr. This is considered a "multithreaded case" when
/// the cached (default) absolute trnasforms of Full Physical Volumes are kept in
/// an external object pointed by store. If the cache for given full physical
/// volume is missing, it gets computed and saved in the store.
const
GeoTrf
::
Transform3D
&
getAbsoluteTransform
(
GeoVAlignmentStore
*
store
=
nullptr
)
const
;
const
GeoTrf
::
Transform3D
&
getDefAbsoluteTransform
(
GeoVAlignmentStore
*
store
=
nullptr
)
const
;
/// Returns the previously computed and cached (default) absolute transform of the volume.
/// If the cache has not yet been computed, and exception gets thrown
const
GeoTrf
::
Transform3D
&
getCachedAbsoluteTransform
(
const
GeoVAlignmentStore
*
store
=
nullptr
)
const
;
const
GeoTrf
::
Transform3D
&
getCachedDefAbsoluteTransform
(
const
GeoVAlignmentStore
*
store
=
nullptr
)
const
;
/// Clears the position information. This can be used if
/// the cache is determined to be invalid. The usual client
...
...
@@ -28,9 +42,6 @@ class GeoVFullPhysVol : public GeoVPhysVol
/// There is little need for casual users to call this.
void
clearPositionInfo
()
const
;
/// Returns the default absolute transform of the volume.
const
GeoTrf
::
Transform3D
&
getDefAbsoluteTransform
(
GeoVAlignmentStore
*
store
=
nullptr
)
const
;
/// Returns the absolute name of this node.
const
std
::
string
&
getAbsoluteName
();
...
...
This diff is collapsed.
Click to expand it.
GeoModelCore/GeoModelKernel/src/GeoVFullPhysVol.cxx
+
25
−
0
View file @
ed3f6298
...
...
@@ -75,6 +75,19 @@ const GeoTrf::Transform3D & GeoVFullPhysVol::getAbsoluteTransform(GeoVAlignmentS
}
}
const
GeoTrf
::
Transform3D
&
GeoVFullPhysVol
::
getCachedAbsoluteTransform
(
const
GeoVAlignmentStore
*
store
)
const
{
if
(
store
==
nullptr
)
{
if
(
m_absPosInfo
->
getAbsTransform
())
return
*
m_absPosInfo
->
getAbsTransform
();
}
else
{
const
GeoTrf
::
Transform3D
*
storedPos
=
store
->
getAbsPosition
(
this
);
if
(
storedPos
)
return
*
storedPos
;
}
throw
std
::
runtime_error
(
"Failed to find the cached absolute transform for "
+
getLogVol
()
->
getName
());
}
void
GeoVFullPhysVol
::
clearPositionInfo
()
const
{
delete
m_absPosInfo
;
...
...
@@ -137,6 +150,18 @@ const GeoTrf::Transform3D& GeoVFullPhysVol::getDefAbsoluteTransform(GeoVAlignmen
}
}
const
GeoTrf
::
Transform3D
&
GeoVFullPhysVol
::
getCachedDefAbsoluteTransform
(
const
GeoVAlignmentStore
*
store
)
const
{
if
(
store
==
nullptr
)
{
if
(
m_absPosInfo
->
getDefAbsTransform
())
return
*
m_absPosInfo
->
getDefAbsTransform
();
}
else
{
const
GeoTrf
::
Transform3D
*
storedPos
=
store
->
getDefAbsPosition
(
this
);
if
(
storedPos
)
return
*
storedPos
;
}
throw
std
::
runtime_error
(
"Failed to find the cached default absolute transform for "
+
getLogVol
()
->
getName
());
}
const
std
::
string
&
GeoVFullPhysVol
::
getAbsoluteName
()
{
//------------------------------------------------------------------------------------------------//
...
...
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