Skip to content

Commit

Permalink
Merge pull request #30834 from fabiocos/fc-mtd-numbering
Browse files Browse the repository at this point in the history
MTD Geometry: updated GeometricTimingDet to remove the residual dependency on DDSolidShape
  • Loading branch information
cmsbuild authored Jul 28, 2020
2 parents 9fdf2e6 + abe561e commit a001841
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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));
}

0 comments on commit a001841

Please sign in to comment.