ATLAS Offline Software
MdtAnalyticRtCalibAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
5 
8 
12 
14 #include "TGraph.h"
15 #include "TGraphErrors.h"
16 #include "TH1F.h"
17 #include "TCanvas.h"
18 #include "TLegend.h"
19 #include "TROOT.h"
20 
21 #include <format>
22 
23 using namespace MuonCalib;
24 namespace MuonCalibR4{
25 
27  ATH_CHECK(m_idHelperSvc.retrieve());
28  ATH_CHECK(m_readKey.initialize());
29  ATH_CHECK(m_writeKey.initialize());
30  if (m_saveDiagnostic) {
31  gROOT->SetStyle("ATLAS");
32  }
33  return StatusCode::SUCCESS;
34  }
36  const EventContext& ctx{Gaudi::Hive::currentContext()};
37  SG::WriteCondHandle writeHandle{m_writeKey, ctx};
38  if(writeHandle.isValid()) {
39  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.");
40  return StatusCode::SUCCESS;
41  }
43  SG::ReadCondHandle readHandle{m_readKey, ctx};
44  ATH_CHECK(readHandle.isValid());
45  writeHandle.addDependency(readHandle);
47  auto writeCdo = std::make_unique<MdtCalibDataContainer>(m_idHelperSvc.get(), readHandle->granularity());
49  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
50  std::map<RtRelationPtr, RtRelationPtr, CalibParamSorter> translatedRts{CalibParamSorter{std::pow(0.1, m_precCutOff)}};
51 
52  RtRelationPtr dummyFillerRt{};
53  MdtFullCalibData::CorrectionPtr dummyFillerCorr{};
54  std::unordered_set<Identifier> missedElements{};
55  for (auto itr = idHelper.detectorElement_begin(); itr != idHelper.detectorElement_end(); ++itr){
56  const Identifier& detId{*itr};
57  if (!readHandle->hasDataForChannel(detId, msgStream())){
58  ATH_MSG_VERBOSE("There's no calibration data available for "<<m_idHelperSvc->toStringDetEl(detId));
59  missedElements.insert(detId);
60  continue;
61  }
62  const MdtFullCalibData* copyMe = readHandle->getCalibData(detId, msgStream());
63 
64  if (copyMe->corrections && !writeCdo->storeData(detId, copyMe->corrections, msgStream())) {
65  return StatusCode::FAILURE;
66  }
68  const std::vector<Identifier> tubes = tubeIds(detId);
69  if (std::ranges::find_if(tubes, [copyMe](const Identifier& tubeId){
70  return !copyMe->tubeCalib->getCalib(tubeId);
71  }) == tubes.end()) {
73  if (!writeCdo->storeData(detId, copyMe->tubeCalib, msgStream())) {
74  return StatusCode::FAILURE;
75  }
76  } else {
77  ATH_MSG_VERBOSE("Tube calibration constants invalid for: "<<m_idHelperSvc->toStringDetEl(detId));
78  missedElements.insert(detId);
79  }
80 
81  RtRelationPtr& translated = translatedRts[copyMe->rtRelation];
82  if (!translated) {
83  translated = translateRt(ctx, detId, *copyMe->rtRelation);
84  }
85  if (!dummyFillerRt) {
86  dummyFillerRt = translated;
87  dummyFillerCorr = copyMe->corrections;
88  }
89  if (!writeCdo->storeData(detId, translated, msgStream())) {
90  ATH_MSG_FATAL("Failed to store rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
91  return StatusCode::FAILURE;
92  }
93  }
94  if (!m_fillMissingCh) {
95  missedElements.clear();
96  }
97  for (const Identifier& detId: missedElements) {
98  ATH_MSG_WARNING("Initial container did not contain any constants for "<<m_idHelperSvc->toString(detId)
99  <<". Insert instead the first translated rt-relation for those channels");
100  const bool fillRt = !writeCdo->hasDataForChannel(detId, msgStream()) ||
101  !writeCdo->getCalibData(detId, msgStream())->rtRelation;
102  if(fillRt) {
103 
104  if (!writeCdo->storeData(detId, dummyFillerRt, msgStream())) {
105  ATH_MSG_FATAL("Failed to store rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
106  return StatusCode::FAILURE;
107  }
108  if (dummyFillerCorr && !writeCdo->storeData(detId, dummyFillerCorr, msgStream())) {
109  return StatusCode::FAILURE;
110  }
111  }
112  if (writeCdo->getCalibData(detId, msgStream())->tubeCalib) {
113  continue;
114  }
115  MdtCalibDataContainer::TubeContainerPtr dummyT0cont = std::make_unique<MdtTubeCalibContainer>(m_idHelperSvc.get(), detId);
117  dummyT0Calib.t0 = m_missingT0;
118  for (const Identifier& tubeId : tubeIds(detId)) {
119  if (!dummyT0cont->setCalib(dummyT0Calib, tubeId, msgStream())) {
120  return StatusCode::FAILURE;
121  }
122  }
123  if (!writeCdo->storeData(detId, std::move(dummyT0cont), msgStream())) {
124  return StatusCode::FAILURE;
125  }
126  }
127  ATH_CHECK(writeHandle.record(std::move(writeCdo)));
128  return StatusCode::SUCCESS;
129  }
130  std::vector<Identifier> MdtAnalyticRtCalibAlg::tubeIds(const Identifier& chId) const {
131  std::vector<Identifier> tubes{};
132  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
133  for (int ml = 1; ml <= idHelper.multilayerMax(chId); ++ml) {
134  const Identifier detId = idHelper.multilayerID(chId, ml);
135  for (int layer = 1; layer <= idHelper.tubeLayerMax(detId); ++layer) {
136  for (int tube = 1; tube <= idHelper.tubeMax(detId); ++tube) {
137  tubes.emplace_back(idHelper.channelID(detId, ml, layer, tube));
138  }
139  }
140  }
141  return tubes;
142  }
143 
145  MdtAnalyticRtCalibAlg::translateRt(const EventContext& ctx,
146  const Identifier& detId,
147  const MdtRtRelation& inRel) const {
148 
149 
150  const std::vector<SamplePoint> rtPoints = fetchDataPoints(*inRel.rt(), *inRel.rtRes());
151  IRtRelationPtr rt{};
152  ITrRelationPtr tr{};
153  unsigned int order{0};
154  while (order++ <= m_maxOrder && !rt) {
155  ATH_MSG_DEBUG("Attempt to fit rt relation for "<<m_idHelperSvc->toStringDetEl(detId)
156  <<" using a polynomial of order "<<order);
157  switch(m_polyTypeRt) {
158  case static_cast<int>(PolyType::ChebyChev):
159  rt = RtFromPoints::getRtChebyshev(rtPoints, order);
160  break;
161  case static_cast<int>(PolyType::Legendre):
162  rt = RtFromPoints::getRtLegendre(rtPoints, order);
163  break;
164  case static_cast<int>(PolyType::Simple):
165  rt = RtFromPoints::getRtSimplePoly(rtPoints, order);
166  break;
167  default:
168  break;
169  }
170  const unsigned rtNdoF = rtPoints.size() - rt->nDoF();
171  const double rtChi2 = calculateChi2(rtPoints, *rt) / rtNdoF;
172  ATH_MSG_VERBOSE("Fit has a chi2 of "<<rtChi2<<". Cut off at "<<m_chiCutOff);
173  if (rtChi2 > m_chiCutOff) {
174  rt.reset();
175  }
176  }
177  if (!rt) {
178  ATH_MSG_ERROR("Failed to fit rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
179  return nullptr;
180  }
181  const std::vector<SamplePoint> trPoints = swapCoordinates(rtPoints, *rt);
182  order = 0;
183  while (order++ <= m_maxOrder && !tr) {
184  ATH_MSG_DEBUG("Now continue with tr fit for "<<m_idHelperSvc->toStringDetEl(detId)
185  <<" using a polynomial of order "<<order);
186  switch(m_polyTypeTr) {
187  case static_cast<int>(PolyType::Legendre):
188  tr = RtFromPoints::getTrLegendre(trPoints, order);
189  break;
190  case static_cast<int>(PolyType::ChebyChev):
191  tr = RtFromPoints::getTrChebyshev(trPoints, order);
192  break;
193  case static_cast<int>(PolyType::Simple):
194  tr = RtFromPoints::getTrSimplePoly(trPoints, order);
195  break;
196  default:
197  break;
198  }
199  const unsigned trNdoF = rtPoints.size() - tr->nDoF();
200  const double trChi2 = calculateChi2(trPoints, *tr) / trNdoF;
202  ATH_MSG_VERBOSE("T-R fit resulted in a chi2/nDoF for tr: "<<trChi2<<" ("<<trNdoF<<")");
203  if (trChi2 > m_chiCutOff) {
204  tr.reset();
205  }
206  }
207  if (!tr) {
208  ATH_MSG_FATAL("Failed to fit tr relation for "<<m_idHelperSvc->toStringDetEl(detId));
209  return nullptr;
210  }
211  auto rtReso = inRel.smartReso();
212  if (m_fitRtReso) {
213  std::unique_ptr<IRtResolution> fittedReso{};
214  std::vector<SamplePoint> rtResoPoints = fetchResolution(rtPoints, m_relUncReso);
215  order = 0;
216  while (order++ <= m_maxOrderReso && !fittedReso) {
217  ATH_MSG_VERBOSE("Finally fit the resolution function "<<m_idHelperSvc->toStringDetEl(detId)
218  <<" using a polynomial of order "<<order);
219  fittedReso = RtFromPoints::getResoChebyshev(rtPoints, rt, m_relUncReso, order);
220  const unsigned nDoF = rtResoPoints.size() - fittedReso->nDoF();
221  const double chi2 = calculateChi2(rtResoPoints, *fittedReso) / nDoF;
222  ATH_MSG_VERBOSE("Fit has a chi2 of "<<chi2<<". Cut off at "<<m_chiCutOff);
223  if (chi2 > m_chiCutOff) {
224  if (order == m_maxOrderReso) {
225  drawResoFunc(ctx, detId, rtResoPoints, *fittedReso);
226  }
227  fittedReso.reset();
228  }
229  }
230 
231  if (fittedReso) {
232  drawResoFunc(ctx, detId, rtResoPoints, *fittedReso);
233  rtReso = std::move(fittedReso);
234  } else {
235  ATH_MSG_WARNING("Despite of having a "<<m_maxOrderReso
236  <<" no rt resolution function could be fitted for "<<m_idHelperSvc->toStringDetEl(detId));
237  }
238  }
239  auto finalRt = std::make_unique<MdtRtRelation>(std::move(rt), rtReso, std::move(tr));
240  drawRt(ctx, detId, rtPoints, *finalRt);
241  return finalRt;
242  }
243  void MdtAnalyticRtCalibAlg::drawRt(const EventContext& ctx,
244  const Identifier& detId,
245  const std::vector<SamplePoint>& rtPoints,
246  const MdtRtRelation& inRel) const {
247  if (!m_saveDiagnostic) {
248  return;
249  }
250  auto dataGraph = std::make_unique<TGraphErrors>();
251  for (const SamplePoint& dataPoint : rtPoints) {
252  dataGraph->SetPoint(dataGraph->GetN(), dataPoint.x1(), dataPoint.x2());
253  dataGraph->SetPointError(dataGraph->GetN()-1, 0., dataPoint.error());
254  }
255 
257  auto rtGraph = std::make_unique<TGraph>();
258  auto trGraph = std::make_unique<TGraph>();
259 
260  double driftTime{inRel.rt()->tLower()};
261  while (driftTime <= inRel.rt()->tUpper()) {
262  const double radius = inRel.rt()->radius(driftTime);
263  const double backRadius = std::clamp(radius,inRel.tr()->minRadius(), inRel.tr()->maxRadius());
264  const double backTime = inRel.tr()->driftTime(backRadius).value_or(-666.);
265  rtGraph->SetPoint(rtGraph->GetN(), driftTime, radius);
266  trGraph->SetPoint(trGraph->GetN(), backTime, radius);
267  driftTime+=1.;
268  }
269  auto canvas = std::make_unique<TCanvas>("can","can", 800, 600);
270  canvas->cd();
271  auto refHisto = std::make_unique<TH1F>("canvasHisto", "canvasHisto;drift time [ns]; drift radius [mm]", 1,
272  inRel.rt()->tLower() - 2, inRel.rt()->tUpper());
273 
274  refHisto->SetMinimum(0.);
275  refHisto->SetMaximum(inRel.rt()->radius(refHisto->GetXaxis()->GetBinUpEdge(1))*1.3);
276  refHisto->Draw("AXIS");
277  const std::string chName = std::format("{:}{:d}{:}{:d}M{:1d}",
278  m_idHelperSvc->stationNameString(detId),
279  std::abs(m_idHelperSvc->stationEta(detId)),
280  m_idHelperSvc->stationEta(detId)> 0? 'A' : 'C',
281  m_idHelperSvc->stationPhi(detId),
282  m_idHelperSvc->mdtIdHelper().multilayer(detId));
283 
284  dataGraph->SetMarkerSize(0);
285  dataGraph->Draw("P");
286  rtGraph->SetLineColor(kRed);
287  rtGraph->Draw("C");
288  trGraph->SetLineColor(kBlue);
289  trGraph->Draw("C");
290 
291  const unsigned rtNDoF= rtPoints.size() - inRel.rt()->nDoF();
292  const unsigned trNDoF= rtPoints.size() - inRel.tr()->nDoF();
293  const double rtChi2 = calculateChi2(rtPoints, *inRel.rt())/ rtNDoF;
294  const double trChi2 = calculateChi2(swapCoordinates(rtPoints, *inRel.rt()), *inRel.tr())/ trNDoF;
295 
296  auto legend = std::make_unique<TLegend>(0.2,0.7,0.6, 0.9,chName.c_str());
297  legend->SetFillStyle(0);
298  legend->SetBorderSize(0);
299  legend->AddEntry(rtGraph.get(),std::format("{:}, order: {:d}, #chi^{{2}}: {:.3f}({:d})",
300  inRel.rt()->name(), inRel.rt()->nDoF(), rtChi2, rtNDoF).c_str(),"L");
301 
302  legend->AddEntry(trGraph.get(),std::format("{:}, order: {:d}, #chi^{{2}}: {:.3f}({:d})",
303  inRel.tr()->name(), inRel.tr()->nDoF(), trChi2, trNDoF).c_str(),"L");
304 
305  legend->Draw();
306  canvas->SaveAs(std::format("MdtAnalyticRt_Evt{:d}_{:}.pdf", ctx.eventID().event_number(), chName).c_str());
307 
309  saveGraph(std::format("/{:}/Evt{:d}/Data_{:}", m_outStream.value(), ctx.evt(), chName ), std::move(dataGraph));
310  saveGraph(std::format("/{:}/Evt{:d}/Rt_{:}", m_outStream.value(), ctx.evt(), chName ), std::move(rtGraph));
311  saveGraph(std::format("/{:}/Evt{:d}/Tr_{:}", m_outStream.value(), ctx.evt(), chName ), std::move(trGraph));
312  }
313  void MdtAnalyticRtCalibAlg::saveGraph(const std::string& path, std::unique_ptr<TGraph>&& graph) const {
314  graph->SetName(path.substr(path.rfind("/")+1).c_str());
315  histSvc()->regGraph(path, std::move(graph)).ignore();
316  }
317  void MdtAnalyticRtCalibAlg::drawResoFunc(const EventContext& ctx,
318  const Identifier& detId,
319  const std::vector<SamplePoint>& resoPoints,
320  const IRtResolution& inReso) const{
321  auto dataGraph = std::make_unique<TGraphErrors>();
322  for (const SamplePoint& dataPoint : resoPoints) {
323  dataGraph->SetPoint(dataGraph->GetN(), dataPoint.x1(), dataPoint.x2());
324  dataGraph->SetPointError(dataGraph->GetN()-1, 0., dataPoint.error());
325  }
326  auto resoGraph = std::make_unique<TGraph>();
327  const auto [tLow, tHigh] = interval(resoPoints);
328  const auto [resoLow, resoHigh] = minMax(resoPoints);
329  double driftTime{tLow};
330  while (driftTime <= tHigh) {
331  const double evalReso = inReso.resolution(driftTime);
332  resoGraph->SetPoint(resoGraph->GetN(), driftTime, evalReso);
333  driftTime+=0.5;
334  }
335  auto canvas = std::make_unique<TCanvas>("can","can", 800, 600);
336  canvas->cd();
337  auto refHisto = std::make_unique<TH1F>("canvasHisto", "canvasHisto;drift time [ns]; #sigma(r_{drift}) [mm]", 1,
338  tLow - 2, tHigh + 2);
339 
340  refHisto->SetMinimum(resoLow*0.7);
341  refHisto->SetMaximum(resoHigh*1.3);
342  refHisto->Draw("AXIS");
343 
344  dataGraph->Draw("P");
345  resoGraph->SetLineColor(kRed);
346  resoGraph->Draw("C");
347 
348  const std::string chName = std::format("{:}{:d}{:}{:d}M{:1d}",
349  m_idHelperSvc->stationNameString(detId),
350  std::abs(m_idHelperSvc->stationEta(detId)),
351  m_idHelperSvc->stationEta(detId)> 0? 'A' : 'C',
352  m_idHelperSvc->stationPhi(detId),
353  m_idHelperSvc->mdtIdHelper().multilayer(detId));
354 
355  const double chi2 = calculateChi2(resoPoints, inReso) / (resoPoints.size() - inReso.nDoF());
356  auto label = MuonValR4::drawLabel(std::format("{:}, {:}, order: {:1d} #chi^{{2}}: {:.3f}", chName, inReso.name(),
357  inReso.nDoF(), chi2), 0.2, 0.8);
358  label->Draw();
359  canvas->SaveAs(std::format("MdtAnalyticReso_Evt{:d}_{:}.pdf", ctx.eventID().event_number(), chName).c_str());
360  }
361 }
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::t0
float t0
< relative t0 in chamber (ns)
Definition: MdtTubeCalibContainer.h:21
MuonCalib::RtFromPoints::getTrChebyshev
static std::unique_ptr< ITrRelation > getTrChebyshev(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of r-t data points into a t(r) relation expressed as a series of chebychev polynomial...
Definition: RtFromPoints.cxx:82
GeoModel::TransientConstSharedPtr< MdtRtRelation >
MuonCalib::IRtResolution::resolution
virtual double resolution(double t, double bgRate=0.0) const =0
returns resolution for a give time and background rate
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CalibParamSorter.h
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
VisualizationHelpers.h
MuonCalib::fetchResolution
std::vector< SamplePoint > fetchResolution(const std::vector< SamplePoint > &points, const double uncert)
Creates a new vector of sample points where the x2 is assigned to the uncertainty and the uncertainty...
Definition: SamplePointUtils.cxx:48
MuonCalib::CalibParamSorter
Helper struct to group Mdt calibration constants which are equivalent within the target precision.
Definition: CalibParamSorter.h:12
MuonCalib::calculateChi2
double calculateChi2(const std::vector< SamplePoint > &dataPoints, const IRtRelation &rtRel)
Returns the chi2 of the rt-relation w.r.t.
Definition: SamplePointUtils.cxx:100
initialize
void initialize()
Definition: run_EoverP.cxx:894
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
MuonCalib::interval
std::pair< double, double > interval(const std::vector< SamplePoint > &points)
Returns the interval covered by the sample points.
Definition: SamplePointUtils.cxx:92
MuonCalib::minMax
std::pair< double, double > minMax(const std::vector< SamplePoint > &points)
Returns the minimum & maximum values covered by the sample points.
Definition: SamplePointUtils.cxx:84
MuonCalib::ITrRelation::driftTime
virtual std::optional< double > driftTime(const double r) const =0
Interface method for fetching the drift-time from the radius Returns a nullopt if the time is out of ...
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonCalib::MdtTubeCalibContainer::getCalib
const SingleTubeCalib * getCalib(const Identifier &tubeId) const
return calibration constants of a single tube
Definition: MdtTubeCalibContainer.h:35
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:32
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
MuonCalib::MdtRtRelation
class which holds calibration constants per rt-region
Definition: MdtRtRelation.h:19
MuonCalib::MdtRtRelation::rtRes
const IRtResolution * rtRes() const
resolution
Definition: MdtRtRelation.h:24
ReadCondHandle.h
MuonCalib::MdtFullCalibData::corrections
CorrectionPtr corrections
Definition: MdtFullCalibData.h:20
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
MuonCalib::RtFromPoints::getResoChebyshev
static std::unique_ptr< IRtResolution > getResoChebyshev(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of reso - t into a reso(t) relation expressed as a series of chebychev polynomials.
Definition: RtFromPoints.cxx:85
MuonCalib::CalibFunc::name
virtual std::string name() const =0
MuonCalib::MdtFullCalibData::tubeCalib
TubeContainerPtr tubeCalib
Definition: MdtFullCalibData.h:22
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
MuonCalib::ITrRelation::maxRadius
virtual double maxRadius() const =0
Returns the maximum drift-radius.
MuonCalib::RtFromPoints::getRtChebyshev
static std::unique_ptr< IRtRelation > getRtChebyshev(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of r-t data points into a r(t) relation expressed as a series of chebychev polynomial...
Definition: RtFromPoints.cxx:79
DeMoAtlasDataLoss.canvas
dictionary canvas
Definition: DeMoAtlasDataLoss.py:187
MuonCalib::RtFromPoints::getRtSimplePoly
static std::unique_ptr< IRtRelation > getRtSimplePoly(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of r(t) data points into a r(t) relation expressed as a series of elementary monomoni...
Definition: RtFromPoints.cxx:101
RtFromPoints.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::MuonStationIndex::chName
const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:119
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonCalib::RtFromPoints::getTrSimplePoly
static std::unique_ptr< ITrRelation > getTrSimplePoly(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of t(r) data points into a t(r) relation expressed as a series of elementary monomoni...
Definition: RtFromPoints.cxx:104
WriteCondHandle.h
MdtAnalyticRtCalibAlg.h
MuonCalib::ITrRelation::minRadius
virtual double minRadius() const =0
Returns the minimum drift-radius.
add-xsec-uncert-quadrature-N.label
label
Definition: add-xsec-uncert-quadrature-N.py:104
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
MdtIdHelper
Definition: MdtIdHelper.h:61
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
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.
MuonCalib::fetchDataPoints
std::vector< SamplePoint > fetchDataPoints(const IRtRelation &rtRel, const double relUnc)
Constructs a list of sample points from the rt-relation.
Definition: SamplePointUtils.cxx:17
MuonCalibR4
Definition: MdtAnalyticRtCalibAlg.cxx:24
MuonCalib::RtFromPoints::getTrLegendre
static std::unique_ptr< ITrRelation > getTrLegendre(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of t(r) data points into a t(r) relation expressed as a series of legendre polynomial...
Definition: RtFromPoints.cxx:98
MuonCalib::MdtRtRelation::tr
const ITrRelation * tr() const
t(r) relationship
Definition: MdtRtRelation.h:25
plotBeamSpotVxVal.legend
legend
Definition: plotBeamSpotVxVal.py:97
MuonCalib::IRtRelation::radius
virtual double radius(double t) const =0
returns drift radius for a given time
MuonCalib::SamplePoint
Definition: SamplePoint.h:15
MuonCalib::MdtRtRelation::smartReso
const IRtResolutionPtr & smartReso() const
Definition: MdtRtRelation.h:30
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
MuonCalib::MdtTubeCalibContainer::setCalib
bool setCalib(SingleTubeCalib val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
Definition: MdtTubeCalibContainer.cxx:19
MuonCalib::IRtResolution
Generic interface to retrieve the resolution on the drift radius as a function of the drift time.
Definition: IRtResolution.h:20
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:23
MuonCalib::RtFromPoints::getRtLegendre
static std::unique_ptr< IRtRelation > getRtLegendre(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Converts a list of r-t data points into a r(t) relation expressed as a series of legendre polynomials...
Definition: RtFromPoints.cxx:95
MuonCalib::ITrRelation::nDoF
virtual unsigned nDoF() const =0
Returns the number of degrees of freedom of the tr relation.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonCalib::swapCoordinates
std::vector< SamplePoint > swapCoordinates(const std::vector< SamplePoint > &points, const IRtRelation &rtRel)
Creates a new vector of samples points with x1 exchanged by x2 and vice-versa.
Definition: SamplePointUtils.cxx:59
SamplePointUtils.h
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:19
MuonCalib::IRtRelation::nDoF
virtual unsigned nDoF() const =0
Returns the number of degrees of freedom of the relation function
MuonCalib::IRtResolution::nDoF
virtual unsigned nDoF() const =0
Returns the number of degrees of freedom of the relation function
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
calibdata.tube
tube
Definition: calibdata.py:30
Identifier
Definition: IdentifierFieldParser.cxx:14