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

#include <MdtCalibDbAlg.h>

Inheritance diagram for MuonCalibR4::MdtCalibDbAlg:
Collaboration diagram for MuonCalibR4::MdtCalibDbAlg:

Public Member Functions

virtual ~MdtCalibDbAlg ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual bool isReEntrant () const override
 
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

using CorrectionPtr = MuonCalib::MdtCalibDataContainer::CorrectionPtr
 
using RtRelationPtr = MuonCalib::MdtCalibDataContainer::RtRelationPtr
 
using TubeContainerPtr = MuonCalib::MdtCalibDataContainer::TubeContainerPtr
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode parseRtPayload (const nlohmann::json &rtBlob, MuonCalib::MdtCalibDataContainer &outContainer) const
 
StatusCode parseRtPayload (TTree &rtTree, MuonCalib::MdtCalibDataContainer &outContainer) const
 Reads a r-t ROOT tree and stores its content in the calibration constant container. More...
 
MuonCalib::IRtRelationPtr makeRt (const std::string &rtType, const std::vector< double > &pars) const
 Creates a new rt function from the typeName & the list of parameters. More...
 
MuonCalib::ITrRelationPtr makeTr (const std::string &trType, const std::vector< double > &pars) const
 Creates a new tr function from the typeName & the list of parameters. More...
 
MuonCalib::IRtResolutionPtr makeReso (const std::string &resoType, const std::vector< double > &pars, MuonCalib::IRtRelationPtr rt) const
 Creates a new resoltuion function from the typeName & the list of parameters. More...
 
StatusCode parseT0Payload (const nlohmann::json &t0Blob, MuonCalib::MdtCalibDataContainer &outContainer) const
 Trnaslates a t0 - JSON payload into transient memory. More...
 
StatusCode parseT0Payload (TTree &t0Tree, MuonCalib::MdtCalibDataContainer &outContainer) const
 Translates a T0 TTree payload into transient memory. More...
 
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"}
 
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainerm_writeKey
 
Gaudi::Property< std::string > m_rtJSON {this, "RtJSON", ""}
 External Rt & T0 JSON files. More...
 
Gaudi::Property< std::string > m_t0JSON {this, "TubeT0JSON", ""}
 
Gaudi::Property< std::string > m_rtRootFile
 
Gaudi::Property< std::string > m_t0RootFile
 
Gaudi::Property< std::string > m_rtTreeName {this, "RtTreeName", "RtCalibConstants"}
 
Gaudi::Property< std::string > m_t0TreeName {this, "T0TreeName", "T0CalibConstants"}
 
SG::ReadCondHandleKey< CondAttrListCollectionm_readKeyRt {this, "ReadKeyRt", "/MDT/RTJSON", "DB folder containing the RT calibrations"}
 
SG::ReadCondHandleKey< CondAttrListCollectionm_readKeyTube {this, "ReadKeyTube", "/MDT/T0JSON", "DB folder containing the tube constants"}
 
Gaudi::Property< std::string > m_dbPayloadType {this, "dbPayloadType","TTree", "specify the format of the payload in the database. Can be TTree or JSON"}
 
Gaudi::Property< double > m_prop_beta {this, "PropagationSpeedBeta", 1., "Speed of the signal propagation"}
 
Gaudi::Property< unsigned > m_t0CalibPrec {this, "T0CalibPrecision", 4}
 Precision cut off to treat 2 t0 constants as equivalent. More...
 
Gaudi::Property< bool > m_create_b_field_function
 
Gaudi::Property< bool > m_createSlewingFunction
 
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 28 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

Member Typedef Documentation

◆ CorrectionPtr

◆ RtRelationPtr

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TubeContainerPtr

Constructor & Destructor Documentation

◆ ~MdtCalibDbAlg()

virtual MuonCalibR4::MdtCalibDbAlg::~MdtCalibDbAlg ( )
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; }

◆ 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 MdtCalibDbAlg::execute ( const EventContext &  ctx) const
overridevirtual

Load the t0 blob

Parse the constants from the database

Definition at line 91 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

91  {
92  ATH_MSG_VERBOSE("Executing MdtCalibDbAlgR4");
93  SG::WriteCondHandle writeHandle{m_writeKey, ctx};
94  if(writeHandle.isValid()) {
95  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.");
96  return StatusCode::SUCCESS;
97  }
98  writeHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteRunLB()));
99  auto writeCdo = std::make_unique<MdtCalibDataContainer>(m_idHelperSvc.get(), RegionGranularity::OnePerMultiLayer);
101  writeCdo->setInversePropSpeed(1./ (m_prop_beta * Gaudi::Units::c_light));
102 
104  if (!m_readKeyRt.empty()) {
105  SG::ReadCondHandle readHandle{m_readKeyRt, ctx};
106  ATH_CHECK(readHandle.isValid());
107  writeHandle.addDependency(readHandle);
108  for(CondAttrListCollection::const_iterator itr = readHandle->begin();
109  itr != readHandle->end(); ++itr) {
110  const coral::AttributeList& atr = itr->second;
111  if(atr["data"].specification().type() != typeid(coral::Blob)) {
112  ATH_MSG_FATAL( "Data column is not of type blob!" );
113  return StatusCode::FAILURE;
114  }
115 
116  coral::Blob blob = atr["data"].data<coral::Blob>();
117 
118  if(m_dbPayloadType =="TTree"){
119  std::unique_ptr<TTree> tree;
120  if(!CoralUtilities::readBlobAsTTree(blob, tree, "RtCalibConstants")) {
121  ATH_MSG_FATAL( "Cannot retrieve data from coral blob!");
122  return StatusCode::FAILURE;
123  }
124  ATH_CHECK(parseRtPayload(*tree, *writeCdo));
125  } else if (m_dbPayloadType=="JSON") {
126  ATH_MSG_VERBOSE("Loading data as a BLOB, uncompressing...");
127  std::string data{};
128  if (!CoralUtilities::readBlobAsString(atr["data"].data<coral::Blob>(), data)) {
129  ATH_MSG_FATAL("Cannot uncompress BLOB! Aborting...");
130  return StatusCode::FAILURE;
131  }
133  ATH_CHECK(parseRtPayload(std::move(rtBlob),*writeCdo));
134  } else {
135  ATH_MSG_FATAL("Payload type " << m_dbPayloadType << " not understood. Options are: TTree or JSON");
136  return StatusCode::FAILURE;
137  }
138  }
139 
140  } else if (!m_rtRootFile.value().empty()) {
141  std::unique_ptr<TFile> inFile{TFile::Open(m_rtRootFile.value().c_str(), "READ")};
142  if(!inFile || inFile->IsZombie()) {
143  ATH_MSG_FATAL("Failed to open file "<<m_rtRootFile);
144  return StatusCode::FAILURE;
145  }
146  TTree* tree{nullptr};
147  inFile->GetObject(m_rtTreeName.value().c_str(), tree);
148  if (!tree) {
149  ATH_MSG_FATAL("The object "<<m_rtRootFile<<" does not contain "<<m_rtTreeName);
150  return StatusCode::FAILURE;
151  }
152  ATH_CHECK(parseRtPayload(*tree, *writeCdo));
153  } else if (!m_rtJSON.value().empty()) {
154  std::ifstream inFile{m_rtJSON};
155  if (!inFile.good()) {
156  ATH_MSG_FATAL("Failed to open "<<m_rtJSON);
157  return StatusCode::FAILURE;
158  }
159  nlohmann::json rtBlob{};
160  inFile >> rtBlob;
161  ATH_CHECK(parseRtPayload(std::move(rtBlob),*writeCdo));
162  }
163  if (!m_readKeyTube.empty()) {
164  SG::ReadCondHandle readHandle{m_readKeyTube, ctx};
165  ATH_CHECK(readHandle.isValid());
166  writeHandle.addDependency(readHandle);
167  for(CondAttrListCollection::const_iterator itr = readHandle->begin();
168  itr != readHandle->end(); ++itr) {
169  const coral::AttributeList& atr = itr->second;
170  if(atr["data"].specification().type() != typeid(coral::Blob)) {
171  ATH_MSG_FATAL( "Data column is not of type blob!" );
172  return StatusCode::FAILURE;
173  }
174 
175  coral::Blob blob = atr["data"].data<coral::Blob>();
176 
177  if(m_dbPayloadType =="TTree"){
178  std::unique_ptr<TTree> tree;
179  if(!CoralUtilities::readBlobAsTTree(blob, tree, "T0CalibConstants")) {
180  ATH_MSG_FATAL( "Cannot retrieve data from coral blob!");
181  return StatusCode::FAILURE;
182  }
183  ATH_CHECK(parseT0Payload(*tree, *writeCdo));
184  } else if (m_dbPayloadType=="JSON") {
185  ATH_MSG_VERBOSE("Loading data as a BLOB, uncompressing...");
186  std::string data{};
187  if (!CoralUtilities::readBlobAsString(atr["data"].data<coral::Blob>(), data)) {
188  ATH_MSG_FATAL("Cannot uncompress BLOB! Aborting...");
189  return StatusCode::FAILURE;
190  }
192  ATH_CHECK(parseT0Payload(std::move(rtBlob),*writeCdo));
193  } else {
194  ATH_MSG_FATAL("Payload type " << m_dbPayloadType << " not understood. Options are: TTree or JSON");
195  return StatusCode::FAILURE;
196  }
197 
198  }
199  } else if (!m_t0RootFile.value().empty()) {
200  std::unique_ptr<TFile> inFile{TFile::Open(m_t0RootFile.value().c_str(), "READ")};
201  if(!inFile || inFile->IsZombie()) {
202  ATH_MSG_FATAL("Failed to open file "<<m_t0RootFile);
203  return StatusCode::FAILURE;
204  }
205  TTree* tree{nullptr};
206  inFile->GetObject(m_t0TreeName.value().c_str(), tree);
207  if (!tree) {
208  ATH_MSG_FATAL("The object "<<m_rtRootFile<<" does not contain "<<m_t0TreeName);
209  return StatusCode::FAILURE;
210  }
211  ATH_CHECK(parseT0Payload(*tree, *writeCdo));
212  } else {
213  std::ifstream inFile{m_t0JSON};
214  if (!inFile.good()) {
215  ATH_MSG_FATAL("Failed to open "<<m_t0JSON);
216  return StatusCode::FAILURE;
217  }
218  nlohmann::json t0Blob{};
219  inFile >> t0Blob;
220  ATH_CHECK(parseT0Payload(std::move(t0Blob), *writeCdo));
221  }
222 
223  ATH_CHECK(writeHandle.record(std::move(writeCdo)));
224  ATH_MSG_INFO("Recorded succesfully "<<m_writeKey.fullKey()<<" "<<writeHandle.getRange());
225  return StatusCode::SUCCESS;
226 }

◆ 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 MdtCalibDbAlg::initialize ( )
overridevirtual

If not trees names are given, then there's no need to try accessing the ROOT file

Definition at line 55 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

55  {
56  ATH_MSG_VERBOSE("Initialize...");
57  ATH_CHECK(m_idHelperSvc.retrieve());
59 
61  if (m_t0TreeName.value().empty()) {
62  m_t0RootFile.value().clear();
63  }
64  if (m_rtTreeName.value().empty()) {
65  m_rtRootFile.value().clear();
66  }
67  const bool initRt = (m_rtJSON.value().empty() && m_rtRootFile.value().empty());
68  const bool initT0 = (m_t0JSON.value().empty() && m_t0RootFile.value().empty());
71 
72  if (m_rtRootFile.value().size()) {
73  ATH_MSG_INFO("Load RT - calibration constants from ROOT File "<<m_rtRootFile);
74  m_rtJSON.clear();
75  } else if (m_rtJSON.value().size()) {
76  ATH_MSG_INFO("Load the RT- calibration constants from JSON file "<<m_rtJSON);
77  m_rtTreeName.clear();
78  } else {
79  ATH_MSG_INFO("Load RT - calibration constants from COOL: "<<m_readKeyRt.fullKey());
80  }
81  if (m_t0RootFile.value().size()) {
82  ATH_MSG_INFO("Load T0 - calibration constants from ROOT File "<<m_t0RootFile);
83  m_t0JSON.clear();
84  } else if (m_t0JSON.value().size()) {
85  ATH_MSG_INFO("Load the T0 - calibration constants from JSON file "<<m_t0JSON);
86  m_t0TreeName.clear();
87  }
88  return StatusCode::SUCCESS;
89 }

◆ 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 }

◆ isReEntrant()

virtual bool MuonCalibR4::MdtCalibDbAlg::isReEntrant ( ) const
inlineoverridevirtual

Definition at line 36 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

36 { return false; }

◆ makeReso()

IRtResolutionPtr MdtCalibDbAlg::makeReso ( const std::string &  resoType,
const std::vector< double > &  pars,
MuonCalib::IRtRelationPtr  rt 
) const
private

Creates a new resoltuion function from the typeName & the list of parameters.

Parameters
trTypeTr-relation type to create
parsParameter vector to parse to the Tr-relation
rtPoint to the rt relation created before.

Definition at line 317 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

318  {
319  IRtResolutionPtr rtReso{};
320  if (resoType == "RtResolutionLookUp") {
321  rtReso = std::make_unique<RtResolutionLookUp>(resoParams);
322  } else if (resoType == "RtResolutionChebyshev") {
323  rtReso = std::make_unique<RtResolutionChebyshev>(resoParams);
324  } else if (resoType == "RadiusResolutionChebyshev") {
325  rtReso = std::make_unique<RadiusResolutionChebyshev>(resoParams, rt);
326  } else {
327  ATH_MSG_FATAL("The rt resolution type <"<<resoType<<"> is not yet supported.");
328  }
329  return rtReso;
330 }

◆ makeRt()

IRtRelationPtr MdtCalibDbAlg::makeRt ( const std::string &  rtType,
const std::vector< double > &  pars 
) const
private

Creates a new rt function from the typeName & the list of parameters.

Parameters
rtTypeRt-relation type to create
parsParameter vector to parse to the Rt-relation

Definition at line 283 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

283  {
284  IRtRelationPtr rtRel{};
285  if (rtType == "RtRelationLookUp") {
286  rtRel = std::make_unique<RtRelationLookUp>(rtParams);
287  } else if (rtType == "RtLegendre"){
288  rtRel = std::make_unique<RtLegendre>(rtParams);
289  } else if (rtType == "RtChebyshev") {
290  rtRel = std::make_unique<RtChebyshev>(rtParams);
291  }
292  if (rtRel) {
293  ATH_MSG_VERBOSE("Fetched new rt-relation <"<<rtType<<"> valid for drift times ranging from "
294  <<rtRel->tLower()<<"-"<<rtRel->tUpper()<<".");
295  } else {
296  ATH_MSG_FATAL("The rt-relation function type <"<<rtType<<"> is not yet supported.");
297  }
298  return rtRel;
299 }

◆ makeTr()

ITrRelationPtr MdtCalibDbAlg::makeTr ( const std::string &  trType,
const std::vector< double > &  pars 
) const
private

Creates a new tr function from the typeName & the list of parameters.

Parameters
trTypeTr-relation type to create
parsParameter vector to parse to the Tr-relation

Definition at line 301 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

301  {
302  ITrRelationPtr trRel{};
303  if (trType == "TrChebyshev") {
304  trRel = std::make_unique<TrChebyshev>(trParams);
305  } else if(trType == "TrLegendre") {
306  trRel = std::make_unique<TrLegendre>(trParams);
307  }
308  if (trRel) {
309  ATH_MSG_VERBOSE("Fetched new tr-relation <"<<trType<<"> valid for drift radii ranging from "
310  <<trRel->minRadius()<<"-"<<trRel->maxRadius()<<".");
311  } else {
312  ATH_MSG_FATAL("The rt-relation function type <"<<trType<<"> is not yet supported.");
313  }
314  return trRel;
315 }

◆ 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.

◆ parseRtPayload() [1/2]

StatusCode MdtCalibDbAlg::parseRtPayload ( const nlohmann::json rtBlob,
MuonCalib::MdtCalibDataContainer outContainer 
) const
private

Loop over the R-T blob payload

Fetch the associated detector elements

Defining constants of the rt-relation

Defining constants of the rt-resolution

Load the rt constants to the assigned detector elements

Definition at line 331 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

332  {
333  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
334 
336  for (auto& payload : rtBlob.items()) {
337  std::vector<Identifier> detIds{};
338 
339  const nlohmann::json calibConstants = payload.value();
341  for (auto& chambList : calibConstants["chambers"].items()) {
342  const nlohmann::json chambPayload = chambList.value();
343  const std::string station = chambPayload["station"];
344  const int eta = chambPayload["eta"];
345  const int phi = chambPayload["phi"];
346  const int ml = chambPayload["ml"];
347  const Identifier mlId{idHelper.channelID(station, eta, phi, ml, 1, 1)};
348  detIds.emplace_back(mlId);
349  }
350 
352  const nlohmann::json rtPayload = calibConstants["rtRelation"];
353  ITrRelationPtr trRel{};
354  IRtRelationPtr rtRel = makeRt(rtPayload["type"], rtPayload["params"]);
355  if (!rtRel) {
356  return StatusCode::FAILURE;
357  }
358  if (calibConstants.find("trRelation") != calibConstants.end()) {
359  const nlohmann::json trPayload = calibConstants["trRelation"];
360  trRel = makeTr(trPayload["type"], trPayload["params"]);
361  if (!trRel) {
362  return StatusCode::FAILURE;
363  }
364  }
366  const nlohmann::json resoPayload = calibConstants["rtReso"];
367  IRtResolutionPtr rtReso =makeReso(resoPayload["type"], resoPayload["params"], rtRel);
368  if (!rtReso) {
369  return StatusCode::FAILURE;
370  }
372  std::make_unique<MdtRtRelation>(std::move(rtRel), std::move(rtReso), std::move(trRel));
373 
374 
376  for (const Identifier& mlId : detIds) {
377  if (outContainer.hasDataForChannel(mlId,msgStream()) &&
378  outContainer.getCalibData(mlId, msgStream())->rtRelation) {
379  continue;
380  }
381  if (!outContainer.storeData(mlId, mdtRel, msgStream())) {
382  return StatusCode::FAILURE;
383  }
384  }
385  }
386  return StatusCode::SUCCESS;
387 }

◆ parseRtPayload() [2/2]

StatusCode MdtCalibDbAlg::parseRtPayload ( TTree &  rtTree,
MuonCalib::MdtCalibDataContainer outContainer 
) const
private

Reads a r-t ROOT tree and stores its content in the calibration constant container.

Parameters
rtTreeTTree to read the data from
outContainerOutput container append the Rt relations

Definition at line 229 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

230  {
231  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
232 
233  std::string* rtType{nullptr}, *trType{nullptr}, *resoType{nullptr};
234 
235  std::vector<double>* rtParams{nullptr}, *trParams{nullptr}, *resoParams{nullptr};
236 
237  std::vector<std::string>* stationName{nullptr};
238  std::vector<short>* stationEta{nullptr};
239  std::vector<unsigned short>* stationPhi{nullptr}, *multiLayer{nullptr};
240 
241  SET_BRANCHADDRESS(rtTree, rtType);
242  SET_BRANCHADDRESS(rtTree, trType);
243  SET_BRANCHADDRESS(rtTree, resoType);
244  SET_BRANCHADDRESS(rtTree, rtParams);
245  SET_BRANCHADDRESS(rtTree, trParams);
246  SET_BRANCHADDRESS(rtTree, resoParams);
248  SET_BRANCHADDRESS(rtTree, stationEta);
249  SET_BRANCHADDRESS(rtTree, stationPhi);
250  SET_BRANCHADDRESS(rtTree, multiLayer);
251 
252  for (Long64_t e = 0; e< rtTree.GetEntries(); ++e) {
253  rtTree.GetEntry(e);
254  ATH_MSG_VERBOSE("Load "<<e<<"-th calibration constant Valid for "<<stationName->size()<< " det elements.");
255  std::vector<Identifier> detIds{};
256  for (unsigned ch = 0; ch < stationName->size(); ++ch){
257  const Identifier detElId = idHelper.channelID(stationName->at(ch), stationEta->at(ch), stationPhi->at(ch),
258  multiLayer->at(ch), 1, 1);
259  detIds.emplace_back(detElId);
260  }
261  IRtRelationPtr rtRel{makeRt(*rtType, *rtParams)};
262  if(!rtRel) {
263  return StatusCode::FAILURE;
264  }
265  ITrRelationPtr trRel = (*trType).size() ? makeTr(*trType, *trParams) : nullptr;
266  if ((*trType).size() && !trRel) {
267  return StatusCode::FAILURE;
268  }
269  IRtResolutionPtr rtReso = makeReso(*resoType, *resoParams, rtRel);
270  if (!rtReso) {
271  return StatusCode::FAILURE;
272  }
274  std::make_unique<MdtRtRelation>(std::move(rtRel), std::move(rtReso), std::move(trRel));
275  for (const Identifier& detId : detIds) {
276  if (!outContainer.storeData(detId, mdtRel, msgStream())){
277  return StatusCode::FAILURE;
278  }
279  }
280  }
281  return StatusCode::SUCCESS;
282 }

◆ parseT0Payload() [1/2]

StatusCode MdtCalibDbAlg::parseT0Payload ( const nlohmann::json t0Blob,
MuonCalib::MdtCalibDataContainer outContainer 
) const
private

Trnaslates a t0 - JSON payload into transient memory.

Parameters
t0BlobJSON payload to be translated
outContainerContainer into which the t0 constants are stored

Loop over the R-T blob payload

Definition at line 444 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

445  {
446  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
448 
450  for (auto& dbEntry : t0Blob.items()) {
451  const nlohmann::json payload = dbEntry.value();
452  const std::string station = payload["station"];
453  const int eta = payload["eta"];
454  const int phi = payload["phi"];
455  bool isValid{false};
456  const Identifier detId = idHelper.elementID(station, eta, phi, isValid);
457  if (!isValid) {
458  ATH_MSG_FATAL("Failed to create a valid identifier from "<<station<<", "<<eta<<", "<<phi);
459  return StatusCode::FAILURE;
460  }
461  TubeContainerPtr calibChannels = std::make_unique<MdtTubeCalibContainer>(m_idHelperSvc.get(), detId);
462 
463  for (auto& calibEntry : payload["calibConstants"].items()){
464  const nlohmann::json calibPayload = calibEntry.value();
465  SingleTubeCalib calibConstant{};
466  calibConstant.t0 = calibPayload["t0"];
467  calibConstant.adcCal = calibPayload["adc"];
468  calibConstant.statusCode = calibPayload["code"];
469  for (auto& tubeEntry : calibPayload["tubes"].items()) {
470  const nlohmann::json tubePayload = tubeEntry.value();
471  const int ml = tubePayload["ml"];
472  const int tubeLayer = tubePayload["tl"];
473  const std::string tubeStr = tubePayload["no"];
474  const std::vector<std::string> tubeTokens{CxxUtils::tokenize(tubeStr, ";")};
475  std::vector<int> tubes{};
476  for (const std::string& token: tubeTokens) {
477  if (token.find("-") == std::string::npos) {
478  tubes.emplace_back(CxxUtils::atoi(token));
479  } else {
480  const std::vector<std::string> rangeToken{CxxUtils::tokenize(token,"-")};
481  if (rangeToken.size() != 2) {
482  ATH_MSG_FATAL("No valid tube range token: "<<token);
483  return StatusCode::FAILURE;
484  }
485  const int tubeLow{CxxUtils::atoi(rangeToken[0])}, tubeHigh{CxxUtils::atoi(rangeToken[1])};
486  if (tubeLow >= tubeHigh){
487  ATH_MSG_FATAL("Invalid range "<<tubeLow<<"-"<<tubeHigh
488  <<". The lower end must be strictly smaller than the upper one");
489  return StatusCode::FAILURE;
490  }
491  for (int tube = tubeLow; tube<=tubeHigh; ++tube) {
492  tubes.push_back(tube);
493  }
494  }
495  }
496  for (const int tube : tubes) {
497  const Identifier tubeId = idHelper.channelID(detId,ml, tubeLayer, tube, isValid);
498  if (!isValid) {
499  ATH_MSG_FATAL("No valid tube identifier from "<<m_idHelperSvc->toStringDetEl(detId)
500  <<", layer: "<<tubeLayer<<", tube: "<<tube);
501  return StatusCode::FAILURE;
502  }
503  if (!calibChannels->setCalib(calibConstant, tubeId, msgStream())){
504  return StatusCode::FAILURE;
505  }
506  }
507  }
508  }
509  if (!outContainer.storeData(detId, std::move(calibChannels), msgStream())) {
510  return StatusCode::FAILURE;
511  }
512  }
513 
514  return StatusCode::SUCCESS;
515 }

◆ parseT0Payload() [2/2]

StatusCode MdtCalibDbAlg::parseT0Payload ( TTree &  t0Tree,
MuonCalib::MdtCalibDataContainer outContainer 
) const
private

Translates a T0 TTree payload into transient memory.

Parameters
t0TreeReference to the TTree to translate
outContainerContainer into which the t0 constants are stored

Definition at line 389 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx.

390  {
391 
392  std::string* stationName{nullptr};
393  short stationEta{0};
394  unsigned short stationPhi{0}, code{0};
395  float t0{0.f}, adc{0.f};
396  std::vector<unsigned short>* multiLayer{nullptr}, *tubeLayer{nullptr}, *tube{nullptr};
397 
399  SET_BRANCHADDRESS(t0Tree, stationEta);
400  SET_BRANCHADDRESS(t0Tree, stationPhi);
401  SET_BRANCHADDRESS(t0Tree, code);
402  SET_BRANCHADDRESS(t0Tree, t0);
403  SET_BRANCHADDRESS(t0Tree, adc);
404  SET_BRANCHADDRESS(t0Tree, multiLayer);
405  SET_BRANCHADDRESS(t0Tree, tubeLayer);
406  SET_BRANCHADDRESS(t0Tree, tube);
407 
409  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
410 
411  for (Long64_t e = 0 ; e <t0Tree.GetEntries(); ++e) {
412  t0Tree.GetEntry(e);
413  bool isValid{false};
414  const Identifier detId = idHelper.elementID(*stationName, stationEta, stationPhi, isValid);
415  if (!isValid) {
416  ATH_MSG_FATAL("Failed to create a valid Identifier from "<<(*stationName)<<", "<<stationEta<<", "
417  <<stationPhi);
418  return StatusCode::FAILURE;
419  }
420  TubeContainerPtr calibChannels = std::make_unique<MdtTubeCalibContainer>(m_idHelperSvc.get(), detId);
421  SingleTubeCalib t0Calib{};
422  t0Calib.adcCal = adc;
423  t0Calib.t0 = t0;
424  t0Calib.statusCode = code;
425 
426  for (unsigned int ch = 0; ch < multiLayer->size(); ++ch){
427  const Identifier tubeId{idHelper.channelID(detId, multiLayer->at(ch),
428  tubeLayer->at(ch), tube->at(ch), isValid)};
429  if (!isValid) {
430  ATH_MSG_FATAL("Failed to get a valid tube Identifier for "<<m_idHelperSvc->toStringChamber(detId)
431  <<", ml: "<<multiLayer->at(ch)<<", tl: "<<tubeLayer->at(ch)<<", tube: "<<tube->at(ch));
432  return StatusCode::FAILURE;
433  }
434  if (!calibChannels->setCalib(t0Calib, tubeId, msgStream())) {
435  return StatusCode::FAILURE;
436  }
437  }
438  if (!outContainer.storeData(detId, calibChannels, msgStream())){
439  return StatusCode::FAILURE;
440  }
441  }
442  return StatusCode::SUCCESS;
443 }

◆ 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.

◆ 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_create_b_field_function

Gaudi::Property<bool> MuonCalibR4::MdtCalibDbAlg::m_create_b_field_function
private
Initial value:
{this, "CreateBFieldFunctions", false,
"If set to true, the B-field correction functions are initialized for each rt-relation that is loaded."}

Definition at line 109 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_createSlewingFunction

Gaudi::Property<bool> MuonCalibR4::MdtCalibDbAlg::m_createSlewingFunction
private
Initial value:
{this, "CreateSlewingFunctions", false,
"If set to true, the slewing correction functions are initialized for each rt-relation that is loaded."}

Definition at line 112 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_dbPayloadType

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_dbPayloadType {this, "dbPayloadType","TTree", "specify the format of the payload in the database. Can be TTree or JSON"}
private

◆ 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_idHelperSvc

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

◆ m_prop_beta

Gaudi::Property<double> MuonCalibR4::MdtCalibDbAlg::m_prop_beta {this, "PropagationSpeedBeta", 1., "Speed of the signal propagation"}
private

◆ m_readKeyRt

SG::ReadCondHandleKey<CondAttrListCollection> MuonCalibR4::MdtCalibDbAlg::m_readKeyRt {this, "ReadKeyRt", "/MDT/RTJSON", "DB folder containing the RT calibrations"}
private

◆ m_readKeyTube

SG::ReadCondHandleKey<CondAttrListCollection> MuonCalibR4::MdtCalibDbAlg::m_readKeyTube {this, "ReadKeyTube", "/MDT/T0JSON", "DB folder containing the tube constants"}
private

◆ m_rtJSON

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_rtJSON {this, "RtJSON", ""}
private

External Rt & T0 JSON files.

Definition at line 90 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_rtRootFile

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_rtRootFile
private
Initial value:
{this, "RtROOT", "",
"Path to an external root file to read the Rt relation from"}

Definition at line 93 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_rtTreeName

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_rtTreeName {this, "RtTreeName", "RtCalibConstants"}
private

◆ m_t0CalibPrec

Gaudi::Property<unsigned> MuonCalibR4::MdtCalibDbAlg::m_t0CalibPrec {this, "T0CalibPrecision", 4}
private

Precision cut off to treat 2 t0 constants as equivalent.

Definition at line 107 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_t0JSON

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_t0JSON {this, "TubeT0JSON", ""}
private

◆ m_t0RootFile

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_t0RootFile
private
Initial value:
{this, "TubeT0ROOT", "",
"Path to an external root file to read the T0 constants from"}

Definition at line 95 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h.

◆ m_t0TreeName

Gaudi::Property<std::string> MuonCalibR4::MdtCalibDbAlg::m_t0TreeName {this, "T0TreeName", "T0CalibConstants"}
private

◆ 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_writeKey

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

Definition at line 86 of file MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.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:21
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
test_pyathena.eta
eta
Definition: test_pyathena.py:10
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
GeoModel::TransientConstSharedPtr< IRtResolution >
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
MuonCalibR4::MdtCalibDbAlg::m_rtTreeName
Gaudi::Property< std::string > m_rtTreeName
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:98
SingleTubeCalib
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib SingleTubeCalib
Definition: MdtCalibrationTool.cxx:26
MuonCalibR4::MdtCalibDbAlg::parseT0Payload
StatusCode parseT0Payload(const nlohmann::json &t0Blob, MuonCalib::MdtCalibDataContainer &outContainer) const
Trnaslates a t0 - JSON payload into transient memory.
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:444
MuonCalibR4::MdtCalibDbAlg::parseRtPayload
StatusCode parseRtPayload(const nlohmann::json &rtBlob, MuonCalib::MdtCalibDataContainer &outContainer) const
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:331
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonCalibR4::MdtCalibDbAlg::m_t0TreeName
Gaudi::Property< std::string > m_t0TreeName
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:99
MuonCalibR4::MdtCalibDbAlg::m_t0RootFile
Gaudi::Property< std::string > m_t0RootFile
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:95
json
nlohmann::json json
Definition: HistogramDef.cxx:9
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonCalib::MdtCalibDataContainer::storeData
bool storeData(const Identifier &mlID, CorrectionPtr corrFuncSet, MsgStream &msg)
Definition: MdtCalibDataContainer.cxx:52
CxxUtils::tokenize
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
Definition: Control/CxxUtils/Root/StringUtils.cxx:15
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1113
tree
TChain * tree
Definition: tile_monitor.h:30
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
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
MuonCalibR4::MdtCalibDbAlg::m_readKeyTube
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyTube
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:102
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
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:867
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
MuonCalibR4::MdtCalibDbAlg::m_t0JSON
Gaudi::Property< std::string > m_t0JSON
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:91
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
MuonCalibR4::MdtCalibDbAlg::m_dbPayloadType
Gaudi::Property< std::string > m_dbPayloadType
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:103
MuonCalibR4::MdtCalibDbAlg::makeReso
MuonCalib::IRtResolutionPtr makeReso(const std::string &resoType, const std::vector< double > &pars, MuonCalib::IRtRelationPtr rt) const
Creates a new resoltuion function from the typeName & the list of parameters.
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:317
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
histSizes.code
code
Definition: histSizes.py:129
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
dumpNswErrorDb.calibEntry
calibEntry
Definition: dumpNswErrorDb.py:65
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
CoralUtilities::readBlobAsString
bool readBlobAsString(const coral::Blob &, std::string &)
Definition: blobaccess.cxx:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
MdtIdHelper
Definition: MdtIdHelper.h:61
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCalibR4::MdtCalibDbAlg::m_readKeyRt
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyRt
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:101
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
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:23
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonCalibR4::MdtCalibDbAlg::m_rtRootFile
Gaudi::Property< std::string > m_rtRootFile
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:93
MuonCalibR4::MdtCalibDbAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:85
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
MuonCalib::MdtCalibDataContainer::getCalibData
const MdtFullCalibData * getCalibData(const Identifier &measId, MsgStream &msg) const
Returns the calibration data associated with this station
Definition: MdtCalibDataContainer.cxx:41
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
MuonCalib::MdtTubeCalibContainer::setCalib
bool setCalib(SingleTubeCalib val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
Definition: MdtTubeCalibContainer.cxx:19
MuonCalibR4::MdtCalibDbAlg::m_prop_beta
Gaudi::Property< double > m_prop_beta
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:105
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MuonCalibR4::MdtCalibDbAlg::makeRt
MuonCalib::IRtRelationPtr makeRt(const std::string &rtType, const std::vector< double > &pars) const
Creates a new rt function from the typeName & the list of parameters.
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:283
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
MuonCalibR4::MdtCalibDbAlg::m_writeKey
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:86
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
MuonCalibR4::MdtCalibDbAlg::makeTr
MuonCalib::ITrRelationPtr makeTr(const std::string &trType, const std::vector< double > &pars) const
Creates a new tr function from the typeName & the list of parameters.
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:301
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
MuonCalib::MdtCalibDataContainer::hasDataForChannel
bool hasDataForChannel(const Identifier &measId, MsgStream &msg) const
Checks whether a calibration data object is already present.
Definition: MdtCalibDataContainer.cxx:36
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:19
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
SET_BRANCHADDRESS
#define SET_BRANCHADDRESS(tree, branchName)
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:41
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
sTgcDigitEffiDump.multiLayer
int multiLayer
Definition: sTgcDigitEffiDump.py:36
MuonCalibR4::MdtCalibDbAlg::m_rtJSON
Gaudi::Property< std::string > m_rtJSON
External Rt & T0 JSON files.
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:90
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
CoralUtilities::readBlobAsTTree
bool readBlobAsTTree(const coral::Blob &blob, std::unique_ptr< TTree > &tree, const std::string_view name="tree")
Interprets the coral::Blob as a TTree instance.
Definition: blobaccess.cxx:107
calibdata.tube
tube
Definition: calibdata.py:30
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:95
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14