Skip to content
Snippets Groups Projects
Commit daacb491 authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2:
Browse files

Add 2D measurements to the space point logic

parent 23b416c3
No related branches found
No related tags found
No related merge requests found
......@@ -19,8 +19,10 @@ namespace MuonR4{
if (primaryMeas->type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
m_driftR = primaryMeas->localPosition<1>()[0];
}
uvcov(0,0) = primaryMeas->localCovariance<1>()[0];
}
if (primaryMeas->numDimensions() == 1) {
uvcov(0,0) = primaryMeas->localCovariance<1>()[0];
}
Jac.col(0) = xAOD::channelNormalInChamber(gctx, primaryMeas).block<2,1>(0,0);
if (secondaryMeas) {
/// Position of the measurements expressed in the chamber frame
......@@ -40,9 +42,11 @@ namespace MuonR4{
const xAOD::MdtDriftCircle* dc = static_cast<const xAOD::MdtDriftCircle*>(primaryMeas);
uvcov(1,1) = 0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash());
} else if (primaryMeas->type() == xAOD::UncalibMeasType::RpcStripType) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(primaryMeas);
uvcov(1,1) = strip->measuresPhi() ? 0.5* strip->readoutElement()->stripPhiLength():
0.5* strip->readoutElement()->stripEtaLength();
if (primaryMeas->numDimensions() == 1) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(primaryMeas);
uvcov(1,1) = strip->measuresPhi() ? 0.5* strip->readoutElement()->stripPhiLength():
0.5* strip->readoutElement()->stripEtaLength();
}
} else if (primaryMeas->type() == xAOD::UncalibMeasType::TgcStripType) {
const xAOD::TgcStrip* strip = static_cast<const xAOD::TgcStrip*>(primaryMeas);
if (strip->measuresPhi()) {
......@@ -54,8 +58,17 @@ namespace MuonR4{
uvcov(1,1) = std::pow(uvcov(1,1), 2);
}
Jac = Jac.inverse().eval();
/// In case of 2D measurements like sTgc-pads or BI-RPC strips we can directly take the covariance
/// from the measurement itself. To indicate that the space point measures both, eta & phi coordinate
/// set the secondary measurement to be the primary one
if (primaryMeas->numDimensions() == 2) {
uvcov = xAOD::toEigen(primaryMeas->localCovariance<2>());
m_secondaryMeas = m_primaryMeas;
}
AmgSymMatrix(2) cov = Jac * uvcov * Jac.transpose();
m_measUncerts = Amg::Vector2D(std::sqrt(cov(0,0)), std::sqrt(cov(1,1)));
}
const xAOD::UncalibratedMeasurement* MuonSpacePoint::primaryMeasurement() const {
......
......@@ -5,6 +5,8 @@
#include "GeoModelHelpers/throwExcept.h"
#include "xAODMuonPrepData/MdtDriftCircle.h"
#include "xAODMuonPrepData/RpcStrip.h"
#include "xAODMuonPrepData/RpcStrip2D.h"
#include "xAODMuonPrepData/RpcMeasurement.h"
#include "xAODMuonPrepData/TgcStrip.h"
#include "xAODMuonPrepData/MMCluster.h"
#include "xAODMuonPrepData/sTgcMeasurement.h"
......@@ -32,7 +34,7 @@ namespace xAOD{
if (meas->type() == xAOD::UncalibMeasType::MdtDriftCircleType){
return static_cast<const xAOD::MdtDriftCircle*>(meas)->readoutElement();
} else if (meas->type() == xAOD::UncalibMeasType::RpcStripType) {
return static_cast<const xAOD::RpcStrip*>(meas)->readoutElement();
return static_cast<const xAOD::RpcMeasurement*>(meas)->readoutElement();
} else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
return static_cast<const xAOD::TgcStrip*>(meas)->readoutElement();
} else if (meas->type() == xAOD::UncalibMeasType::MMClusterType) {
......@@ -53,8 +55,15 @@ namespace xAOD{
const xAOD::MdtDriftCircle* dc = static_cast<const xAOD::MdtDriftCircle*>(meas);
return toChamberTransform(gctx, dc).translation();
} else if (meas->type() == xAOD::UncalibMeasType::RpcStripType) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(meas);
return toChamberTransform(gctx, strip) *(strip->localPosition<1>()[0] * Amg::Vector3D::UnitX());
if (meas->numDimensions() == 1) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(meas);
return toChamberTransform(gctx, strip) *(strip->localPosition<1>()[0] * Amg::Vector3D::UnitX());
} else {
const xAOD::RpcStrip2D* strip = static_cast<const xAOD::RpcStrip2D*>(meas);
Amg::Vector3D locPos{Amg::Vector3D::Zero()};
locPos.block<2,1>(0,0) = xAOD::toEigen(strip->localPosition<2>());
return toChamberTransform(gctx, strip) * locPos;
}
} else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
const xAOD::TgcStrip* strip = static_cast<const xAOD::TgcStrip*>(meas);
return toChamberTransform(gctx, strip) *(strip->localPosition<1>()[0] * Amg::Vector3D::UnitX());
......@@ -70,7 +79,7 @@ namespace xAOD{
const xAOD::MdtDriftCircle* dc = static_cast<const xAOD::MdtDriftCircle*>(meas);
return toChamberTransform(gctx,dc).linear() * Amg::Vector3D::UnitZ();
} else if (meas->type() == xAOD::UncalibMeasType::RpcStripType) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(meas);
const xAOD::RpcMeasurement* strip = static_cast<const xAOD::RpcMeasurement*>(meas);
return toChamberTransform(gctx, strip).linear() * Amg::Vector3D::UnitY();
} else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
const xAOD::TgcStrip* strip = static_cast<const xAOD::TgcStrip*>(meas);
......@@ -91,7 +100,7 @@ namespace xAOD{
const xAOD::MdtDriftCircle* dc = static_cast<const xAOD::MdtDriftCircle*>(meas);
return toChamberTransform(gctx,dc).linear() * Amg::Vector3D::UnitY();
} else if (meas->type() == xAOD::UncalibMeasType::RpcStripType) {
const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(meas);
const xAOD::RpcMeasurement* strip = static_cast<const xAOD::RpcMeasurement*>(meas);
return toChamberTransform(gctx, strip).linear() * Amg::Vector3D::UnitX();
} else if (meas->type() == xAOD::UncalibMeasType::TgcStripType) {
const xAOD::TgcStrip* strip = static_cast<const xAOD::TgcStrip*>(meas);
......
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