ATLAS Offline Software
SpacePointCalibrator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "SpacePointCalibrator.h"
5 
16 #include "GaudiKernel/PhysicalConstants.h"
18 
21 
23 
26 namespace {
27  constexpr double c_inv = 1./ Gaudi::Units::c_light;
28 }
29 
30 namespace MuonR4{
34  using namespace SegmentFit;
35 
37  ATH_CHECK(m_geoCtxKey.initialize());
38  ATH_CHECK(m_idHelperSvc.retrieve());
39  ATH_CHECK(m_mdtCalibrationTool.retrieve(EnableTool{m_idHelperSvc->hasMDT()}));
40  ATH_CHECK(m_nswCalibTool.retrieve(EnableTool{m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC()}));
41  ATH_CHECK(detStore()->retrieve(m_detMgr));
42  return StatusCode::SUCCESS;
43  }
44 
46  const CalibratedSpacePoint& spacePoint,
47  const Amg::Vector3D& segPos,
48  const Amg::Vector3D& segDir,
49  const double timeDelay) const {
50  CalibSpacePointPtr calibSP{};
51  if (spacePoint.type() != xAOD::UncalibMeasType::Other){
52  calibSP = calibrate(ctx, spacePoint.spacePoint(), segPos, segDir, timeDelay);
53  } else {
54  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint);
55  }
56  if (spacePoint.fitState() == State::Outlier) {
57  calibSP->setFitState(State::Outlier);
58  }
59  return calibSP;
60  }
61 
64  const Amg::Vector3D& segPos,
65  const Amg::Vector3D& segDir,
66  const double timeDelay) const {
67  for (CalibSpacePointPtr& sp : spacePoints){
68  sp = calibrate(ctx, *sp, segPos, segDir, timeDelay);
69  }
70  return spacePoints;
71  }
72 
74  const SpacePoint* spacePoint,
75  const Amg::Vector3D& posInChamb,
76  const Amg::Vector3D& dirInChamb,
77  const double timeOffset) const {
78 
79  const ActsGeometryContext* gctx{nullptr};
80  if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
81  return nullptr;
82  }
83  const Amg::Vector3D& spPos{spacePoint->positionInChamber()};
84  const Amg::Transform3D& locToGlob{spacePoint->msSector()->localToGlobalTrans(*gctx)};
85  Amg::Vector3D chDir{spacePoint->directionInChamber()};
86 
87  // Adjust the space point position according to the external seed. But only if the space point
88  // is a 1D strip
89  Amg::Vector3D calibSpPos = spacePoint->dimension() == 2 ? spPos
90  : spPos + Amg::intersect<3>(posInChamb, dirInChamb, spPos, chDir).value_or(0) * chDir;
91 
92  CalibSpacePointPtr calibSP{};
93  switch (spacePoint->type()) {
95  const Amg::Vector3D locClosestApproach = posInChamb
96  + Amg::intersect<3>(spPos, chDir,
97  posInChamb, dirInChamb).value_or(0) * dirInChamb;
98 
99  Amg::Vector3D closestApproach{locToGlob* locClosestApproach};
100  const double timeOfArrival = closestApproach.mag() * c_inv + timeOffset;
101  AmgSymMatrix(2) jac{AmgSymMatrix(2)::Identity()};
102  jac.col(0) = spacePoint->normalInChamber().block<2,1>(0,0).unit();
103  jac.col(1) = spacePoint->directionInChamber().block<2,1>(0,0).unit();
104 
105  if (spacePoint->dimension() == 1) {
106  auto* dc = static_cast<const xAOD::MdtDriftCircle*>(spacePoint->primaryMeasurement());
107  MdtCalibInput calibInput{*dc, *gctx};
108  calibInput.setTrackDirection(locToGlob.linear() * dirInChamb,
109  dirInChamb.phi() || posInChamb[toInt(AxisDefs::phi)] );
110  calibInput.setTimeOfFlight(timeOfArrival);
111  calibInput.setClosestApproach(std::move(closestApproach));
112  ATH_MSG_VERBOSE("Parse hit calibration "<<m_idHelperSvc->toString(dc->identify())<<", "<<calibInput);
113  MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(ctx, calibInput);
114  ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
115  State fitState{State::Valid};
116  AmgSymMatrix(2) diagCov{AmgSymMatrix(2)::Identity()};
117  diagCov(toInt(AxisDefs::eta), toInt(AxisDefs::eta)) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()),2);
120  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
121  <<std::endl<<calibInput<<std::endl<<calibOutput);
122  fitState = State::FailedCalib;
123  diagCov(toInt(AxisDefs::phi), toInt(AxisDefs::phi)) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
124  } else {
125  diagCov(toInt(AxisDefs::phi), toInt(AxisDefs::phi)) = std::pow(calibOutput.driftRadiusUncert(), 2);
126  }
127  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), std::move(chDir), fitState);
128  calibSP->setCovariance<2>(jac.inverse()*diagCov*jac);
129  calibSP->setDriftRadius(calibOutput.driftRadius());
130  } else {
131  auto* dc = static_cast<const xAOD::MdtTwinDriftCircle*>(spacePoint->primaryMeasurement());
132  MdtCalibInput calibInput{*dc, *gctx};
133  calibInput.setClosestApproach(closestApproach);
134  calibInput.setTimeOfFlight(timeOfArrival);
135 
136  MdtCalibInput twinInput{dc->twinIdentify(), dc->twinAdc(), dc->twinTdc(), dc->readoutElement(), *gctx};
137  twinInput.setClosestApproach(closestApproach);
138  twinInput.setTimeOfFlight(timeOfArrival);
139 
140  MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(ctx,
141  std::move(calibInput),
142  std::move(twinInput));
143 
144  AmgSymMatrix(2) diagCov{AmgSymMatrix(2)::Identity()};
145  State fitState{State::Valid};
147  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
148  <<std::endl<<calibOutput);
149  diagCov(toInt(AxisDefs::phi), toInt(AxisDefs::phi)) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
150  diagCov(toInt(AxisDefs::eta), toInt(AxisDefs::eta)) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
151  fitState = State::FailedCalib;
152  } else {
153  diagCov(toInt(AxisDefs::phi), toInt(AxisDefs::phi)) = std::pow(calibOutput.uncertPrimaryR(), 2);
154  diagCov(toInt(AxisDefs::eta), toInt(AxisDefs::eta)) = std::pow(calibOutput.sigmaZ(), 2);
155  }
156  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), std::move(chDir), fitState);
157  calibSP->setCovariance<2>(jac.inverse()*diagCov*jac);
158  calibSP->setDriftRadius(calibOutput.primaryDriftR());
159  }
160  break;
161  }
163  auto* strip = static_cast<const xAOD::RpcMeasurement*>(spacePoint->primaryMeasurement());
164 
166  const Amg::Transform3D toGasGap{strip->readoutElement()->globalToLocalTrans(*gctx, strip->layerHash()) * locToGlob};
167  const Amg::Vector3D lPos = toGasGap * calibSpPos;
168  using EdgeSide = MuonGMR4::RpcReadoutElement::EdgeSide;
169  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), std::move(chDir));
170  AmgSymMatrix(3) cov{AmgSymMatrix(3)::Identity()};
171  cov.block<2,2>(0, 0) = spacePoint->covariance();
172 
173  cov(2, 2) = m_rpcTimeResolution * m_rpcTimeResolution;
174 
175  const double time1 = strip->time()
176  - strip->readoutElement()->distanceToEdge(strip->layerHash(),
177  lPos.block<2,1>(0,0),
178  EdgeSide::readOut) /m_rpcSignalVelocity;
179 
180  if (spacePoint->dimension() == 2) {
181  auto* strip2 = static_cast<const xAOD::RpcMeasurement*>(spacePoint->secondaryMeasurement());
182 
183  const double time2 = strip2->time() -
184  strip2->readoutElement()->distanceToEdge(strip2->layerHash(),
185  Eigen::Rotation2D{M_PI_2}*lPos.block<2,1>(0,0),
186  EdgeSide::readOut)/m_rpcSignalVelocity;
188  calibSP->setTimeMeasurement(0.5*(time1 + time2));
190  cov(2,2) += std::pow(0.5*(time1 - time2), 2);
191  cov(2,1) = cov(1,2) = - strip->readoutElement()->stripPhiPitch() /m_rpcSignalVelocity / std::sqrt(12.)* std::sqrt(cov(2, 2));
192  cov(2,0) = cov(0,2) = - strip->readoutElement()->stripEtaPitch() /m_rpcSignalVelocity / std::sqrt(12.)* std::sqrt(cov(2, 2));
193 
194  } else {
195  calibSP->setTimeMeasurement(time1);
196  if (strip->measuresPhi()) {
197  cov(2,1) = cov(1,2) = - 0.5 *strip->readoutElement()->stripPhiLength() /m_rpcSignalVelocity * std::sqrt(cov(2, 2));
198  } else {
199  cov(2,0) = cov(0,2) = - 0.5 *strip->readoutElement()->stripEtaLength() /m_rpcSignalVelocity * std::sqrt(cov(2, 2));
200  }
201  }
202  calibSP->setCovariance<3>(std::move(cov));
204  ATH_MSG_VERBOSE("Create rpc space point "<<m_idHelperSvc->toString(strip->identify())<<", dimension "<<spacePoint->dimension()
205  << ", at "<<Amg::toString(calibSP->positionInChamber())<<", uncalib time: "
206  <<strip->time()<<", calib time: "<<calibSP->time()<<" cov " <<toString(calibSP->covariance()));
207  break;
208  }
211  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), std::move(chDir));
212  calibSP->setCovariance<2>(spacePoint->covariance());
213  break;
214  }
216  const xAOD::MMCluster* cluster = static_cast<const xAOD::MMCluster*>(spacePoint->primaryMeasurement());
217 
218  std::vector<NSWCalib::CalibratedStrip> calibClus;
219  StatusCode sc = m_nswCalibTool->calibrateClus(ctx, *gctx, cluster, locToGlob * posInChamb, calibClus);
220  if(sc.isFailure()) {
221  ATH_MSG_WARNING("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster->identify()));
222  return nullptr;
223  }
224 
225  Amg::Vector2D locPos{cluster->localPosition<1>()[0] * Amg::Vector2D::UnitX()};
226  Amg::MatrixX loce = spacePoint->covariance();
227 
228  Amg::Vector3D globalTrackDir{locToGlob.linear() * dirInChamb};
229  Amg::Vector3D locDir = Muon::NswClustering::toLocal(cluster->readoutElement()->globalToLocalTrans(*gctx, cluster->layerHash()), globalTrackDir);
230 
231  Muon::IMMClusterBuilderTool::RIO_Author rotAuthor = m_clusterBuilderToolMM->getCalibratedClusterPosition(ctx, calibClus, locDir ,locPos, loce);
232  if(rotAuthor == Muon::IMMClusterBuilderTool::RIO_Author::unKnownAuthor){
233  ATH_MSG_ERROR("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster->identify()));
234  return nullptr;
235  }
236 
237  Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTrans(*gctx, cluster->layerHash())};
238 
239  Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
240  calibSpPosInLayer.x() = locPos.x();
241 
242  calibSpPos = toChamberTrans * calibSpPosInLayer;
243 
244  calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), std::move(chDir));
245  calibSP->setCovariance<2>(spacePoint->covariance());
246  ATH_MSG_DEBUG("calibrated MM cluster "<<m_idHelperSvc->toString(cluster->identify()) << " loc x old " << cluster->localPosition<1>()[0] << " new loc x " << locPos.x());
247 
248  break;
249  }
250  default:
251  ATH_MSG_WARNING("Do not know how to calibrate "<<m_idHelperSvc->toString(spacePoint->identify()));
252  }
253  return calibSP;
254  }
255 
257  const std::vector<const SpacePoint*>& spacePoints,
258  const Amg::Vector3D& posInChamb,
259  const Amg::Vector3D& dirInChamb,
260  const double timeOffset) const {
261  CalibSpacePointVec calibSpacePoints{};
262  calibSpacePoints.reserve(spacePoints.size());
263  for(const SpacePoint* spacePoint : spacePoints) {
264  CalibSpacePointPtr hit = calibrate(ctx, spacePoint, posInChamb, dirInChamb, timeOffset);
265  if (hit) calibSpacePoints.push_back(std::move(hit));
266  }
267  return calibSpacePoints;
268  }
269  double SpacePointCalibrator::driftVelocity(const EventContext& ctx,
270  const CalibratedSpacePoint& spacePoint) const {
271  if(spacePoint.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
272  const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(ctx, spacePoint.spacePoint()->identify());
273  const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
274  return calibConsts->rtRelation->rt()->driftVelocity(driftTime.value_or(0.));
275  }
276  return 0.;
277  }
278  double SpacePointCalibrator::driftAcceleration(const EventContext& ctx,
279  const CalibratedSpacePoint& spacePoint) const {
280  if(spacePoint.type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
281  const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(ctx, spacePoint.spacePoint()->identify());
282  const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
283  return calibConsts->rtRelation->rt()->driftAcceleration(driftTime.value_or(0.));
284  }
285  return 0.;
286  }
287 
288  void SpacePointCalibrator::calibrateSourceLink(const Acts::GeometryContext& geoctx,
289  const Acts::CalibrationContext& cctx,
290  const Acts::SourceLink& link,
291  ActsTrk::MutableTrackContainer::TrackStateProxy trackState) const {
292 
294  const Acts::BoundTrackParameters trackPars{trackState.referenceSurface().getSharedPtr(),
295  trackState.parameters(), trackState.covariance(),
297 
298  const Amg::Vector3D trackPos{trackPars.position(geoctx)};
299  const Amg::Vector3D trackDir{trackPars.direction()};
300  const ActsGeometryContext* gctx = geoctx.get<const ActsGeometryContext*>();
301  const EventContext* ctx = cctx.get<const EventContext*>();
302  const auto* muonMeas = ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(link);
303  ATH_MSG_VERBOSE("Calibrate measurement "<<m_idHelperSvc->toString(xAOD::identify(muonMeas))
304  <<" @ surface "<<trackState.referenceSurface().geometryId());
305  switch (muonMeas->type()){
306  using enum xAOD::UncalibMeasType;
307  case MdtDriftCircleType: {
308  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(muonMeas);
309  MdtCalibInput calibInput{*dc, *gctx};
310  calibInput.setClosestApproach(trackPos);
311  //calibInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
312  calibInput.setTrackDirection(trackDir, true);
313  const double driftSign = sign(trackPars.parameters()[Acts::eBoundLoc0]);
314 
316  if (ATH_LIKELY(muonMeas->numDimensions() == 1)) {
317  MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(*ctx, calibInput);
318  ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
319  AmgVector(1) pos{AmgVector(1)::Zero()};
320  AmgSymMatrix(1) cov{AmgSymMatrix(1)::Identity()};
323  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
324  <<std::endl<<calibInput<<std::endl<<calibOutput);
325  cov(Acts::eBoundLoc0,Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
326  } else {
327  pos[Acts::eBoundLoc0] = driftSign*calibOutput.driftRadius();
328  cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.driftRadiusUncert(), 2);
329  }
330  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
331  }
333  else {
334  const auto* twinDC = static_cast<const xAOD::MdtTwinDriftCircle*>(muonMeas);
335  MdtCalibInput twinInput{twinDC->twinIdentify(), twinDC->twinAdc(), twinDC->twinTdc(), twinDC->readoutElement(), *gctx};
336  twinInput.setClosestApproach(trackPos);
337  twinInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
338 
339  MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(*ctx,
340  std::move(calibInput),
341  std::move(twinInput));
343  AmgSymMatrix(2) locCov{AmgSymMatrix(2)::Identity()};
345  ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
346  <<std::endl<<calibOutput);
347  locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
348  locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
349  } else {
350  locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.uncertPrimaryR(), 2);
351  locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(calibOutput.sigmaZ(), 2);
352  locPos[Acts::eBoundLoc0] = driftSign*calibOutput.primaryDriftR();
353  locPos[Acts::eBoundLoc1] = calibOutput.locZ();
354  }
355  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimNoTime, locPos, locCov, link, trackState);
356  }
357  break;
358  } case RpcStripType: {
359  const auto* rpcClust = static_cast<const xAOD::RpcMeasurement*>(muonMeas);
361  if (ATH_LIKELY(rpcClust->numDimensions() == 1)) {
362  if (!m_useRpcTime) {
363  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime,
364  rpcClust->localPosition<1>(),
365  rpcClust->localCovariance<1>(), link, trackState);
366  } else {
367  AmgVector(2) measPars{AmgVector(2)::Zero()};
368  AmgSymMatrix(2) measCov{AmgSymMatrix(2)::Identity()};
369  measPars[0] = rpcClust->localPosition<1>()[0];
370  measCov(0,0) = rpcClust->localCovariance<1>()(0, 0);
371  measCov(1,1) = std::pow(m_rpcTimeResolution, 2);
372  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimWithTime,
373  measPars, measCov, link, trackState);
374  }
375  }
377  else {
378  if (!m_useRpcTime) {
379  setState<2, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimNoTime,
380  rpcClust->localPosition<2>(),
381  rpcClust->localCovariance<2>(), link, trackState);
382  } else {
383  AmgVector(3) measPars{AmgVector(3)::Zero()};
384  AmgSymMatrix(3) measCov{AmgSymMatrix(3)::Identity()};
385  measPars.block<2,1>(0,0) = xAOD::toEigen(rpcClust->localPosition<2>());
386  measCov.block<2,2>(0,0) = xAOD::toEigen(rpcClust->localCovariance<2>());
387  measCov(2,2) = std::pow(m_rpcTimeResolution, 2);
388  setState<3, ActsTrk::MutableTrackStateBackend>(ProjectorType::e2DimWithTime,
389  measPars, measCov, link, trackState);
390  }
391  }
392  break;
393  } case TgcStripType: {
394  if (!m_useTgcTime) {
395  setState<1, ActsTrk::MutableTrackStateBackend>(ProjectorType::e1DimRotNoTime,
396  muonMeas->localPosition<1>(),
397  muonMeas->localCovariance<1>(), link, trackState);
398  } else {
399  ATH_MSG_WARNING("Tgc time calibration to be implemented...");
400  }
401  break;
402  }
403  case MMClusterType: {
404  THROW_EXCEPTION("Micromega measurements are not yet implemented");
405  break;
406  } case sTgcStripType: {
407  THROW_EXCEPTION("sTGC measurements are not yet implemented");
408  break;
409  } default: {
410  THROW_EXCEPTION("The parsed measurement is not a muon measurement. Please check.");
411  }
412 
413  }
414 
415  }
416 }
MuonR4::ISpacePointCalibrator::CalibSpacePointVec
std::vector< CalibSpacePointPtr > CalibSpacePointVec
Definition: ISpacePointCalibrator.h:31
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
MuonR4::SpacePoint::msSector
const MuonGMR4::SpectrometerSector * msSector() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:56
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:82
UtilFunctions.h
MuonR4::SpacePoint::type
xAOD::UncalibMeasType type() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:71
MuonR4::SpacePoint::normalInChamber
const Amg::Vector3D & normalInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:65
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
MdtCalibInput.h
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MdtCalibInput
Definition: MdtCalibInput.h:34
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
NswClusteringUtils.h
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
xAOD::MMCluster_v1::readoutElement
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
MdtCalibTwinOutput::sigmaZ
double sigmaZ() const
Definition: MdtCalibTwinOutput.cxx:49
MuonR4::CalibratedSpacePoint::State::Outlier
@ Outlier
MuonR4::SpacePoint::secondaryMeasurement
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:50
MdtTwinDriftCircle.h
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:78
xAODUncalibMeasCalibrator.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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
MatrixUtils.h
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
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
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::CalibSpacePointVec
ISpacePointCalibrator::CalibSpacePointVec CalibSpacePointVec
Definition: SpacePointCalibrator.cxx:31
MuonR4::SpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:47
MuonR4::SegmentFit::AxisDefs::phi
@ phi
MuonR4::SegmentFitHelpers::driftSign
int driftSign(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &uncalibHit, MsgStream &msg)
Calculates whether a segement line travereses the tube measurement on the left (-1) or right (1) side...
Definition: SegmentFitHelperFunctions.cxx:239
xAOD::MMCluster_v1::layerHash
IdentifierHash layerHash() const
Returns the hash of the associated layer (Needed for surface retrieval)
Definition: MMCluster_v1.cxx:23
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
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
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
UtilFunctions.h
MdtCalibOutput.h
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonR4::CalibratedSpacePoint::State::FailedCalib
@ FailedCalib
xAOD::MdtTwinDriftCircle_v1
Definition: MdtTwinDriftCircle_v1.h:12
MuonR4::CalibratedSpacePoint::State
State
State flag to distinguish different space point states.
Definition: CalibratedSpacePoint.h:24
MuonR4::SpacePointCalibrator::calibrateSourceLink
void calibrateSourceLink(const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, ActsTrk::MutableTrackContainer::TrackStateProxy state) const override final
Definition: SpacePointCalibrator.cxx:288
xAOD::Other
@ Other
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MdtCalibTwinOutput::locZ
double locZ() const
Definition: MdtCalibTwinOutput.cxx:48
MuonR4::CalibratedSpacePoint::type
xAOD::UncalibMeasType type() const
Returns the space point type.
Definition: CalibratedSpacePoint.cxx:36
MdtCalibInput::setClosestApproach
void setClosestApproach(const Amg::Vector3D &approach)
Sets the closest approach.
Definition: MdtCalibInput.cxx:106
MuonR4::SegmentFit::toString
std::string toString(const Parameters &pars)
Definition: SegmentFitterEventData.cxx:59
MuonR4::SpacePointCalibrator::driftVelocity
double driftVelocity(const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
Definition: SpacePointCalibrator.cxx:269
SpacePointCalibrator.h
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.
MuonR4::SegmentFit::AxisDefs::eta
@ eta
MuonR4::SpacePointCalibrator::driftAcceleration
double driftAcceleration(const EventContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
Definition: SpacePointCalibrator.cxx:278
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MdtDriftCircle.h
MuonR4::CalibratedSpacePoint::State::Valid
@ Valid
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:19
MuonR4::ISpacePointCalibrator::CalibSpacePointPtr
std::unique_ptr< CalibratedSpacePoint > CalibSpacePointPtr
Definition: ISpacePointCalibrator.h:30
TgcStrip.h
MuonR4::SpacePoint::directionInChamber
const Amg::Vector3D & directionInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:62
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
MuonR4::CalibratedSpacePoint::fitState
State fitState() const
Returns the state of the calibrated space point.
Definition: CalibratedSpacePoint.cxx:55
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
RpcMeasurement.h
MdtCalibTwinOutput::primaryStatus
MdtDriftCircleStatus primaryStatus() const
Definition: MdtCalibTwinOutput.cxx:54
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
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:112
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
MdtCalibOutput::driftRadiusUncert
double driftRadiusUncert() const
Returns the uncertainty on the drift radius.
Definition: MdtCalibOutput.cxx:20
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MultiTrajectory.h
ATH_LIKELY
#define ATH_LIKELY(x)
Definition: AthUnlikelyMacros.h:16
MuonR4::SpacePoint::positionInChamber
const Amg::Vector3D & positionInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:59
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:73
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
MuonR4::CalibSpacePointPtr
ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
Definition: SpacePointCalibrator.cxx:32
SegmentFitterEventData.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MdtReadoutElement.h
MuonGMR4::SpectrometerSector::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Definition: SpectrometerSector.cxx:75
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
MuonR4::CalibratedSpacePoint
The calibrated Space point is created during the calibration process.
Definition: CalibratedSpacePoint.h:15
MdtFullCalibData.h
MuonR4::SpacePoint::dimension
unsigned int dimension() const
Is the space point a 1D or combined 2D measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:100
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
MMCluster.h
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
MuonR4::CalibratedSpacePoint::spacePoint
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
Definition: CalibratedSpacePoint.cxx:18
MuonR4::AmgSymMatrix
const AmgSymMatrix(2) &SpacePoint
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:90
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::RpcMeasurement_v1::time
float time() const
Returns the time.
MuonR4::CalibratedSpacePoint::driftRadius
double driftRadius() const
The drift radius of the calibrated space point.
Definition: CalibratedSpacePoint.cxx:27
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MdtCalibOutput::driftRadius
double driftRadius() const
Returns the drift radius of the calibrated object.
Definition: MdtCalibOutput.cxx:19
MuonR4::SpacePoint::identify
const Identifier & identify() const
: Identifier of the primary measurement
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:80
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
MuonR4::SpacePointCalibrator::initialize
StatusCode initialize() override final
Definition: SpacePointCalibrator.cxx:36