Skip to content
Snippets Groups Projects
Commit b7046914 authored by Robert Johannes Langenberg's avatar Robert Johannes Langenberg
Browse files

Merge branch '709-remove-redundant-geometrysignature' into 'master'

Remove redundant geometrySignature

Closes #709

See merge request !787
parents 09c4afc8 a27bed64
No related branches found
No related tags found
1 merge request!787Remove redundant geometrySignature
Pipeline #1492272 passed
// This file is part of the Acts project.
//
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project
//
// 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/.
///////////////////////////////////////////////////////////////////
// GeometrySignature.h, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
namespace Acts {
///@class GeometrySignature
///
/// An enumeration object that puts the signature
/// of a GeometryBuilder to all subvolumes
///
/// @todo will be in the future be replace by GeometryID mechanism
///
enum GeometrySignature {
Global = 0,
ID = 1,
BeamPipe = 2,
Calo = 3,
MS = 4,
Cavern = 5,
NumberOfSignatures = 6,
Unsigned = 99
};
enum GeometryType {
Static = 0,
Dense = 1,
DenseWithLayers = 1,
Detached = 2,
Master = 3,
NumberOfGeometryTypes = 3
};
} // namespace Acts
\ No newline at end of file
......@@ -11,9 +11,9 @@
///////////////////////////////////////////////////////////////////
#pragma once
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryID.hpp"
#include "Acts/Geometry/GeometrySignature.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include <functional>
......@@ -106,12 +106,6 @@ class TrackingGeometry {
const std::function<void(const Acts::Surface*)>& visitor) const;
private:
/// Geometry Builder busineess: the geometry builder has to sign
///
/// @param geosit is the volume signature
/// @param geotype is the volume navigation type
void sign(GeometrySignature geosit, GeometryType geotype = Static);
/// The known world - and the beamline
TrackingVolumePtr m_world;
std::shared_ptr<const PerigeeSurface> m_beam;
......
......@@ -17,7 +17,6 @@
#include "Acts/Geometry/BoundarySurfaceT.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryID.hpp"
#include "Acts/Geometry/GeometrySignature.hpp"
#include "Acts/Geometry/Layer.hpp"
#include "Acts/Geometry/Volume.hpp"
#include "Acts/Material/IVolumeMaterial.hpp"
......@@ -336,18 +335,6 @@ class TrackingVolume : public Volume {
/// @return If it has a BVH or not.
bool hasBoundingVolumeHierarchy() const;
/// Sign the volume - the geometry builder has to do that
///
/// @param geosign is the volume signature
/// @param geotype is the volume navigation type
void sign(GeometrySignature geosign, GeometryType geotype = Static);
/// return the Signature
GeometrySignature geometrySignature() const;
/// return the Signature
GeometryType geometryType() const;
/// Register the color code
///
/// @param icolor is a color number
......@@ -462,12 +449,6 @@ class TrackingVolume : public Volume {
/// Volumes to glue Volumes from the outside
GlueVolumesDescriptor* m_glueVolumeDescriptor{nullptr};
/// The Signature done by the GeometryBuilder
GeometrySignature m_geometrySignature{Unsigned};
/// The gometry type for the navigation schema
GeometryType m_geometryType{NumberOfGeometryTypes};
/// Volume name for debug reasons & screen output
std::string m_name;
......@@ -511,14 +492,6 @@ TrackingVolume::confinedVolumes() const {
return m_confinedVolumes;
}
inline GeometrySignature TrackingVolume::geometrySignature() const {
return m_geometrySignature;
}
inline GeometryType TrackingVolume::geometryType() const {
return m_geometryType;
}
inline void TrackingVolume::registerColorCode(unsigned int icolor) {
m_colorCode = icolor;
}
......
......@@ -160,8 +160,6 @@ std::shared_ptr<Acts::TrackingVolume> Acts::CuboidVolumeBuilder::buildVolume(
std::make_shared<const Transform3D>(trafo), bounds, cfg.volumeMaterial,
std::move(layArr), nullptr, cfg.trackingVolumes, cfg.name);
}
trackVolume->sign(GeometrySignature::Global);
return trackVolume;
}
......@@ -221,6 +219,5 @@ Acts::MutableTrackingVolumePtr Acts::CuboidVolumeBuilder::trackingVolume(
MutableTrackingVolumePtr mtvp(TrackingVolume::create(
std::make_shared<const Transform3D>(trafo), volume, trVolArr, "World"));
mtvp->sign(GeometrySignature::Global);
return mtvp;
}
\ No newline at end of file
......@@ -468,9 +468,7 @@ Acts::CylinderVolumeBuilder::trackingVolume(
// now create the new container volume
volume = tvHelper->createContainerTrackingVolume(gctx, totalContainer);
}
// sign the volume and return it
volume->sign(GeometrySignature(m_cfg.volumeSignature));
// now return what you have
return volume;
}
......
......@@ -46,12 +46,6 @@ const Acts::TrackingVolume* Acts::TrackingGeometry::highestTrackingVolume()
return (m_world.get());
}
void Acts::TrackingGeometry::sign(GeometrySignature geosit,
GeometryType geotype) {
auto mutableWorld = std::const_pointer_cast<TrackingVolume>(m_world);
mutableWorld->sign(geosit, geotype);
}
const Acts::TrackingVolume* Acts::TrackingGeometry::trackingVolume(
const std::string& name) const {
auto sVol = m_trackingVolumes.begin();
......
......@@ -104,33 +104,6 @@ const Acts::TrackingVolume* Acts::TrackingVolume::lowestTrackingVolume(
return this;
}
void Acts::TrackingVolume::sign(GeometrySignature geosign,
GeometryType geotype) {
// never overwrite what is already signed, that's a crime
if (m_geometrySignature == Unsigned) {
m_geometrySignature = geosign;
}
m_geometryType = geotype;
// confined static volumes
if (m_confinedVolumes) {
for (auto& volumesIter : (m_confinedVolumes->arrayObjects())) {
auto mutableVolumesIter =
std::const_pointer_cast<TrackingVolume>(volumesIter);
mutableVolumesIter->sign(geosign, geotype);
}
}
// finally for confined dense volumes
if (!m_confinedDenseVolumes.empty()) {
for (auto& volumesIter : m_confinedDenseVolumes) {
auto mutableVolumesIter =
std::const_pointer_cast<TrackingVolume>(volumesIter);
mutableVolumesIter->sign(geosign, geotype);
}
}
}
const Acts::TrackingVolumeBoundaries& Acts::TrackingVolume::boundarySurfaces()
const {
return (m_boundarySurfaces);
......
......@@ -123,7 +123,6 @@ struct CubicTrackingGeometry {
auto trackVolume1 = TrackingVolume::create(
std::make_shared<const Transform3D>(trafoVol1), boundsVol, nullptr,
std::move(layArr1), nullptr, {}, "Volume 1");
trackVolume1->sign(GeometrySignature::Global);
// Build volume for surfaces with positive x-values
Transform3D trafoVol2(Transform3D::Identity());
......@@ -140,8 +139,6 @@ struct CubicTrackingGeometry {
std::make_shared<const Transform3D>(trafoVol2), boundsVol, nullptr,
std::move(layArr2), nullptr, {}, "Volume 2");
trackVolume2->sign(GeometrySignature::Global);
// Glue volumes
trackVolume2->glueTrackingVolume(
geoContext, BoundarySurfaceFace::negativeFaceYZ, trackVolume1.get(),
......@@ -175,8 +172,6 @@ struct CubicTrackingGeometry {
TrackingVolume::create(std::make_shared<const Transform3D>(trafoWorld),
worldVol, trVolArr, "World"));
mtvpWorld->sign(GeometrySignature::Global);
// Build and return tracking geometry
return std::shared_ptr<TrackingGeometry>(
new Acts::TrackingGeometry(mtvpWorld));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment