|
ATLAS Offline Software
|
Go to the documentation of this file.
28 const std::string& na,
32 declareInterface<IMdtDriftCircleOnTrackCreator>(
this);
33 declareInterface<IRIO_OnTrackCreator>(
this);
51 using Property = ToolSettings::Property;
54 calibSettings.isActive(Property::TofCorrection));
56 calibSettings.isActive(Property::PropCorrection));
58 calibSettings.isActive(Property::TempCorrection));
60 calibSettings.isActive(Property::MagFieldCorrection));
62 calibSettings.isActive(Property::SlewCorrection));
64 calibSettings.isActive(Property::BackgroundCorrection));
75 return StatusCode::FAILURE;
77 if (msgLevel(MSG::INFO)) {
79 ss <<
"Constructed default MuonDriftCircleErrorStrategy:";
114 ss <<
"Using Data Loose error tuning";
116 ss <<
"Using Data Tight error tuning";
126 ATH_MSG_ERROR(
"Detected bad default configuration, using Cosmic TOF without "
127 <<
"time of flight corrections does not work");
128 return StatusCode::FAILURE;
134 return StatusCode::FAILURE;
138 ATH_MSG_ERROR(
"This tool is too complicated to rely on defaults. Potential configuration issue.");
139 return StatusCode::FAILURE;
141 return StatusCode::SUCCESS;
147 const double t0Shift,
150 const double tTrack)
const {
152 const EventContext& ctx{Gaudi::Hive::currentContext()};
159 calibInput.setClosestApproach(GP);
160 if (GD) calibInput.setTrackDirection((*GD).unit());
166 ATH_MSG_VERBOSE(
" running in ATLTIME mode, tof: " << calibInput.timeOfFlight());
171 calibInput.setTimeOfFlight(0);
172 ATH_MSG_VERBOSE(
"running in NO_CORRECTIONS mode, tof: " << calibInput.timeOfFlight());
179 ATH_MSG_VERBOSE(
" running in COSMICS_TRIGGERTIME mode, triggerOffset: "
180 << calibInput.triggerTime());
183 calibInput.setTimeOfFlight(
timeOfFlight(calibInput.closestApproach(),
beta, tTrack, t0Shift));
185 << calibInput.timeOfFlight() <<
" tTrack: " << tTrack
186 <<
" t0Shift: " << t0Shift
191 ATH_MSG_WARNING(
"No valid mode selected, cannot apply tof correction");
192 calibInput.setTimeOfFlight(0);
201 if (!posOnIdealWire) {
202 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" globalToLocal() failed for ideal surface");
205 posOnWire = std::move(*posOnIdealWire);
207 double positionAlongWire = posOnWire[
Trk::locZ];
222 std::unique_ptr<MdtDriftCircleOnTrack> rot{};
228 std::optional<Amg::Vector2D>
pos = surf.globalToLocal(GP, calibInput.trackDirection());
232 ATH_MSG_WARNING(
"Unexpected globalToLocal failure, cannot create MDT ROT ");
239 rot = std::make_unique<MdtDriftCircleOnTrack>(&mdtPrd,
240 std::move(calibOutput.
locPars),
241 std::move(calibOutput.
locErr),
244 calibInput.trackDirection(),
254 rot = std::make_unique<MdtDriftCircleOnTrack>(&mdtPrd,
255 std::move(calibOutput.
locPars),
256 std::move(calibOutput.
locErr),
264 rot = std::make_unique<MdtDriftCircleOnTrack>(&mdtPrd,
265 std::move(calibOutput.
locPars),
266 std::move(calibOutput.
locErr),
279 return rot.release();
306 ATH_MSG_VERBOSE(
"getLocalMeasurement "<<calibInput<<
" with m_doMdt=" <<
m_doMdt <<
" and " << myStrategy);
316 ATH_MSG_VERBOSE(
"getLocalMeasurement() - Calibrated output "<<calibOutput);
318 radius = calibOutput.driftRadius();
323 std::optional<Amg::Vector2D> myLocalPosition = surf.
globalToLocal(gpos, gdir);
324 if (myLocalPosition) {
327 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" ErrorAtPredictedPosition failed because local position "<<
328 "transformation didn't succeed. Using measured radius instead.");
350 sigmaR = calibOutput.driftRadiusUncert();
353 <<
" SigmaR = " << sigmaR);
354 double sigmaR2 = 0.0;
358 ATH_MSG_DEBUG(
"After scaling etc:\t Moore sigmaR2 = " << sigmaR2);
361 ATH_MSG_DEBUG(
"After scaling etc:\t Muon ErrorStrategy sigmaR2 = " << sigmaR2);
371 newLocalCov(0, 0) = sigmaR2;
383 const double tTrack)
const {
391 const EventContext& )
const {
394 <<
" Trk::PrepRawData not a MdtPrepData!! No rot created ");
426 ATH_MSG_WARNING(
"updateError: ErrorAtPredictedPosition is not yet supported!");
434 <<
" for radius=" <<
radius);
437 const EventContext& ctx{Gaudi::Hive::currentContext()};
441 if (sigmaR < 0.0001 || sigmaR * sigmaR < 0.0001) {
444 <<
" reso " << sigmaR <<
" sigma2 "
445 << sigmaR * sigmaR <<
" drift time " <<
t
453 double sigmaR2 = 0.0;
459 ATH_MSG_DEBUG(
"After scaling etc:\t Muon ErrorStrategy sigmaR2 = " << sigmaR2);
461 std::unique_ptr<MdtDriftCircleOnTrack> rot{DCT.
clone()};
463 rot->setErrorStrategy(myStrategy);
470 return rot.release();
476 const double tShift)
const {
483 return 0.23 *
std::exp(-std::abs(
r) / 6.06) + 0.0362;
511 return sigmaR2 + 0.005;
514 return 4 * sigmaR2 + 0.16;
517 return sigmaR2 + 0.005;
526 return 1.44 * sigmaR2 + 1.44;
530 return 1.44 * sigmaR2 + 0.16;
531 return 1.44 * sigmaR2 + 1.;
536 return 1.44 * sigmaR2 + 1.;
538 return 4 * sigmaR2 + 25;
541 return 1.44 * sigmaR2 + 1.;
547 return 4 * sigmaR2 + 49.;
550 return 4 * sigmaR2 + 4.;
557 return 2.25 * sigmaR2 + 0.09;
575 return 1.44 * sigmaR2 + fixedTerm;
594 return sigmaR2 + 0.005;
598 return 4 * sigmaR2 + 0.16;
601 return sigmaR2 + 0.005;
611 return 1.44 * sigmaR2 + 4;
614 return 1.44 * sigmaR2 + 0.04;
619 return 1.44 * sigmaR2 + 1.;
620 return 4 * sigmaR2 + 25;
624 return 1.44 * sigmaR2 + 0.25;
631 return 1.44 * sigmaR2 + 0.25;
634 return 1.44 * sigmaR2 + 0.04;
641 return 4 * sigmaR2 + 4.;
644 return 4 * sigmaR2 + 4.;
651 return 2.25 * sigmaR2 + 0.09;
670 return 1.44 * sigmaR2 + fixedTerm;
689 return sigmaR2 + 0.005;
692 return 4 * sigmaR2 + 0.16;
695 return sigmaR2 + 0.005;
704 return 1.44 * sigmaR2 + 0.04;
708 return 1.21 * sigmaR2 + 0.01;
710 return 1.21 * sigmaR2 + 0.01;
715 return 1.44 * sigmaR2 + 1.;
717 return 4 * sigmaR2 + 1.;
722 return 1.21 * sigmaR2 + 0.25;
729 return 1.21 * sigmaR2 + 0.25;
735 return 1.21 * sigmaR2 + 25.;
738 return 1.21 * sigmaR2 + 0.04;
744 return 4 * sigmaR2 + 4.;
747 return 4 * sigmaR2 + 4.;
754 return 2.25 * sigmaR2 + 0.09;
759 double fixedTerm = 0.01;
772 return 1.21 * sigmaR2 + fixedTerm;
801 return sigmaR2 + 0.005;
804 return 4 * sigmaR2 + 0.16;
807 return sigmaR2 + 0.005;
813 return 1.21 * sigmaR2;
820 return 2.25 * sigmaR2;
823 return 1.21 * sigmaR2;
double mooreErrorStrategyTight(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
static double parametrisedSigma(double r)
double mooreErrorStrategy(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
@ WireSagTimeCorrection
Wire sag correction was applied in calibration.
Trk::LocalParameters locPars
Gaudi::Property< bool > m_errorAtPredictedPosition
Add a term to the error to account for very poorly aligned stations.
@ COSMICS_TRIGGERTIME
case for normal cosmic data with rpc trigger or simulation including TOF.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
void setCalibWindow(unsigned long)
Only the first nCalibWindowBits bits will be stored!
Gaudi::Property< bool > m_stationError
Add a special error to account for the T0 refit.
DriftCircleStatus
Enumerates the 'status' of the wire on which the tracks passed (based on the TRT_Side enum,...
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
Eigen::Matrix< double, 2, 1 > Vector2D
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Gaudi::Property< bool > m_doMdt
Process MDT ROTs.
Gaudi::Property< double > m_globalToLocalTolerance
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
@ ATLTIME
normal time of flight corrections assuming IP + light speed to be used for simulated data and collisi...
virtual const MuonGM::MdtReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
#define ATH_MSG_VERBOSE(x)
@ NO_CORRECTIONS
special case for cosmics taken with scintilator trigger which is read out so the offset with respect ...
double muonErrorStrategy(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
MdtDriftCircleOnTrackCreator(const std::string &, const std::string &, const IInterface *)
This class provides conversion from CSC RDO data to CSC Digits.
virtual void updateSign(MdtDriftCircleOnTrack &rot, const Trk::DriftCircleSide si) const override final
Update of the sign of the drift radius.
Support class for PropertyMgr.
MdtDriftCircleOnTrack * MdtRotPtr
@ PropCorrection
Propagation correction was applied in calibration.
@ TempCorrection
Temperature correction was applied in calibration.
double driftTime() const
Returns the value of the drift time used to obtain the drift radius.
ToolHandle< IMdtCalibrationTool > m_mdtCalibrationTool
std::pair< double, ParamDefs > DefinedParameter
@ T0Refit
A special error was applied to account for the T0 refit (user defined via jobProperties)
@ WireSagGeomCorrection
Wire sag was applied, and so will affect errors.
@ UNDECIDED
sign of drift radius has not been determined
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for StraightLineSurface: GlobalToLocal method without dynamic memory allocation This method...
MuonDriftCircleErrorStrategy m_errorStrategy
< Error strategy for created ROTs
@ SlewCorrection
Slewing correction was applied in calibration.
@ FixedError
A fixed error is given to this hit (user defined via jobProperties)
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_looseErrors
@ TofCorrection
Time of flight correction was applied in calibration.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_t0Refit
Use error strategy for segments by default.
double mooreErrorStrategyLoose(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
Gaudi::Property< bool > m_doIndividualChamberReweights
toggle between MC and data alignment errors (to be removed in rel.
static constexpr double s_inverseSpeedOfLight
@ BackgroundCorrection
Background correction was applied in calibration.
virtual MdtDriftCircleOnTrack * clone() const override final
Pseudo-constructor, needed to avoid excessive RTTI.
@ NODRIFTTIME
drift time was not used - drift radius is 0.
double driftRadius() const
Returns the value of the drift radius.
@ Segment
Treating a segment or a track.
Trk::DriftCircleStatus m_status
information on the status of the Mdt measurement - see Trk::DriftCircleStatus for definitions
double mooreErrorStrategyMC(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
@ ErrorAtPredictedPosition
@ MagFieldCorrection
Magnetic field correction was applied in calibration.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
@ DECIDED
sign of drift radius has been determined
Identifier identify() const
return the identifier
@ StationError
A term is added to account for misaligned.
Gaudi::Property< bool > m_doSegments
Deweight individual chambers.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
const Amg::Vector2D & localPosition() const
return the local position reference
Gaudi::Property< bool > m_useErrorParametrisation
Use the predicted track position to correct the Error.
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
virtual void setLocalParameters(const Trk::LocalParameters &locPos)
Sets the local parameters.
CalibrationOutput getLocalMeasurement(const EventContext &ctx, const MdtPrepData &DC, const MdtCalibInput &calibInput, const MuonDriftCircleErrorStrategy &strategy) const
preform the mdt calibration
Class to represent measurements from the Monitored Drift Tubes.
Eigen::Matrix< double, 3, 1 > Vector3D
void setParameter(CreationParameter, bool value)
void setStrategy(Strategy)
Select the strategy to be used - only one can be set at a time.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
double timeOfFlight(const Amg::Vector3D &pos, const double beta, const double tTrack, const double tShift) const
DriftCircleSide
Enumerates the 'side' of the wire on which the tracks passed (i.e.
@ ParameterisedErrors
Use parameterised errors.
Gaudi::Property< bool > m_isMC
toggle whether the time of flight is included in the t0 shifts
Amg::MatrixX m_localCovariance
Gaudi::Property< bool > m_wasConfigured
Gaudi::Property< bool > m_createTubeHits
Scale ROTs depending on local alignment (i.e.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
double getTriggerTime() const
currently returns 0.
Gaudi::Property< bool > m_applyToF
toggle between loose errors (initial before alignment) and tight after alignment
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
virtual Trk::RIO_OnTrack * correct(const Trk::PrepRawData &prd, const Trk::TrackParameters &tp, const EventContext &) const override
Base class method for correct.
Gaudi::Property< int > m_timeCorrectionType
StIndex
enum to classify the different station layers in the muon spectrometer
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
virtual MdtRotPtr createRIO_OnTrack(const MdtPrepData &prd, const Amg::Vector3D &globalPos, const Amg::Vector3D *gdir=nullptr, const double t0Shift=0., const MuonDriftCircleErrorStrategy *strategy=nullptr, const double beta=1, const double tTrack=1) const override final
Calibrate a MdtPrepData object.
Gaudi::Property< bool > m_scaleMdtCov
Fixed error (not tube radius)
MdtDriftCircleOnTrackCreator::CalibrationOutput CalibrationOutput
struct to hold output of calibration
bool creationParameter(CreationParameter) const
virtual MdtRotPtr updateError(const MdtDriftCircleOnTrack &DCT, const Trk::TrackParameters *pars=nullptr, const MuonDriftCircleErrorStrategy *strategy=nullptr) const override
Update error of a ROT without changing the drift radius.
Gaudi::Property< bool > m_doFixedError
Use parameterised errors.
Gaudi::Property< std::string > m_defaultStrategy
if set to true, the ROT creator create 'tube' hits with a local position of 0 and an error of tube ra...
Strategy strategy() const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc