23 size_t numCellsX,
size_t numCellsY) :
24 m_activeBounds(std::move(mBounds)),
25 m_binUtility(nullptr),
37 (*m_binUtility) += yBinUtility;
49 std::vector< std::shared_ptr< const Trk::Surface> >& segmentationSurfacesX,
50 std::vector< std::shared_ptr< const Trk::Surface> >& segmentationSurfacesY,
60 std::unique_ptr<Trk::TrapezoidBounds> moduleTrapBounds(
new Trk::TrapezoidBounds(m_activeBounds->minHalflengthX(),m_activeBounds->maxHalflengthX(),m_activeBounds->halflengthY()));
69 readoutPlaneTransform.translation() =
Amg::Vector3D(0.,0.,readoutDirection*halfThickness);
71 counterPlaneBounds = moduleBounds;
72 counterPlaneTransform.translation() =
Amg::Vector3D(0.,0.,-readoutDirection*halfThickness);
75 boundarySurfaces.push_back(std::shared_ptr<const Trk::PlaneSurface>(
new Trk::PlaneSurface(readoutPlaneTransform,readoutPlaneBounds)));
76 boundarySurfaces.push_back(std::shared_ptr<const Trk::PlaneSurface>(
new Trk::PlaneSurface(counterPlaneTransform,counterPlaneBounds)));
80 double pitchX = 2.*(m_activeBounds->maxHalflengthX()+m_activeBounds->minHalflengthX())*0.5/m_binsX;
84 xBinRotationMatrix.col(0) = Amg::Vector3D::UnitY();
85 xBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
86 xBinRotationMatrix.col(2) = Amg::Vector3D::UnitX();
89 segmentationSurfacesX.reserve(m_binsX);
90 for (
size_t ibinx = 0; ibinx <= m_binsX; ++ibinx){
92 double cPosX = -(m_activeBounds->minHalflengthX()+m_activeBounds->maxHalflengthX())*0.5+ibinx*pitchX;
96 double stereoLocal = asin(sinStereoLocal(
Amg::Vector2D(cPosX, 0.)));
101 std::unique_ptr<Trk::RectangleBounds> xBinBounds(
new Trk::RectangleBounds(m_activeBounds->halflengthY()/
cos(stereoLocal),halfThickness));
103 if (ibinx==0 || ibinx == m_binsX)
104 boundarySurfaces.push_back(std::shared_ptr<const Trk::PlaneSurface>(
new Trk::PlaneSurface(binTransform,&*xBinBounds)));
106 segmentationSurfacesX.push_back(std::shared_ptr<const Trk::PlaneSurface>(
new Trk::PlaneSurface(binTransform,&*xBinBounds)));
112 yBinRotationMatrix.col(0) = Amg::Vector3D::UnitX();
113 yBinRotationMatrix.col(1) = Amg::Vector3D::UnitZ();
116 double pitchY = 2.*m_activeBounds->halflengthY()/m_binsY;
118 segmentationSurfacesY.reserve(m_binsY);
119 for (
size_t ibiny = 0; ibiny <= m_binsY; ++ibiny){
121 double binPosY = -m_activeBounds->halflengthY()+ibiny*pitchY;
124 std::unique_ptr<Trk::RectangleBounds> yBinBounds(
new Trk::RectangleBounds(localPitchX*m_binsX*0.5,halfThickness));
127 if (ibiny == 0 || ibiny == m_binsY)
128 boundarySurfaces.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,&*yBinBounds));
130 segmentationSurfacesY.push_back(std::make_shared<Trk::PlaneSurface>(binTransform,&*yBinBounds));
138 double bX = (m_binsX>1) ? m_binUtility->binPosition(projectLocX(
Amg::Vector2D(dCell.first, dCell.second)),0.,0) : 0.;
139 double bY = (m_binsY>1) ? m_binUtility->binPosition(dCell.second,0.,1) : 0.;
147 double halfThickness,
148 int readoutDirection,
149 double lorentzAngle)
const
154 double lorentzDeltaX = -readoutDirection*stepCenter.z()*
std::tan(lorentzAngle);
156 double driftInZ = (halfThickness-readoutDirection*stepCenter.z());
157 double driftLength = std::abs(driftInZ/
std::cos(lorentzAngle));
159 Amg::Vector2D stepCenterProjected(stepCenter.x()+lorentzDeltaX,stepCenter.y());
164 return Trk::DigitizationStep((endStep-startStep).
mag(),driftLength,dCell,startStep,endStep,stepCenterProjected,cellCenter);