Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • leggett/acts-core
  • adye/acts-core
  • xju/acts-core
  • corentin/acts-core
  • keli/acts-core
  • gli/acts-core
  • xai/acts-core
  • bschlag/acts-core
  • berkeleylab/acts/acts-core
  • emoyse/acts-core
  • smh/acts-core
  • pagessin/acts-core
  • chamont/acts-core
  • sroe/a-common-tracking-sw
  • calaf/a-common-tracking-sw
  • hgraslan/acts-core
16 results
Show changes
Commits on Source (197)
Showing
with 782 additions and 282 deletions
......@@ -289,15 +289,10 @@ sync_releases:
stage: deploy
image: alpine:3.8
before_script:
- apk --no-cache add krb5-dev python3 py3-cffi alpine-sdk python3-dev libffi-dev libxml2-dev libxslt-dev py3-lxml openssl-dev krb5 py3-pynacl
- apk --no-cache add python3 py3-cffi alpine-sdk python3-dev libffi-dev libxml2-dev libxslt-dev py3-lxml openssl-dev py3-pynacl
- pip3 install --upgrade pip
- pip3 install python-cern-sso-krb
- pip3 install -r CI/requirements.txt
script:
- unset PYTHONHOME
- echo "$ATSJENKINS_PASSWORD" | kinit atsjenkins@CERN.CH 2>&1 >/dev/null
- CI/sync_releases.py
after_script:
- kdestroy
only:
- tags
#!/usr/bin/env python3
import cern_sso
import os
from urllib.parse import quote as quote_plus
import requests
import json
import re
import argparse
import gitlab
from concurrent.futures import ThreadPoolExecutor, as_completed
import dateutil.parser
import contextlib
import sys
import math
# these are optional, but nice
try:
from tqdm import tqdm
except:
tqdm = None
try:
from halo import Halo
except:
Halo = None
class JIRAException(Exception):
def __init__(self, messages, *args, **kwargs):
self.messages = messages
class JIRA:
def __init__(self, cookies, url):
self.cookies = cookies
self.url = url
def jql(self, q):
return requests.get(self.url + "/rest/api/2/search?jql={}&maxResults=500".format(q), cookies=self.cookies)
def get_version_issues(self, version):
res = self.jql("project= ACTS AND fixVersion = {} AND status = Closed".format(version)).json()
try:
assert res["maxResults"] > res["total"]
assert res["startAt"] == 0
return res["issues"]
except:
raise JIRAException(res["errorMessages"])
@contextlib.contextmanager
def spinner(text, *args, **kwargs):
......@@ -54,102 +21,49 @@ def spinner(text, *args, **kwargs):
with Halo(text, *args, **kwargs):
yield
else:
sys.stdout.write(text+"\n")
sys.stdout.write(text + "\n")
yield
if sys.stdout.isatty() and tqdm is not None:
Progress = tqdm
prog_iter = tqdm
prog_write = tqdm.write
else:
class Progress():
def __init__(self, total, desc, *args, **kwargs):
self.total = total
self.current = 0
sys.stdout.write(desc+"\n")
def update(self, n=1, *args, **kwargs):
self.current += n
perc = self.current / self.total * 100
inc = math.ceil(self.total / 10)
if self.current % inc == 0:
sys.stdout.write("%.2f"%perc + "%\n")
def close(self):
pass
def prog_iter(values, *args, **kwargs):
p = Progress(len(values), *args, **kwargs)
for value in values:
yield value
p.update()
p.close()
def prog_write(*args, **kwargs):
sys.stdout.write(*args, **kwargs)
sys.stdout.write("\n")
def mtmap(tp, func, values, desc=None):
prog = Progress(total=len(values), leave=False, desc=desc)
futures = []
for v in values:
futures.append(tp.submit(func, v))
for _ in as_completed(futures):
prog.update()
prog.close()
return [f.result() for f in futures]
def make_release_notes(version, issues, mrs):
issues_by_type = {}
for issue in issues:
issue_type = issue["fields"]["issuetype"]["name"]
summary = issue["fields"]["summary"]
key = issue["key"]
url = "https://its.cern.ch/jira/browse/{}".format(key)
if not issue_type in issues_by_type:
issues_by_type[issue_type] = []
issues_by_type[issue_type].append((key, url, summary))
markdown = ""
markdown += "# Release v{}\n\n".format(version)
markdown += "\n"*2 + "Merge requests for this release:\n\n"
for mr in mrs:
markdown += " - [!%d - %s](%s)" % (mr.iid, mr.title, mr.web_url) + "\n"
markdown += "\n"*2
for issue_type, issues in issues_by_type.items():
def parse_version(tag):
return re.match(r"v(\d\.\d\d\.\d\d)", tag.name).group(1)
markdown += "## {}\n".format(issue_type)
for key, url, summary in sorted(issues, key=lambda i: i[0]):
markdown += " - [[{key}] {summary}]({url})\n".format(key=key, url=url, summary=summary)
def group_items(labels, items):
groups = {l: [] for l in labels}
groups["Uncategorized"] = []
markdown += "\n"*2
for item in items:
assigned = False
for label in item.labels:
if label in labels:
groups[label].append(item)
assigned = True
break
# is we get here, we didn't group this
if not assigned:
groups["Uncategorized"].append(item)
return groups
return markdown
def parse_version(tag):
return re.match(r"v(\d\.\d\d\.\d\d)", tag.name).group(1)
def main():
p = argparse.ArgumentParser()
p.add_argument("--access-token",
help="Gitlab access token to update the releases",
default=os.getenv("ATSJENKINS_ACCESS_TOKEN", None))
p.add_argument(
"--access-token",
help="Gitlab access token to update the releases",
default=os.getenv("ATSJENKINS_ACCESS_TOKEN", None),
)
p.add_argument("--dry-run", "-s", action="store_true")
p.add_argument("--verbose", "-v", action="store_true")
args = p.parse_args()
label_groups = os.getenv(
"RELEASE_NOTES_LABEL_GROUPS", "New Feature;Bug;Improvement"
).split(";")
jira_url = "https://its.cern.ch/jira"
cookies = cern_sso.krb_sign_on(jira_url)
jira = JIRA(cookies=cookies, url=jira_url)
print("Label groups:", ", ".join(label_groups))
args = p.parse_args()
gl = gitlab.Gitlab("https://gitlab.cern.ch", private_token=args.access_token)
if not args.dry_run:
......@@ -160,70 +74,79 @@ def main():
with spinner(text="Loading tags"):
tags = project.tags.list(all=True)
with spinner(text="Loading merge requests"):
mrlist = project.mergerequests.list(state="merged", target_branch="master", all=True)
with ThreadPoolExecutor(max_workers=15) as tp:
mrs = mrlist
for tag in tags:
date = dateutil.parser.parse(tag.commit["created_at"])
tag.created_at = date
tags = list(sorted(tags, key=lambda t: t.created_at))
def augment_with_commit(mr):
commit = project.commits.get(mr.sha)
date = dateutil.parser.parse(commit.created_at)
mr.commit_date = date
return mr
mrs = mtmap(tp, augment_with_commit, mrs, desc="Loading MR commit info")
def load_issues(tag):
version = parse_version(tag)
try:
return tag, jira.get_version_issues(version)
except JIRAException:
return tag, []
version_issues = dict(mtmap(tp, load_issues, tags, desc="Loading issues from JIRA"))
with spinner(text="Loading milestones"):
milestones = project.milestones.list(all=True)
ms_map = {}
for ms in milestones:
ms_map[ms.title] = ms
tag_mrs = {}
tag_mrs[tags[0]] = []
for mr in mrs:
if tags[0].created_at > mr.commit_date:
tag_mrs[tags[0]].append(mr)
for tag, tagn in zip(tags, tags[1:]):
tag_mrs[tagn] = []
for mr in mrs:
if tag.created_at < mr.commit_date < tagn.created_at:
tag_mrs[tagn].append(mr)
print("Found", len(tags), "tags")
for tag in prog_iter(tags, desc="Updating tag release notes"):
name = tag.name
for tag in tags:
version = parse_version(tag)
has_release = tag.release is not None
prog_write(name)
relnotes = make_release_notes(version, version_issues[tag], tag_mrs[tag])
if not has_release:
prog_write("Creating release for tag %s"%name)
else:
prog_write("Updating release notes for tag %s"%name)
if not version in ms_map:
print(f"No milestone found for tag f{tag.name} => skipping")
milestone = ms_map[version]
print(tag.name, milestone.title)
mrs = []
with spinner(text=f"Loading merge requests associated with %{milestone.iid}"):
for mr in milestone.merge_requests():
if mr.state == "merged":
mrs.append(mr)
# need to get issues from merged MRs
with spinner(text=f"Collecting issues from {len(mrs)} merged MRs"):
issue_ids = []
issues = []
for mr in mrs:
for issue in mr.closes_issues():
if issue.id not in issue_ids:
issue_ids.append(issue.id)
issues.append(issue)
issues_grouped = group_items(label_groups, issues)
mrs_grouped = group_items(label_groups, mrs)
if args.verbose:
print("Issues:", ", ".join([str(i.iid) for i in issues]))
for g, issues in issues_grouped.items():
print(g, ", ".join([str(i.iid) for i in issues]))
print("MRs:", ", ".join([str(mr.iid) for mr in mrs]))
for g, mrs in mrs_grouped.items():
print(g, ", ".join([str(mr.iid) for mr in mrs]))
with spinner(text="Assembling release notes"):
# make the Markdown
md = ""
# md = f"# Release {tag.name}\n"
md += f"Milestone: [%{milestone.title}]({milestone.web_url})\n"
if len(mrs) > 0:
md += f"### {len(mrs)} Merge Requests in this release:\n"
for g in label_groups + ["Uncategorized"]:
if len(mrs_grouped[g]) == 0:
continue
md += f"#### {g}\n"
for mr in mrs_grouped[g]:
md += f"- [!{mr.iid} - {mr.title}]({mr.web_url})\n"
md += "\n"
if len(issues) > 0:
md += f"### {len(issues)} issues addressed in this release:\n"
for g in label_groups + ["Uncategorized"]:
if len(issues_grouped[g]) == 0:
continue
md += f"#### {g}\n"
for issue in issues_grouped[g]:
md += f"- [#{issue.iid} - {issue.title}]({issue.web_url})\n"
# print(md)
if not args.dry_run:
tag.set_release_description(relnotes)
prog_write("Release notes for %s set" % name)
print("Release note synchronization complete")
with spinner(text=f"Saving release notes on {tag.name}"):
tag.set_release_description(md)
if args.verbose:
print("---")
if "__main__" == __name__:
......
......@@ -7,12 +7,13 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// TrackingGeometry.h, Acts project
// TrackingGeometry.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/GeometryContext.hpp"
#include "Acts/Utilities/GeometryID.hpp"
#include "Acts/Utilities/GeometrySignature.hpp"
#include <functional>
......@@ -26,6 +27,7 @@ class TrackingVolume;
class Layer;
class Surface;
class PerigeeSurface;
class IMaterialDecorator;
using TrackingVolumePtr = std::shared_ptr<const TrackingVolume>;
using MutableTrackingVolumePtr = std::shared_ptr<TrackingVolume>;
......@@ -38,7 +40,6 @@ using MutableTrackingVolumePtr = std::shared_ptr<TrackingVolume>;
/// (respectively, if existing, a global search of an associated Layer or the
/// next associated Layer), such as a continous navigation by BoundarySurfaces
/// between the confined TrackingVolumes.
class TrackingGeometry
{
/// Give the GeometryBuilder friend rights
......@@ -48,7 +49,10 @@ public:
/// Constructor
///
/// @param highestVolume is the world volume
TrackingGeometry(const MutableTrackingVolumePtr& highestVolume);
/// @param materialDecorator is a dediated decorator that can assign
/// surface or volume based material to the TrackingVolume
TrackingGeometry(const MutableTrackingVolumePtr& highestVolume,
const IMaterialDecorator* materialDecorator = nullptr);
/// Destructor
~TrackingGeometry();
......
......@@ -16,11 +16,13 @@
#include <string>
#include "Acts/Detector/detail/BoundaryIntersectionSorter.hpp"
#include "Acts/Layers/Layer.hpp"
#include "Acts/Material/IVolumeMaterial.hpp"
#include "Acts/Surfaces/BoundaryCheck.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/BinnedArray.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/GeometryContext.hpp"
#include "Acts/Utilities/GeometryID.hpp"
#include "Acts/Utilities/GeometrySignature.hpp"
#include "Acts/Volumes/BoundarySurfaceT.hpp"
#include "Acts/Volumes/Volume.hpp"
......@@ -29,15 +31,14 @@ namespace Acts {
class GlueVolumesDescriptor;
class VolumeBounds;
class Material;
using TrackingVolumeBoundaryPtr
= std::shared_ptr<const BoundarySurfaceT<TrackingVolume>>;
// master typedefs
using TrackingVolumePtr = std::shared_ptr<const TrackingVolume>;
using MutableTrackingVolumePtr = std::shared_ptr<TrackingVolume>;
using TrackingVolumeBoundaryPtr
= std::shared_ptr<const BoundarySurfaceT<TrackingVolume>>;
// possible contained
using TrackingVolumeArray = BinnedArray<TrackingVolumePtr>;
using TrackingVolumeVector = std::vector<TrackingVolumePtr>;
......@@ -116,7 +117,7 @@ public:
static MutableTrackingVolumePtr
create(std::shared_ptr<const Transform3D> htrans,
VolumeBoundsPtr volumeBounds,
std::shared_ptr<const Material> matprop,
std::shared_ptr<const IVolumeMaterial> volumeMaterial,
std::unique_ptr<const LayerArray> containedLayers = nullptr,
std::shared_ptr<const TrackingVolumeArray> containedVolumes = nullptr,
const std::string& volumeName = "undefined")
......@@ -124,7 +125,7 @@ public:
return MutableTrackingVolumePtr(
new TrackingVolume(std::move(htrans),
std::move(volumeBounds),
std::move(matprop),
std::move(volumeMaterial),
std::move(containedLayers),
std::move(containedVolumes),
volumeName));
......@@ -270,8 +271,18 @@ public:
boundarySurfaces() const;
/// Return the material of the volume
std::shared_ptr<const Material>
material() const;
std::shared_ptr<const IVolumeMaterial>
volumeMaterial() const;
/// Set the volume material description
///
/// The material is usually derived in a complicated way and loaded from
/// a framework given source. As various volumes could potentially share the
/// the same material description, it is provided as a shared object
///
/// @param material Material description of this volume
void
assignVolumeMaterial(std::shared_ptr<const IVolumeMaterial> material);
/// Glue another tracking volume to this one
/// - if common face is set the glued volumes are sharing the boundary, down
......@@ -386,15 +397,15 @@ protected:
/// Constructor for a full equipped Tracking Volume
///
/// @param htrans is the global 3D transform to position the volume in space
/// @param volbounds is the description of the volume boundaries
/// @param matprop is are materials of the tracking volume
/// @param volumeBounds is the description of the volume boundaries
/// @param volumeMaterial is are materials of the tracking volume
/// @param staticLayerArray is the confined layer array (optional)
/// @param containedVolumeArray is the confined volume array
/// @param volumeName is a string identifier
TrackingVolume(std::shared_ptr<const Transform3D> htrans,
VolumeBoundsPtr volbounds,
std::shared_ptr<const Material> matprop,
std::unique_ptr<const LayerArray> staticLayerArray = nullptr,
TrackingVolume(std::shared_ptr<const Transform3D> htrans,
VolumeBoundsPtr volumeBounds,
std::shared_ptr<const IVolumeMaterial> volumeMaterial,
std::unique_ptr<const LayerArray> staticLayerArray = nullptr,
std::shared_ptr<const TrackingVolumeArray> containedVolumeArray
= nullptr,
const std::string& volumeName = "undefined");
......@@ -411,15 +422,18 @@ private:
void
synchronizeLayers(double envelope = 1.) const;
/// close the Geometry, i.e. set the TDD_ID
/// close the Geometry, i.e. set the GeometryID and assign material
///
/// @param materialDecorator is a dedicated decorator for the
/// material to be assigned (surface, volume based)
/// @param volumeMap is a map to find the a volume
/// by a given name
/// @param vol is the geometry id of the volume
/// as calculated by the TrackingGeometry
///
void
closeGeometry(std::map<std::string, const TrackingVolume*>& volumeMap,
closeGeometry(const IMaterialDecorator* materialDecorator,
std::map<std::string, const TrackingVolume*>& volumeMap,
size_t& vol);
/// interlink the layers in this TrackingVolume
......@@ -434,8 +448,8 @@ private:
operator=(const TrackingVolume&)
= delete;
/// The Material the TrackingVolume consists of
std::shared_ptr<const Material> m_material;
/// The volume based material the TrackingVolume consists of
std::shared_ptr<const IVolumeMaterial> m_volumeMaterial{nullptr};
/// Remember the mother volume
const TrackingVolume* m_motherVolume{nullptr};
......@@ -472,10 +486,17 @@ TrackingVolume::volumeName() const
return m_name;
}
inline std::shared_ptr<const Material>
TrackingVolume::material() const
inline std::shared_ptr<const IVolumeMaterial>
TrackingVolume::volumeMaterial() const
{
return m_volumeMaterial;
}
inline void
TrackingVolume::assignVolumeMaterial(
std::shared_ptr<const IVolumeMaterial> material)
{
return m_material;
m_volumeMaterial = std::move(material);
}
inline const LayerArray*
......
......@@ -12,9 +12,9 @@
#include <sstream>
#include <utility>
#include "Acts/Extrapolator/detail/InteractionFormulas.hpp"
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Material/Material.hpp"
#include "Acts/Material/MaterialProperties.hpp"
#include "Acts/Material/SurfaceMaterial.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Helpers.hpp"
......@@ -116,7 +116,7 @@ struct MaterialInteractor
// A current surface has been already assigned by the navigator
// check for material
if (state.navigation.currentSurface
&& state.navigation.currentSurface->associatedMaterial()) {
&& state.navigation.currentSurface->surfaceMaterial()) {
// Let's set the pre/full/post update stage
MaterialUpdateStage mStage = fullUpdate;
// We are at the start surface
......@@ -140,8 +140,8 @@ struct MaterialInteractor
// Get the surface material & properties from them and continue if you
// found some
const SurfaceMaterial* sMaterial
= state.navigation.currentSurface->associatedMaterial();
const ISurfaceMaterial* sMaterial
= state.navigation.currentSurface->surfaceMaterial();
MaterialProperties mProperties = sMaterial->materialProperties(
stepper.position(state.stepping), state.stepping.navDir, mStage);
// Material properties (non-zero) have been found for this configuration
......@@ -321,4 +321,13 @@ private:
}
};
/// Using some short hands for Recorded Material
using RecordedMaterial = MaterialInteractor::result_type;
/// And recorded material track
/// - this is start: position, start momentum
/// and the Recorded material
using RecordedMaterialTrack
= std::pair<std::pair<Acts::Vector3D, Acts::Vector3D>, RecordedMaterial>;
} // end of namespace Acts
......@@ -855,6 +855,13 @@ private:
if (state.navigation.navBoundaries.empty()) {
// Exclude the current surface in case it's a boundary
navOpts.startObject = state.navigation.currentSurface;
debugLog(state, [&] {
std::stringstream ss;
ss << "Try to find boundaries, we are at: "
<< stepper.position(state.stepping).transpose()
<< ", dir: " << stepper.direction(state.stepping).transpose();
return ss.str();
});
// Evaluate the boundary surfaces
state.navigation.navBoundaries
= state.navigation.currentVolume->compatibleBoundaries(
......@@ -897,10 +904,21 @@ private:
or distance * distance
< s_onSurfaceTolerance * s_onSurfaceTolerance) {
debugLog(state, [&] {
return std::string("Boundary intersection not valid, skipping it.");
std::stringstream ss;
ss << "Boundary intersection with:\n";
boundaryIntersect.object->toStream(state.geoContext, ss);
ss << "\n";
ss << "Boundary intersection not valid, skipping it.\n";
ss << "valid: " << bool(boundaryIntersect) << "\n";
ss << "pathLength: " << distance << "\n";
if (distance < 0 && std::abs(distance) < 0.01) {
ss << "Very likely overstepped over boundary surface! \n";
}
return ss.str();
});
// Increase the iterator to the next one
++state.navigation.navBoundaryIter;
} else {
debugLog(state,
[&] { return std::string("Boundary intersection valid."); });
......
......@@ -17,10 +17,12 @@
#include "Acts/EventData/NeutralParameters.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Layers/ApproachDescriptor.hpp"
#include "Acts/Material/IMaterialDecorator.hpp"
#include "Acts/Surfaces/SurfaceArray.hpp"
#include "Acts/Utilities/BinnedArray.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/GeometryContext.hpp"
#include "Acts/Utilities/GeometryID.hpp"
#include "Acts/Utilities/GeometryObject.hpp"
#include "Acts/Utilities/GeometryStatics.hpp"
#include "Acts/Utilities/Intersection.hpp"
......@@ -29,6 +31,7 @@
namespace Acts {
class Surface;
class ISurfaceMaterial;
class BinUtility;
class Volume;
class VolumeBounds;
......@@ -370,12 +373,17 @@ protected:
private:
/// Private helper method to close the geometry
/// - it will assign material to the surfaces if needed
/// - it will set the layer geometry ID for a unique identification
/// - it will also register the internal sub strucutre
///
/// @param materialDecorator is a decorator that assigns
/// optionally the surface material to where they belong
/// @param layerID is the geometry id of the volume
/// as calculated by the TrackingGeometry
void
closeGeometry(const GeometryID& layerID);
closeGeometry(const IMaterialDecorator* materialDecorator,
const GeometryID& layerID);
};
/// Layers are constructedd with shared_ptr factories, hence the layer array is
......
......@@ -78,7 +78,7 @@ Layer::resolve(bool resolveSensitive,
}
if (resolveMaterial
&& (m_ssSensitiveSurfaces > 1 || m_ssApproachSurfaces > 1
|| (surfaceRepresentation().associatedMaterial() != nullptr))) {
|| (surfaceRepresentation().surfaceMaterial() != nullptr))) {
return true;
}
return false;
......@@ -156,7 +156,7 @@ Layer::compatibleSurfaces(const GeometryContext& gctx,
return true;
}
// next option: it's a material surface and you want to have it
if (options.resolveMaterial && sf.associatedMaterial()) {
if (options.resolveMaterial && sf.surfaceMaterial()) {
return true;
}
// last option: resovle all
......@@ -264,7 +264,7 @@ Layer::surfaceOnApproach(const GeometryContext& gctx,
bool resolvePS = options.resolveSensitive || options.resolvePassive;
bool resolveMS = options.resolveMaterial
&& (m_ssSensitiveSurfaces > 1 || m_ssApproachSurfaces > 1
|| surfaceRepresentation().associatedMaterial());
|| surfaceRepresentation().surfaceMaterial());
// now of course this only counts when you have an approach descriptor
if (m_approachDescriptor && (resolvePS || resolveMS)) {
......
......@@ -160,10 +160,9 @@ public:
getFieldCell(const Vector3D& position) const
{
const auto& gridPosition = m_transformPos(position);
size_t bin = m_grid.getGlobalBinIndex(gridPosition);
const auto& indices = m_grid.getLocalBinIndices(bin);
const auto& lowerLeft = m_grid.getLowerLeftBinEdge(indices);
const auto& upperRight = m_grid.getUpperRightBinEdge(indices);
const auto& indices = m_grid.localBinsFromPosition(gridPosition);
const auto& lowerLeft = m_grid.lowerLeftBinEdge(indices);
const auto& upperRight = m_grid.upperRightBinEdge(indices);
// loop through all corner points
constexpr size_t nCorners = 1 << DIM_POS;
......@@ -185,7 +184,7 @@ public:
std::vector<size_t>
getNBins() const
{
auto nBinsArray = m_grid.getNBins();
auto nBinsArray = m_grid.numLocalBins();
return std::vector<size_t>(nBinsArray.begin(), nBinsArray.end());
}
......@@ -195,7 +194,7 @@ public:
std::vector<double>
getMin() const
{
auto minArray = m_grid.getMin();
auto minArray = m_grid.minPosition();
return std::vector<double>(minArray.begin(), minArray.end());
}
......@@ -205,7 +204,7 @@ public:
std::vector<double>
getMax() const
{
auto maxArray = m_grid.getMax();
auto maxArray = m_grid.maxPosition();
return std::vector<double>(maxArray.begin(), maxArray.end());
}
......
......@@ -11,8 +11,8 @@
///////////////////////////////////////////////////////////////////
#pragma once
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Material/MaterialProperties.hpp"
#include "Acts/Material/SurfaceMaterial.hpp"
#include "Acts/Utilities/BinUtility.hpp"
#include "Acts/Utilities/Definitions.hpp"
......@@ -24,7 +24,7 @@ namespace Acts {
/// MaterialProperties. This is not memory optimised as every bin
/// holds one material property object.
class BinnedSurfaceMaterial : public SurfaceMaterial
class BinnedSurfaceMaterial : public ISurfaceMaterial
{
public:
/// Default Constructor - deleted
......
......@@ -7,23 +7,22 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// HomogeneousSurfaceMaterial.h, Acts project
// HomogeneousSurfaceMaterial.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
#include <vector>
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Material/MaterialProperties.hpp"
#include "Acts/Material/SurfaceMaterial.hpp"
#include "Acts/Utilities/Definitions.hpp"
namespace Acts {
/// @class HomogeneousSurfaceMaterial
///
/// It extends the SurfaceMaterial base class and describes a simple homogeneous
/// material descriptions
class HomogeneousSurfaceMaterial : public SurfaceMaterial
/// It extends the ISurfaceMaterial virutal base class to describe
/// a simple homogeneous material on a surface
class HomogeneousSurfaceMaterial : public ISurfaceMaterial
{
public:
/// Default Constructor - defaulted
......@@ -98,10 +97,10 @@ public:
materialProperties(size_t ib0, size_t ib1) const final;
/// The inherited methods - for materialProperties access
using SurfaceMaterial::materialProperties;
using ISurfaceMaterial::materialProperties;
/// The interited methods - for scale access
using SurfaceMaterial::factor;
using ISurfaceMaterial::factor;
/// Output Method for std::ostream
///
......
// This file is part of the Acts project.
//
// Copyright (C) 2019 Acts project team
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// HomogeneousVolumeMaterial.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
#include "Acts/Material/IVolumeMaterial.hpp"
#include "Acts/Material/Material.hpp"
#include "Acts/Utilities/Definitions.hpp"
namespace Acts {
/// @class HomogeneousVolumeMaterial
///
/// It extends the IVolumeMaterial base class to describe a simple
/// homogeneous material in a volume
class HomogeneousVolumeMaterial : public IVolumeMaterial
{
public:
/// Default Constructor - defaulted
HomogeneousVolumeMaterial() = default;
/// Explicit constructor
///
/// @param material is the material held by this
HomogeneousVolumeMaterial(const Material& material) : m_material(material) {}
/// Access to actual material
///
/// @param position is the request position for the material call
/// @todo interface to change including 'cell'
const Material&
material(const Vector3D& /*position*/) const final
{
return m_material;
}
private:
Material m_material;
};
} // namespace
// This file is part of the Acts project.
//
// Copyright (C) 2019 Acts project team
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// IMaterialDecorator.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
namespace Acts {
class Surface;
class TrackingVolume;
/// @class IMaterialDecorator
///
/// Virtual base class for decorators that allow to load
/// material onto a TrackingGeometry. The geometry allows material
/// to be assigned either to surfaces or to volumes, hence there are
/// two decorate interface methots.
///
class IMaterialDecorator
{
public:
/// Virtual Destructor
virtual ~IMaterialDecorator() = default;
/// Decorate a surface
///
/// @param surface the non-cost surface that is decorated
virtual void
decorate(Surface& surface) const = 0;
/// Decorate a TrackingVolume
///
/// @param volume the non-cost volume that is decorated
virtual void
decorate(TrackingVolume& volume) const = 0;
};
} // namespace
\ No newline at end of file
// This file is part of the Acts project.
//
// Copyright (C) 2016-2018 Acts project team
// Copyright (C) 2016-2019 Acts project team
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// SurfaceMaterial.h, Acts project
// ISurfaceMaterial.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
......@@ -19,32 +19,31 @@
namespace Acts {
/// @class SurfaceMaterial
/// @class ISurfaceMaterial
///
/// Virtual base class of surface based material description
///
/// MaterialProperties that are associated to a surface,
/// extended by certain special representations (binned, homogenous)
///
/// The SurfaceMaterial class inherits from GeometryID,
/// in order to allow storing the material in a file and assigning it uniquely.
///
class SurfaceMaterial
class ISurfaceMaterial
{
public:
/// Constructor
SurfaceMaterial() = default;
ISurfaceMaterial() = default;
/// Constructor
///
/// @param splitFactor is the splitting ratio between pre/post update
SurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {}
ISurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {}
/// Destructor
virtual ~SurfaceMaterial() = default;
virtual ~ISurfaceMaterial() = default;
/// Scale operator
///
/// @param scale is the scale factor applied
virtual SurfaceMaterial&
virtual ISurfaceMaterial&
operator*=(double scale)
= 0;
......@@ -109,11 +108,11 @@ public:
/// @brief output stream operator
///
/// Prints information about this object to the output stream using the
/// virtual SurfaceMaterial::dump method
/// virtual ISurfaceMaterial::toStream method
///
/// @return modified output stream object
friend std::ostream&
operator<<(std::ostream& out, const SurfaceMaterial& sm)
operator<<(std::ostream& out, const ISurfaceMaterial& sm)
{
sm.toStream(out);
return out;
......@@ -128,8 +127,8 @@ protected:
};
inline double
SurfaceMaterial::factor(NavigationDirection pDir,
MaterialUpdateStage mStage) const
ISurfaceMaterial::factor(NavigationDirection pDir,
MaterialUpdateStage mStage) const
{
if (mStage == Acts::fullUpdate) {
return 1.;
......@@ -138,9 +137,9 @@ SurfaceMaterial::factor(NavigationDirection pDir,
}
inline MaterialProperties
SurfaceMaterial::materialProperties(const Vector2D& lp,
NavigationDirection pDir,
MaterialUpdateStage mStage) const
ISurfaceMaterial::materialProperties(const Vector2D& lp,
NavigationDirection pDir,
MaterialUpdateStage mStage) const
{
// The plain material properties associated to this bin
MaterialProperties plainMatProp = materialProperties(lp);
......@@ -156,9 +155,9 @@ SurfaceMaterial::materialProperties(const Vector2D& lp,
}
inline MaterialProperties
SurfaceMaterial::materialProperties(const Vector3D& gp,
NavigationDirection pDir,
MaterialUpdateStage mStage) const
ISurfaceMaterial::materialProperties(const Vector3D& gp,
NavigationDirection pDir,
MaterialUpdateStage mStage) const
{
// The plain material properties associated to this bin
MaterialProperties plainMatProp = materialProperties(gp);
......
// This file is part of the Acts project.
//
// Copyright (C) 2019 Acts project team
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// IVolumeMaterial.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
namespace Acts {
class Material;
/// @class IVolumeMaterial
///
/// Virtual base class of volume material description
//
/// Material associated with a Volume (homogenous, binned, interpolated)
class IVolumeMaterial
{
public:
/// Virtual Destructor
virtual ~IVolumeMaterial() = default;
/// Access to actual material
///
/// @param position is the request position for the material call
/// @todo interface to change including 'cell'
virtual const Material&
material(const Vector3D& position) const = 0;
};
} // namespace
// This file is part of the Acts project.
//
// Copyright (C) 2019 Acts project team
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <functional>
#include <optional>
#include "Acts/Material/Material.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Interpolation.hpp"
namespace Acts {
/// @brief Struct for mapping global 3D positions to material values
///
/// Global 3D positions are transformed into a @c DIM_POS Dimensional vector
/// which is used to look up the material classification value in the
/// underlying material map.
template <typename G>
struct MaterialMapper
{
public:
using Grid_t = G;
static constexpr size_t DIM_POS = Grid_t::DIM;
/// @brief Struct representing smallest grid unit in material grid
///
/// This type encapsulate all required information to perform linear
/// interpolation of material classification values within a 3D volume.
struct MaterialCell
{
/// Number of corner points defining the confining hyper-box
static constexpr unsigned int N = 1 << DIM_POS;
/// @brief Default constructor
///
/// @param [in] transformPos Mapping of global 3D coordinates onto grid
/// space
/// @param [in] lowerLeft Generalized lower-left corner of hyper box
/// (containing the minima of the hyper box along
/// each Dimension)
/// @param [in] upperRight Generalized upper-right corner of hyper box
/// (containing the maxima of the hyper box along
/// each Dimension)
/// @param [in] materialValues Material classification values at the hyper
/// box corners sorted in the canonical order defined in Acts::interpolate
MaterialCell(
std::function<ActsVectorD<DIM_POS>(const Vector3D&)> transformPos,
std::array<double, DIM_POS> lowerLeft,
std::array<double, DIM_POS> upperRight,
std::array<ActsVectorF<5>, N> materialValues)
: m_transformPos(std::move(transformPos))
, m_lowerLeft(std::move(lowerLeft))
, m_upperRight(std::move(upperRight))
, m_materialValues(std::move(materialValues))
{
}
/// @brief Retrieve material at given position
///
/// @param [in] position Global 3D position
/// @return Material at the given position
///
/// @pre The given @c position must lie within the current cell.
Material
getMaterial(const Vector3D& position) const
{
// defined in Interpolation.hpp
return Material(interpolate(m_transformPos(position),
m_lowerLeft,
m_upperRight,
m_materialValues));
}
/// @brief Check whether given 3D position is inside this cell
///
/// @param [in] position Global 3D position
/// @return @c true if position is inside the current cell,
/// otherwise @c false
bool
isInside(const Vector3D& position) const
{
const auto& gridCoordinates = m_transformPos(position);
for (unsigned int i = 0; i < DIM_POS; ++i) {
if (gridCoordinates[i] < m_lowerLeft.at(i)
|| gridCoordinates[i] >= m_upperRight.at(i)) {
return false;
}
}
return true;
}
private:
/// Geometric transformation applied to global 3D positions
std::function<ActsVectorD<DIM_POS>(const Vector3D&)> m_transformPos;
/// Generalized lower-left corner of the confining hyper-box
std::array<double, DIM_POS> m_lowerLeft;
/// Generalized upper-right corner of the confining hyper-box
std::array<double, DIM_POS> m_upperRight;
/// @brief Material component vectors at the hyper-box corners
///
/// @note These values must be order according to the prescription detailed
/// in Acts::interpolate.
std::array<ActsVectorF<5>, N> m_materialValues;
};
/// @brief Default constructor
///
/// @param [in] transformPos Mapping of global 3D coordinates (cartesian)
/// onto grid space
/// @param [in] grid Grid storing material classification values
MaterialMapper(
std::function<ActsVectorD<DIM_POS>(const Vector3D&)> transformPos,
Grid_t grid)
: m_transformPos(std::move(transformPos)), m_grid(std::move(grid))
{
}
/// @brief Retrieve material at given position
///
/// @param [in] position Global 3D position
/// @return Material at the given position
///
/// @pre The given @c position must lie within the range of the underlying
/// map.
Material
getMaterial(const Vector3D& position) const
{
return Material(m_grid.interpolate(m_transformPos(position)));
}
/// @brief Retrieve material cell for given position
///
/// @param [in] position Global 3D position
/// @return material cell containing the given global position
///
/// @pre The given @c position must lie within the range of the underlying
/// map.
MaterialCell
getMaterialCell(const Vector3D& position) const
{
const auto& gridPosition = m_transformPos(position);
size_t bin = m_grid.globalBinFromPosition(gridPosition);
const auto& indices = m_grid.localBinsFromPosition(bin);
const auto& lowerLeft = m_grid.lowerLeftBinEdge(indices);
const auto& upperRight = m_grid.upperRightBinEdge(indices);
// Loop through all corner points
constexpr size_t nCorners = 1 << DIM_POS;
std::array<ActsVectorF<5>, nCorners> neighbors;
const auto& cornerIndices = m_grid.closestPointsIndices(gridPosition);
size_t i = 0;
for (size_t index : cornerIndices) {
neighbors.at(i++) = m_grid.at(index);
}
return MaterialCell(
m_transformPos, lowerLeft, upperRight, std::move(neighbors));
}
/// @brief Get the number of bins for all axes of the map
///
/// @return Vector returning number of bins for all map axes
std::vector<size_t>
getNBins() const
{
auto nBinsArray = m_grid.numLocalBins();
return std::vector<size_t>(nBinsArray.begin(), nBinsArray.end());
}
/// @brief Get the minimum value of all axes of the map
///
/// @return Vector returning the minima of all map axes
std::vector<double>
getMin() const
{
auto minArray = m_grid.minPosition();
return std::vector<double>(minArray.begin(), minArray.end());
}
/// @brief Get the maximum value of all axes of the map
///
/// @return Vector returning the maxima of all map axes
std::vector<double>
getMax() const
{
auto maxArray = m_grid.maxPosition();
return std::vector<double>(maxArray.begin(), maxArray.end());
}
/// @brief Check whether given 3D position is inside look-up domain
///
/// @param [in] position Global 3D position
/// @return @c true if position is inside the defined look-up grid,
/// otherwise @c false
bool
isInside(const Vector3D& position) const
{
return m_grid.isInside(m_transformPos(position));
}
/// @brief Get a const reference on the underlying grid structure
///
/// @return Grid reference
const Grid_t&
getGrid() const
{
return m_grid;
}
private:
/// Geometric transformation applied to global 3D positions
std::function<ActsVectorD<DIM_POS>(const Vector3D&)> m_transformPos;
/// Grid storing material values
Grid_t m_grid;
};
/// @ingroup Material
/// @brief Interpolate material classification values from material values on a
/// given grid
///
/// This class implements a material service which is initialized by a
/// material map defined by:
/// - a list of material values on a regular grid in some n-Dimensional space,
/// - a transformation of global 3D coordinates onto this n-Dimensional
/// space.
/// - a transformation of local n-Dimensional material coordinates into
/// global (cartesian) 3D coordinates
///
/// The material value for a given global position is then determined by:
/// - mapping the position onto the grid,
/// - looking up the material classification values on the closest grid points,
/// - doing a linear interpolation of these values.
/// @warning Each classification number of the material is interpolated
/// independently and thus does not consider any correlations that exists
/// between these values. This might work out since the used material is already
/// a mean of the materials in a certain bin and can therewith be treated as a
/// collection of numbers.
/// @tparam G Type of the grid
template <typename Mapper_t>
class InterpolatedMaterialMap final
{
public:
/// @brief Temporary storage of a certain cell to improve material access
struct Cache
{
/// Stored material cell
std::optional<typename Mapper_t::MaterialCell> matCell;
/// Boolean statement if the cell is initialized
bool initialized = false;
};
/// @brief Create interpolated map
///
/// @param [in] mapper Material map
InterpolatedMaterialMap(Mapper_t& mapper) : m_mapper(std::move(mapper)) {}
/// @brief Retrieve material
///
/// @param [in] position Global 3D position
///
/// @return Material at given position
Material
getMaterial(const Vector3D& position) const
{
return m_mapper.getMaterial(position);
}
/// @brief Retrieve material
///
/// @param [in] position Global 3D position
/// @param [in,out] cache Cache object. Contains material cell used for
/// interpolation
///
/// @return material at given position
Material
getMaterial(const Vector3D& position, Cache& cache) const
{
if (!cache.initialized || !(*cache.matCell).isInside(position)) {
cache.matCell = getMaterialCell(position);
cache.initialized = true;
}
return (*cache.matCell).getMaterial(position);
}
/// @brief Retrieve material value & its "gradient"
///
/// @param [in] position Global 3D position
/// @param [out] derivative "Gradient" of material as (5x5) matrix
/// @return Material
///
/// @note Currently the derivative is not calculated
/// @todo return derivative
Material
getMaterialGradient(const Vector3D& position,
ActsMatrixD<5, 5>& /*derivative*/) const
{
return m_mapper.getMaterial(position);
}
/// @brief Retrieve material value & its "gradient"
///
/// @param [in] position Global 3D position
/// @param [out] derivative "Gradient" of material as (5x5) matrix
/// @param [in,out] cache Cache object. Contains cell used for
/// @return Material
///
/// @note Currently the derivative is not calculated
/// @note Cache is not used currently
/// @todo return derivative
Material
getMaterialGradient(const Vector3D& position,
ActsMatrixD<5, 5>& /*derivative*/,
Cache& /*cache*/) const
{
return m_mapper.getMaterial(position);
}
/// @brief Convenience method to access underlying material mapper
///
/// @return The material mapper
Mapper_t
getMapper() const
{
return m_mapper;
}
/// @brief Check whether given 3D position is inside look-up domain
///
/// @param [in] position Global 3D position
/// @return @c true if position is inside the defined map, otherwise @c false
bool
isInside(const Vector3D& position) const
{
return m_mapper.isInside(position);
}
private:
/// @brief Retrieve cell for given position
///
/// @param [in] position Global 3D position
/// @return Material cell containing the given global position
///
/// @pre The given @c position must lie within the range of the underlying
/// map.
typename Mapper_t::MaterialCell
getMaterialCell(const Vector3D& position) const
{
return m_mapper.getMaterialCell(position);
}
/// @brief object for global coordinate transformation and interpolation
///
/// This object performs the mapping of the global 3D coordinates onto the
/// material grid and the interpolation of the material component values on
/// close-by grid points.
Mapper_t m_mapper;
};
} // namespace Acts
......@@ -21,6 +21,7 @@
#include <utility>
#include <vector>
#include "Acts/Material/MaterialComposition.hpp"
#include "Acts/Utilities/Definitions.hpp"
namespace Acts {
......@@ -75,6 +76,16 @@ public:
m_store[5] = zOaTr;
}
Material(ActsVectorF<5> iMatData, MaterialComposition imc = {})
: Material(iMatData[0],
iMatData[1],
iMatData[2],
iMatData[3],
iMatData[4],
std::move(imc))
{
}
/// @brief Copy Constructor
///
/// @param mat copy constructor
......@@ -146,6 +157,7 @@ public:
{
return m_store[matZ];
}
/// @brief Access to rho
float
rho() const
......@@ -160,6 +172,15 @@ public:
return m_store[matZ_AR];
}
/// @brief Access to all classification numbers of the material
ActsVectorF<5>
classificationNumbers()
{
ActsVectorF<5> numbers;
numbers << X0(), L0(), A(), Z(), rho();
return numbers;
}
/// spit out as a string
std::string
toString() const
......@@ -204,4 +225,4 @@ Material::operator!=(const Material& mat) const
{
return !operator==(mat);
}
}
\ No newline at end of file
} // namespace Acts
\ No newline at end of file
......@@ -9,9 +9,9 @@
#pragma once
#include <sstream>
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Material/Material.hpp"
#include "Acts/Material/MaterialProperties.hpp"
#include "Acts/Material/SurfaceMaterial.hpp"
#include "Acts/Surfaces/Surface.hpp"
namespace Acts {
......@@ -81,10 +81,10 @@ struct MaterialCollector
return dstream.str();
});
if (state.navigation.currentSurface->associatedMaterial()) {
if (state.navigation.currentSurface->surfaceMaterial()) {
// get the material propertices and only continue
const MaterialProperties* mProperties
= state.navigation.currentSurface->associatedMaterial()->material(
= state.navigation.currentSurface->surfaceMaterial()->material(
stepper.position(state.stepping));
if (mProperties) {
// pre/post/full update
......@@ -95,7 +95,7 @@ struct MaterialCollector
return std::string("Update on start surface: post-update mode.");
});
prepofu
= state.navigation.currentSurface->associatedMaterial()->factor(
= state.navigation.currentSurface->surfaceMaterial()->factor(
state.stepping.navDir, postUpdate);
} else if (state.navigation.targetSurface
== state.navigation.currentSurface) {
......@@ -103,7 +103,7 @@ struct MaterialCollector
return std::string("Update on target surface: pre-update mode");
});
prepofu
= state.navigation.currentSurface->associatedMaterial()->factor(
= state.navigation.currentSurface->surfaceMaterial()->factor(
state.stepping.navDir, preUpdate);
} else {
debugLog(state, [&] {
......
......@@ -7,69 +7,69 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// SurfaceMaterialProxy.hpp, Acts project MaterialPlugins
// ProtoSurfaceMaterial.hpp, Acts project MaterialPlugins
///////////////////////////////////////////////////////////////////
#pragma once
#include "Acts/Material/SurfaceMaterial.hpp"
#include "Acts/Material/ISurfaceMaterial.hpp"
#include "Acts/Utilities/BinUtility.hpp"
namespace Acts {
/// @class SurfaceMaterialProxy
/// @class ProtoSurfaceMaterial
///
/// @brief proxy to SurfaceMaterial hand over BinUtility
///
/// The SurfaceMaterialProxy class acts as a proxy to the SurfaceMaterial
/// The ProtoSurfaceMaterial class acts as a proxy to the SurfaceMaterial
/// to mark the layers and surfaces on which the material should be mapped on
/// at construction time of the geometry and to hand over the granularity of
/// of the material map with the bin Utility.
class SurfaceMaterialProxy : public SurfaceMaterial
class ProtoSurfaceMaterial : public ISurfaceMaterial
{
public:
/// Constructor without BinUtility - homogenous material
SurfaceMaterialProxy() = default;
ProtoSurfaceMaterial() = default;
/// Constructor with BinUtility - multidimensional material
///
/// @param binUtility a BinUtility determining the granularity
/// and binning of the material on the surface/layer
SurfaceMaterialProxy(const BinUtility& binUtility);
ProtoSurfaceMaterial(const BinUtility& binUtility);
/// Copy constuctor
///
/// @param smproxy The source proxy
SurfaceMaterialProxy(const SurfaceMaterialProxy& smproxy) = default;
ProtoSurfaceMaterial(const ProtoSurfaceMaterial& smproxy) = default;
/// Copy move constuctor
///
/// @param smproxy The source proxy
SurfaceMaterialProxy(SurfaceMaterialProxy&& smproxy) = default;
ProtoSurfaceMaterial(ProtoSurfaceMaterial&& smproxy) = default;
/// Destructor
///
/// @param smproxy The source proxy
~SurfaceMaterialProxy() override = default;
~ProtoSurfaceMaterial() override = default;
/// Assignment operator
///
/// @param smproxy The source proxy
SurfaceMaterialProxy&
operator=(const SurfaceMaterialProxy& smproxy)
ProtoSurfaceMaterial&
operator=(const ProtoSurfaceMaterial& smproxy)
= default;
/// Assigment move operator
///
/// @param smproxy The source proxy
SurfaceMaterialProxy&
operator=(SurfaceMaterialProxy&& smproxy)
ProtoSurfaceMaterial&
operator=(ProtoSurfaceMaterial&& smproxy)
= default;
/// Scale operator
///
/// @param
SurfaceMaterialProxy&
ProtoSurfaceMaterial&
operator*=(double scale) final;
/// Return the BinUtility
......@@ -119,26 +119,26 @@ private:
}
inline const Acts::MaterialProperties&
Acts::SurfaceMaterialProxy::materialProperties(const Vector2D& /*lp*/) const
Acts::ProtoSurfaceMaterial::materialProperties(const Vector2D& /*lp*/) const
{
return (m_materialProperties);
}
inline const Acts::MaterialProperties&
Acts::SurfaceMaterialProxy::materialProperties(const Vector3D& /*gp*/) const
Acts::ProtoSurfaceMaterial::materialProperties(const Vector3D& /*gp*/) const
{
return (m_materialProperties);
}
inline const Acts::MaterialProperties&
Acts::SurfaceMaterialProxy::materialProperties(size_t /*ib0*/,
Acts::ProtoSurfaceMaterial::materialProperties(size_t /*ib0*/,
size_t /*ib1*/) const
{
return (m_materialProperties);
}
inline const Acts::BinUtility&
Acts::SurfaceMaterialProxy::binUtility() const
Acts::ProtoSurfaceMaterial::binUtility() const
{
return m_binUtility;
}
\ No newline at end of file
......@@ -73,7 +73,7 @@ struct DenseEnvironmentExtension
// Check existence of a volume with material
if (!state.navigation.currentVolume
|| !state.navigation.currentVolume->material()) {
|| !state.navigation.currentVolume->volumeMaterial()) {
return 0;
}
return 2;
......@@ -104,8 +104,10 @@ struct DenseEnvironmentExtension
// i = 0 is used for setup and evaluation of k
if (i == 0) {
// Set up container for energy loss
massSI = units::Nat2SI<units::MASS>(state.options.mass);
material = state.navigation.currentVolume->material().get();
auto volumeMaterial = state.navigation.currentVolume->volumeMaterial();
Vector3D position = stepper.position(state.stepping);
massSI = units::Nat2SI<units::MASS>(state.options.mass);
material = &(volumeMaterial->material(position));
initialMomentum
= units::Nat2SI<units::MOMENTUM>(stepper.momentum(state.stepping));
currentMomentum = initialMomentum;
......