ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonCalibR4::MdtAnalyticRtCalibAlg Class Reference

#include <MdtAnalyticRtCalibAlg.h>

Inheritance diagram for MuonCalibR4::MdtAnalyticRtCalibAlg:
Collaboration diagram for MuonCalibR4::MdtAnalyticRtCalibAlg:

Public Types

enum  PolyType { PolyType::ChebyChev, PolyType::Legendre, PolyType::Simple }
 
using RtRelationPtr = MuonCalib::MdtFullCalibData::RtRelationPtr
 

Public Member Functions

virtual ~MdtAnalyticRtCalibAlg ()=default
 
virtual StatusCode initialize () override final
 
virtual StatusCode execute (const EventContext &ctx) const override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void drawRt (const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &rtPoints, const MuonCalib::MdtRtRelation &inRel) const
 
void drawResoFunc (const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &resoPoints, const MuonCalib::IRtResolution &inReso) const
 
RtRelationPtr translateRt (const EventContext &ctx, const Identifier &detId, const MuonCalib::MdtRtRelation &inRel) const
 Translates the rt / tr & resolution relation from a look-up table into the requested polynomial type. More...
 
std::vector< IdentifiertubeIds (const Identifier &chId) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ServiceHandle< MuonValR4::IRootVisualizationServicem_visualSvc {this, "VisualSvc", "MuonValR4::RootVisualizationService"}
 Service handle of the visualization service. More...
 
MuonValR4::IRootVisualizationService::ClientToken m_clientToken {}
 Token to be presented to the visualization service
More...
 
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainerm_readKey {this, "ReadKey", "MdtCalibConstantsR4"}
 
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainerm_writeKey
 
Gaudi::Property< unsigned > m_maxOrder {this, "maxOrder", 12}
 Maximum order of the polynomial in use. More...
 
Gaudi::Property< int > m_polyTypeRt {this, "PolyTypeRt", Acts::toUnderlying(PolyType::ChebyChev)}
 Toggle the polynomial for the Rt-relation: ChebyChev or Legendre. More...
 
Gaudi::Property< int > m_polyTypeTr {this, "PolyTypeTr", Acts::toUnderlying(PolyType::Legendre)}
 Toggle the polynomial for the Rt-relation: ChebyChev or Legendre. More...
 
Gaudi::Property< bool > m_fitRtReso {this, "FitRtReso", true}
 Toggle whether the resolution shall be also converted into a polynomial. More...
 
Gaudi::Property< double > m_relUncReso {this, "RelUncertOnReso", 0.01}
 Assignment of the relative uncertainty on each resolution data point. More...
 
Gaudi::Property< unsigned > m_maxOrderReso {this, "maxOrderReso", 25}
 Maximal order to use for the resolution
More...
 
Gaudi::Property< float > m_chiCutOff {this,"chi2CutOff", 0.05}
 Stop incrementing the order once the chi2CutOff is reached
More...
 
Gaudi::Property< bool > m_saveDiagnostic {this, "saveDiagnosticHist", true}
 Save diagnostic histograms. More...
 
Gaudi::Property< std::string > m_outStream {this, "OutStream", "MDTANALYTICRTS"}
 StreamName of the diagnostic histograms. More...
 
Gaudi::Property< unsigned > m_precCutOff {this,"precCutOff", 6}
 Precision cut-off to treat two incoming rt-relations as equivalent. More...
 
Gaudi::Property< bool > m_fillMissingCh {this, "fillMissingCh", true}
 At the end of the translation, it's checked whether all channels have been assigned. More...
 
Gaudi::Property< float > m_missingT0 {this, "missingT0", 5.4597301}
 Default t0 constant to use, in case there's
More...
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 27 of file MdtAnalyticRtCalibAlg.h.

Member Typedef Documentation

◆ RtRelationPtr

Definition at line 40 of file MdtAnalyticRtCalibAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ PolyType

Enumerator
ChebyChev 
Legendre 
Simple 

Definition at line 35 of file MdtAnalyticRtCalibAlg.h.

35  {
36  ChebyChev,
37  Legendre,
38  Simple
39  };

Constructor & Destructor Documentation

◆ ~MdtAnalyticRtCalibAlg()

virtual MuonCalibR4::MdtAnalyticRtCalibAlg::~MdtAnalyticRtCalibAlg ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ drawResoFunc()

void MuonCalibR4::MdtAnalyticRtCalibAlg::drawResoFunc ( const EventContext &  ctx,
const Identifier detId,
const std::vector< MuonCalib::SamplePoint > &  resoPoints,
const MuonCalib::IRtResolution inReso 
) const
private

Definition at line 306 of file MdtAnalyticRtCalibAlg.cxx.

309  {
310 
311  const std::string chName = std::format("{:}{:d}{:}{:d}M{:1d}",
312  m_idHelperSvc->stationNameString(detId),
313  std::abs(m_idHelperSvc->stationEta(detId)),
314  m_idHelperSvc->stationEta(detId)> 0? 'A' : 'C',
315  m_idHelperSvc->stationPhi(detId),
316  m_idHelperSvc->mdtIdHelper().multilayer(detId));
317 
318  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, std::format("RtReso_{:}", chName) );
319  canvas->setAxisTitles("drift time [ns]", "#sigma(r_{drift}) [mm]");
320  auto dataGraph = std::make_unique<TGraphErrors>();
321  for (const SamplePoint& dataPoint : resoPoints) {
322  dataGraph->SetPoint(dataGraph->GetN(), dataPoint.x1(), dataPoint.x2());
323  dataGraph->SetPointError(dataGraph->GetN()-1, 0., dataPoint.error());
324  canvas->expandPad(dataPoint.x1(), dataPoint.x2());
325  }
326  auto resoGraph = std::make_unique<TGraph>();
327  const auto [tLow, tHigh] = interval(resoPoints);
328  const auto [resoLow, resoHigh] = minMax(resoPoints);
329  canvas->expandPad(tLow, resoLow);
330  canvas->expandPad(tHigh, resoHigh);
331  double driftTime{tLow};
332  while (driftTime <= tHigh) {
333  const double evalReso = inReso.resolution(driftTime);
334  resoGraph->SetPoint(resoGraph->GetN(), driftTime, evalReso);
335  driftTime+=0.5;
336  }
337  canvas->add(std::move(dataGraph), "P");
338  canvas->add(std::move(resoGraph), "C");
339 
340  const double chi2 = calculateChi2(resoPoints, inReso) / (resoPoints.size() - inReso.nDoF());
341  canvas->add(MuonValR4::drawLabel(std::format("{:}, {:}, order: {:1d} #chi^{{2}}: {:.3f}", chName, inReso.name(),
342  inReso.nDoF(), chi2), 0.2, 0.8));
343  }

◆ drawRt()

void MuonCalibR4::MdtAnalyticRtCalibAlg::drawRt ( const EventContext &  ctx,
const Identifier detId,
const std::vector< MuonCalib::SamplePoint > &  rtPoints,
const MuonCalib::MdtRtRelation inRel 
) const
private

Populate the rt & tr relation graphs

Definition at line 244 of file MdtAnalyticRtCalibAlg.cxx.

247  {
248  if (!m_saveDiagnostic) {
249  return;
250  }
251  const std::string chName = std::format("{:}{:d}{:}{:d}M{:1d}",
252  m_idHelperSvc->stationNameString(detId),
253  std::abs(m_idHelperSvc->stationEta(detId)),
254  m_idHelperSvc->stationEta(detId)> 0? 'A' : 'C',
255  m_idHelperSvc->stationPhi(detId),
256  m_idHelperSvc->mdtIdHelper().multilayer(detId));
257  auto canvas = m_visualSvc->prepareCanvas(ctx, m_clientToken, std::format("RtRelation_{:}", chName) );
258  canvas->setAxisTitles("drift time [ns]", "drift radius [mm]");
259  auto dataGraph = std::make_unique<TGraphErrors>();
260  for (const SamplePoint& dataPoint : rtPoints) {
261  dataGraph->SetPoint(dataGraph->GetN(), dataPoint.x1(), dataPoint.x2());
262  dataGraph->SetPointError(dataGraph->GetN()-1, 0., dataPoint.error());
263  canvas->expandPad(dataPoint.x1(), dataPoint.x2());
264  }
265 
267  auto rtGraph = std::make_unique<TGraph>();
268  auto trGraph = std::make_unique<TGraph>();
269 
270  double driftTime{inRel.rt()->tLower()};
271  while (driftTime <= inRel.rt()->tUpper()) {
272  const double radius = inRel.rt()->radius(driftTime);
273  const double backRadius = std::clamp(radius,inRel.tr()->minRadius(), inRel.tr()->maxRadius());
274  const double backTime = inRel.tr()->driftTime(backRadius).value_or(-666.);
275  rtGraph->SetPoint(rtGraph->GetN(), driftTime, radius);
276  trGraph->SetPoint(trGraph->GetN(), backTime, radius);
277  canvas->expandPad(driftTime, radius);
278  canvas->expandPad(backTime, radius);
279  driftTime+=1.;
280  }
281 
282  const unsigned rtNDoF= rtPoints.size() - inRel.rt()->nDoF();
283  const unsigned trNDoF= rtPoints.size() - inRel.tr()->nDoF();
284  const double rtChi2 = calculateChi2(rtPoints, *inRel.rt())/ rtNDoF;
285  const double trChi2 = calculateChi2(swapCoordinates(rtPoints, *inRel.rt()), *inRel.tr())/ trNDoF;
286 
287  auto legend = std::make_unique<TLegend>(0.2,0.7,0.6, 0.9,chName.c_str());
288  legend->SetFillStyle(0);
289  legend->SetBorderSize(0);
290  legend->AddEntry(rtGraph.get(),std::format("{:}, order: {:d}, #chi^{{2}}: {:.3f}({:d})",
291  inRel.rt()->name(), inRel.rt()->nDoF(), rtChi2, rtNDoF).c_str(),"L");
292 
293  legend->AddEntry(trGraph.get(),std::format("{:}, order: {:d}, #chi^{{2}}: {:.3f}({:d})",
294  inRel.tr()->name(), inRel.tr()->nDoF(), trChi2, trNDoF).c_str(),"L");
295 
296  dataGraph->SetMarkerSize(0);
297  rtGraph->SetLineColor(kRed);
298  trGraph->SetLineColor(kBlue);
299 
300  canvas->add(std::move(dataGraph), "P");
301  canvas->add(std::move(rtGraph), "C");
302  canvas->add(std::move(trGraph), "C");
303  canvas->add(std::move(legend));
304  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonCalibR4::MdtAnalyticRtCalibAlg::execute ( const EventContext &  ctx) const
finaloverridevirtual

Setup the conditions handle to convert the calibration constants

Output conditions object

Start the loop

Check whether all tubes are complete

Copy the calibration constants for T0 & the corrections

Definition at line 39 of file MdtAnalyticRtCalibAlg.cxx.

39  {
40  SG::WriteCondHandle writeHandle{m_writeKey, ctx};
41  if(writeHandle.isValid()) {
42  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.");
43  return StatusCode::SUCCESS;
44  }
46  SG::ReadCondHandle readHandle{m_readKey, ctx};
47  ATH_CHECK(readHandle.isValid());
48  writeHandle.addDependency(readHandle);
50  auto writeCdo = std::make_unique<MdtCalibDataContainer>(m_idHelperSvc.get(), readHandle->granularity());
52  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
53  std::map<RtRelationPtr, RtRelationPtr, CalibParamSorter> translatedRts{CalibParamSorter{std::pow(0.1, m_precCutOff)}};
54 
55  RtRelationPtr dummyFillerRt{};
56  MdtFullCalibData::CorrectionPtr dummyFillerCorr{};
57  std::unordered_set<Identifier> missedElements{};
58  for (auto itr = idHelper.detectorElement_begin(); itr != idHelper.detectorElement_end(); ++itr){
59  const Identifier& detId{*itr};
60  if (!readHandle->hasDataForChannel(detId, msgStream())){
61  ATH_MSG_VERBOSE("There's no calibration data available for "<<m_idHelperSvc->toStringDetEl(detId));
62  missedElements.insert(detId);
63  continue;
64  }
65  const MdtFullCalibData* copyMe = readHandle->getCalibData(detId, msgStream());
66 
67  if (copyMe->corrections && !writeCdo->storeData(detId, copyMe->corrections, msgStream())) {
68  return StatusCode::FAILURE;
69  }
71  const std::vector<Identifier> tubes = tubeIds(detId);
72  if (std::ranges::none_of(tubes, [copyMe](const Identifier& tubeId){
73  return !copyMe->tubeCalib->getCalib(tubeId);
74  })) {
76  if (!writeCdo->storeData(detId, copyMe->tubeCalib, msgStream())) {
77  return StatusCode::FAILURE;
78  }
79  } else {
80  ATH_MSG_VERBOSE("Tube calibration constants invalid for: "<<m_idHelperSvc->toStringDetEl(detId));
81  missedElements.insert(detId);
82  }
83 
84  RtRelationPtr& translated = translatedRts[copyMe->rtRelation];
85  if (!translated) {
86  translated = translateRt(ctx, detId, *copyMe->rtRelation);
87  }
88  if (!dummyFillerRt) {
89  dummyFillerRt = translated;
90  dummyFillerCorr = copyMe->corrections;
91  }
92  if (!writeCdo->storeData(detId, translated, msgStream())) {
93  ATH_MSG_FATAL("Failed to store rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
94  return StatusCode::FAILURE;
95  }
96  }
97  if (!m_fillMissingCh) {
98  missedElements.clear();
99  }
100  for (const Identifier& detId: missedElements) {
101  ATH_MSG_WARNING("Initial container did not contain any constants for "<<m_idHelperSvc->toString(detId)
102  <<". Insert instead the first translated rt-relation for those channels");
103  const bool fillRt = !writeCdo->hasDataForChannel(detId, msgStream()) ||
104  !writeCdo->getCalibData(detId, msgStream())->rtRelation;
105  if(fillRt) {
106  if (!writeCdo->storeData(detId, dummyFillerRt, msgStream())) {
107  ATH_MSG_FATAL("Failed to store rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
108  return StatusCode::FAILURE;
109  }
110  if (dummyFillerCorr && !writeCdo->storeData(detId, dummyFillerCorr, msgStream())) {
111  return StatusCode::FAILURE;
112  }
113  }
114  if (writeCdo->getCalibData(detId, msgStream())->tubeCalib) {
115  continue;
116  }
117  MdtCalibDataContainer::TubeContainerPtr dummyT0cont = std::make_unique<MdtTubeCalibContainer>(m_idHelperSvc.get(), detId);
119  dummyT0Calib.t0 = m_missingT0;
120  for (const Identifier& tubeId : tubeIds(detId)) {
121  if (!dummyT0cont->setCalib(dummyT0Calib, tubeId, msgStream())) {
122  return StatusCode::FAILURE;
123  }
124  }
125  if (!writeCdo->storeData(detId, std::move(dummyT0cont), msgStream())) {
126  return StatusCode::FAILURE;
127  }
128  }
129  ATH_CHECK(writeHandle.record(std::move(writeCdo)));
130  return StatusCode::SUCCESS;
131  }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ initialize()

StatusCode MuonCalibR4::MdtAnalyticRtCalibAlg::initialize ( )
finaloverridevirtual

Definition at line 27 of file MdtAnalyticRtCalibAlg.cxx.

27  {
28  ATH_CHECK(m_idHelperSvc.retrieve());
31  if (m_saveDiagnostic) {
32  ATH_CHECK(m_visualSvc.retrieve());
34  m_clientToken.preFixName = "AnalyticMdtCalib";
35  ATH_CHECK(m_visualSvc->registerClient(m_clientToken));
36  }
37  return StatusCode::SUCCESS;
38  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ translateRt()

MdtAnalyticRtCalibAlg::RtRelationPtr MuonCalibR4::MdtAnalyticRtCalibAlg::translateRt ( const EventContext &  ctx,
const Identifier detId,
const MuonCalib::MdtRtRelation inRel 
) const
private

Translates the rt / tr & resolution relation from a look-up table into the requested polynomial type.

If translation fails, a nullptr is returned

Parameters
ctxEventContext mainly used for visualization
detIdIdentifier of the associated Mdt multilayer (visualization)
inRelPointer to the input rt relation to translate

Reject bad fits

Definition at line 147 of file MdtAnalyticRtCalibAlg.cxx.

149  {
150 
151  const std::vector<SamplePoint> rtPoints = fetchDataPoints(*inRel.rt(), *inRel.rtRes());
152  IRtRelationPtr rt{};
153  ITrRelationPtr tr{};
154  unsigned int order{0};
155  while (order++ <= m_maxOrder && !rt) {
156  ATH_MSG_DEBUG("Attempt to fit rt relation for "<<m_idHelperSvc->toStringDetEl(detId)
157  <<" using a polynomial of order "<<order);
158  switch(m_polyTypeRt) {
159  case toUnderlying(PolyType::ChebyChev):
160  rt = RtFromPoints::getRtChebyshev(rtPoints, order);
161  break;
162  case toUnderlying(PolyType::Legendre):
163  rt = RtFromPoints::getRtLegendre(rtPoints, order);
164  break;
165  case toUnderlying(PolyType::Simple):
166  rt = RtFromPoints::getRtSimplePoly(rtPoints, order);
167  break;
168  default:
169  break;
170  }
171  const unsigned rtNdoF = rtPoints.size() - rt->nDoF();
172  const double rtChi2 = calculateChi2(rtPoints, *rt) / rtNdoF;
173  ATH_MSG_VERBOSE("Fit has a chi2 of "<<rtChi2<<". Cut off at "<<m_chiCutOff);
174  if (rtChi2 > m_chiCutOff) {
175  rt.reset();
176  }
177  }
178  if (!rt) {
179  ATH_MSG_ERROR("Failed to fit rt relation for "<<m_idHelperSvc->toStringDetEl(detId));
180  return nullptr;
181  }
182  const std::vector<SamplePoint> trPoints = swapCoordinates(rtPoints, *rt);
183  order = 0;
184  while (order++ <= m_maxOrder && !tr) {
185  ATH_MSG_DEBUG("Now continue with tr fit for "<<m_idHelperSvc->toStringDetEl(detId)
186  <<" using a polynomial of order "<<order);
187  switch(m_polyTypeTr) {
188  case toUnderlying(PolyType::Legendre):
189  tr = RtFromPoints::getTrLegendre(trPoints, order);
190  break;
191  case toUnderlying(PolyType::ChebyChev):
192  tr = RtFromPoints::getTrChebyshev(trPoints, order);
193  break;
194  case toUnderlying(PolyType::Simple):
195  tr = RtFromPoints::getTrSimplePoly(trPoints, order);
196  break;
197  default:
198  break;
199  }
200  const unsigned trNdoF = rtPoints.size() - tr->nDoF();
201  const double trChi2 = calculateChi2(trPoints, *tr) / trNdoF;
203  ATH_MSG_VERBOSE("T-R fit resulted in a chi2/nDoF for tr: "<<trChi2<<" ("<<trNdoF<<")");
204  if (trChi2 > m_chiCutOff) {
205  tr.reset();
206  }
207  }
208  if (!tr) {
209  ATH_MSG_FATAL("Failed to fit tr relation for "<<m_idHelperSvc->toStringDetEl(detId));
210  return nullptr;
211  }
212  auto rtReso = inRel.smartReso();
213  if (m_fitRtReso) {
214  std::unique_ptr<IRtResolution> fittedReso{};
215  std::vector<SamplePoint> rtResoPoints = fetchResolution(rtPoints, m_relUncReso);
216  order = 0;
217  while (order++ <= m_maxOrderReso && !fittedReso) {
218  ATH_MSG_VERBOSE("Finally fit the resolution function "<<m_idHelperSvc->toStringDetEl(detId)
219  <<" using a polynomial of order "<<order);
220  fittedReso = RtFromPoints::getResoChebyshev(rtPoints, rt, m_relUncReso, order);
221  const unsigned nDoF = rtResoPoints.size() - fittedReso->nDoF();
222  const double chi2 = calculateChi2(rtResoPoints, *fittedReso) / nDoF;
223  ATH_MSG_VERBOSE("Fit has a chi2 of "<<chi2<<". Cut off at "<<m_chiCutOff);
224  if (chi2 > m_chiCutOff) {
225  if (order == m_maxOrderReso) {
226  drawResoFunc(ctx, detId, rtResoPoints, *fittedReso);
227  }
228  fittedReso.reset();
229  }
230  }
231 
232  if (fittedReso) {
233  drawResoFunc(ctx, detId, rtResoPoints, *fittedReso);
234  rtReso = std::move(fittedReso);
235  } else {
236  ATH_MSG_WARNING("Despite of having a "<<m_maxOrderReso
237  <<" no rt resolution function could be fitted for "<<m_idHelperSvc->toStringDetEl(detId));
238  }
239  }
240  auto finalRt = std::make_unique<MdtRtRelation>(std::move(rt), rtReso, std::move(tr));
241  drawRt(ctx, detId, rtPoints, *finalRt);
242  return finalRt;
243  }

◆ tubeIds()

std::vector< Identifier > MuonCalibR4::MdtAnalyticRtCalibAlg::tubeIds ( const Identifier chId) const
private

Definition at line 132 of file MdtAnalyticRtCalibAlg.cxx.

132  {
133  std::vector<Identifier> tubes{};
134  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
135  for (int ml = 1; ml <= idHelper.multilayerMax(chId); ++ml) {
136  const Identifier detId = idHelper.multilayerID(chId, ml);
137  for (int layer = 1; layer <= idHelper.tubeLayerMax(detId); ++layer) {
138  for (int tube = 1; tube <= idHelper.tubeMax(detId); ++tube) {
139  tubes.emplace_back(idHelper.channelID(detId, ml, layer, tube));
140  }
141  }
142  }
143  return tubes;
144  }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_chiCutOff

Gaudi::Property<float> MuonCalibR4::MdtAnalyticRtCalibAlg::m_chiCutOff {this,"chi2CutOff", 0.05}
private

Stop incrementing the order once the chi2CutOff is reached

Definition at line 89 of file MdtAnalyticRtCalibAlg.h.

◆ m_clientToken

MuonValR4::IRootVisualizationService::ClientToken MuonCalibR4::MdtAnalyticRtCalibAlg::m_clientToken {}
private

Token to be presented to the visualization service

Definition at line 70 of file MdtAnalyticRtCalibAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fillMissingCh

Gaudi::Property<bool> MuonCalibR4::MdtAnalyticRtCalibAlg::m_fillMissingCh {this, "fillMissingCh", true}
private

At the end of the translation, it's checked whether all channels have been assigned.

Definition at line 98 of file MdtAnalyticRtCalibAlg.h.

◆ m_fitRtReso

Gaudi::Property<bool> MuonCalibR4::MdtAnalyticRtCalibAlg::m_fitRtReso {this, "FitRtReso", true}
private

Toggle whether the resolution shall be also converted into a polynomial.

Definition at line 83 of file MdtAnalyticRtCalibAlg.h.

◆ m_idHelperSvc

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

Definition at line 66 of file MdtAnalyticRtCalibAlg.h.

◆ m_maxOrder

Gaudi::Property<unsigned> MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrder {this, "maxOrder", 12}
private

Maximum order of the polynomial in use.

Definition at line 77 of file MdtAnalyticRtCalibAlg.h.

◆ m_maxOrderReso

Gaudi::Property<unsigned> MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrderReso {this, "maxOrderReso", 25}
private

Maximal order to use for the resolution

Definition at line 87 of file MdtAnalyticRtCalibAlg.h.

◆ m_missingT0

Gaudi::Property<float> MuonCalibR4::MdtAnalyticRtCalibAlg::m_missingT0 {this, "missingT0", 5.4597301}
private

Default t0 constant to use, in case there's

Definition at line 100 of file MdtAnalyticRtCalibAlg.h.

◆ m_outStream

Gaudi::Property<std::string> MuonCalibR4::MdtAnalyticRtCalibAlg::m_outStream {this, "OutStream", "MDTANALYTICRTS"}
private

StreamName of the diagnostic histograms.

Definition at line 94 of file MdtAnalyticRtCalibAlg.h.

◆ m_polyTypeRt

Gaudi::Property<int> MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeRt {this, "PolyTypeRt", Acts::toUnderlying(PolyType::ChebyChev)}
private

Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.

Definition at line 79 of file MdtAnalyticRtCalibAlg.h.

◆ m_polyTypeTr

Gaudi::Property<int> MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeTr {this, "PolyTypeTr", Acts::toUnderlying(PolyType::Legendre)}
private

Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.

Definition at line 81 of file MdtAnalyticRtCalibAlg.h.

◆ m_precCutOff

Gaudi::Property<unsigned> MuonCalibR4::MdtAnalyticRtCalibAlg::m_precCutOff {this,"precCutOff", 6}
private

Precision cut-off to treat two incoming rt-relations as equivalent.

Definition at line 96 of file MdtAnalyticRtCalibAlg.h.

◆ m_readKey

SG::ReadCondHandleKey<MuonCalib::MdtCalibDataContainer> MuonCalibR4::MdtAnalyticRtCalibAlg::m_readKey {this, "ReadKey", "MdtCalibConstantsR4"}
private

Definition at line 72 of file MdtAnalyticRtCalibAlg.h.

◆ m_relUncReso

Gaudi::Property<double> MuonCalibR4::MdtAnalyticRtCalibAlg::m_relUncReso {this, "RelUncertOnReso", 0.01}
private

Assignment of the relative uncertainty on each resolution data point.

Definition at line 85 of file MdtAnalyticRtCalibAlg.h.

◆ m_saveDiagnostic

Gaudi::Property<bool> MuonCalibR4::MdtAnalyticRtCalibAlg::m_saveDiagnostic {this, "saveDiagnosticHist", true}
private

Save diagnostic histograms.

Definition at line 92 of file MdtAnalyticRtCalibAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_visualSvc

ServiceHandle<MuonValR4::IRootVisualizationService> MuonCalibR4::MdtAnalyticRtCalibAlg::m_visualSvc {this, "VisualSvc", "MuonValR4::RootVisualizationService"}
private

Service handle of the visualization service.

Definition at line 68 of file MdtAnalyticRtCalibAlg.h.

◆ m_writeKey

SG::WriteCondHandleKey<MuonCalib::MdtCalibDataContainer> MuonCalibR4::MdtAnalyticRtCalibAlg::m_writeKey
private
Initial value:
{this, "WriteKey", "MdtCalibConstants",
"Conditions object containing the calibrations"}

Definition at line 73 of file MdtAnalyticRtCalibAlg.h.


The documentation for this class was generated from the following files:
MuonValR4::IRootVisualizationService::ClientToken::preFixName
std::string preFixName
Prefix name of the saved Canvas.
Definition: IRootVisualizationService.h:41
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::t0
float t0
< relative t0 in chamber (ns)
Definition: MdtTubeCalibContainer.h:21
GeoModel::TransientConstSharedPtr< MdtCorFuncSet >
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType::ChebyChev
@ ChebyChev
MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeTr
Gaudi::Property< int > m_polyTypeTr
Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.
Definition: MdtAnalyticRtCalibAlg.h:81
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
MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrderReso
Gaudi::Property< unsigned > m_maxOrderReso
Maximal order to use for the resolution
Definition: MdtAnalyticRtCalibAlg.h:87
covarianceToolsLibrary.calculateChi2
def calculateChi2(data, mc, cov=None, verbosity=0)
Definition: covarianceToolsLibrary.py:415
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:40
MuonCalibR4::MdtAnalyticRtCalibAlg::m_saveDiagnostic
Gaudi::Property< bool > m_saveDiagnostic
Save diagnostic histograms.
Definition: MdtAnalyticRtCalibAlg.h:92
MuonCalibR4::MdtAnalyticRtCalibAlg::m_fillMissingCh
Gaudi::Property< bool > m_fillMissingCh
At the end of the translation, it's checked whether all channels have been assigned.
Definition: MdtAnalyticRtCalibAlg.h:98
MuonCalibR4::MdtAnalyticRtCalibAlg::translateRt
RtRelationPtr translateRt(const EventContext &ctx, const Identifier &detId, const MuonCalib::MdtRtRelation &inRel) const
Translates the rt / tr & resolution relation from a look-up table into the requested polynomial type.
Definition: MdtAnalyticRtCalibAlg.cxx:147
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:50
MuonCalib::CalibParamSorter
Helper struct to group Mdt calibration constants which are equivalent within the target precision.
Definition: CalibParamSorter.h:12
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType::Legendre
@ Legendre
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
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 ...
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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:40
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
MuonCalib::MdtRtRelation::rtRes
const IRtResolution * rtRes() const
resolution
Definition: MdtRtRelation.h:24
MuonCalibR4::MdtAnalyticRtCalibAlg::PolyType::Simple
@ Simple
MuonCalibR4::MdtAnalyticRtCalibAlg::m_visualSvc
ServiceHandle< MuonValR4::IRootVisualizationService > m_visualSvc
Service handle of the visualization service.
Definition: MdtAnalyticRtCalibAlg.h:68
MuonValR4::IRootVisualizationService::ClientToken::canvasLimit
std::size_t canvasLimit
How many canvases are drawn at maximum in a job.
Definition: IRootVisualizationService.h:45
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonCalib::MdtFullCalibData::corrections
CorrectionPtr corrections
Definition: MdtFullCalibData.h:20
MuonCalibR4::MdtAnalyticRtCalibAlg::m_relUncReso
Gaudi::Property< double > m_relUncReso
Assignment of the relative uncertainty on each resolution data point.
Definition: MdtAnalyticRtCalibAlg.h:85
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
MuonCalib::CalibFunc::name
virtual std::string name() const =0
MuonCalibR4::MdtAnalyticRtCalibAlg::m_precCutOff
Gaudi::Property< unsigned > m_precCutOff
Precision cut-off to treat two incoming rt-relations as equivalent.
Definition: MdtAnalyticRtCalibAlg.h:96
MuonCalibR4::MdtAnalyticRtCalibAlg::m_writeKey
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
Definition: MdtAnalyticRtCalibAlg.h:73
MuonCalib::MdtFullCalibData::tubeCalib
TubeContainerPtr tubeCalib
Definition: MdtFullCalibData.h:22
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
MuonCalibR4::MdtAnalyticRtCalibAlg::m_maxOrder
Gaudi::Property< unsigned > m_maxOrder
Maximum order of the polynomial in use.
Definition: MdtAnalyticRtCalibAlg.h:77
MuonCalib::ITrRelation::maxRadius
virtual double maxRadius() const =0
Returns the maximum drift-radius.
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
DeMoAtlasDataLoss.canvas
dictionary canvas
Definition: DeMoAtlasDataLoss.py:187
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
getLatestRuns.interval
interval
Definition: getLatestRuns.py:24
MuonCalib::ITrRelation::minRadius
virtual double minRadius() const =0
Returns the minimum drift-radius.
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:525
MdtIdHelper
Definition: MdtIdHelper.h:61
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
MuonCalib::IRtRelation::tUpper
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
MuonCalibR4::MdtAnalyticRtCalibAlg::m_readKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_readKey
Definition: MdtAnalyticRtCalibAlg.h:72
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:19
MuonCalibR4::MdtAnalyticRtCalibAlg::tubeIds
std::vector< Identifier > tubeIds(const Identifier &chId) const
Definition: MdtAnalyticRtCalibAlg.cxx:132
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonCalibR4::MdtAnalyticRtCalibAlg::drawRt
void drawRt(const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &rtPoints, const MuonCalib::MdtRtRelation &inRel) const
Definition: MdtAnalyticRtCalibAlg.cxx:244
MuonCalib::MdtRtRelation::tr
const ITrRelation * tr() const
t(r) relationship
Definition: MdtRtRelation.h:25
MuonCalibR4::MdtAnalyticRtCalibAlg::RtRelationPtr
MuonCalib::MdtFullCalibData::RtRelationPtr RtRelationPtr
Definition: MdtAnalyticRtCalibAlg.h:40
MuonCalibR4::MdtAnalyticRtCalibAlg::m_missingT0
Gaudi::Property< float > m_missingT0
Default t0 constant to use, in case there's
Definition: MdtAnalyticRtCalibAlg.h:100
CaloClusterMLCalib::minMax
float minMax(float x, const std::vector< float > &params)
Definition: CaloClusterMLCalibFeatureTransform.h:69
MuonCalib::RtFromPoints
Definition: RtFromPoints.h:22
plotBeamSpotVxVal.legend
legend
Definition: plotBeamSpotVxVal.py:97
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
MuonCalib::IRtRelation::radius
virtual double radius(double t) const =0
returns drift radius for a given time
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonCalib::SamplePoint
Definition: SamplePoint.h:15
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MuonCalibR4::MdtAnalyticRtCalibAlg::m_clientToken
MuonValR4::IRootVisualizationService::ClientToken m_clientToken
Token to be presented to the visualization service
Definition: MdtAnalyticRtCalibAlg.h:70
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::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
a
TList * a
Definition: liststreamerinfos.cxx:10
h
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
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
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:61
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
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
MuonCalibR4::MdtAnalyticRtCalibAlg::m_chiCutOff
Gaudi::Property< float > m_chiCutOff
Stop incrementing the order once the chi2CutOff is reached
Definition: MdtAnalyticRtCalibAlg.h:89
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
MuonCalibR4::MdtAnalyticRtCalibAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtAnalyticRtCalibAlg.h:66
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
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
MuonCalibR4::MdtAnalyticRtCalibAlg::drawResoFunc
void drawResoFunc(const EventContext &ctx, const Identifier &detId, const std::vector< MuonCalib::SamplePoint > &resoPoints, const MuonCalib::IRtResolution &inReso) const
Definition: MdtAnalyticRtCalibAlg.cxx:306
calibdata.tube
tube
Definition: calibdata.py:30
MuonCalibR4::MdtAnalyticRtCalibAlg::m_fitRtReso
Gaudi::Property< bool > m_fitRtReso
Toggle whether the resolution shall be also converted into a polynomial.
Definition: MdtAnalyticRtCalibAlg.h:83
fitman.k
k
Definition: fitman.py:528
MuonCalibR4::MdtAnalyticRtCalibAlg::m_polyTypeRt
Gaudi::Property< int > m_polyTypeRt
Toggle the polynomial for the Rt-relation: ChebyChev or Legendre.
Definition: MdtAnalyticRtCalibAlg.h:79
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14