Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MTD Geometry: updated GeometricTimingDet to remove the residual dependency on DDSolidShape #30834

Merged
merged 2 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Geometry/MTDNumberingBuilder/interface/GeometricTimingDet.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define Geometry_MTDNumberingBuilder_GeometricTimingDet_H

#include "CondFormats/GeometryObjects/interface/PGeometricTimingDet.h"
#include "DetectorDescription/Core/interface/DDSolidShapes.h"
#include "DetectorDescription/DDCMS/interface/DDSolidShapes.h"
#include "DataFormats/GeometrySurface/interface/Surface.h"
#include "DataFormats/GeometrySurface/interface/Bounds.h"
#include "DataFormats/DetId/interface/DetId.h"
Expand Down Expand Up @@ -99,7 +99,8 @@ class GeometricTimingDet {
double phi() const { return phi_; }
double rho() const { return rho_; }

DDSolidShape const& shape() const { return shape_; }
LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); }
cms::DDSolidShape shape_dd4hep() const { return shape_; }
GeometricTimingEnumType type() const { return type_; }
std::string const& name() const { return ddname_; }
// internal representaion
Expand Down Expand Up @@ -169,7 +170,7 @@ class GeometricTimingDet {
double phi_;
double rho_;
RotationMatrix rot_;
DDSolidShape shape_;
cms::DDSolidShape shape_;
nav_type ddd_;
std::string ddname_;
GeometricTimingEnumType type_;
Expand Down
9 changes: 4 additions & 5 deletions Geometry/MTDNumberingBuilder/src/GeometricTimingDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GeometricTimingDet::GeometricTimingDet(DDFilteredView* fv, GeometricTimingEnumTy
phi_(trans_.Phi()),
rho_(trans_.Rho()),
rot_(fv->rotation()),
shape_(fv->shape()),
shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())),
ddname_(fv->name()),
type_(type),
params_(fv->parameters()),
Expand All @@ -95,7 +95,7 @@ using namespace geant_units::operators;
GeometricTimingDet::GeometricTimingDet(cms::DDFilteredView* fv, GeometricTimingEnumType type)
: trans_(fv->translation()),
rot_(fv->rotation()),
shape_(DDSolidShape(static_cast<int>(fv->shape()))),
shape_(fv->shape()),
ddname_(fv->name()),
type_(type),
params_(fv->parameters()),
Expand Down Expand Up @@ -137,7 +137,7 @@ GeometricTimingDet::GeometricTimingDet(const PGeometricTimingDet::Item& onePGD,
onePGD.a31_,
onePGD.a32_,
onePGD.a33_),
shape_(static_cast<DDSolidShape>(onePGD.shape_)),
shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast<LegacySolidShape>(onePGD.shape_))),
ddd_(),
ddname_(onePGD.name_), //, "fromdb");
type_(type),
Expand Down Expand Up @@ -257,6 +257,5 @@ GeometricTimingDet::Rotation GeometricTimingDet::rotationBounds() const {
std::unique_ptr<Bounds> GeometricTimingDet::bounds() const {
const std::vector<double>& par = params_;
TrackerShapeToBounds shapeToBounds;
return std::unique_ptr<Bounds>(
shapeToBounds.buildBounds(cms::dd::name_from_value(cms::LegacySolidShapeMap, shape_), par));
return std::unique_ptr<Bounds>(shapeToBounds.buildBounds(shape_, par));
}