ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MuonR4::SpacePointCalibrator Class Reference

#include <SpacePointCalibrator.h>

Inheritance diagram for MuonR4::SpacePointCalibrator:
Collaboration diagram for MuonR4::SpacePointCalibrator:

Public Types

enum  ProjectorType {
  ProjectorType::e1DimNoTime = 0, ProjectorType::e1DimRotNoTime = 1, ProjectorType::e2DimNoTime = 2, ProjectorType::e1DimWithTime = 3,
  ProjectorType::e1DimRotWithTime = 4, ProjectorType::e2DimWithTime = 5
}
 Enum encoding the possible projectors used in ATLAS. More...
 
template<typename trajectory_t >
using TrackState_t = typename Acts::MultiTrajectory< trajectory_t >::TrackStateProxy
 Abbrivation of the track state proxy type. More...
 
template<typename trajectory_t >
using ConstTrackState_t = typename Acts::MultiTrajectory< trajectory_t >::ConstTrackStateProxy
 Abbrivation of the const track state proxy type. More...
 

Public Member Functions

StatusCode initialize () override final
 
CalibSpacePointPtr calibrate (const EventContext &ctx, const SpacePoint *spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
 
CalibSpacePointPtr calibrate (const EventContext &ctx, const CalibratedSpacePoint &spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
 
CalibSpacePointVec calibrate (const EventContext &ctx, const std::vector< const SpacePoint * > &spacePoints, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
 
CalibSpacePointVec calibrate (const Acts::CalibrationContext &ctx, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay, const CalibSpacePointVec &spacePoints) const override final
 
void updateSigns (const Amg::Vector3D &trackPos, const Amg::Vector3D &trackDir, CalibSpacePointVec &hitsToCalib) const override final
 
double driftVelocity (const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
 
double driftAcceleration (const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
 
void calibrateSourceLink (const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, ActsTrk::MutableTrackContainer::TrackStateProxy state) const override final
 
void stampSignsOnMeasurements (const xAOD::MuonSegment &segment) const override final
 
template<std::size_t Dim, typename trajectory_t , typename pos_t , typename cov_t >
void setState (const ProjectorType projector, const pos_t &locpos, const cov_t &cov, Acts::SourceLink link, TrackState_t< trajectory_t > &trackState) const
 Copy the local position & covariance into the Acts track state proxy. More...
 

Private Member Functions

void calibrateCombinedPrd (const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::CombinedMuonStrip *combinedPrd, ActsTrk::MutableTrackContainer::TrackStateProxy state) const
 Calibrates the track states from a combined muon strip. More...
 
std::pair< double, double > calibrateMM (const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::MMCluster &cluster, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
 Calibrates the position and covariance of a MicroMegas (MM) cluster. More...
 
std::pair< double, double > calibratesTGC (const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::sTgcStripCluster &cluster, std::optional< double > posAlongTheStrip, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
 Calibrates the position and covariance of an sTGC (small-strip Thin Gap Chamber) cluster. More...
 

Private Attributes

SG::ReadHandleKey< ActsTrk::GeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
 access to the ACTS geometry context More...
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< IMdtCalibrationToolm_mdtCalibrationTool {this, "MdtCalibrationTool", ""}
 
ToolHandle< Muon::INSWCalibToolm_nswCalibTool {this, "NSWCalibTool", ""}
 
ToolHandle< Muon::IMMClusterBuilderToolm_clusterBuilderToolMM {this, "MMClusterBuilder", ""}
 
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 
Gaudi::Property< double > m_muonPropSpeed {this, "PropagationSpeed", 1./ Gaudi::Units::c_light }
 Assumed propagation velocity of the muon through the detector. More...
 
Gaudi::Property< double > m_rpcSignalVelocity
 How fast does an electron signal travel along an rpc strip
More...
 
Gaudi::Property< double > m_rpcTimeResolution
 
Gaudi::Property< bool > m_useRpcTime {this, "useRpcTime", false}
 Load the Rpc time on the track states for the track fit. More...
 
Gaudi::Property< bool > m_useTgcTime
 Load the Tgc bunch crossing ID on the track states. More...
 
Gaudi::Property< bool > m_usesTgcTime
 
Gaudi::Property< bool > m_MdtSignFromSegment
 

Static Private Attributes

constexpr static std::array< Acts::BoundSubspaceIndices, 6 > s_boundSpaceIndices
 Array to map the Projector types to the bound index configurations used by the ATLAS detector measurements. More...
 

Detailed Description

Definition at line 30 of file SpacePointCalibrator.h.

Member Typedef Documentation

◆ ConstTrackState_t

template<typename trajectory_t >
using ActsTrk::detail::MeasurementCalibratorBase::ConstTrackState_t = typename Acts::MultiTrajectory<trajectory_t>::ConstTrackStateProxy
inherited

Abbrivation of the const track state proxy type.

Definition at line 44 of file MeasurementCalibratorBase.h.

◆ TrackState_t

template<typename trajectory_t >
using ActsTrk::detail::MeasurementCalibratorBase::TrackState_t = typename Acts::MultiTrajectory<trajectory_t>::TrackStateProxy
inherited

Abbrivation of the track state proxy type.

Definition at line 41 of file MeasurementCalibratorBase.h.

Member Enumeration Documentation

◆ ProjectorType

Enum encoding the possible projectors used in ATLAS.

Their integer representations correspond to the element index in the s_boundSpaceIndices member

Enumerator
e1DimNoTime 
e1DimRotNoTime 

Project out solely the locX (Applies to Itk strips, Rpc, Tgc, sTgc, Mm)

e2DimNoTime 

Project out solely the locY - Complementary projector if the strip plane is rotated (Applies to Itk endcap strips, Rpc, Tgc, sTgc)

e1DimWithTime 

Project out the two spatial coordinates - (Applies to ITk pixel, BI-Rpc, sTgc pad)

e1DimRotWithTime 

Project out the locX & time coordinate - (Applies to Rpc, Tgc, Mm, sTgc)

e2DimWithTime 

Project out the locY & time coordinate - (Applies to Rpc, Tgc, sTgc)

Definition at line 29 of file MeasurementCalibratorBase.h.

29  {
30  e1DimNoTime = 0,
31  e1DimRotNoTime = 1,
32  e2DimNoTime = 2,
34  e1DimWithTime = 3,
35  e1DimRotWithTime = 4,
36  e2DimWithTime = 5,
37  };

Member Function Documentation

◆ calibrate() [1/4]

CalibSpacePointVec MuonR4::SpacePointCalibrator::calibrate ( const Acts::CalibrationContext &  ctx,
const Amg::Vector3D seedPosInChamb,
const Amg::Vector3D seedDirInChamb,
const double  timeDelay,
const CalibSpacePointVec spacePoints 
) const
finaloverride

Definition at line 82 of file SpacePointCalibrator.cxx.

86  {
87  CalibSpacePointVec newCalib{};
88  const EventContext* ctx = cctx.get<const EventContext*>();
89  newCalib.reserve(spacePoints.size());
90  for (const CalibSpacePointPtr& sp : spacePoints){
91  newCalib.emplace_back(calibrate(*ctx, *sp, segPos, segDir, timeDelay));
92  }
93  return newCalib;
94  }

◆ calibrate() [2/4]

CalibSpacePointPtr MuonR4::SpacePointCalibrator::calibrate ( const EventContext &  ctx,
const CalibratedSpacePoint spacePoint,
const Amg::Vector3D seedPosInChamb,
const Amg::Vector3D seedDirInChamb,
const double  timeDelay 
) const
finaloverride

Definition at line 63 of file SpacePointCalibrator.cxx.

67  {
68  CalibSpacePointPtr calibSP{};
69  if (spacePoint.type() != xAOD::UncalibMeasType::Other){
70  calibSP = calibrate(ctx, spacePoint.spacePoint(), segPos, segDir, timeDelay);
71  } else {
72  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint);
73  }
74  if (spacePoint.fitState() == State::Outlier) {
75  calibSP->setFitState(State::Outlier);
76  } else if (spacePoint.fitState() == State::Duplicate) {
77  calibSP->setFitState(State::Duplicate);
78  }
79  return calibSP;
80  }

◆ calibrate() [3/4]

CalibSpacePointPtr MuonR4::SpacePointCalibrator::calibrate ( const EventContext &  ctx,
const SpacePoint spacePoint,
const Amg::Vector3D seedPosInChamb,
const Amg::Vector3D seedDirInChamb,
const double  timeDelay 
) const
finaloverride

In valid drift radius has been created

Transform the space point into the local frame to calculate the propagation time towards the readout

Average the time

Add the difference to the covariance though

Definition at line 96 of file SpacePointCalibrator.cxx.

100  {
101 
102  const ActsTrk::GeometryContext* gctx{nullptr};
103  if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
104  return nullptr;
105  }
106  const Amg::Vector3D& spPos{spacePoint->localPosition()};
107  const Amg::Transform3D& locToGlob{spacePoint->msSector()->localToGlobalTrans(*gctx)};
108  const Amg::Vector3D& chDir{spacePoint->sensorDirection()};
109 
110  // Adjust the space point position according to the external seed. But only if the space point
111  // is a 1D strip
112  Amg::Vector3D calibSpPos = spacePoint->dimension() == 2 ? spPos
113  : spPos + Amg::intersect<3>(posInChamb, dirInChamb, spPos, chDir).value_or(0) * chDir;
114 
115  SpacePoint::Cov_t cov = spacePoint->covariance();
116  CalibSpacePointPtr calibSP{};
117  ATH_MSG_VERBOSE("Calibrate "<<(*spacePoint) <<" -> updated pos "<<Amg::toString(calibSpPos));
118  switch (spacePoint->type()) {
120  const Amg::Vector3D locClosestApproach = posInChamb
121  + Amg::intersect<3>(spPos, chDir,
122  posInChamb, dirInChamb).value_or(0) * dirInChamb;
123 
124  Amg::Vector3D closestApproach{locToGlob* locClosestApproach};
125  const double timeOfArrival = closestApproach.mag() * c_inv + timeOffset;
126 
127  if (ATH_LIKELY(spacePoint->dimension() == 1)) {
128  auto* dc = static_cast<const xAOD::MdtDriftCircle*>(spacePoint->primaryMeasurement());
129  MdtCalibInput calibInput{*dc, *gctx};
130  calibInput.setTrackDirection(locToGlob.linear() * dirInChamb,
131  Acts::abs(dirInChamb.phi() - 90._degree) > 1.e-7 );
132  calibInput.setTimeOfFlight(timeOfArrival);
133  calibInput.setClosestApproach(std::move(closestApproach));
134  ATH_MSG_VERBOSE("Parse hit calibration "<<m_idHelperSvc->toString(dc->identify())<<", "<<calibInput);
135  MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(ctx, calibInput);
136  ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
137  State fitState{State::Valid};
140  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
141  <<std::endl<<calibInput<<std::endl<<calibOutput);
142  fitState = State::FailedCalib;
143  cov[Acts::toUnderlying(AxisDefs::etaCov)] = dc->readoutElement()->innerTubeRadius();
144  } else {
145  cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.driftRadiusUncert());
146  }
147  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
148  calibSP->setCovariance(cov);
149  calibSP->setDriftRadius(calibOutput.driftRadius());
150  } else {
151  auto* dc = static_cast<const xAOD::MdtTwinDriftCircle*>(spacePoint->primaryMeasurement());
152  MdtCalibInput calibInput{*dc, *gctx};
153  calibInput.setClosestApproach(closestApproach);
154  calibInput.setTimeOfFlight(timeOfArrival);
155 
156  MdtCalibInput twinInput{dc->twinIdentify(), dc->twinAdc(), dc->twinTdc(), dc->readoutElement(), *gctx};
157  twinInput.setClosestApproach(closestApproach);
158  twinInput.setTimeOfFlight(timeOfArrival);
159 
160  MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(ctx,
161  std::move(calibInput),
162  std::move(twinInput));
163 
164  State fitState{State::Valid};
166  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
167  <<std::endl<<calibOutput);
168  cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(dc->readoutElement()->innerTubeRadius());
169  cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()));
170  fitState = State::FailedCalib;
171  } else {
172  cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.uncertPrimaryR());
173  cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(calibOutput.sigmaZ());
174  }
175  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
176  calibSP->setCovariance(cov);
177  calibSP->setDriftRadius(calibOutput.primaryDriftR());
178  }
179  break;
180  }
182  auto* strip = static_cast<const xAOD::RpcMeasurement*>(spacePoint->primaryMeasurement());
183 
185  const Amg::Transform3D toGasGap{strip->readoutElement()->globalToLocalTrans(*gctx, strip->layerHash()) * locToGlob};
186  const Amg::Vector3D lPos = toGasGap * calibSpPos;
187  using EdgeSide = MuonGMR4::RpcReadoutElement::EdgeSide;
188  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
189 
190  cov[Acts::toUnderlying(AxisDefs::timeCov)] = Acts::square(m_rpcTimeResolution);
191 
192  const double time1 = strip->time()
193  - strip->readoutElement()->distanceToEdge(strip->layerHash(), lPos,
194  EdgeSide::readOut) /m_rpcSignalVelocity;
195 
196  if (spacePoint->dimension() == 2) {
197  auto* strip2 = static_cast<const xAOD::RpcMeasurement*>(spacePoint->secondaryMeasurement());
198 
199  const double time2 = strip2->time() -
200  strip2->readoutElement()->distanceToEdge(strip2->layerHash(),lPos, EdgeSide::readOut)/m_rpcSignalVelocity;
202  calibSP->setTimeMeasurement(0.5*(time1 + time2));
204  cov[Acts::toUnderlying(AxisDefs::timeCov)] += Acts::square(0.5*(time1 - time2));
205  }
206  calibSP->setCovariance(cov);
207  ATH_MSG_VERBOSE("Create rpc space point "<<m_idHelperSvc->toString(strip->identify())<<", dimension "<<spacePoint->dimension()
208  << ", at "<<Amg::toString(calibSP->localPosition())<<", uncalib time: "
209  <<strip->time()<<", calib time: "<<calibSP->time()<<" cov " <<calibSP->covariance());
210  break;
211  }
213  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
214  calibSP->setCovariance(cov);
215  break;
216  }
218  const xAOD::MMCluster* cluster = static_cast<const xAOD::MMCluster*>(spacePoint->primaryMeasurement());
219  Amg::Vector3D globalPos{locToGlob * posInChamb};
220  Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
221 
222  std::pair<double, double> calibPosCov {calibrateMM(ctx, *gctx, *cluster, globalPos, globalDir)};
223 
224  ATH_MSG_DEBUG("Calibrated pos and cov" << calibPosCov.first << " " << calibPosCov.second);
225  cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibPosCov.second;
226  Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTrans(*gctx, cluster->layerHash())};
227 
228  // since we want to take the second coordiante from the external estimate we need to transform the sp posiiton to the layer frame, replace the precission coordinate and transform back
229  Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
230  ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
231  calibSpPosInLayer.x() = calibPosCov.first;
232  ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
233  calibSpPos = toChamberTrans * calibSpPosInLayer;
234 
235  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
236  calibSP->setCovariance(cov);
237  ATH_MSG_DEBUG("calibrated MM cluster "<<m_idHelperSvc->toString(cluster->identify()) << " loc x old " << cluster->localPosition<1>()[0] << " new loc x " << calibSP->localPosition()[1] << "cov " << calibSP->covariance());
238 
239  break;
240  }
242  const auto* cluster = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->primaryMeasurement());
243 
244  // We do not apply any correction for pads or wire only space points
245  if (cluster->channelType() != sTgcIdHelper::sTgcChannelTypes::Strip) {
246  ATH_MSG_DEBUG("Calibrating an sTGC Pad or wire " << m_idHelperSvc->toString(cluster->identify()));
247  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
248  calibSP->setCovariance(cov);
249  break;
250  }
251 
252  std::optional<double> posAlongTheStrip{std::nullopt};
253 
254  // check if the space point is a strip/wire combination and take the position along the strip from the wire measurement
255  if(spacePoint->secondaryMeasurement()) {
256  const auto* secMeas = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->secondaryMeasurement());
257  ATH_MSG_VERBOSE("Using secondary measurement "<< m_idHelperSvc->toString(secMeas->identify())<<" for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
258  posAlongTheStrip =static_cast<double>(spacePoint->secondaryMeasurement()->localPosition<1>()[0]);
259  } else {
260  ATH_MSG_VERBOSE("No secondary measurement for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
261  }
262 
263  Amg::Vector3D globalPos{locToGlob * posInChamb};
264  Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
265 
266  const auto* stripClus = static_cast<const xAOD::sTgcStripCluster*>(cluster);
267  const auto [calibPos, calibCov] = calibratesTGC(ctx, *gctx, *stripClus, posAlongTheStrip, globalPos, globalDir);
268 
269  ATH_MSG_DEBUG("Calibrated pos and cov" << calibPos << " " << calibCov);
270  cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibCov;
271  Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTrans(*gctx, cluster->layerHash())};
272 
273  // since we want to take the second coordiante from the external estimate we need to transform the sp posiiton to the layer frame, replace the precission coordinate and transform back
274  Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
275  ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
276  calibSpPosInLayer.x() = calibPos;
277  ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
278  calibSpPos = toChamberTrans * calibSpPosInLayer;
279 
280  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
281  calibSP->setCovariance(cov);
282  ATH_MSG_DEBUG("calibrated sTGC cluster "<<m_idHelperSvc->toString(cluster->identify()) << " loc x old " << cluster->localPosition<1>()[0] << " new loc x " << calibSP->localPosition()[1] << "cov " << calibSP->covariance());
283  break;
284  }
285 
286  default:
287  ATH_MSG_WARNING("Do not know how to calibrate "<<m_idHelperSvc->toString(spacePoint->identify()));
288  }
289  return calibSP;
290  }

◆ calibrate() [4/4]

CalibSpacePointVec MuonR4::SpacePointCalibrator::calibrate ( const EventContext &  ctx,
const std::vector< const SpacePoint * > &  spacePoints,
const Amg::Vector3D seedPosInChamb,
const Amg::Vector3D seedDirInChamb,
const double  timeDelay 
) const
finaloverride

Definition at line 292 of file SpacePointCalibrator.cxx.

296  {
297  CalibSpacePointVec calibSpacePoints{};
298  calibSpacePoints.reserve(spacePoints.size());
299  for(const SpacePoint* spacePoint : spacePoints) {
300  CalibSpacePointPtr hit = calibrate(ctx, spacePoint, posInChamb, dirInChamb, timeOffset);
301  if (hit) {
302  calibSpacePoints.push_back(std::move(hit));
303  }
304  }
305  return calibSpacePoints;
306  }

◆ calibrateCombinedPrd()

void MuonR4::SpacePointCalibrator::calibrateCombinedPrd ( const EventContext &  ctx,
const ActsTrk::GeometryContext gctx,
const xAOD::CombinedMuonStrip combinedPrd,
ActsTrk::MutableTrackContainer::TrackStateProxy  state 
) const
private

Calibrates the track states from a combined muon strip.

It's a pseudo measurement composed out of two 1D strip measurements residing in the same gas gap (Relevant for Rpc/Tgc/sTgc)

Parameters
ctxThe event context providing the necessary conditions and event-specific information.
gctxPointer to the ActsTrk::GeometryContext, used for geometry-related transformations.
combinedPrdPointer to the measurement carrying the actual prds which are to be combined on the track state
stateThe proxy to the actual track state to fill

Apply the stereo transform to the covariance

Definition at line 372 of file SpacePointCalibrator.cxx.

375  {
376  const auto sl = ActsTrk::detail::xAODUncalibMeasCalibrator::pack(combinedPrd);
377  if (combinedPrd->type() == xAOD::UncalibMeasType::RpcStripType) {
378  if (m_useRpcTime) {
379  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
380  }
381  Amg::Vector2D cmbPos{combinedPrd->primaryStrip()->localPosition<1>()[0],
382  combinedPrd->secondaryStrip()->localPosition<1>()[0]};
383  AmgSymMatrix(2) cmbCov{AmgSymMatrix(2)::Identity()};
384  cmbCov (0, 0) = combinedPrd->primaryStrip()->localCovariance<1>()(0,0);
385  cmbCov (1, 1) = combinedPrd->secondaryStrip()->localCovariance<1>()(0,0);
386  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
387 
388 
389  } else if (combinedPrd->type() == xAOD::UncalibMeasType::TgcStripType) {
390  if (m_useTgcTime) {
391  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
392  }
393  const auto* wireMeas = static_cast<const xAOD::TgcStrip*>(combinedPrd->primaryStrip());
394  const auto* stripMeas = static_cast<const xAOD::TgcStrip*>(combinedPrd->secondaryStrip());
395 
396  const auto& radialDesign = stripMeas->readoutElement()->stripLayout(stripMeas->layerHash());
397  const auto& wireDesign = wireMeas->readoutElement()->wireGangLayout(wireMeas->layerHash());
398 
399  const double dirDots = radialDesign.stripDir(stripMeas->channelNumber()).dot(wireDesign.stripNormal());
401  AmgSymMatrix(2) stereoTrf{AmgSymMatrix(2)::Identity()};
402  const double invDist = 1. / (1. - Acts::square(dirDots));
403  stereoTrf(0, 0) = stereoTrf(1, 1) = invDist;
404  stereoTrf(0, 1) = stereoTrf(1, 0) = -dirDots * invDist;
405 
406  Amg::Vector2D cmbPos{wireMeas->localPosition<1>()[0],
407  stripMeas->localPosition<1>()[0]};
408  AmgSymMatrix(2) cmbCov{AmgSymMatrix(2)::Identity()};
409  cmbCov (0, 0) = wireMeas->localCovariance<1>()(0,0);
410  cmbCov (1, 1) = stripMeas->localCovariance<1>()(0,0);
411 
412  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime, cmbPos,
413  stereoTrf*cmbCov*stereoTrf.transpose(), sl, state);
414  } else {
415  THROW_EXCEPTION("Undefined uncalibrated measurement "
416  <<m_idHelperSvc->toString(xAOD::identify(combinedPrd)));
417  }
418  }

◆ calibrateMM()

std::pair< double, double > MuonR4::SpacePointCalibrator::calibrateMM ( const EventContext &  ctx,
const ActsTrk::GeometryContext gctx,
const xAOD::MMCluster cluster,
const Amg::Vector3D globalPos,
const Amg::Vector3D globalDir 
) const
private

Calibrates the position and covariance of a MicroMegas (MM) cluster.

Parameters
ctxThe event context providing the necessary conditions and event-specific information.
gctxPointer to the ActsTrk::GeometryContext, used for geometry-related transformations.
clusterPointer to the xAOD::MMCluster representing the MicroMegas cluster to be calibrated.
globalPosThe global position from an external measurement.
globalDirThe global position from an external measurement.
calibLocPosThe calibrated local position of the cluster (output parameter).
calibLocCovThe calibrated local covariance of the cluster (output parameter).

Definition at line 327 of file SpacePointCalibrator.cxx.

331  {
332  std::vector<NSWCalib::CalibratedStrip> calibClus;
333  StatusCode sc = m_nswCalibTool->calibrateClus(ctx, gctx, cluster, globalPos, calibClus);
334  if(sc.isFailure()) {
335  ATH_MSG_WARNING("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
336  return std::make_pair(0., 0.);
337  }
338 
339  Amg::Vector2D locPos{cluster.localPosition<1>()[0] * Amg::Vector2D::UnitX()};
341 
342  Amg::MatrixX calibCov{};
343  calibCov.resize(1,1);
344  calibCov(0,0) = cluster.localCovariance<1>()(0, 0);
345  ATH_MSG_DEBUG("old loc pos " << locPos[0] << " old cov" << calibCov(0,0) );
346 
347  Muon::IMMClusterBuilderTool::RIO_Author rotAuthor = m_clusterBuilderToolMM->getCalibratedClusterPosition(ctx, calibClus, locDir ,locPos, calibCov);
348  if(rotAuthor == Muon::IMMClusterBuilderTool::RIO_Author::unKnownAuthor){
349  THROW_EXCEPTION("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
350  }
351  ATH_MSG_DEBUG("new loc pos " << locPos[0] << " new cov" << calibCov(0,0) );
352  return std::make_pair(locPos[0], calibCov(0,0));
353  }

◆ calibrateSourceLink()

void MuonR4::SpacePointCalibrator::calibrateSourceLink ( const Acts::GeometryContext &  geoctx,
const Acts::CalibrationContext &  cctx,
const Acts::SourceLink &  link,
ActsTrk::MutableTrackContainer::TrackStateProxy  state 
) const
finaloverride

Construct bound track parameters to fetch the global track position

Only the combined muonstrip has zero dimensions

Vast majority of the measurements are ordinary drift tubes

Invalid drift radius has been created

Twin tube case

Legacy BM / BO chambers

BI clusters

Definition at line 419 of file SpacePointCalibrator.cxx.

422  {
423 
425  const Acts::BoundTrackParameters trackPars{trackState.referenceSurface().getSharedPtr(),
426  trackState.parameters(), trackState.covariance(),
428 
429 
430  const auto* muonMeas = ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(link);
431  const ActsTrk::GeometryContext* gctx = geoctx.get<const ActsTrk::GeometryContext*>();
432  const EventContext* ctx = cctx.get<const EventContext*>();
433  ATH_MSG_VERBOSE("Calibrate measurement "<<m_idHelperSvc->toString(xAOD::identify(muonMeas))
434  <<" @ surface "<<trackState.referenceSurface().geometryId());
436  if (muonMeas->numDimensions() == 0u) {
437  calibrateCombinedPrd(*ctx, *gctx, static_cast<const xAOD::CombinedMuonStrip*>(muonMeas),
438  trackState);
439  return;
440 
441  }
442  const Amg::Vector3D trackPos{trackPars.position(geoctx)};
443  const Amg::Vector3D trackDir{trackPars.direction()};
444 
445  switch (muonMeas->type()){
446  using enum xAOD::UncalibMeasType;
447  case MdtDriftCircleType: {
448  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(muonMeas);
449  MdtCalibInput calibInput{*dc, *gctx};
450  calibInput.setClosestApproach(trackPos);
451  //calibInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
452  calibInput.setTrackDirection(trackDir, true);
453  const double driftSign = m_MdtSignFromSegment ?
454  static_cast<double>(dec_trackSign(*dc)) :
455  sign(trackPars.parameters()[Acts::eBoundLoc0]);
456 
458  if (ATH_LIKELY(muonMeas->numDimensions() == 1)) {
459  MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(*ctx, calibInput);
460  ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
461  AmgVector(1) pos{AmgVector(1)::Zero()};
462  AmgSymMatrix(1) cov{AmgSymMatrix(1)::Identity()};
465  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
466  <<std::endl<<calibInput<<std::endl<<calibOutput);
467  cov(Acts::eBoundLoc0,Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
468  } else {
469  pos[Acts::eBoundLoc0] = driftSign*calibOutput.driftRadius();
470  cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.driftRadiusUncert(), 2);
471  }
472  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
473  }
475  else {
476  const auto* twinDC = static_cast<const xAOD::MdtTwinDriftCircle*>(muonMeas);
477  MdtCalibInput twinInput{twinDC->twinIdentify(), twinDC->twinAdc(), twinDC->twinTdc(), twinDC->readoutElement(), *gctx};
478  twinInput.setClosestApproach(trackPos);
479  twinInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
480 
481  MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(*ctx,
482  std::move(calibInput),
483  std::move(twinInput));
485  AmgSymMatrix(2) locCov{AmgSymMatrix(2)::Identity()};
487  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
488  <<std::endl<<calibOutput);
489  locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
490  locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
491  } else {
492  locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.uncertPrimaryR(), 2);
493  locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(calibOutput.sigmaZ(), 2);
494  locPos[Acts::eBoundLoc0] = driftSign*calibOutput.primaryDriftR();
495  locPos[Acts::eBoundLoc1] = calibOutput.locZ();
496  }
497  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime, locPos, locCov, link, trackState);
498  }
499  break;
500  } case RpcStripType: {
501  const auto* rpcClust = static_cast<const xAOD::RpcMeasurement*>(muonMeas);
503  if (ATH_LIKELY(rpcClust->numDimensions() == 1)) {
504 
505  if (!m_useRpcTime) {
506  const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
508  setState<1, ActsTrk::MutableTrackStateBackend>(proj,
509  rpcClust->localPosition<1>(),
510  rpcClust->localCovariance<1>(), link, trackState);
511  } else {
512  AmgVector(2) measPars{AmgVector(2)::Zero()};
513  AmgSymMatrix(2) measCov{AmgSymMatrix(2)::Identity()};
514  measPars[0] = rpcClust->localPosition<1>()[0];
515  measCov(0,0) = rpcClust->localCovariance<1>()(0, 0);
516  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
517  measCov(1,1) = std::pow(m_rpcTimeResolution, 2);
518  const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotWithTime
520  setState<2, ActsTrk::MutableTrackStateBackend>(proj,
521  measPars, measCov, link, trackState);
522  }
523  }
525  else {
526  if (!m_useRpcTime) {
527  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime,
528  rpcClust->localPosition<2>(),
529  rpcClust->localCovariance<2>(), link, trackState);
530  } else {
531  AmgVector(3) measPars{AmgVector(3)::Zero()};
532  AmgSymMatrix(3) measCov{AmgSymMatrix(3)::Identity()};
533  measPars.block<2,1>(0,0) = xAOD::toEigen(rpcClust->localPosition<2>());
534  measCov.block<2,2>(0,0) = xAOD::toEigen(rpcClust->localCovariance<2>());
535  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
536  measCov(2,2) = std::pow(m_rpcTimeResolution, 2);
537  setState<3, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimWithTime,
538  measPars, measCov, link, trackState);
539  }
540  }
541  break;
542  } case TgcStripType: {
543  const auto* tgcClust = static_cast<const xAOD::TgcStrip*>(muonMeas);
544  if (!m_useTgcTime) {
545  const auto proj = tgcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
547  setState<1, ActsTrk::MutableTrackStateBackend>(proj,
548  tgcClust->localPosition<1>(),
549  tgcClust->localCovariance<1>(), link, trackState);
550  } else {
551  ATH_MSG_WARNING("Tgc time calibration to be implemented...");
552  }
553  break;
554  }
555  case MMClusterType: {
556  const auto* mmClust = static_cast<const xAOD::MMCluster*>(muonMeas);
557  std::pair<double, double> calibPosCov{calibrateMM(*ctx,* gctx, *mmClust, trackPos, trackDir)};
558  AmgVector(1) pos{AmgVector(1)(calibPosCov.first)};
559  AmgSymMatrix(1) cov{AmgSymMatrix(1)(calibPosCov.second)};
560 
561  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime,
562  pos, cov, link, trackState);
563  break;
564  } case sTgcStripType: {
565  const auto* stgcClust = static_cast<const xAOD::sTgcMeasurement*>(muonMeas);
566 
567  if(stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
568  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime,
569  muonMeas->localPosition<1>(),
570  muonMeas->localCovariance<1>(), link, trackState);
571 
572  } else if(stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
573  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime,
574  stgcClust->localPosition<2>(),
575  stgcClust->localCovariance<2>(), link, trackState);
576 
577 
578  } else { // strips
579  const auto stgCluster = static_cast<const xAOD::sTgcStripCluster*>(muonMeas);
580  std::pair<double, double> calibPosCov{calibratesTGC(*ctx, *gctx, *stgCluster, std::nullopt, trackPos, trackDir)};
581  if(!m_usesTgcTime) {
582  AmgVector(1) pos{calibPosCov.first};
583  AmgSymMatrix(1) cov{calibPosCov.second};
584  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime,
585  pos,
586  cov, link, trackState);
587  } else {
588  ATH_MSG_WARNING("sTGC time calibration to be implemented...");
589  AmgVector(2) pos{AmgVector(2)::Zero()};
590  AmgSymMatrix(2) cov{AmgSymMatrix(2)::Zero()};
591  pos[0] = calibPosCov.first;
592  pos[1] = stgCluster->time();
593  cov(0,0) = calibPosCov.second;
594  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
595  cov(1,1) = std::pow(25 /*ns*/, 2);
596 
597  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimWithTime,
598  pos,
599  cov, link, trackState);
600  }
601  break;
602 
603  }
604  THROW_EXCEPTION("sTGC measurements are not yet implemented");
605  break;
606  } default: {
607  THROW_EXCEPTION("The parsed measurement is not a muon measurement. Please check.");
608  }
609  }
610  }

◆ calibratesTGC()

std::pair< double, double > MuonR4::SpacePointCalibrator::calibratesTGC ( const EventContext &  ctx,
const ActsTrk::GeometryContext gctx,
const xAOD::sTgcStripCluster cluster,
std::optional< double >  posAlongTheStrip,
const Amg::Vector3D globalPos,
const Amg::Vector3D globalDir 
) const
private

Calibrates the position and covariance of an sTGC (small-strip Thin Gap Chamber) cluster.

Parameters
ctxThe event context providing the necessary conditions for the calibration.
gctxPointer to the ActsTrk::GeometryContext, which provides geometry-related information.
clusterPointer to the sTGC strip cluster to be calibrated.
posAlongTheStripThe position along the strip obtained from the secondary measurement(wire), 0 if no wire measurement is present.
globalPosThe global position from an external measurement.
globalDirThe global direction from an external measurement.
[out]calibLocPosThe calibrated local position of the cluster (output parameter).
[out]calibLocCovThe calibrated local covariance of the cluster (output parameter).

Definition at line 355 of file SpacePointCalibrator.cxx.

360  {
361 
362  // if the second coordiante was not provided by the wire, take it from the seed track position
363  if(!posAlongTheStrip) {
364  Amg::Vector3D extPosLocal = cluster.readoutElement()->globalToLocalTrans(gctx, cluster.layerHash()) * globalPos;
365  posAlongTheStrip = extPosLocal[1];
366  }
367 
368  // For now just copying over the local position and covariance. Eventually this should apply corrections from B-Lines and as build geometry
369 
370  return std::make_pair(cluster.localPosition<1>()[0], cluster.localCovariance<1>()(0,0));
371  }

◆ driftAcceleration()

double MuonR4::SpacePointCalibrator::driftAcceleration ( const EventContext &  ctx,
const CalibratedSpacePoint spacePoint 
) const
finaloverride

Definition at line 316 of file SpacePointCalibrator.cxx.

317  {
318  if(spacePoint.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
319  const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(ctx, spacePoint.spacePoint()->identify());
320  const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
321  return calibConsts->rtRelation->rt()->driftAcceleration(driftTime.value_or(0.));
322  }
323  return 0.;
324  }

◆ driftVelocity()

double MuonR4::SpacePointCalibrator::driftVelocity ( const EventContext &  ctx,
const CalibratedSpacePoint spacePoint 
) const
finaloverride

Definition at line 307 of file SpacePointCalibrator.cxx.

308  {
309  if(spacePoint.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
310  const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(ctx, spacePoint.spacePoint()->identify());
311  const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
312  return calibConsts->rtRelation->rt()->driftVelocity(driftTime.value_or(0.));
313  }
314  return 0.;
315  }

◆ initialize()

StatusCode MuonR4::SpacePointCalibrator::initialize ( )
finaloverride

Definition at line 45 of file SpacePointCalibrator.cxx.

45  {
47  ATH_CHECK(m_idHelperSvc.retrieve());
48  ATH_CHECK(m_mdtCalibrationTool.retrieve(EnableTool{m_idHelperSvc->hasMDT()}));
49  ATH_CHECK(m_nswCalibTool.retrieve(EnableTool{m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC()}));
51  return StatusCode::SUCCESS;
52  }

◆ setState()

template<std::size_t Dim, typename trajectory_t , typename pos_t , typename cov_t >
void ActsTrk::detail::MeasurementCalibratorBase::setState ( const ProjectorType  projector,
const pos_t &  locpos,
const cov_t &  cov,
Acts::SourceLink  link,
TrackState_t< trajectory_t > &  trackState 
) const
inherited

Copy the local position & covariance into the Acts track state proxy.

Template Parameters
DimDimension of the measurement
trajectory_tData type of the track state proxy backend
pos_tData type of the [Dim x 1] position vector
cov_tData type of the [Dim x Dim] covariance matrix
Parameters
projectorProjector configuration of the measurement
locposCalibrated local postion
covCalibrated local covariance
linkSource link to associate with the state
trackStateRefrence to the track state proxy to write.

◆ stampSignsOnMeasurements()

void MuonR4::SpacePointCalibrator::stampSignsOnMeasurements ( const xAOD::MuonSegment segment) const
finaloverride

Definition at line 611 of file SpacePointCalibrator.cxx.

611  {
612  const auto [segPos, segLine] = makeLine(localSegmentPars(segment));
613  const Segment* detSeg = MuonR4::detailedSegment(segment);
614  for (const auto& meas : detSeg->measurements()) {
615  if (meas->type() == xAOD::UncalibMeasType::MdtDriftCircleType){
616  dec_trackSign(*meas->spacePoint()->primaryMeasurement()) =
617  SeedingAux::strawSign(segPos, segLine, *meas);
618  }
619  }
620  }

◆ updateSigns()

void MuonR4::SpacePointCalibrator::updateSigns ( const Amg::Vector3D trackPos,
const Amg::Vector3D trackDir,
CalibSpacePointVec hitsToCalib 
) const
finaloverride

Definition at line 54 of file SpacePointCalibrator.cxx.

56  {
57  std::vector<int> signs = SeedingAux::strawSigns(trackPos, trackDir,
58  hitsToCalib);
59  for (const auto& [spIdx, sp]: Acts::enumerate(hitsToCalib)) {
60  sp->setDriftRadius(sp->driftRadius() * signs[spIdx]);
61  }
62  }

Member Data Documentation

◆ m_clusterBuilderToolMM

ToolHandle<Muon::IMMClusterBuilderTool> MuonR4::SpacePointCalibrator::m_clusterBuilderToolMM {this, "MMClusterBuilder", ""}
private

Definition at line 131 of file SpacePointCalibrator.h.

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonR4::SpacePointCalibrator::m_detMgr {nullptr}
private

Definition at line 133 of file SpacePointCalibrator.h.

◆ m_geoCtxKey

SG::ReadHandleKey<ActsTrk::GeometryContext> MuonR4::SpacePointCalibrator::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

access to the ACTS geometry context

Definition at line 123 of file SpacePointCalibrator.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::SpacePointCalibrator::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 125 of file SpacePointCalibrator.h.

◆ m_mdtCalibrationTool

ToolHandle<IMdtCalibrationTool> MuonR4::SpacePointCalibrator::m_mdtCalibrationTool {this, "MdtCalibrationTool", ""}
private

Definition at line 127 of file SpacePointCalibrator.h.

◆ m_MdtSignFromSegment

Gaudi::Property<bool> MuonR4::SpacePointCalibrator::m_MdtSignFromSegment
private
Initial value:
{this, "useSegmentSigns", true,
"Mdt drift signs are copied from the segment line instead from the track state"}

Definition at line 154 of file SpacePointCalibrator.h.

◆ m_muonPropSpeed

Gaudi::Property<double> MuonR4::SpacePointCalibrator::m_muonPropSpeed {this, "PropagationSpeed", 1./ Gaudi::Units::c_light }
private

Assumed propagation velocity of the muon through the detector.

Needs to be replaced by the proper time estimate once the calibrator is exposed to the Acts propagator

Definition at line 138 of file SpacePointCalibrator.h.

◆ m_nswCalibTool

ToolHandle<Muon::INSWCalibTool> MuonR4::SpacePointCalibrator::m_nswCalibTool {this, "NSWCalibTool", ""}
private

Definition at line 129 of file SpacePointCalibrator.h.

◆ m_rpcSignalVelocity

Gaudi::Property<double> MuonR4::SpacePointCalibrator::m_rpcSignalVelocity
private
Initial value:
{this, "rpcSignalVelocity", 0.5 * Gaudi::Units::c_light,
"Propagation speed of the signal inside the rpc strip"}

How fast does an electron signal travel along an rpc strip

Definition at line 141 of file SpacePointCalibrator.h.

◆ m_rpcTimeResolution

Gaudi::Property<double> MuonR4::SpacePointCalibrator::m_rpcTimeResolution
private
Initial value:
{this, "rpcTimeResolution", 0.6 * Gaudi::Units::nanosecond,
"Estimated time resolution of the strip readout"}

Definition at line 144 of file SpacePointCalibrator.h.

◆ m_useRpcTime

Gaudi::Property<bool> MuonR4::SpacePointCalibrator::m_useRpcTime {this, "useRpcTime", false}
private

Load the Rpc time on the track states for the track fit.

Definition at line 148 of file SpacePointCalibrator.h.

◆ m_usesTgcTime

Gaudi::Property<bool> MuonR4::SpacePointCalibrator::m_usesTgcTime
private
Initial value:
{this, "usesTgcTime", false,
"Load the sTgc time on the track states for the fit"}

Definition at line 152 of file SpacePointCalibrator.h.

◆ m_useTgcTime

Gaudi::Property<bool> MuonR4::SpacePointCalibrator::m_useTgcTime
private
Initial value:
{this, "useTgcTime", false,
"Load the Tgc BC-ID on the track states for the fit"}

Load the Tgc bunch crossing ID on the track states.

Definition at line 150 of file SpacePointCalibrator.h.

◆ s_boundSpaceIndices

constexpr static std::array<Acts::BoundSubspaceIndices, 6> ActsTrk::detail::MeasurementCalibratorBase::s_boundSpaceIndices
staticconstexprprivateinherited
Initial value:
{
Acts::BoundSubspaceIndices{Acts::eBoundLoc0},
Acts::BoundSubspaceIndices{Acts::eBoundLoc1},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundTime},
Acts::BoundSubspaceIndices{Acts::eBoundLoc1, Acts::eBoundTime},
Acts::BoundSubspaceIndices{Acts::eBoundLoc0, Acts::eBoundLoc1, Acts::eBoundTime}
}

Array to map the Projector types to the bound index configurations used by the ATLAS detector measurements.

Definition at line 66 of file MeasurementCalibratorBase.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MdtCalibInput::setTrackDirection
void setTrackDirection(const Amg::Vector3D &trackDir, bool hasPhi)
Sets the direction of the externally determined track.
Definition: MdtCalibInput.cxx:110
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
xAOD::RpcMeasurement_v1
RpcMeasurement_v1: Class storing the geneic.
Definition: RpcMeasurement_v1.h:21
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:95
xAOD::sTgcMeasurement_v1::layerHash
IdentifierHash layerHash() const
Returns the hash of the associated gasGap layer.
Definition: sTgcMeasurement_v1.cxx:38
MuonR4::CalibratedSpacePoint::State::FailedCalib
@ FailedCalib
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e2DimNoTime
@ e2DimNoTime
Project out solely the locY - Complementary projector if the strip plane is rotated (Applies to Itk e...
xAOD::sTgcStripCluster_v1
Definition: sTgcStripCluster_v1.h:13
xAOD::CombinedMuonStrip_v1::primaryStrip
const xAOD::UncalibratedMeasurement * primaryStrip() const
Returns the primary associated measurement.
Definition: CombinedMuonStrip_v1.cxx:27
xAOD::CombinedMuonStrip_v1::type
virtual xAOD::UncalibMeasType type() const override final
Returns the type of the measurement type as a simple enumeration.
Definition: CombinedMuonStrip_v1.cxx:18
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MdtCalibInput
Definition: MdtCalibInput.h:36
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
MuonR4::CalibratedSpacePoint::State::Valid
@ Valid
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:19
MuonR4::SpacePoint::CovIdx::timeCov
@ timeCov
MuonR4::SpacePoint::Cov_t
std::array< double, 3 > Cov_t
Abrivation of the covariance type.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:27
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonR4::SpacePointCalibrator::m_MdtSignFromSegment
Gaudi::Property< bool > m_MdtSignFromSegment
Definition: SpacePointCalibrator.h:154
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
xAOD::MMCluster_v1::readoutElement
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
MuonR4::SpacePointCalibrator::m_geoCtxKey
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
access to the ACTS geometry context
Definition: SpacePointCalibrator.h:123
MdtCalibTwinOutput::sigmaZ
double sigmaZ() const
Definition: MdtCalibTwinOutput.cxx:49
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e2DimWithTime
@ e2DimWithTime
Project out the locY & time coordinate - (Applies to Rpc, Tgc, sTgc)
xAOD::CombinedMuonStrip_v1::secondaryStrip
const xAOD::UncalibratedMeasurement * secondaryStrip() const
Returns the secondary associated measurement.
Definition: CombinedMuonStrip_v1.cxx:33
python.SystemOfUnits.nanosecond
float nanosecond
Definition: SystemOfUnits.py:134
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e1DimRotNoTime
@ e1DimRotNoTime
Project out solely the locX (Applies to Itk strips, Rpc, Tgc, sTgc, Mm)
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
MuonR4::SpacePoint::CovIdx::etaCov
@ etaCov
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:35
ActsTrk::detail::xAODUncalibMeasCalibrator::pack
static Acts::SourceLink pack(const xAOD::UncalibratedMeasurement *meas)
Helper method to pack an uncalibrated measurement to an Acts source link.
Definition: xAODUncalibMeasCalibrator.cxx:9
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
MuonGMR4::RpcReadoutElement::EdgeSide
EdgeSide
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:109
MdtCalibTwinOutput::uncertPrimaryR
double uncertPrimaryR() const
Definition: MdtCalibTwinOutput.cxx:52
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
keylayer_zslicemap.strip
strip
Definition: keylayer_zslicemap.py:151
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ActsTrk::detail::xAODUncalibMeasCalibrator::unpack
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
Definition: xAODUncalibMeasCalibrator.cxx:12
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::CalibSpacePointVec
ISpacePointCalibrator::CalibSpacePointVec CalibSpacePointVec
Definition: SpacePointCalibrator.cxx:40
MuonR4::detailedSegment
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Definition: TrackingHelpers.cxx:14
MuonR4::SpacePointCalibrator::m_rpcSignalVelocity
Gaudi::Property< double > m_rpcSignalVelocity
How fast does an electron signal travel along an rpc strip
Definition: SpacePointCalibrator.h:141
MuonR4::SpacePointCalibrator::calibratesTGC
std::pair< double, double > calibratesTGC(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::sTgcStripCluster &cluster, std::optional< double > posAlongTheStrip, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of an sTGC (small-strip Thin Gap Chamber) cluster.
Definition: SpacePointCalibrator.cxx:355
MuonR4::SpacePointCalibrator::m_useRpcTime
Gaudi::Property< bool > m_useRpcTime
Load the Rpc time on the track states for the track fit.
Definition: SpacePointCalibrator.h:148
MuonR4::SpacePointCalibrator::m_useTgcTime
Gaudi::Property< bool > m_useTgcTime
Load the Tgc bunch crossing ID on the track states.
Definition: SpacePointCalibrator.h:150
MuonR4::SpacePointCalibrator::calibrateMM
std::pair< double, double > calibrateMM(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::MMCluster &cluster, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of a MicroMegas (MM) cluster.
Definition: SpacePointCalibrator.cxx:327
xAOD::MMCluster_v1::layerHash
IdentifierHash layerHash() const
Returns the hash of the associated layer (Needed for surface retrieval)
Definition: MMCluster_v1.cxx:23
MuonR4::CalibratedSpacePoint::State::Outlier
@ Outlier
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
Muon::NswClustering::toLocal
Amg::Vector3D toLocal(const Amg::Transform3D &toLocalTrans, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
Definition: NswClusteringUtils.h:21
MuonR4::SpacePointCalibrator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: SpacePointCalibrator.h:125
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
MuonR4::SpacePointCalibrator::m_nswCalibTool
ToolHandle< Muon::INSWCalibTool > m_nswCalibTool
Definition: SpacePointCalibrator.h:129
xAOD::MMCluster_v1::identify
const Identifier & identify() const
: Returns the Athena identifier of the micro mega cluster It's constructed from the measurementHash &...
Definition: MMCluster_v1.cxx:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
MuonR4::State
CalibratedSpacePoint::State State
Definition: SpacePointCalibrator.cxx:42
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
xAOD::MdtTwinDriftCircle_v1
Definition: MdtTwinDriftCircle_v1.h:12
MuonR4::CalibratedSpacePoint::State::Duplicate
@ Duplicate
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
xAOD::Other
@ Other
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MdtCalibTwinOutput::locZ
double locZ() const
Definition: MdtCalibTwinOutput.cxx:48
MuonR4::SpacePointCalibrator::m_clusterBuilderToolMM
ToolHandle< Muon::IMMClusterBuilderTool > m_clusterBuilderToolMM
Definition: SpacePointCalibrator.h:131
MdtCalibInput::setClosestApproach
void setClosestApproach(const Amg::Vector3D &approach)
Sets the closest approach.
Definition: MdtCalibInput.cxx:106
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::UncalibratedMeasurement_v1::localCovariance
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
F600IntegrationConfig.spacePoints
spacePoints
Definition: F600IntegrationConfig.py:122
MdtCalibOutput::status
MdtDriftCircleStatus status() const
Status of the calibration.
Definition: MdtCalibOutput.cxx:40
MdtCalibOutput
Definition: MdtCalibOutput.h:10
xAOD::UncalibratedMeasurement_v1::localPosition
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
xAOD::TgcStrip_v1::readoutElement
const MuonGMR4::TgcReadoutElement * readoutElement() const
Retrieve the associated TgcReadoutElement.
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
MuonGMR4::RadialStripDesign::stripDir
Amg::Vector2D stripDir(int stripNumber) const
: Returns the direction of the radial strip (Pointing from the bottom edge to the top edge)
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e1DimNoTime
@ e1DimNoTime
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonR4::sign
constexpr double sign(const double x)
Returns the sign of a number.
Definition: MatrixUtils.h:11
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e1DimRotWithTime
@ e1DimRotWithTime
Project out the locX & time coordinate - (Applies to Rpc, Tgc, Mm, sTgc)
CalibSpacePointPtr
MuonR4::ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
Definition: MuonSPCalibrationTest.cxx:10
MuonR4::SpacePoint::CovIdx::phiCov
@ phiCov
xAOD::sTgcMeasurement_v1::readoutElement
const MuonGMR4::sTgcReadoutElement * readoutElement() const
Retrieve the associated sTgcReadoutElement.
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType::e1DimWithTime
@ e1DimWithTime
Project out the two spatial coordinates - (Applies to ITk pixel, BI-Rpc, sTgc pad)
MdtCalibTwinOutput::primaryStatus
MdtDriftCircleStatus primaryStatus() const
Definition: MdtCalibTwinOutput.cxx:54
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
MuonR4::SpacePointCalibrator::m_usesTgcTime
Gaudi::Property< bool > m_usesTgcTime
Definition: SpacePointCalibrator.h:152
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:110
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
MuonR4::SpacePointCalibrator::m_mdtCalibrationTool
ToolHandle< IMdtCalibrationTool > m_mdtCalibrationTool
Definition: SpacePointCalibrator.h:127
MdtCalibOutput::driftRadiusUncert
double driftRadiusUncert() const
Returns the uncertainty on the drift radius.
Definition: MdtCalibOutput.cxx:20
ATH_LIKELY
#define ATH_LIKELY(x)
Definition: AthUnlikelyMacros.h:16
MuonR4::SpacePointCalibrator::calibrate
CalibSpacePointPtr calibrate(const EventContext &ctx, const SpacePoint *spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
Definition: SpacePointCalibrator.cxx:96
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
xAOD::CombinedMuonStrip_v1
The Acts fitters running on the Uncalibrated measurements are uncapable of producing two track states...
Definition: CombinedMuonStrip_v1.h:19
MuonR4::SpacePointCalibrator::m_rpcTimeResolution
Gaudi::Property< double > m_rpcTimeResolution
Definition: SpacePointCalibrator.h:144
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25
MuonR4::SpacePointCalibrator::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: SpacePointCalibrator.h:133
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:42
MdtCalibTwinOutput::primaryDriftR
double primaryDriftR() const
Definition: MdtCalibTwinOutput.cxx:50
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
Muon::MMClusterOnTrack::Author
Author
Definition: MMClusterOnTrack.h:89
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:78
MuonR4::SpacePointCalibrator::calibrateCombinedPrd
void calibrateCombinedPrd(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::CombinedMuonStrip *combinedPrd, ActsTrk::MutableTrackContainer::TrackStateProxy state) const
Calibrates the track states from a combined muon strip.
Definition: SpacePointCalibrator.cxx:372
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::RpcMeasurement_v1::time
float time() const
Returns the time.
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MdtCalibOutput::driftRadius
double driftRadius() const
Returns the drift radius of the calibrated object.
Definition: MdtCalibOutput.cxx:19
xAOD::sTgcMeasurement_v1
Definition: sTgcMeasurement_v1.h:21
MuonGMR4::TgcReadoutElement::stripLayout
const RadialStripDesign & stripLayout(const IdentifierHash &layHash) const
Returns access to the strip design of the given gasGap [1-3] If the gap does not have strips an excep...
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32