diff --git a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h index e400d0bc50fb86997b2ee5cf1c717b6fca59ebca..3f5aefca2a7e645404c7dc6ff4f31659b6d0edea 100644 --- a/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h +++ b/DetectorDescription/ReadoutGeometryBase/ReadoutGeometryBase/DetectorDesign.h @@ -39,7 +39,7 @@ class SiLocalPosition; class SiIntersect; enum DetectorShape { - Box=0, Trapezoid, Annulus,Other + Box=0, Trapezoid, Annulus,Other,PolarAnnulus }; enum DetectorType { diff --git a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx index e834f246281e61ffc44df29009938a8198e23e45..5140b4671caf6572535c24effbaf033c93e97307 100644 --- a/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx +++ b/DetectorDescription/ReadoutGeometryBase/src/SolidStateDetectorElementBase.cxx @@ -143,7 +143,18 @@ using Trk::distDepth; if (!dir.m_etaDirection) xEta = -xEta; if (!dir.m_phiDirection) xPhi = -xPhi; - return Amg::Vector2D(xPhi, xEta); + auto result = Amg::Vector2D(xPhi, xEta); + + if (m_design->shape() == InDetDD::PolarAnnulus) { // Do conversion to polar co-ords as well + double x = result.x(); + double y = result.y(); + + double r = std::hypot(x,y); + double phi = std::atan2(y,x); + result = Amg::Vector2D(phi,r); + } + + return result; } HepGeom::Point3D<double> diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index be06c20fc52f2cd3d948871b1204bd1a3c980999..c73530757ca323d26cfe30dba9f3f947e2274f26 100644 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -475,26 +475,28 @@ namespace InDetDD { //Since these are barrel, endcap, sensor-type, specific, might be better for these to be calculated in the design() //However, not clear how one could do that for the annulus calculation which uses global frame double sinStereo = 0.; + auto designShape = m_siDesign->shape(); if (isBarrel()) { sinStereo = this->phiAxis().z(); } else { // endcap - if (m_siDesign->shape() == InDetDD::Annulus) { //built-in Stereo angle for Annulus shape sensor - Amg::Vector3D sensorCenter = m_siDesign->sensorCenter(); - //Below retrieved method will return -sin(m_Stereo), thus sinStereolocal = sin(m_Stereo) - double sinStereoReco = - (m_siDesign->sinStripAngleReco(sensorCenter[1], sensorCenter[0])); - double cosStereoReco = sqrt(1-sinStereoReco*sinStereoReco); - double radialShift = sensorCenter[0]; - //The focus of all strips in the local reco frame - Amg::Vector2D localfocus(-radialShift*sinStereoReco, radialShift - radialShift*cosStereoReco); - //The focus of all strips in the global frame - Amg::Vector3D globalfocus(globalPosition(localfocus)); - //The direction of x-axis of the Strip frame in the global frame - const Amg::Vector3D& center = this->center(); - Amg::Vector3D globalSFxAxis =(center - globalfocus)/radialShift; - //Stereo angle is the angle between global radial direction and the x-axis of the Strip frame in the global frame - sinStereo = (center.y() * globalSFxAxis.x() - center.x() * globalSFxAxis.y()) / center.perp(); + if (designShape == InDetDD::Annulus) { //built-in Stereo angle for Annulus shape sensor + Amg::Vector3D sensorCenter = m_siDesign->sensorCenter(); + //Below retrieved method will return -sin(m_Stereo), thus sinStereolocal = sin(m_Stereo) + double sinStereoReco = - (m_siDesign->sinStripAngleReco(sensorCenter[1], sensorCenter[0])); + double cosStereoReco = sqrt(1-sinStereoReco*sinStereoReco); + double radialShift = sensorCenter[0]; + //The focus of all strips in the local reco frame + Amg::Vector2D localfocus(-radialShift*sinStereoReco, radialShift - radialShift*cosStereoReco); + //The focus of all strips in the global frame + Amg::Vector3D globalfocus(globalPosition(localfocus)); + //The direction of x-axis of the Strip frame in the global frame + const Amg::Vector3D& center = this->center(); + Amg::Vector3D globalSFxAxis =(center - globalfocus)/radialShift; + //Stereo angle is the angle between global radial direction and the x-axis of the Strip frame in the global frame + sinStereo = (center.y() * globalSFxAxis.x() - center.x() * globalSFxAxis.y()) / center.perp(); } - else { + // else if (designShape == InDetDD::PolarAnnulus) {} // Polar specialisation in future + else { // barrel const Amg::Vector3D& etaAxis = this->etaAxis(); const Amg::Vector3D& center = this->center(); sinStereo = (center.y() * etaAxis.x() - center.x() * etaAxis.y()) / center.perp(); diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx index 91aced7afe6f31120ec01df604f94154c1995267..b4356af7e9e91d3113f84126ca4078fc4883f65b 100644 --- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx +++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/src/StripStereoAnnulusDesign.cxx @@ -456,7 +456,8 @@ void StripStereoAnnulusDesign::distanceToDetectorEdge(SiLocalPosition const & po DetectorShape StripStereoAnnulusDesign::shape() const { - return InDetDD::Annulus; + if (m_usePC) return InDetDD::PolarAnnulus; + else return InDetDD::Annulus; } double StripStereoAnnulusDesign::stripLength(const InDetDD::SiCellId &cellId) const diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/ITkStripClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/ITkStripClusterOnTrackTool.cxx index 0906c8a557a11bc2e411b9f821b8e98b16edc0da..d020dd08b07d4e9a2369a1eb7f07824475cf9ad8 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/ITkStripClusterOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/ITkStripClusterOnTrackTool.cxx @@ -121,6 +121,8 @@ ITk::StripClusterOnTrackTool::correct const Trk::SurfaceBounds *bounds = &trackPar.associatedSurface().bounds(); Trk::SurfaceBounds::BoundsType boundsType = bounds->type(); + auto designShape = EL->design().shape(); + // Get local position of track // Amg::Vector2D loct = trackPar.localPosition(); @@ -231,7 +233,7 @@ ITk::StripClusterOnTrackTool::correct } // rotation for endcap ITkStrip - if (EL->design().shape() == InDetDD::Trapezoid || EL->design().shape() == InDetDD::Annulus) { + if (designShape == InDetDD::Trapezoid || designShape == InDetDD::Annulus) { double sn = EL->sinStereoLocal(SC->localPosition()); double sn2 = sn * sn; double cs2 = 1. - sn2; @@ -245,9 +247,12 @@ ITk::StripClusterOnTrackTool::correct } oldcov = mat; } + // else if (designShape == InDetDD::PolarAnnulus) {// polar rotation for endcap} Amg::MatrixX cov(oldcov); - if (EL->design().shape() != InDetDD::Trapezoid && EL->design().shape()!=InDetDD::Annulus) { // barrel + // barrel + // if (designShape != InDetDD::Trapezoid && designShape!=InDetDD::Annulus && designShape != InDetDD::PolarAnnulus) { + if (designShape == InDetDD::Box) { Trk::DefinedParameter lpos1dim(SC->localPosition().x(), Trk::locX); locpar = (m_option_make2dimBarrelClusters) ? Trk::LocalParameters(SC->localPosition()) :// PRDformation does 2-dim @@ -261,9 +266,8 @@ ITk::StripClusterOnTrackTool::correct SG::ReadCondHandle<RIO_OnTrackErrorScaling> error_scaling( m_stripErrorScalingKey ); cov = check_cast<SCTRIO_OnTrackErrorScaling>(*error_scaling)->getScaledCovariance( cov, false, 0.0); } - } - - else { // endcap + // } else if (designShape == InDetDD::PolarAnnulus) { // polar specialisation + } else { // endcap locpar = Trk::LocalParameters(SC->localPosition()); if (!m_stripErrorScalingKey.key().empty()) { SG::ReadCondHandle<RIO_OnTrackErrorScaling> error_scaling( m_stripErrorScalingKey ); diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx index 749fa29c77da87dfc0d88ef0640d02aad9970bc4..fef18a322a5237ec40953e2e4fb990e28e6a5ad7 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx @@ -536,8 +536,9 @@ ClusterMakerTool::sctCluster(const Identifier& clusterID, break; } + auto designShape = element->design().shape(); // rotation for endcap SCT - if(element->design().shape() == InDetDD::Trapezoid || element->design().shape() == InDetDD::Annulus) { + if(designShape == InDetDD::Trapezoid || designShape == InDetDD::Annulus) { double sn = element->sinStereoLocal(localPos); double sn2 = sn*sn; double cs2 = 1.-sn2; @@ -547,7 +548,7 @@ ClusterMakerTool::sctCluster(const Identifier& clusterID, errorMatrix.fillSymmetric(0,0,cs2*v0+sn2*v1); errorMatrix.fillSymmetric(0,1,sn*sqrt(cs2)*(v0-v1)); errorMatrix.fillSymmetric(1,1,sn2*v0+cs2*v1); - } + } //else if (designShape == InDetDD::PolarAnnulus) {// Polar rotation for endcap} SCT_Cluster* newCluster = new SCT_Cluster( clusterID, locpos, rdoList, width, element, std::move(errorMatrix)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx index a1c3f3d8fdafc030e6659ac82d9216031f1f9a7d..3665d411d5b4fc80e5969782771ff35b2c6952ef 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx @@ -427,6 +427,7 @@ namespace InDet { const Amg::Transform3D& T2 = element2->transform(); Amg::Vector3D C = element1->center() ; bool isAnnulus = (element1->design().shape() == InDetDD::Annulus); + // bool isPolar = (element1->design().shape() == InDetDD::PolarAnnulus); double x12 = T1(0,0)*T2(0,0)+T1(1,0)*T2(1,0)+T1(2,0)*T2(2,0) ; double r = isAnnulus ? std::sqrt(C[0]*C[0]+C[1]*C[1]) : std::sqrt(T1(0,3)*T1(0,3)+T1(1,3)*T1(1,3));