Create the segmentation surfaces in X.
101 double lorentzAngleTan =
std::tan(lorentzAngle);
102 double lorentzPlaneShiftX = halfThickness*lorentzAngleTan;
113 std::shared_ptr<const Trk::SurfaceBounds> readoutPlaneBounds =
moduleBounds;
114 std::shared_ptr<const Trk::SurfaceBounds> counterPlaneBounds(
nullptr);
116 readoutPlaneTransform.translation() =
Amg::Vector3D(0.,0.,readoutDirection*halfThickness);
118 if (lorentzAngle == 0.){
120 counterPlaneTransform.translation() =
Amg::Vector3D(0.,0.,-readoutDirection*halfThickness);
123 double lorentzReducedHalfX =
m_activeBounds->halflengthX() - std::abs(lorentzPlaneShiftX);
124 std::shared_ptr<const Trk::SurfaceBounds> lorentzReducedBounds(std::make_shared<Trk::RectangleBounds>(lorentzReducedHalfX,
m_activeBounds->halflengthY()));
125 counterPlaneBounds = lorentzReducedBounds;
127 double counterPlaneShift = -readoutDirection*lorentzPlaneShiftX;
128 counterPlaneTransform.translation() =
Amg::Vector3D(counterPlaneShift,0.,-readoutDirection*halfThickness);
131 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(readoutPlaneTransform,readoutPlaneBounds));
132 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(counterPlaneTransform,counterPlaneBounds));
139 std::shared_ptr<const Trk::SurfaceBounds> xBinBounds(std::make_shared<Trk::RectangleBounds>(
m_activeBounds->halflengthY(),halfThickness));
141 double lorentzPlaneHalfX = std::abs(halfThickness/
std::cos(lorentzAngle));
143 std::shared_ptr<const Trk::SurfaceBounds> lorentzPlaneBounds = (lorentzAngle==0.) ? xBinBounds :
144 std::shared_ptr<const Trk::SurfaceBounds>(std::make_shared<Trk::RectangleBounds>(
m_activeBounds->halflengthY(),lorentzPlaneHalfX));
148 xBinRotationMatrix.col(0) = Amg::Vector3D::UnitY();
149 xBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
150 xBinRotationMatrix.col(2) = Amg::Vector3D::UnitX();
153 xBinRotationMatrix *
Amg::AngleAxis3D(lorentzAngle, Amg::Vector3D::UnitX()) : xBinRotationMatrix;
156 segmentationSurfacesX.reserve(
m_binsX);
157 for (
size_t ibinx = 0; ibinx <=
m_binsX; ++ibinx){
161 if (!ibinx || ibinx ==
m_binsX){
163 bool boundaryStraight = (lorentzAngle == 0. || (!ibinx && readoutDirection*lorentzAngle > 0.) || (ibinx==
m_binsX && readoutDirection*lorentzAngle < 0));
166 const Amg::RotationMatrix3D& boundaryXRotation = boundaryStraight ? xBinRotationMatrix : lorentzPlaneRotationMatrix;
170 std::shared_ptr<const Trk::SurfaceBounds> boundaryXBounds = boundaryStraight ? xBinBounds : lorentzPlaneBounds;
172 boundarySurfaces.push_back(std::make_shared<const Trk::PlaneSurface>(boundaryXTransform,boundaryXBounds));
176 Amg::Vector3D lorentzPlanePosition(cPosX-readoutDirection*lorentzPlaneShiftX, 0., 0.);
179 segmentationSurfacesX.push_back(std::make_shared<Trk::PlaneSurface>(lorentzPlaneTransform,lorentzPlaneBounds));
186 yBinRotationMatrix.col(0) = Amg::Vector3D::UnitX();
187 yBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
191 std::shared_ptr<const Trk::SurfaceBounds> yBinBounds(std::make_shared<Trk::RectangleBounds>(
m_activeBounds->halflengthX(),halfThickness));
193 segmentationSurfacesY.reserve(
m_binsY);
194 for (
size_t ibiny = 0; ibiny <=
m_binsY; ++ibiny){
201 if (ibiny == 0 || ibiny ==
m_binsY)
202 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,yBinBounds));
204 segmentationSurfacesY.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,yBinBounds));