ATLAS Offline Software
AddressRemappingSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "AddressRemappingSvc.h"
11 
12 #include "GaudiKernel/MsgStream.h"
13 #include "GaudiKernel/GenericAddress.h"
14 #include "GaudiKernel/Algorithm.h"
15 #include "GaudiKernel/IAlgManager.h"
16 #include "GaudiKernel/IClassIDSvc.h"
17 
19 #include "AthenaKernel/IRCUSvc.h"
21 
22 #include "SGTools/DataProxy.h"
28 
29 #include <algorithm>
30 
31 #include "boost/range.hpp"
32 
33 
34 //________________________________________________________________________________
35 AddressRemappingSvc::AddressRemappingSvc(const std::string& name, ISvcLocator* pSvcLocator) :
36  extends1<AthService, Athena::IInputRename>(name, pSvcLocator),
37  m_clidSvc("ClassIDSvc", name),
38  m_RCUSvc("Athena::RCUSvc", name),
39  m_oldTads(),
40  m_newTads()
41 {}
42 
43 //__________________________________________________________________________
45 }
46 //__________________________________________________________________________
48  ATH_MSG_VERBOSE("Initializing " << name());
49 
51  ATH_CHECK( m_clidSvc.retrieve() );
52  ATH_CHECK( m_RCUSvc.retrieve() );
53  //ATH_CHECK( m_algResourcePool.retrieve() );
54 
55  m_oldTads.clear();
56  m_newTads.clear();
57  for (const std::string& overwrite : m_overwriteMaps) {
58  const std::string::size_type p_sep = overwrite.find("->");
59  if (p_sep == std::string::npos) {
60  ATH_MSG_ERROR("Unexpected format in TypeKeyOverwriteMaps: " << overwrite);
61  return(StatusCode::FAILURE);
62  }
63  //const std::pair<std::string, std::string> entry(overwrite.substr(0, p_sep), overwrite.substr(p_sep + 2));
64  const std::pair<std::string, std::string> entry(overwrite.substr(p_sep + 2), overwrite.substr(0, p_sep));
65  ATH_MSG_INFO("TypeKeyOverwriteMaps for: " << entry.second
66  << " -> " << entry.first);
67  const std::string::size_type p_oldSep = entry.first.find('#');
68  if (p_oldSep == std::string::npos) {
69  ATH_MSG_ERROR("Unexpected format in TypeKeyOverwriteMaps: " << overwrite);
70  return(StatusCode::FAILURE);
71  }
72 
73  std::string clidStr = entry.first.substr(0, p_oldSep);
74  std::set<CLID> symClids;
75  for (std::string::size_type p_clidSep = clidStr.rfind(','); p_clidSep != std::string::npos; clidStr.resize(p_clidSep), p_clidSep = clidStr.rfind(',')) {
76  symClids.insert(getClid(clidStr.substr(p_clidSep + 1)));
77  }
78  std::string keyStr = entry.first.substr(p_oldSep + 1);
79  std::set<std::string> aliases;
80  for (std::string::size_type p_keySep = keyStr.rfind(','); p_keySep != std::string::npos; keyStr.resize(p_keySep), p_keySep = keyStr.rfind(',')) {
81  aliases.insert(keyStr.substr(p_keySep + 1));
82  }
83  SG::TransientAddress oldTad(getClid(clidStr), keyStr);
84  for (CLID clid : symClids) {
85  oldTad.setTransientID(clid);
86  }
87  oldTad.setAlias(aliases);
88 
89  const std::string::size_type p_newSep = entry.second.find('#');
90  if (p_newSep == std::string::npos) {
91  ATH_MSG_ERROR("Unexpected format in TypeKeyOverwriteMaps: " << overwrite);
92  return(StatusCode::FAILURE);
93  }
94  SG::TransientAddress newTad(getClid(entry.second.substr(0, p_newSep)), entry.second.substr(p_newSep + 1));
95  ATH_MSG_INFO("TypeKeyOverwriteMaps for: " << newTad.clID()
96  << "#" << newTad.name()
97  << " -> " << oldTad.clID()
98  << "#" << oldTad.name());
99  m_oldTads.push_back(std::move(oldTad));
100  m_newTads.push_back(std::move(newTad));
101  }
102 
104  ATH_CHECK( initInputRenames() );
105  return(StatusCode::SUCCESS);
106 }
107 //__________________________________________________________________________
116 {
117  if (toadd.empty()) return;
118  // Ok, managed via RCU.
120  Athena::RCUUpdate<InputRenameMap_t> u (inputRenames);
121  auto newmap = std::make_unique<InputRenameMap_t> (*u);
122  for (const auto& p : toadd)
123  newmap->insert (p);
124  u.update (std::move (newmap));
125 }
126 //__________________________________________________________________________
130 StatusCode AddressRemappingSvc::initInputRenames()
131 {
132  // Accumulate renames into this map.
133  InputRenameMap_t newmap;
134 
135  // Parse input properties.
136  for (const std::string& remap : m_typeKeyRenameMaps)
137  {
138  std::string::size_type pos1 = remap.find('#');
139  std::string::size_type pos2 = remap.find("->");
140  if (pos1 == std::string::npos || pos2 == std::string::npos || pos2 < pos1)
141  {
142  ATH_MSG_ERROR ( "Bad InputRemaps string: " << remap );
143  continue;
144  }
145 
146  std::string cname = remap.substr (0, pos1);
147  std::string from = remap.substr (pos1+1, pos2-pos1-1);
148  std::string to = remap.substr (pos2+2, std::string::npos);
149  CLID clid = getClid (cname);
150  if (clid == CLID_NULL) {
151  ATH_MSG_ERROR( "Can't find CLID for InputRemaps string: " << remap );
152  continue;
153  }
154 
155  // We have a request to rename FROM to TO for CLID.
156  // Translate to sgkeys and add to the map.
157  SG::sgkey_t from_key = m_proxyDict->stringToKey (from, clid);
158  SG::sgkey_t to_key = m_proxyDict->stringToKey (to, clid);
159  newmap[from_key] = Athena::IInputRename::Rename { to_key, to };
160  }
161 
162  // Publish the map.
163  addInputRenames (newmap);
164 
165  if (!m_typeKeyRenameMaps.empty()) {
166  SG::DataProxyHolder::setInputRenameMap (m_inputRenames.get());
169  *m_proxyDict);
170  }
171 
172  return StatusCode::SUCCESS;
173 }
174 //__________________________________________________________________________
176 {
177  ATH_CHECK( m_clidSvc.release() );
178  ATH_CHECK( m_proxyDict.release() );
179  ATH_CHECK( m_RCUSvc.release() );
180  ATH_CHECK( m_algResourcePool.release() );
182  return(StatusCode::SUCCESS);
183 }
184 //________________________________________________________________________________
187 {
188  return preLoadAddressesConst (storeID, tads);
189 }
191  IAddressProvider::tadList& tads) const
192 {
193  if (storeID == StoreID::EVENT_STORE) {
194  ATH_CHECK( renameTads (tads) );
195  }
196 
197  const std::vector<SG::TransientAddress>* oldTads = nullptr;
198  const std::vector<SG::TransientAddress>* newTads = nullptr;
199 
200  if (m_skipBadRemappings) {
201  // We need to have the cleaned lists built in loadAddresses.
202  // If that hasn't already been done, return now.
204  return StatusCode::SUCCESS;
205  }
206  oldTads = m_oldTadsCleaned.ptr();
207  newTads = m_newTadsCleaned.ptr();
208  }
209  else {
210  // No cleaning needed.
211  oldTads = &m_oldTads;
212  newTads = &m_newTads;
213  }
214 
215  StatusCode status = m_proxyDict.retrieve();
216  if (!status.isSuccess()) {
217  ATH_MSG_ERROR("Unable to get the IProxyDict");
218  return(status);
219  }
220  for (std::vector<SG::TransientAddress>::const_iterator oldIter = oldTads->begin(),
221  newIter = newTads->begin(), oldIterEnd = oldTads->end();
222  oldIter != oldIterEnd; ++oldIter, ++newIter) {
223  SG::TransientAddress* tadd = new SG::TransientAddress(*oldIter);
224  tads.push_back(tadd);
225  m_proxyDict->stringToKey(oldIter->name(), oldIter->clID());
226  m_proxyDict->stringToKey(newIter->name(), newIter->clID());
227  }
228  return(StatusCode::SUCCESS);
229 }
230 //________________________________________________________________________________
233 {
234  if (storeID == StoreID::EVENT_STORE) {
235  initDeletes();
236  ATH_CHECK( renameTads (tads) );
237  }
238  return loadAddressesConst (tads);
239 }
240 
242 {
243  if(!m_skipBadRemappings) return(StatusCode::SUCCESS);
245  return StatusCode::SUCCESS;
246  }
247 
248  std::vector<SG::TransientAddress> oldTadsCleaned = m_oldTads;
249  std::vector<SG::TransientAddress> newTadsCleaned = m_newTads;
250 
251  //do same as in preLoadAddresses, except check each tad will have a valid proxy to remap to
252  StatusCode status = m_proxyDict.retrieve();
253  if (!status.isSuccess()) {
254  ATH_MSG_ERROR("Unable to get the IProxyDict");
255  return(status);
256  }
257  for (std::vector<SG::TransientAddress>::iterator oldIter = oldTadsCleaned.begin(),
258  newIter = newTadsCleaned.begin(), oldIterEnd = oldTadsCleaned.end();
259  oldIter != oldIterEnd; ++oldIter, ++newIter)
260  {
261  CLID goodCLID = newIter->clID(); //newIter are the things we are remapping to
262  SG::TransientAddress::TransientClidSet clidvec(oldIter->transientID());
263  std::set<CLID> clidToKeep (clidvec.begin(), clidvec.end());
264  //try dataproxy, if it fails, try data proxy of next type
265  SG::DataProxy* dataProxy(m_proxyDict->proxy(goodCLID,newIter->name()/*the name of the address in the input file*/));
266  if(dataProxy==0) {
267  //remove goodCLID from the clidToKeep
268  clidToKeep.erase(goodCLID);
269  //try base types
270  const SG::BaseInfoBase* bi = SG::BaseInfoBase::find (newIter->clID());
271  if (bi) {
272  for (CLID goodCLID : bi->get_bases()) {
273  dataProxy = m_proxyDict->proxy(goodCLID, newIter->name());
274  if(dataProxy) break;
275  clidToKeep.erase(goodCLID); //was a bad CLID, so get rid of it
276  }
277  }
278  if(dataProxy) {
279  ATH_MSG_DEBUG("Remapping " << oldIter->clID() << "#" << oldIter->name() << " to base-class CLID: " << goodCLID << "#" << newIter->name());
280  //modify newIter to have these restricted clid instead
281  *newIter = SG::TransientAddress(goodCLID, newIter->name());
282  }
283  }
284  if(dataProxy==0) {
285  ATH_MSG_INFO("Skipping remapping of " << oldIter->clID() << "#" << oldIter->name() << " because no suitable remapping found");
286  continue;
287  }
288  SG::TransientAddress* tadd = new SG::TransientAddress(goodCLID,oldIter->name(),oldIter->address());
289  tadd->setAlias(oldIter->alias());//match the aliases
290  //also match the transientIDs, but only for the ok CLID
291  for(auto tIter = clidToKeep.begin(); tIter != clidToKeep.end(); ++tIter) {
292  if(goodCLID == *tIter) continue; //already added in constructor
293  tadd->setTransientID(goodCLID);
294  }
295  //replace oldIter tad with this new tadd if we have changed the primary CLID
296  if(oldIter->clID()!=tadd->clID()) {
297  *oldIter = *tadd; //relies on assignment operator
298  }
299  tads.push_back(tadd);
300  m_proxyDict->stringToKey(oldIter->name(), oldIter->clID());
301  m_proxyDict->stringToKey(newIter->name(), newIter->clID());
302  }
303 
304 
305  //only do this once, not every event .. FIXME: Should I be rechecking every new file? For now, we assume will not chain together different sample types
306  m_oldTadsCleaned.set (std::move (oldTadsCleaned));
307  m_newTadsCleaned.set (std::move (newTadsCleaned));
308 
309  return StatusCode::SUCCESS;
310 
311 }
312 //________________________________________________________________________________
315  const EventContext& ctx)
316 {
317  return updateAddressConst (storeID, tad, ctx);
318 }
321  const EventContext& /*ctx*/) const
322 {
323  const std::vector<SG::TransientAddress>* oldTads = nullptr;
324  const std::vector<SG::TransientAddress>* newTads = nullptr;
325 
327  oldTads = m_oldTadsCleaned.ptr();
328  newTads = m_newTadsCleaned.ptr();
329  }
330  else {
331  // No cleaning needed.
332  oldTads = &m_oldTads;
333  newTads = &m_newTads;
334  }
335 
336  for (std::vector<SG::TransientAddress>::const_iterator oldIter = oldTads->begin(),
337  newIter = newTads->begin(), oldIterEnd = oldTads->end();
338  oldIter != oldIterEnd; ++oldIter, ++newIter) {
339  if (oldIter->transientID(tad->clID())
340  && (oldIter->name() == tad->name() || oldIter->alias().find(tad->name()) != oldIter->alias().end())) {
341  ATH_MSG_DEBUG("Overwrite for: " << tad->clID() << "#" << tad->name() << " -> " << newIter->clID() << "#" << newIter->name());
342  SG::DataProxy* dataProxy(m_proxyDict->proxy(newIter->clID(), newIter->name()));
343  if (dataProxy == 0) {
344  ATH_MSG_WARNING("Cannot get proxy for: " << newIter->clID() << "#" << newIter->name());
345  return(StatusCode::FAILURE);
346  }
347  GenericAddress* newGadd = 0;
348  if (dataProxy->isValidAddress()) newGadd = dynamic_cast<GenericAddress*>(dataProxy->address());
349  if (newGadd == 0) {
350  ATH_MSG_WARNING("Cannot get GenericAddress for: " << newIter->clID() << "#" << newIter->name());
351  return(StatusCode::FAILURE);
352  }
353  GenericAddress* oldGadd = new GenericAddress(newGadd->svcType(), tad->clID(), *newGadd->par(), tad->name(), *newGadd->ipar());
354  tad->setAddress(oldGadd);
355  return(StatusCode::SUCCESS);
356  }
357  }
358  return(StatusCode::FAILURE);
359 }
360 //_______________________________________________________________________________
366 {
367  // Fetch the current rename map using RCU.
369 
370  // We can exit early if there's nothing to do.
371  // FIXME: m_deletes will almost never be empty, but many times it will have
372  // no overlap with the input file. Should try to speed up by
373  // noticing/caching that somehow.
374  if (r->empty() && m_deletes.empty()) return StatusCode::SUCCESS;
375 
376  // We may discover additional remappings due to autosymlinking.
377  // Accumulate them here.
378  InputRenameMap_t newmap;
379 
380  // Loop over all TADs.
383  while (pos != end) {
384  SG::TransientAddress*& tad = *pos;
385 
386  // Has the object described by this TAD been renamed?
387  // FIXME: Handle renaming aliases.
388  CLID tad_clid = tad->clID();
389  SG::sgkey_t sgkey = m_proxyDict->stringToKey (tad->name(), tad_clid);
390  auto it = r->find (sgkey);
391  if (it != r->end()) {
392  const std::string& name_renamed = it->second.m_key;
393 
394  // We're doing a renaming. Make a new TAD with the new name.
395  auto tad_new = std::make_unique<SG::TransientAddress>
396  (tad_clid, name_renamed,
397  tad->address(), tad->clearAddress());
398  for (CLID clid : tad->transientID()) {
399  if (clid == tad_clid) continue;
400  tad_new->setTransientID (clid);
401  SG::sgkey_t from_key = m_proxyDict->stringToKey (tad->name(), clid);
402  if (r->find(from_key) == r->end()) {
403  SG::sgkey_t to_key = m_proxyDict->stringToKey (name_renamed, clid);
404  newmap[from_key] = Athena::IInputRename::Rename { to_key, name_renamed };
405  }
406  }
407 
408  size_t namelen = tad->name().size();
410  for (const std::string& a : tad->alias()) {
411  std::string a_renamed = a;
412 
413  SG::sgkey_t from_key = m_proxyDict->stringToKey (a_renamed, tad_clid);
414  auto it_a = r->find (from_key);
415  if (it_a != r->end()) {
416  a_renamed = it_a->second.m_key;
417  }
418 
419  if (strncmp (a_renamed.c_str(), tad->name().c_str(), namelen) == 0 &&
420  a_renamed[namelen] == '.')
421  {
422  a_renamed = name_renamed + a_renamed.substr (namelen, std::string::npos);
423  }
424 
425  newAliases.insert (a_renamed);
426  }
427  tad_new->setAlias (newAliases);
428  tad_new->setProvider (tad->provider(), tad->storeID());
429 
430  // Replace the old TAD in the list with the new one.
431  delete tad;
432  tad = tad_new.release();
433 
434  ++pos;
435  }
436 
437  else if (isDeleted (*tad)) {
438  // Rename the existing TAD to end in _DELETED.
439  // Drop symlinks in the process.
440  auto tad_new = std::make_unique<SG::TransientAddress>
441  (tad->clID(), tad->name() + "_DELETED",
442  tad->address(), tad->clearAddress());
443  tad_new->setProvider (tad->provider(), tad->storeID());
444  // Preserve alias information, also renaming them to end in _DELETED.
445  for (const std::string& a : tad->alias()) {
446  tad_new->setAlias (a + "_DELETED");
447  }
448  // Replace the old TAD in the list with the new one.
449  delete tad;
450  tad = tad_new.release();
451 
452  ++pos;
453  }
454 
455  else {
456  // Check for renaming of an alias; eg., for renaming a dynamic vbl.
458  for (const std::string& a : aset) {
459  SG::sgkey_t from_key = m_proxyDict->stringToKey (a, tad_clid);
460  auto it_a = r->find (from_key);
461  if (it_a != r->end()) {
462  const std::string& s = it_a->second.m_key;
463  tad->removeAlias (a);
464  tad->setAlias (s);
465  }
466  }
467 
468  ++pos;
469  }
470  }
471 
472  // Publish additional remappings.
473  addInputRenames (newmap);
474 
475  return StatusCode::SUCCESS;
476 }
477 
478 
479 //________________________________________________________________________________
481  CLID clid(atoi(type.c_str())); // Is type a CLID?
482  if (clid == 0) { // or not
483  if (!m_clidSvc->getIDOfTypeName(type, clid).isSuccess()) {
484  return(0);
485  }
486  }
487  return(clid);
488 }
489 //______________________________________________________________________________
492 {
493  if (m_typeKeyRenameMaps.empty())
494  return nullptr;
495  return m_inputRenames.get();
496 }
497 //______________________________________________________________________________
499 {
500  if (m_haveDeletes) return;
501 
502  std::list<IAlgorithm*> algs = m_algResourcePool->getFlatAlgList();
503 
504  std::scoped_lock lock (m_deletesMutex);
505  if (m_haveDeletes) return;
506  m_haveDeletes = true;
507 
508  for (IAlgorithm* ialg : algs) {
509  if (Gaudi::Algorithm* alg = dynamic_cast<Gaudi::Algorithm*> (ialg)) {
510  // Need to ignore SGInputLoader; it'll have output deps
511  // on everything being read.
512  if (alg->name() == "SGInputLoader") continue;
513 
514  // Also ignore ViewDataVerifier algs, since they have no real output
515  if (alg->type() == "AthViews::ViewDataVerifier" ) continue;
516 
517  for (const DataObjID& dobj : alg->outputDataObjs()) {
518  static const std::string pref = "StoreGateSvc+";
519  if (dobj.key().rfind(pref, 0) != std::string::npos) {
520  std::string key = dobj.key().substr (pref.size());
521  m_deletes.emplace (key, dobj.clid());
522 
523  // If this looks like an xAOD type, then also make an entry
524  // for an aux store. Don't want to try to rely on BaseInfo here,
525  // as we may not have loaded the proper libraries yet.
526  // Second line of the test is to handle the tests in DataModelTest.
527  if (dobj.fullKey().find ("xAOD") != std::string::npos ||
528  dobj.fullKey().find ("cinfo") != std::string::npos)
529  {
530  m_deletes.emplace (key + "Aux.",
532  }
533  }
534  }
535  } else {
536  ATH_MSG_WARNING(ialg->name() << " doesn't seem to be an Algorithm" );
537  }
538 
539  }
540 }
541 //______________________________________________________________________________
543 {
544  std::string key = tad.name();
545  std::scoped_lock lock (m_deletesMutex);
546  for (auto p : boost::make_iterator_range (m_deletes.equal_range (key))) {
547  CLID clid = p.second;
548  if (tad.transientID (clid)) {
549  return true;
550  }
551  }
552  return false;
553 }
554 
555 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.PyAthenaComps.algs
algs
Definition: PyAthenaComps.py:43
beamspotman.r
def r
Definition: beamspotman.py:676
common.sgkey
def sgkey(tool)
Definition: common.py:1028
Athena::RCUObject
Wrapper object controlled by RCU synchonization.
Definition: RCUObject.h:322
AddressRemappingSvc::InputRenameMap_t
Athena::IInputRename::InputRenameMap_t InputRenameMap_t
Map of sgkey->sgkey for input renames.
Definition: AddressRemappingSvc.h:112
AddressRemappingSvc::isDeleted
bool isDeleted(const SG::TransientAddress &tad) const
Definition: AddressRemappingSvc.cxx:542
AddressRemappingSvc::~AddressRemappingSvc
virtual ~AddressRemappingSvc()
Destructor.
Definition: AddressRemappingSvc.cxx:44
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
AddressRemappingSvc::m_skipBadRemappings
Gaudi::Property< bool > m_skipBadRemappings
Definition: AddressRemappingSvc.h:116
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
SGout2dot.alg
alg
Definition: SGout2dot.py:243
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Athena::RCUUpdate
Helper to update data in a RCUObject.
Definition: RCUObject.h:138
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Athena::IInputRename::Rename
Type of the input rename map: sgkey_t -> sgkey_t.
Definition: IInputRename.h:41
SG::TransientAddress::storeID
StoreID::type storeID() const
Definition: TransientAddress.h:311
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
SG::AuxTypeRegistry::setInputRenameMap
void setInputRenameMap(const Athena::IInputRename::InputRenameMap_t *map, const IStringPool &pool)
Declare input renaming requests.
Definition: AuxTypeRegistry.cxx:917
AddressRemappingSvc::addInputRenames
void addInputRenames(const InputRenameMap_t &toadd) const
Merge in additional input rename mappings.
Definition: AddressRemappingSvc.cxx:115
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
initialize
void initialize()
Definition: run_EoverP.cxx:894
python.FakeAthena.Algorithm
def Algorithm(name)
Definition: FakeAthena.py:41
AddressRemappingSvc::m_inputRenames
std::unique_ptr< InputRenameRCU_t > m_inputRenames
Definition: AddressRemappingSvc.h:114
SG::TransientAddress::setAlias
void setAlias(const std::string &key)
set alias'
Definition: TransientAddress.h:251
skel.it
it
Definition: skel.GENtoEVGEN.py:423
DataProxyHolder.h
Manage DataProxy reference in ElementLink/DataLink.
AddressRemappingSvc::m_oldTads
std::vector< SG::TransientAddress > m_oldTads
Definition: AddressRemappingSvc.h:90
AddressRemappingSvc::m_oldTadsCleaned
CxxUtils::CachedValue< std::vector< SG::TransientAddress > > m_oldTadsCleaned
Definition: AddressRemappingSvc.h:97
SG::TransientAddress
Definition: TransientAddress.h:32
SG::TransientAddress::TransientClidSet
std::vector< CLID > TransientClidSet
Strictly a set, but there shouldn't be more than a handful of entries, so store it as a sorted vector...
Definition: TransientAddress.h:38
SG::TransientAddress::removeAlias
bool removeAlias(const std::string &key)
remove alias from proxy
Definition: TransientAddress.h:271
AddressRemappingSvc::m_haveDeletes
std::atomic< bool > m_haveDeletes
Definition: AddressRemappingSvc.h:121
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::BaseInfoBase::get_bases
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
Definition: BaseInfo.cxx:304
AddressRemappingSvc::AddressRemappingSvc
AddressRemappingSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Definition: AddressRemappingSvc.cxx:35
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
IRCUSvc.h
read-copy-update (RCU) style synchronization for Athena.
AddressRemappingSvc::initDeletes
void initDeletes()
Definition: AddressRemappingSvc.cxx:498
AddressRemappingSvc::getClid
CLID getClid(std::string type) const
Definition: AddressRemappingSvc.cxx:480
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AddressRemappingSvc::loadAddresses
virtual StatusCode loadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Implementation of the loadAddresses function without any functionality.
Definition: AddressRemappingSvc.cxx:231
AddressRemappingSvc::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Definition: AddressRemappingSvc.h:81
AddressRemappingSvc::m_overwriteMaps
StringArrayProperty m_overwriteMaps
TypeKeyOverwriteMaps, map for type::key overwrites.
Definition: AddressRemappingSvc.h:89
SG::TransientAddress::name
const std::string & name() const
Get the primary (hashed) SG key.
Definition: TransientAddress.h:208
AddressRemappingSvc::m_newTadsCleaned
CxxUtils::CachedValue< std::vector< SG::TransientAddress > > m_newTadsCleaned
Definition: AddressRemappingSvc.h:98
SG::DataProxy::address
virtual IOpaqueAddress * address() const override final
Retrieve IOpaqueAddress.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::TransientAddress::alias
const TransientAliasSet & alias() const
set the clearAddress flag: IOA will not be deleted in proxy
Definition: TransientAddress.h:278
AddressRemappingSvc::renameTads
StatusCode renameTads(IAddressProvider::tadList &tads) const
Scan TAD list and carry out any requested renamings.
Definition: AddressRemappingSvc.cxx:365
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
SG::TransientAddress::provider
IAddressProvider * provider()
Definition: TransientAddress.h:306
AddressRemappingSvc::m_algResourcePool
ServiceHandle< IAlgResourcePool > m_algResourcePool
Definition: AddressRemappingSvc.h:85
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
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
AthService
Definition: AthService.h:32
Athena::RCURead
Helper to read data from a RCUObject.
Definition: RCUObject.h:136
SG::TransientAddress::clID
CLID clID() const
Retrieve string key:
Definition: TransientAddress.h:201
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AddressRemappingSvc.h
This file contains the class definition for the AddressRemappingSvc class.
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
AddressRemappingSvc::m_RCUSvc
ServiceHandle< Athena::IRCUSvc > m_RCUSvc
Definition: AddressRemappingSvc.h:84
AddressRemappingSvc::m_deletes
std::unordered_multimap< std::string, CLID > m_deletes
Definition: AddressRemappingSvc.h:122
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:569
SG::TransientAddress::setTransientID
void setTransientID(CLID id)
get transient CLID's
Definition: TransientAddress.cxx:142
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
SG::TransientAddress::setAddress
void setAddress(IOpaqueAddress *pAddress)
Retrieve primary clid.
Definition: TransientAddress.cxx:172
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:32
AddressRemappingSvc::preLoadAddressesConst
StatusCode preLoadAddressesConst(StoreID::type storeID, IAddressProvider::tadList &tads) const
Definition: AddressRemappingSvc.cxx:190
AddressRemappingSvc::m_proxyDict
ServiceHandle< IProxyDict > m_proxyDict
Definition: AddressRemappingSvc.h:82
a
TList * a
Definition: liststreamerinfos.cxx:10
remap
std::map< std::string, std::string > remap
list of directories to be explicitly remapped
Definition: hcg.cxx:92
StoreID::type
type
Definition: StoreID.h:24
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AddressRemappingSvc::preLoadAddresses
virtual StatusCode preLoadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Get all addresses from provider.
Definition: AddressRemappingSvc.cxx:185
TransientAddress.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
AddressRemappingSvc::updateAddressConst
StatusCode updateAddressConst(StoreID::type, SG::TransientAddress *pTad, const EventContext &ctx) const
Definition: AddressRemappingSvc.cxx:319
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
AddressRemappingSvc::m_typeKeyRenameMaps
Gaudi::Property< std::vector< std::string > > m_typeKeyRenameMaps
Property: list of requested input renames.
Definition: AddressRemappingSvc.h:101
IAuxStore.h
Interface for non-const operations on an auxiliary store.
AddressRemappingSvc::inputRenameMap
virtual const IInputRename::InputRenameRCU_t * inputRenameMap() const override
Retrieve a pointer to the input rename map.
Definition: AddressRemappingSvc.cxx:491
IAddressProvider::tadList
std::list< SG::TransientAddress * > tadList
Definition: IAddressProvider.h:32
AddressRemappingSvc::updateAddress
virtual StatusCode updateAddress(StoreID::type, SG::TransientAddress *pTad, const EventContext &ctx) override
Update a transient address.
Definition: AddressRemappingSvc.cxx:313
AddressRemappingSvc::loadAddressesConst
StatusCode loadAddressesConst(IAddressProvider::tadList &tads) const
Definition: AddressRemappingSvc.cxx:241
SG::DataProxy::isValidAddress
bool isValidAddress() const
is the address valid?
Definition: DataProxy.cxx:566
SG::TransientAddress::clearAddress
void clearAddress(const bool &flag)
Return the clearAddress flag.
Definition: TransientAddress.h:285
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
merge.status
status
Definition: merge.py:17
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
IConstAuxStore.h
Interface for const operations on an auxiliary store.
checker_macros.h
Define macros for attributes used to control the static checker.
SG::DataProxy
Definition: DataProxy.h:44
SG::TransientAddress::TransientAliasSet
std::set< std::string > TransientAliasSet
Definition: TransientAddress.h:40
SG::TransientAddress::transientID
bool transientID(CLID id) const
set transient CLID's
Definition: TransientAddress.h:236
AddressRemappingSvc::m_deletesMutex
std::mutex m_deletesMutex
Definition: AddressRemappingSvc.h:120
AddressRemappingSvc::finalize
virtual StatusCode finalize() override
Required of all Gaudi services:
Definition: AddressRemappingSvc.cxx:175
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
DataProxy.h
AddressRemappingSvc::m_newTads
std::vector< SG::TransientAddress > m_newTads
Definition: AddressRemappingSvc.h:91