Create the segmentation surfaces in X.
102 double lorentzAngleTan =
std::tan(lorentzAngle);
103 double lorentzPlaneShiftX = halfThickness*lorentzAngleTan;
117 readoutPlaneTransform.translation() =
Amg::Vector3D(0.,0.,readoutDirection*halfThickness);
119 if (lorentzAngle == 0.){
121 counterPlaneTransform.translation() =
Amg::Vector3D(0.,0.,-readoutDirection*halfThickness);
124 double lorentzReducedHalfX =
m_activeBounds->halflengthX() - std::abs(lorentzPlaneShiftX);
126 counterPlaneBounds = lorentzReducedBounds;
128 double counterPlaneShift = -readoutDirection*lorentzPlaneShiftX;
129 counterPlaneTransform.translation() =
Amg::Vector3D(counterPlaneShift,0.,-readoutDirection*halfThickness);
132 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(readoutPlaneTransform,readoutPlaneBounds));
133 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(counterPlaneTransform,counterPlaneBounds));
142 double lorentzPlaneHalfX = std::abs(halfThickness/
std::cos(lorentzAngle));
149 xBinRotationMatrix.col(0) = Amg::Vector3D::UnitY();
150 xBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
151 xBinRotationMatrix.col(2) = Amg::Vector3D::UnitX();
154 xBinRotationMatrix *
Amg::AngleAxis3D(lorentzAngle, Amg::Vector3D::UnitX()) : xBinRotationMatrix;
157 segmentationSurfacesX.reserve(
m_binsX);
158 for (
size_t ibinx = 0; ibinx <=
m_binsX; ++ibinx){
162 if (!ibinx || ibinx ==
m_binsX){
164 bool boundaryStraight = (lorentzAngle == 0. || (!ibinx && readoutDirection*lorentzAngle > 0.) || (ibinx==
m_binsX && readoutDirection*lorentzAngle < 0));
167 const Amg::RotationMatrix3D& boundaryXRotation = boundaryStraight ? xBinRotationMatrix : lorentzPlaneRotationMatrix;
173 boundarySurfaces.push_back(std::shared_ptr<const Trk::PlaneSurface>(
new Trk::PlaneSurface(boundaryXTransform,boundaryXBounds)));
177 Amg::Vector3D lorentzPlanePosition(cPosX-readoutDirection*lorentzPlaneShiftX, 0., 0.);
180 segmentationSurfacesX.push_back(std::make_shared<Trk::PlaneSurface>(lorentzPlaneTransform,lorentzPlaneBounds));
187 yBinRotationMatrix.col(0) = Amg::Vector3D::UnitX();
188 yBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
194 segmentationSurfacesY.reserve(
m_binsY);
195 for (
size_t ibiny = 0; ibiny <=
m_binsY; ++ibiny){
202 if (ibiny == 0 || ibiny ==
m_binsY)
203 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,yBinBounds));
205 segmentationSurfacesY.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,yBinBounds));