CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
MTDDiskSectorBuilderFromDet Class Reference

#include <MTDDiskSectorBuilderFromDet.h>

Public Member Functions

BoundDiskSectoroperator() (const std::vector< const GeomDet *> &dets) const
 

Detailed Description

The trapezoid has the minimal size fully containing all Dets.

Definition at line 15 of file MTDDiskSectorBuilderFromDet.h.

Member Function Documentation

◆ operator()()

BoundDiskSector * MTDDiskSectorBuilderFromDet::operator() ( const std::vector< const GeomDet *> &  dets) const

Definition at line 81 of file MTDDiskSectorBuilderFromDet.cc.

References funct::abs(), GloballyPositioned< T >::position(), makeMuonMisalignmentScenario::rot, and PV3DBase< T, PVType, FrameType >::z().

81  {
82  // check that the dets are all at about the same z
83  float zcheck = dets.front()->surface().position().z();
84  constexpr double tol(0.5); // minimal safety check on z position of modules within a sector, width ~ 10 mm
85  for (auto const& idet : dets) {
86  float zdiff = zcheck - (*idet).surface().position().z();
87  if (std::abs(zdiff) > tol) {
88  edm::LogError("MTDDetLayers")
89  << " MTDDiskSectorBuilderFromDet: Trying to build sector from Dets at different z positions !! Delta_z = "
90  << zdiff;
91  }
92  }
93 
94  auto bo = computeBounds(dets);
95 
96  Surface::PositionType pos(bo.second.x(), bo.second.y(), bo.second.z());
97  Surface::RotationType rot = computeRotation(dets, pos);
98  return new BoundDiskSector(pos, rot, bo.first);
99 }
Log< level::Error, false > LogError
Abs< T >::type abs(const T &t)
Definition: Abs.h:22