Skip to content
Snippets Groups Projects
Commit 8a8b9559 authored by James Smith's avatar James Smith
Browse files

Sweep changes from !47748

parent 91ccf48e
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!48271Manually sweep changes from !47748 - Tracking: Customisation of hitLocalToLocal for polar co-ordinates
......@@ -39,7 +39,7 @@ class SiLocalPosition;
class SiIntersect;
enum DetectorShape {
Box=0, Trapezoid, Annulus,Other
Box=0, Trapezoid, Annulus,Other,PolarAnnulus
};
enum DetectorType {
......
......@@ -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>
......
......@@ -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();
......
......@@ -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
......
......@@ -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 );
......
......@@ -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));
......
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment