ATLAS Offline Software
Loading...
Searching...
No Matches
MdtDriftCircleOnTrackCreator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUON_MDTDRIFTCIRCLEONTRACKCREATOR_H
6#define MUON_MDTDRIFTCIRCLEONTRACKCREATOR_H
7
8#include <bitset>
9#include <memory>
10#include <string>
11
13#include "GaudiKernel/PhysicalConstants.h"
23
24class MdtCalibToolInput;
25
26namespace Muon {
27
28class MdtPrepData;
29
70 public:
90
91 public:
92 MdtDriftCircleOnTrackCreator(const std::string&, const std::string&, const IInterface*);
93 virtual ~MdtDriftCircleOnTrackCreator() = default;
94
95 virtual StatusCode initialize() override final;
96
110 const Amg::Vector3D& globalPos,
111 const Amg::Vector3D* gdir = nullptr,
112 const double t0Shift = 0.,
113 const MuonDriftCircleErrorStrategy* strategy = nullptr,
114 const double beta = 1,
115 const double tTrack = 1) const override final;
116
126 virtual void updateSign(MdtDriftCircleOnTrack& rot,
127 const Trk::DriftCircleSide si) const override final;
128
139 const Trk::TrackParameters* pars = nullptr,
140 const MuonDriftCircleErrorStrategy* strategy = nullptr) const override;
141
142
144 virtual Trk::RIO_OnTrack* correct(const Trk::PrepRawData& prd,
145 const Trk::TrackParameters& tp, const EventContext& /*ctx*/) const override;
146
156 virtual MdtRotPtr correct(const MdtPrepData& prd,
157 const Trk::TrackParameters& tp,
159 const double beta,
160 const double tTrack) const override final;
161
164 return m_errorStrategy;
165 };
166
179
180
181
182 private:
183
184 double timeOfFlight(const Amg::Vector3D& pos,
185 const double beta,
186 const double tTrack,
187 const double tShift) const;
188
190 CalibrationOutput getLocalMeasurement(const EventContext& ctx,
191 const MdtPrepData& DC,
192 const MdtCalibInput& calibInput,
193 const MuonDriftCircleErrorStrategy& strategy) const;
194
196 double getTriggerTime() const { return 0.; }
197
198 // parametrised error function
199 static double parametrisedSigma(double r);
200
201 double mooreErrorStrategy(const MuonDriftCircleErrorStrategy& myStrategy,
202 double sigmaR,
203 const Identifier& id) const;
204
205 double mooreErrorStrategyMC(const MuonDriftCircleErrorStrategy& myStrategy,
206 double sigmaR,
207 const Identifier& id) const;
208
210 double sigmaR,
211 const Identifier& id) const;
212
214 double sigmaR,
215 const Identifier& id) const;
216
217 double muonErrorStrategy(const MuonDriftCircleErrorStrategy& myStrategy,
218 double sigmaR,
219 const Identifier& id) const;
220
221 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
222
223 ToolHandle<IMdtCalibrationTool> m_mdtCalibrationTool{this, "CalibrationTool", ""};
224
225 // Configuration variables
226 Gaudi::Property<bool> m_doMdt{this, "doMDT", true};
228 Gaudi::Property<int> m_timeCorrectionType{this, "TimingMode", 0};
229 // Constants for use during calculations
231 Gaudi::Property<double> m_fixedError{this, "FixedError", 1.};
232
233 Gaudi::Property<double> m_globalToLocalTolerance{this, "GlobalToLocalTolerance", 1000.,
234 "Tolerance used for the Surface::globalToLocal"};
235
236 // Member variables used to fill the default error strategy
239
241 Gaudi::Property<std::string> m_defaultStrategy{this, "DefaultErrorStrategy", "Muon",
242 "Default error strategy to be used in calculating errors"};
243
246 Gaudi::Property<bool> m_createTubeHits{this, "CreateTubeHit", false};
248 Gaudi::Property<bool> m_scaleMdtCov{this, "DoErrorScaling", true};
250 Gaudi::Property<bool> m_doFixedError{this, "DoFixedError", true};
252 Gaudi::Property<bool> m_useErrorParametrisation{this, "UseParametrisedError", false};
257 Gaudi::Property<bool> m_errorAtPredictedPosition{this, "UseErrorAtPredictedPosition", false};
259 Gaudi::Property<bool> m_stationError{this, "DoStationError", false};
261 Gaudi::Property<bool> m_t0Refit{this, "T0RefitError", false};
263 Gaudi::Property<bool> m_doSegments{this, "DoSegmentErrors", true};
265 Gaudi::Property<bool> m_doIndividualChamberReweights{this, "DeweightIndividualChambers", true};
267 Gaudi::Property<bool> m_isMC{this, "IsMC", false};
269 Gaudi::Property<bool> m_applyToF{this, "ApplyToF", true};
272 Gaudi::Property<bool> m_looseErrors{this, "UseLooseErrors", false,
273 "Use error strategy for MC"};
274 Gaudi::Property<bool> m_wasConfigured{this, "WasConfigured", false,
275 "This tool is too complicated to rely on defaults. Will fail if not configured."};
276
277 static constexpr double s_inverseSpeedOfLight{1. / Gaudi::Units::c_light};
278
279 int m_BME_idx{-1};
280
281};
282
283} // namespace Muon
284
285#endif
Eigen::Matrix< double, 3, 1 > Vector3D
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Interface for tools calibrating MdtPrepData, turning them into Muon::MdtDriftCircleOnTrack object.
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.
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.
virtual ~MdtDriftCircleOnTrackCreator()=default
Gaudi::Property< bool > m_scaleMdtCov
Fixed error (not tube radius)
virtual const MuonDriftCircleErrorStrategy & errorStrategy() const override
Returns the default error strategy object.
Gaudi::Property< bool > m_t0Refit
Use error strategy for segments by default.
virtual void updateSign(MdtDriftCircleOnTrack &rot, const Trk::DriftCircleSide si) const override final
Update of the sign of the drift radius.
MdtDriftCircleOnTrackCreator(const std::string &, const std::string &, const IInterface *)
MuonDriftCircleErrorStrategy m_errorStrategy
< Error strategy for created ROTs
virtual StatusCode initialize() override final
CalibrationOutput getLocalMeasurement(const EventContext &ctx, const MdtPrepData &DC, const MdtCalibInput &calibInput, const MuonDriftCircleErrorStrategy &strategy) const
preform the mdt calibration
double mooreErrorStrategyMC(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
Gaudi::Property< double > m_fixedError
< Error used when m_doFixed error =true or m_scaleErrorManually = true
double getTriggerTime() const
currently returns 0.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< bool > m_applyToF
toggle between loose errors (initial before alignment) and tight after alignment
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...
virtual Trk::RIO_OnTrack * correct(const Trk::PrepRawData &prd, const Trk::TrackParameters &tp, const EventContext &) const override
Base class method for correct.
Gaudi::Property< bool > m_doIndividualChamberReweights
toggle between MC and data alignment errors (to be removed in rel.
double mooreErrorStrategyLoose(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
double muonErrorStrategy(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
Gaudi::Property< bool > m_doSegments
Deweight individual chambers.
double mooreErrorStrategy(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
Gaudi::Property< bool > m_errorAtPredictedPosition
Add a term to the error to account for very poorly aligned stations.
ToolHandle< IMdtCalibrationTool > m_mdtCalibrationTool
@ ATLTIME
normal time of flight corrections assuming IP + light speed to be used for simulated data and collisi...
@ NO_CORRECTIONS
special case for cosmics taken with scintilator trigger which is read out so the offset with respect ...
@ COSMICS_TRIGGERTIME
case for normal cosmic data with rpc trigger or simulation including TOF.
Gaudi::Property< bool > m_createTubeHits
Scale ROTs depending on local alignment (i.e.
double mooreErrorStrategyTight(const MuonDriftCircleErrorStrategy &myStrategy, double sigmaR, const Identifier &id) const
Gaudi::Property< bool > m_stationError
Add a special error to account for the T0 refit.
double timeOfFlight(const Amg::Vector3D &pos, const double beta, const double tTrack, const double tShift) const
Gaudi::Property< bool > m_useErrorParametrisation
Use the predicted track position to correct the Error.
Gaudi::Property< bool > m_doMdt
Process MDT ROTs.
Gaudi::Property< bool > m_isMC
toggle whether the time of flight is included in the t0 shifts
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Class to represent measurements from the Monitored Drift Tubes.
Definition MdtPrepData.h:33
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
int r
Definition globals.cxx:22
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::bitset< 23 > MuonDriftCircleErrorStrategyInput
Ensure that the ATLAS eigen extensions are properly loaded.
CalibrationOutput(Trk::LocalParameters lp, Amg::MatrixX le, double t, bool ok)