ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MdtCalibrationTool Class Reference

#include <MdtCalibrationTool.h>

Inheritance diagram for MdtCalibrationTool:
Collaboration diagram for MdtCalibrationTool:

Public Types

using CorrectionPtr = MuonCalib::MdtFullCalibData::CorrectionPtr
 
using RtRelationPtr = MuonCalib::MdtFullCalibData::RtRelationPtr
 
using TubeContainerPtr = MuonCalib::MdtFullCalibData::TubeContainerPtr
 

Public Member Functions

 MdtCalibrationTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor More...
 
virtual ~MdtCalibrationTool ()=default
 destructor More...
 
virtual StatusCode initialize () override final
 initialization More...
 
virtual MdtCalibOutput calibrate (const EventContext &ctx, const MdtCalibInput &hit, bool resolFromRtrack=false) const override final
 Convert the raw MDT time (+charge) into a drift radius + error. More...
 
virtual MdtCalibTwinOutput calibrateTwinTubes (const EventContext &ctx, MdtCalibInput &&hit, MdtCalibInput &&twinHit) const override final
 Convert the raw MDT times of two twin hits into a Twin position (coordinate along tube) It returns whether the conversion was successful. More...
 
virtual double getResolutionFromRt (const EventContext &ctx, const Identifier &module, const double time) const override final
 
virtual ToolSettings getSettings () const override final
 
virtual const MuonCalib::MdtFullCalibDatagetCalibConstants (const EventContext &ctx, const Identifier &channelId) const override final
 

Private Member Functions

Muon::MdtDriftCircleStatus driftTimeStatus (double driftTime, const MuonCalib::MdtRtRelation &rtRelation) const
 

Private Attributes

Gaudi::Property< int > m_windowSetting {this, "TimeWindowSetting", timeWindowMode::Default}
 
Gaudi::Property< double > m_timeWindowLowerBound {this, "TimeWindowLowerBound", 0.}
 
Gaudi::Property< double > m_timeWindowUpperBound {this, "TimeWindowUpperBound", 0.}
 
Gaudi::Property< bool > m_doTof {this, "DoTofCorrection", true}
 
Gaudi::Property< bool > m_doProp {this, "DoPropagationCorrection", true}
 
Gaudi::Property< bool > m_doTemp {this, "DoTemperatureCorrection", false}
 
Gaudi::Property< bool > m_doField {this,"DoMagneticFieldCorrection", false}
 
Gaudi::Property< bool > m_doSlew {this, "DoSlewingCorrection", false}
 
Gaudi::Property< bool > m_doBkg {this, "DoBackgroundCorrection", false}
 
Gaudi::Property< bool > m_doPropUncert {this, "DoPropagationTimeUncert", false}
 
ToolHandle< MuonCalib::IShiftMapToolsm_t0ShiftTool {this, "T0ShiftTool", ""}
 
ToolHandle< MuonCalib::IShiftMapToolsm_tMaxShiftTool {this, "TShiftMaxTool", ""}
 
Gaudi::Property< bool > m_doT0Shift {this, "DoT0Shift", false}
 
Gaudi::Property< bool > m_doTMaxShift {this, "DoTMaxShift", false}
 
Gaudi::Property< double > m_unphysicalHitRadiusUpperBound {this, "UpperBoundHitRadius", 20.}
 
Gaudi::Property< double > m_unphysicalHitRadiusLowerBound {this, "LowerBoundHitRadius" , 0.}
 
Gaudi::Property< double > m_resTwin {this, "ResolutionTwinTube" , 1.05, "Twin tube resolution"}
 
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainerm_calibDbKey
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 

Detailed Description

the Mdt Calib Service provides, on request, the drift radius and its error, computed applying the proper calibration, for any hit in Mdt chambers

Author
Martin Woudstra, Niels van Eldik

Definition at line 35 of file MdtCalibrationTool.h.

Member Typedef Documentation

◆ CorrectionPtr

Definition at line 39 of file MdtCalibrationTool.h.

◆ RtRelationPtr

Definition at line 40 of file MdtCalibrationTool.h.

◆ TubeContainerPtr

Definition at line 41 of file MdtCalibrationTool.h.

Constructor & Destructor Documentation

◆ MdtCalibrationTool()

MdtCalibrationTool::MdtCalibrationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

constructor

Definition at line 33 of file MdtCalibrationTool.cxx.

33  :
34  base_class(type, name, parent) {}

◆ ~MdtCalibrationTool()

virtual MdtCalibrationTool::~MdtCalibrationTool ( )
virtualdefault

destructor

Member Function Documentation

◆ calibrate()

MdtCalibOutput MdtCalibrationTool::calibrate ( const EventContext &  ctx,
const MdtCalibInput hit,
bool  resolFromRtrack = false 
) const
finaloverridevirtual

Convert the raw MDT time (+charge) into a drift radius + error.

It returns whether the conversion was successful.

Parameters
[in,out]hitHit must have pointer set to the MdtDigit, as well as the global hit position (including the position along the tube!)
[in]signedTracklengththe track length from the 'triggerpoint' to the hit. It is used for the time-of-flight correction. This triggerpoint is the I.P. for ATLAS p-p collisions, typically scintillators in test-beam and cosmic teststands, and not clear yet what is it is for cosmics in ATLAS. The sign is for determining the sign of the time-of-flight correction. If a muon first passes the triggerpoint, and then the MDT tube, the sign should be positive (the case for ATLAS p-p and H8 test-beam). If a muon first passes the MDT tube, and then de triggerpoint, the sign should be negative (typically the case for cosmic-ray teststands).
[in]triggerTimethe time of the 'triggerpoint' in ns. This is the time (measured with the same clock as the MDT TDC's) when the muon passed a known point in space: the 'triggerpoint'. For ATLAS this is 0.0 since the TDC's are synchonised w.r.t. the bunch-crossings. For H8 test-beam it is the trigger time, which is time when the muon passed the trigger scintillators. For cosmic-ray teststands it is usually also the time when the muon passed the trigger scintillators. For cosmics in ATLAS it is not clear yet.
[in]resolFromRtrackindicates the method to provide the resolution as a function of the distance of the reconstructed track from the anode wire instead of the drift radius

Retrieve the constants for the specific tube

calculate drift time

slewing corrections

now check whether we are outside the time window

Definition at line 107 of file MdtCalibrationTool.cxx.

109  {
110 
111  const Identifier& id{calibIn.identify()};
112  const MuonCalib::MdtFullCalibData* calibConstants = getCalibConstants(ctx, id);
113  if (!calibConstants) {
114  ATH_MSG_WARNING("Could not find calibration data for channel "<<m_idHelperSvc->toString(id));
115  return MdtCalibOutput{};
116  }
117 
118  // require at least the MdtRtRelation to be available
119  const RtRelationPtr& rtRelation{calibConstants->rtRelation};
120  // Hardcoded MDT tube radius 14.6mm here - not correct for sMDT
121  // on the other hand it should be rare that a tube does not have an RT
122  if(!rtRelation) {
123  ATH_MSG_WARNING("No rtRelation found, cannot calibrate tube "<<m_idHelperSvc->toString(id));
124  return MdtCalibOutput{};
125  }
126  if (!calibConstants->tubeCalib) {
127  ATH_MSG_WARNING("Cannot extract the single tube calibrations for tube "<<m_idHelperSvc->toString(id));
128  return MdtCalibOutput{};
129  }
131  const SingleTubeCalib* singleTubeData = calibConstants->tubeCalib->getCalib(id);
132  if (!singleTubeData) {
133  ATH_MSG_WARNING("Failed to access tubedata for " << m_idHelperSvc->toString(id));
134  return MdtCalibOutput{};
135  }
136 
137  MdtCalibOutput calibResult{};
138  // correct for global t0 of rt-region
139 
140  calibResult.setTubeT0(singleTubeData->t0 + rtRelation->t0Global());
141  calibResult.setMeanAdc(singleTubeData->adcCal);
142 
143  // set propagation delay
144  if (m_doProp) {
145  const double propagationDistance = calibIn.signalPropagationDistance();
146  ATH_MSG_VERBOSE("Calibration of "<<m_idHelperSvc->toString(id)<<", propagation distance: "<<propagationDistance<<" -> "
147  <<(singleTubeData->inversePropSpeed * propagationDistance));
148  calibResult.setPropagationTime(singleTubeData->inversePropSpeed * propagationDistance);
149  }
150 
152  const double driftTime = calibIn.tdc() * tdcBinSize
153  - (m_doTof ? calibIn.timeOfFlight() : 0.)
154  - calibIn.triggerTime()
155  - calibResult.tubeT0()
156  - calibResult.signalPropagationTime();
157 
158  calibResult.setDriftTime(driftTime);
159  // apply corrections
160  double corrTime{0.};
161  const bool doCorrections = m_doField || m_doTemp || m_doBkg;
162  if (doCorrections) {
163  const CorrectionPtr& corrections{calibConstants->corrections};
164  const RtRelationPtr& rtRelation{calibConstants->rtRelation};
165  const MuonCalib::IRtRelation* rt = rtRelation->rt();
166  ATH_MSG_VERBOSE("There are correction functions.");
168  if (m_doSlew && corrections->slewing()) {
169  double slewTime=corrections->slewing()->correction(calibResult.driftTime(), calibIn.adc());
170  corrTime -= slewTime;
171  calibResult.setSlewingTime(slewTime);
172  }
173 
174 
175  if (m_doField && corrections->bField()) {
176  MagField::AtlasFieldCache fieldCache{};
177 
179  if (!readHandle.isValid()) {
180  THROW_EXCEPTION("calibrate: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCacheCondObjInputKey.key());
181  }
182  readHandle->getInitializedCache(fieldCache);
183 
185  fieldCache.getField(calibIn.closestApproach().data(), globalB.data());
186  const Amg::Vector2D locBField = calibIn.projectMagneticField(globalB);
187  using BFieldComp = MdtCalibInput::BFieldComp;
188  calibResult.setLorentzTime(corrections->bField()->correction(calibResult.driftTime(),
189  locBField[static_cast<int>(BFieldComp::alongWire)],
190  locBField[static_cast<int>(BFieldComp::alongTrack)]));
191  corrTime -= calibResult.lorentzTime();
192  }
193  if(m_doTemp && rt && rt->hasTmaxDiff()) {
194  const MdtIdHelper& id_helper{m_idHelperSvc->mdtIdHelper()};
195  const int mL = id_helper.multilayer(id);
196  const double tempTime = MuonCalib::RtScaleFunction(calibResult.driftTime(), mL == 2, *rt);
197  calibResult.setTemperatureTime(tempTime);
198  corrTime-=calibResult.temperatureTime();
199  }
200  // background corrections (I guess this is never active)
201  if (m_doBkg && corrections->background()) {
202  double bgLevel{0.};
203  calibResult.setBackgroundTime(corrections->background()->correction(calibResult.driftTime(), bgLevel ));
204  corrTime += calibResult.backgroundTime();
205  }
206  }
207 
208  calibResult.setDriftTime(calibResult.driftTime() + corrTime);
209 
210  // calculate drift radius + error
211  double r{0.}, reso{0.};
212  double t = calibResult.driftTime();
213  double t_inrange = t;
214  Muon::MdtDriftCircleStatus timeStatus = driftTimeStatus(t, *rtRelation);
215 
216  assert(rtRelation->rt() != nullptr);
217  r = rtRelation->rt()->radius(t);
218  // apply tUpper gshift
219  if (m_doTMaxShift) {
220  float tShift = m_tMaxShiftTool->getValue(id);
221  r = rtRelation->rt()->radius( t * (1 + tShift) );
222  }
223  // check whether drift times are within range, if not fix them to the min/max range
224  if ( t < rtRelation->rt()->tLower() ) {
225  t_inrange = rtRelation->rt()->tLower();
226  double rmin = rtRelation->rt()->radius( t_inrange );
227  double drdt = (rtRelation->rt()->radius( t_inrange + 30. ) - rmin)/30.;
229  if (timeStatus == Muon::MdtStatusBeforeSpectrum) {
230  t = rtRelation->rt()->tLower() - m_timeWindowLowerBound;
231  }
232  // if we get here we are outside the rt range but inside the window.
233  r = std::max(rmin + drdt*(t-t_inrange), m_unphysicalHitRadiusLowerBound.value());
234  } else if( t > rtRelation->rt()->tUpper() ) {
235  t_inrange = rtRelation->rt()->tUpper();
236  double rmax = rtRelation->rt()->radius( t_inrange );
237  double drdt = (rmax - rtRelation->rt()->radius( t_inrange - 30. ))/30.;
238  // now check whether we are outside the time window
239  if ( timeStatus == Muon::MdtStatusAfterSpectrum ) {
240  t = rtRelation->rt()->tUpper() + m_timeWindowUpperBound;
241  }
242  // if we get here we are outside the rt range but inside the window.
243  r = rmax + drdt*(t-t_inrange);
244  }
245 
246  assert(rtRelation->rtRes() != nullptr);
247  if (!resolFromRtrack) {
248  reso = rtRelation->rtRes()->resolution( t_inrange );
249  } else {
250  const std::optional<double> tFromR = rtRelation->tr()->driftTime(std::abs(calibIn.distanceToTrack()));
251  reso = rtRelation->rtRes()->resolution(tFromR.value_or(0.));
252  }
253 
254 
255  if (m_doPropUncert) {
256  assert(rtRelation->rt() != nullptr);
257 
258  const double driftTimeUp = std::min(rtRelation->rt()->tUpper(),
259  calibIn.tdc() * tdcBinSize
260  - (m_doTof ? calibIn.timeOfFlight() : 0.)
261  - calibIn.triggerTime()
262  - calibResult.tubeT0());
263 
264  const double driftTimeDn = std::max(rtRelation->rt()->tLower(),
265  calibIn.tdc() * tdcBinSize
266  - (m_doTof ? calibIn.timeOfFlight() : 0.)
267  - calibIn.triggerTime()
268  - calibResult.tubeT0()
269  - calibIn.tubeLength() * singleTubeData->inversePropSpeed);
270 
271  const double radiusUp = rtRelation->rt()->radius(driftTimeUp);
272  const double radiusDn = rtRelation->rt()->radius(driftTimeDn);
273  ATH_MSG_VERBOSE("Measurement "<<m_idHelperSvc->toString(calibIn.identify())
274  <<" nominal drift time "<<driftTime<<", down: "<<driftTimeDn<<", up: "<<driftTimeUp
275  <<" --> driftRadius: "<<r<<" pm "<<reso<<", prop-up: "<<radiusUp<<", prop-dn: "<<radiusDn
276  <<" delta: "<<(radiusUp-radiusDn));
277  calibResult.setDriftUncertSigProp(0.5*std::abs(radiusUp - radiusDn));
278  }
279 
280  calibResult.setDriftRadius(r, reso);
281  calibResult.setStatus(timeStatus);
282  // summary
283  ATH_MSG_VERBOSE( "Calibration for tube " << m_idHelperSvc->toString(id)
284  <<" passed. "<<std::endl<<"Input: "<<calibIn<<std::endl<<"Extracted calib constants: "<<calibResult<<std::endl);
285  return calibResult;
286 } //end MdtCalibrationTool::calibrate

◆ calibrateTwinTubes()

MdtCalibTwinOutput MdtCalibrationTool::calibrateTwinTubes ( const EventContext &  ctx,
MdtCalibInput &&  hit,
MdtCalibInput &&  twinHit 
) const
finaloverridevirtual

Convert the raw MDT times of two twin hits into a Twin position (coordinate along tube) It returns whether the conversion was successful.

The primary hit has a smaller tdc...

Propagation time difference inside the primary tube

HVPropTime - ROPropTime = invPropSpeed*(twinZ - HVPos) - (ROPos - twinZ) = 2*invPropSpeed*twinZ - (HVPos + ROPos)

Definition at line 288 of file MdtCalibrationTool.cxx.

290  {
291 
292  MdtCalibOutput primResult = calibrate(ctx, primHit);
293  MdtCalibOutput twinResult = calibrate(ctx, twinHit);
294 
295  // get Identifier and MdtReadOutElement for twin tubes
296  // get 'raw' drifttimes of twin pair; we don't use timeofFlight or propagationTime cause they are irrelevant for twin coordinate
297  double primdriftTime = primHit.tdc()*tdcBinSize - primResult.tubeT0();
298  double twinDriftTime = twinHit.tdc()*tdcBinSize - twinResult.tubeT0();
300  if (primdriftTime >= twinDriftTime) {
301  ATH_MSG_VERBOSE("Swap "<<m_idHelperSvc->toString(primHit.identify())<<" & "<<m_idHelperSvc->toString(twinHit.identify())
302  <<" primDriftTime: "<<primdriftTime<<", secondTime: "<<twinDriftTime);
303  std::swap(primdriftTime, twinDriftTime);
304  std::swap(primResult, twinResult);
305  std::swap(primHit, twinHit);
306  }
307  const Identifier& primId = primHit.identify();
308  const Identifier& twinId = twinHit.identify();
309 
310  // get calibration constants from DbTool
311  const MuonCalib::MdtFullCalibData* data1st = getCalibConstants(ctx, primId);
312  const MuonCalib::MdtFullCalibData* data2nd = getCalibConstants(ctx, twinId);
313  if (!data1st || !data2nd) {
314  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Failed to access calibration constants for tubes "<<
315  m_idHelperSvc->toString(primId)<<" & "<<m_idHelperSvc->toString(twinId));
316  return MdtCalibTwinOutput{};
317  }
318  const SingleTubeCalib* calibSingleTube1st = data1st->tubeCalib->getCalib(primId);
319  const SingleTubeCalib* calibSingleTube2nd = data2nd->tubeCalib->getCalib(twinId);
320  if (!calibSingleTube1st || !calibSingleTube2nd) {
321  ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Failed to access calibration constants for tubes "<<
322  m_idHelperSvc->toString(primId)<<" & "<<m_idHelperSvc->toString(twinId));
323  return MdtCalibTwinOutput{};
324  }
325 
326  // get tubelength and set HV-delay (~6ns)
327  constexpr double HVdelay = 6.;
328 
330  double twin_timedif = twinDriftTime - primdriftTime - calibSingleTube2nd->inversePropSpeed * twinHit.tubeLength() - HVdelay;
333 
334  const double tubeHalfLength = 0.5*primHit.tubeLength();
335  const double zTwin = std::clamp(0.5* primHit.readOutSide()* twin_timedif / calibSingleTube1st->inversePropSpeed,
336  -tubeHalfLength, tubeHalfLength);
337  const double errZTwin = m_resTwin / calibSingleTube1st->inversePropSpeed;
338 
339  ATH_MSG_VERBOSE( "Twin calibration - tube: " << m_idHelperSvc->toString(primId)<< " twintube: " << m_idHelperSvc->toString(twinId)<<endmsg
340  << " prompthit tdc = " << primHit.tdc() << " twinhit tdc = " << twinHit.tdc()
341  << " tube driftTime = " << primResult<< " second tube driftTime = " << twinResult<<endmsg
342  << " Time difference =" << twin_timedif << " zTwin=" << zTwin<<", errorZ="<<errZTwin);
343  MdtCalibTwinOutput calibResult{primHit,twinHit,primResult, twinResult};
344 
345 
346  calibResult.setLocZ(zTwin, errZTwin);
347  return calibResult;
348 }

◆ driftTimeStatus()

Muon::MdtDriftCircleStatus MdtCalibrationTool::driftTimeStatus ( double  driftTime,
const MuonCalib::MdtRtRelation rtRelation 
) const
private

Definition at line 350 of file MdtCalibrationTool.cxx.

351  {
352  if (rtRelation.rt()) {
353  if(driftTime < rtRelation.rt()->tLower() - m_timeWindowLowerBound) {
354  ATH_MSG_VERBOSE( " drift time outside time window "
355  << driftTime << ". Mininum time = "
356  << rtRelation.rt()->tLower() - m_timeWindowLowerBound );
358  } else if (driftTime > rtRelation.rt()->tUpper() + m_timeWindowUpperBound) {
359  ATH_MSG_VERBOSE( " drift time outside time window "
360  << driftTime << ". Maximum time = "
361  << rtRelation.rt()->tUpper() + m_timeWindowUpperBound);
363  }
364  } else {
365  ATH_MSG_WARNING( "No valid rt relation supplied for driftTimeStatus method" );
367  }
369 }

◆ getCalibConstants()

const MuonCalib::MdtFullCalibData * MdtCalibrationTool::getCalibConstants ( const EventContext &  ctx,
const Identifier channelId 
) const
finaloverridevirtual

Definition at line 99 of file MdtCalibrationTool.cxx.

100  {
101  SG::ReadCondHandle constantHandle{m_calibDbKey, ctx};
102  if (!constantHandle.isValid()){
103  THROW_EXCEPTION("Failed to retrieve the Mdt calibration constants "<<m_calibDbKey.fullKey());
104  }
105  return constantHandle->getCalibData(channelId, msgStream());
106 }

◆ getResolutionFromRt()

double MdtCalibrationTool::getResolutionFromRt ( const EventContext &  ctx,
const Identifier module,
const double  time 
) const
finaloverridevirtual

Definition at line 370 of file MdtCalibrationTool.cxx.

370  {
371 
372  const MuonCalib::MdtFullCalibData* moduleConstants = getCalibConstants(ctx, moduleID);
373  if (!moduleConstants){
374  THROW_EXCEPTION("Failed to retrieve set of calibration constants for "<<m_idHelperSvc->toString(moduleID));
375  }
376  const RtRelationPtr& rtRel{moduleConstants->rtRelation};
377  if (!rtRel) {
378  THROW_EXCEPTION("No rt-relation found for "<<m_idHelperSvc->toString(moduleID));
379  }
380  const double t = std::min(std::max(time, rtRel->rt()->tLower()), rtRel->rt()->tUpper());
381  return rtRel->rtRes()->resolution(t);
382 }

◆ getSettings()

ToolSettings MdtCalibrationTool::getSettings ( ) const
finaloverridevirtual

Definition at line 36 of file MdtCalibrationTool.cxx.

36  {
37  ToolSettings settings{};
38  using Property = ToolSettings::Property;
39  settings.setBit(Property::TofCorrection, m_doTof);
40  settings.setBit(Property::PropCorrection, m_doProp);
41  settings.setBit(Property::TempCorrection, m_doTemp);
42  settings.setBit(Property::MagFieldCorrection, m_doField);
43  settings.setBit(Property::SlewCorrection, m_doSlew);
44  settings.setBit(Property::BackgroundCorrection, m_doBkg);
45  settings.window = static_cast<timeWindowMode>(m_windowSetting.value());
46  return settings;
47 }

◆ initialize()

StatusCode MdtCalibrationTool::initialize ( )
finaloverridevirtual

initialization

Ensure that the conditions dependency is properly declared

Shifting tools to evaluate systematic uncertainties on the T0 timing

Definition at line 48 of file MdtCalibrationTool.cxx.

48  {
49  ATH_MSG_DEBUG( "Initializing" );
50 
51  switch(m_windowSetting.value()) {
52  case timeWindowMode::UserDefined:
53  ATH_MSG_DEBUG("Use predefined user values of "<<m_timeWindowLowerBound<<" & "<<m_timeWindowUpperBound);
54  break;
56  ATH_MSG_DEBUG("Use 1000. & 2000. as the lower and upper time window values ");
57  m_timeWindowLowerBound = 1000.;
58  m_timeWindowUpperBound = 2000.;
59  break;
60  case timeWindowMode::CollisionG4:
61  ATH_MSG_DEBUG("Use Geant4 collision time window of 20-30");
64  break;
65  case timeWindowMode::CollisionData:
66  ATH_MSG_DEBUG("Use collision data time window of 10 to 30");
69  break;
70  case timeWindowMode::CollisionFitT0:
71  ATH_MSG_DEBUG("Use collision data time window of 50 to 100 to fit T0 in the end");
74  break;
75  default:
76  ATH_MSG_FATAL("Unknown time window setting "<<m_windowSetting<<" provided.");
77  return StatusCode::FAILURE;
78  };
79 
80  ATH_CHECK(m_idHelperSvc.retrieve());
85  ATH_CHECK(m_t0ShiftTool.retrieve(EnableTool{m_doT0Shift}));
86  ATH_CHECK(m_tMaxShiftTool.retrieve(EnableTool{m_doTMaxShift}));
87  ATH_MSG_DEBUG("Initialization finalized "<<std::endl
88  <<" TimeWindow: ["<< m_timeWindowLowerBound.value()<<";"<<m_timeWindowUpperBound.value()<<"]"<<std::endl
89  <<" Correct time of flight "<<(m_doTof ? "yay" : "nay")<<std::endl
90  <<" Correct propagation time "<<(m_doProp ? "si" : "no")<<std::endl
91  <<" Correct temperature "<<(m_doTemp ? "si" : "no")<<std::endl
92  <<" Correct magnetic field "<<(m_doField ? "si" : "no")<<std::endl
93  <<" Correct time slew "<<(m_doSlew ? "si" : "no")<<std::endl
94  <<" Correct background "<<(m_doBkg ? "si" : "no"));
95  return StatusCode::SUCCESS;
96 } //end MdtCalibrationTool::initialize

Member Data Documentation

◆ m_calibDbKey

SG::ReadCondHandleKey<MuonCalib::MdtCalibDataContainer> MdtCalibrationTool::m_calibDbKey
private
Initial value:
{this, "CalibDataKey", "MdtCalibConstants",
"Conditions object containing the calibrations"}

Definition at line 127 of file MdtCalibrationTool.h.

◆ m_doBkg

Gaudi::Property<bool> MdtCalibrationTool::m_doBkg {this, "DoBackgroundCorrection", false}
private

Definition at line 111 of file MdtCalibrationTool.h.

◆ m_doField

Gaudi::Property<bool> MdtCalibrationTool::m_doField {this,"DoMagneticFieldCorrection", false}
private

Definition at line 109 of file MdtCalibrationTool.h.

◆ m_doProp

Gaudi::Property<bool> MdtCalibrationTool::m_doProp {this, "DoPropagationCorrection", true}
private

Definition at line 107 of file MdtCalibrationTool.h.

◆ m_doPropUncert

Gaudi::Property<bool> MdtCalibrationTool::m_doPropUncert {this, "DoPropagationTimeUncert", false}
private

Definition at line 112 of file MdtCalibrationTool.h.

◆ m_doSlew

Gaudi::Property<bool> MdtCalibrationTool::m_doSlew {this, "DoSlewingCorrection", false}
private

Definition at line 110 of file MdtCalibrationTool.h.

◆ m_doT0Shift

Gaudi::Property<bool> MdtCalibrationTool::m_doT0Shift {this, "DoT0Shift", false}
private

Definition at line 119 of file MdtCalibrationTool.h.

◆ m_doTemp

Gaudi::Property<bool> MdtCalibrationTool::m_doTemp {this, "DoTemperatureCorrection", false}
private

Definition at line 108 of file MdtCalibrationTool.h.

◆ m_doTMaxShift

Gaudi::Property<bool> MdtCalibrationTool::m_doTMaxShift {this, "DoTMaxShift", false}
private

Definition at line 120 of file MdtCalibrationTool.h.

◆ m_doTof

Gaudi::Property<bool> MdtCalibrationTool::m_doTof {this, "DoTofCorrection", true}
private

Definition at line 106 of file MdtCalibrationTool.h.

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> MdtCalibrationTool::m_fieldCacheCondObjInputKey
private
Initial value:
{this, "AtlasFieldCacheCondObj", "fieldCondObj",
"Name of the Magnetic Field conditions object key"}

Definition at line 134 of file MdtCalibrationTool.h.

◆ m_idHelperSvc

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

Definition at line 136 of file MdtCalibrationTool.h.

◆ m_resTwin

Gaudi::Property<double> MdtCalibrationTool::m_resTwin {this, "ResolutionTwinTube" , 1.05, "Twin tube resolution"}
private

Definition at line 124 of file MdtCalibrationTool.h.

◆ m_t0ShiftTool

ToolHandle<MuonCalib::IShiftMapTools> MdtCalibrationTool::m_t0ShiftTool {this, "T0ShiftTool", ""}
private

Definition at line 114 of file MdtCalibrationTool.h.

◆ m_timeWindowLowerBound

Gaudi::Property<double> MdtCalibrationTool::m_timeWindowLowerBound {this, "TimeWindowLowerBound", 0.}
private

Definition at line 104 of file MdtCalibrationTool.h.

◆ m_timeWindowUpperBound

Gaudi::Property<double> MdtCalibrationTool::m_timeWindowUpperBound {this, "TimeWindowUpperBound", 0.}
private

Definition at line 105 of file MdtCalibrationTool.h.

◆ m_tMaxShiftTool

ToolHandle<MuonCalib::IShiftMapTools> MdtCalibrationTool::m_tMaxShiftTool {this, "TShiftMaxTool", ""}
private

Definition at line 116 of file MdtCalibrationTool.h.

◆ m_unphysicalHitRadiusLowerBound

Gaudi::Property<double> MdtCalibrationTool::m_unphysicalHitRadiusLowerBound {this, "LowerBoundHitRadius" , 0.}
private

Definition at line 123 of file MdtCalibrationTool.h.

◆ m_unphysicalHitRadiusUpperBound

Gaudi::Property<double> MdtCalibrationTool::m_unphysicalHitRadiusUpperBound {this, "UpperBoundHitRadius", 20.}
private

Definition at line 122 of file MdtCalibrationTool.h.

◆ m_windowSetting

Gaudi::Property<int> MdtCalibrationTool::m_windowSetting {this, "TimeWindowSetting", timeWindowMode::Default}
private

Definition at line 103 of file MdtCalibrationTool.h.


The documentation for this class was generated from the following files:
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::t0
float t0
< relative t0 in chamber (ns)
Definition: MdtTubeCalibContainer.h:20
beamspotman.r
def r
Definition: beamspotman.py:676
MdtCalibrationTool::calibrate
virtual MdtCalibOutput calibrate(const EventContext &ctx, const MdtCalibInput &hit, bool resolFromRtrack=false) const override final
Convert the raw MDT time (+charge) into a drift radius + error.
Definition: MdtCalibrationTool.cxx:107
GeoModel::TransientConstSharedPtr< MdtCorFuncSet >
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MdtCalibInput::BFieldComp
BFieldComp
Definition: MdtCalibInput.h:123
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
MdtCalibrationTool::m_doTof
Gaudi::Property< bool > m_doTof
Definition: MdtCalibrationTool.h:106
MuonCalib::IRtRelation::hasTmaxDiff
bool hasTmaxDiff() const
Definition: IRtRelation.h:36
Muon::MdtStatusAfterSpectrum
@ MdtStatusAfterSpectrum
The tube produced a hit that is inconsistent with the drift time spectrum, the drift time is larger t...
Definition: MdtDriftCircleStatus.h:40
Muon::MdtDriftCircleStatus
MdtDriftCircleStatus
Enum to represent the 'status' of Mdt measurements e.g.
Definition: MdtDriftCircleStatus.h:25
MdtCalibrationTool::m_doBkg
Gaudi::Property< bool > m_doBkg
Definition: MdtCalibrationTool.h:111
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
MdtCalibrationTool::m_tMaxShiftTool
ToolHandle< MuonCalib::IShiftMapTools > m_tMaxShiftTool
Definition: MdtCalibrationTool.h:116
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
Property
Support class for PropertyMgr.
Definition: Property.h:23
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
MdtCalibrationTool::m_timeWindowUpperBound
Gaudi::Property< double > m_timeWindowUpperBound
Definition: MdtCalibrationTool.h:105
MdtCalibInput::identify
const Identifier & identify() const
Returns the Identifier of the hit.
Definition: MdtCalibInput.cxx:84
MuonCalib::MdtFullCalibData::corrections
CorrectionPtr corrections
Definition: MdtFullCalibData.h:20
MdtCalibrationTool::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: MdtCalibrationTool.h:134
MuonCalib::MdtFullCalibData::tubeCalib
TubeContainerPtr tubeCalib
Definition: MdtFullCalibData.h:22
MCP::SystVariation::Default
@ Default
Definition: EnumDef.h:73
MdtCalibrationTool::m_calibDbKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_calibDbKey
Definition: MdtCalibrationTool.h:127
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
Muon::MdtStatusBeforeSpectrum
@ MdtStatusBeforeSpectrum
The tube produced a hit that is inconsistent with the drift time spectrum, the drift time is smaller ...
Definition: MdtDriftCircleStatus.h:37
MdtCalibInput::tubeLength
double tubeLength() const
Returns the tube length.
Definition: MdtCalibInput.cxx:154
MdtCalibrationTool::m_unphysicalHitRadiusLowerBound
Gaudi::Property< double > m_unphysicalHitRadiusLowerBound
Definition: MdtCalibrationTool.h:123
MdtCalibrationTool::m_doTemp
Gaudi::Property< bool > m_doTemp
Definition: MdtCalibrationTool.h:108
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MdtCalibrationTool::m_doPropUncert
Gaudi::Property< bool > m_doPropUncert
Definition: MdtCalibrationTool.h:112
MdtCalibrationTool::m_doField
Gaudi::Property< bool > m_doField
Definition: MdtCalibrationTool.h:109
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtCalibrationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtCalibrationTool.h:136
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCalib::IRtRelation::tUpper
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
MdtCalibOutput
Definition: MdtCalibOutput.h:10
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
MdtCalibrationTool::m_doSlew
Gaudi::Property< bool > m_doSlew
Definition: MdtCalibrationTool.h:110
MdtCalibrationTool::m_t0ShiftTool
ToolHandle< MuonCalib::IShiftMapTools > m_t0ShiftTool
Definition: MdtCalibrationTool.h:114
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::adcCal
float adcCal
quality flag for the SingleTubeCalib constants: 0 all ok, 1 no hits found, 2 too few hits,...
Definition: MdtTubeCalibContainer.h:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MdtCalibrationTool::RtRelationPtr
MuonCalib::MdtFullCalibData::RtRelationPtr RtRelationPtr
Definition: MdtCalibrationTool.h:40
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::inversePropSpeed
float inversePropSpeed
multiplicative correction factor for ADC measurement w.r.t.
Definition: MdtTubeCalibContainer.h:22
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MdtCalibOutput::setTubeT0
void setTubeT0(const double T0)
Sets the tube T0.
Definition: MdtCalibOutput.cxx:44
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MdtCalibrationTool::m_windowSetting
Gaudi::Property< int > m_windowSetting
Definition: MdtCalibrationTool.h:103
MuonCalib::IRtRelation::tLower
virtual double tLower() const =0
Returns the lower time covered by the r-t.
MuonCalib::MdtRtRelation::rt
const IRtRelation * rt() const
rt relation
Definition: MdtRtRelation.h:27
MdtCalibTwinOutput
Definition: MdtCalibTwinOutput.h:11
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtCalibrationTool::m_timeWindowLowerBound
Gaudi::Property< double > m_timeWindowLowerBound
Definition: MdtCalibrationTool.h:104
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
MdtCalibrationTool::m_doTMaxShift
Gaudi::Property< bool > m_doTMaxShift
Definition: MdtCalibrationTool.h:120
Muon::MdtStatusUnDefined
@ MdtStatusUnDefined
Undefined.
Definition: MdtDriftCircleStatus.h:43
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:18
MdtCalibrationTool::m_doProp
Gaudi::Property< bool > m_doProp
Definition: MdtCalibrationTool.h:107
MdtCalibrationTool::driftTimeStatus
Muon::MdtDriftCircleStatus driftTimeStatus(double driftTime, const MuonCalib::MdtRtRelation &rtRelation) const
Definition: MdtCalibrationTool.cxx:350
MuonCalib::RtScaleFunction
float RtScaleFunction(const float t, const bool ml2, const IRtRelation &rtrelation)
Definition: RtScaleFunction.cxx:20
ToolSettings
MdtCalibrationTool::ToolSettings ToolSettings
Definition: MdtCalibrationTool.cxx:32
MdtCalibInput::tdc
int16_t tdc() const
Returns the tdc counts of the hit.
Definition: MdtCalibInput.cxx:85
MdtCalibrationTool::getCalibConstants
virtual const MuonCalib::MdtFullCalibData * getCalibConstants(const EventContext &ctx, const Identifier &channelId) const override final
Definition: MdtCalibrationTool.cxx:99
MuonCalib::IRtRelation
generic interface for a rt-relation
Definition: IRtRelation.h:15
MdtCalibOutput::tubeT0
double tubeT0() const
Returns the point in time where the muon typically enters the chamber.
Definition: MdtCalibOutput.cxx:43
MdtCalibrationTool::m_resTwin
Gaudi::Property< double > m_resTwin
Definition: MdtCalibrationTool.h:124
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Identifier
Definition: IdentifierFieldParser.cxx:14