ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
AthenaPoolCnvSvc Class Reference

This class provides the interface between Athena and PoolSvc. More...

#include <AthenaPoolCnvSvc.h>

Inheritance diagram for AthenaPoolCnvSvc:
Collaboration diagram for AthenaPoolCnvSvc:

Public Member Functions

virtual StatusCode initialize () override
 Required of all Gaudi Services. More...
 
virtual StatusCode io_reinit () override
 
virtual StatusCode finalize () override
 Required of all Gaudi Services. More...
 
virtual StatusCode io_finalize () override
 
virtual StatusCode stop () override
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
 Implementation of IConversionSvc: Create the transient representation of an object from persistent state. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Implementation of IConversionSvc: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConversionSvc: Resolve the references of the converted object. More...
 
virtual StatusCode connectOutput (const std::string &outputConnectionSpec, const std::string &openMode) override
 Implementation of IConversionSvc: Connect to the output connection specification with open mode. More...
 
virtual StatusCode connectOutput (const std::string &outputConnectionSpec) override
 Implementation of IConversionSvc: Connect to the output connection specification with open mode. More...
 
virtual StatusCode commitOutput (const std::string &outputConnectionSpec, bool doCommit) override
 Implementation of IConversionSvc: Commit pending output. More...
 
virtual StatusCode disconnectOutput (const std::string &outputConnectionSpec) override
 Disconnect to the output connection. More...
 
virtual IPoolSvcgetPoolSvc () override
 
virtual TokenregisterForWrite (Placement *placement, const void *obj, const RootType &classDesc) override
 
virtual void setObjPtr (void *&obj, const Token *token) override
 
virtual bool useDetailChronoStat () const override
 
StatusCode createAddress (long svcType, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
 Create a Generic address using explicit arguments to identify a single object. More...
 
virtual StatusCode createAddress (long svcType, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
 Create address from string form. More...
 
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
 Convert address to string form. More...
 
virtual StatusCode decodeOutputSpec (std::string &connectionSpec, int &outputTech) const override
 Extract/deduce the DB technology from the connection string/file specification. More...
 
virtual StatusCode registerCleanUp (IAthenaPoolCleanUp *cnv) override
 Implement registerCleanUp to register a IAthenaPoolCleanUp to be called during cleanUp. More...
 
virtual StatusCode cleanUp (const std::string &connection) override
 Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function. More...
 
virtual StatusCode setInputAttributes (const std::string &fileName) override
 Set the input file attributes, if any are requested from jobOpts. More...
 
virtual void handle (const Incident &incident) override
 Implementation of IIncidentListener: Handle for EndEvent incidence. More...
 
void flushDataHeaderForms (const std::string &streamName="*")
 Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all) More...
 
 AthenaPoolCnvSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Service Constructor. More...
 
virtual ~AthenaPoolCnvSvc ()=default
 Destructor. More...
 

Protected Member Functions

unsigned outputContextId (const std::string &outputConnection)
 

Protected Attributes

PMonUtils::BasicStopWatchResultMap_t m_chronoMap {}
 Map that holds chrono information. More...
 
Gaudi::Property< bool > m_persSvcPerOutput {this,"PersSvcPerOutput",true}
 PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream. More...
 
Gaudi::Property< std::string > m_persSvcPerInputType {this,"PersSvcPerInputType",""}
 PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type. More...
 
std::mutex m_mutex
 
Gaudi::Property< int > m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1}
 To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush. More...
 
Gaudi::Property< bool > m_oneDataHeaderForm { this, "OneDataHeaderForm", false }
 If true, use only one DataHeaderForm per Stream. More...
 
Gaudi::Property< int > m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 }
 Property for DataHeaderCnv input DHForm cache size. More...
 
Gaudi::Property< bool > m_DHFilterAliases { this, "doFilterDHAliases", true }
 Flag to control SG alias filtering when writing out DataHeader (see DataHeaderCnv_p6) More...
 

Private Member Functions

void extractPoolAttributes (const Gaudi::Property< std::vector< std::string >> &property, std::vector< std::vector< std::string > > *contAttr, std::vector< std::vector< std::string > > *dbAttr, std::vector< std::vector< std::string > > *domAttr=0) const
 Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property. More...
 
StatusCode processPoolAttributes (std::vector< std::vector< std::string > > &attr, const std::string &fileName, unsigned long contextId, bool doGet=true, bool doSet=true, bool doClear=true) const
 Set/get technology dependent POOL attributes. More...
 

Private Attributes

std::string m_lastInputFileName
 decoded storage tech requested in "StorageTechnology" property More...
 
ServiceHandle< IPoolSvcm_poolSvc {this,"PoolSvc","PoolSvc"}
 
ServiceHandle< IClassIDSvc > m_clidSvc {this,"ClassIDSvc","ClassIDSvc"}
 
Gaudi::Property< bool > m_useDetailChronoStat {this,"UseDetailChronoStat",false}
 UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false. More...
 
Gaudi::Property< std::map< std::string, std::string > > m_storageTechProp {this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}}
 Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE) More...
 
std::map< std::string, int > m_storageTechMap
 
Gaudi::Property< std::string > m_containerPrefixProp {this,"PoolContainerPrefix","Default"}
 POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix from APRDefaults according to StorageTech. More...
 
Gaudi::Property< std::string > m_containerNameHintProp {this,"TopLevelContainerName",""}
 TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>". More...
 
Gaudi::Property< std::string > m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"}
 SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching) More...
 
Gaudi::Property< std::vector< std::string > > m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"}
 Output PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
 
std::vector< std::vector< std::string > > m_domainAttr
 
std::vector< std::vector< std::string > > m_databaseAttr
 
std::vector< std::vector< std::string > > m_containerAttr
 
std::vector< unsigned int > m_contextAttr
 
std::map< std::string, int > m_fileCommitCounter
 
std::map< std::string, int > m_fileFlushSetting
 
Gaudi::Property< std::vector< std::string > > m_inputPoolAttr {this,"InputPoolAttributes",{}}
 Input PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
 
std::vector< std::vector< std::string > > m_inputAttr
 
Gaudi::Property< std::vector< std::string > > m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}}
 Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event. More...
 
std::vector< std::vector< std::string > > m_inputAttrPerEvent
 
Gaudi::Property< std::vector< std::string > > m_maxFileSizes {this,"MaxFileSizes",{}}
 MaxFileSizes, vector with maximum file sizes for Athena POOL output files. More...
 
long long m_domainMaxFileSize =std::numeric_limits<long long>::max()
 
std::map< std::string, long long > m_databaseMaxFileSize
 
std::string m_defContainerType {}
 Default container type (from PoolSvc) More...
 

Friends

class SvcFactory< AthenaPoolCnvSvc >
 

Detailed Description

This class provides the interface between Athena and PoolSvc.

Definition at line 40 of file AthenaPoolCnvSvc.h.

Constructor & Destructor Documentation

◆ AthenaPoolCnvSvc()

AthenaPoolCnvSvc::AthenaPoolCnvSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Service Constructor.

Definition at line 596 of file AthenaPoolCnvSvc.cxx.

596  :
597  base_class(name, pSvcLocator, pool::POOL_StorageType.type()) {
598 }

◆ ~AthenaPoolCnvSvc()

virtual AthenaPoolCnvSvc::~AthenaPoolCnvSvc ( )
virtualdefault

Destructor.

Member Function Documentation

◆ cleanUp()

StatusCode AthenaPoolCnvSvc::cleanUp ( const std::string &  connection)
overridevirtual

Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.

Definition at line 545 of file AthenaPoolCnvSvc.cxx.

545  {
546  bool retError = false;
547  std::size_t cpos = connection.find(':');
548  std::size_t bpos = connection.find('[');
549  if (cpos == std::string::npos) {
550  cpos = 0;
551  } else {
552  cpos++;
553  }
554  if (bpos != std::string::npos) bpos = bpos - cpos;
555  const std::string conn = connection.substr(cpos, bpos);
556  ATH_MSG_VERBOSE("Cleanup for Connection='"<< conn <<"'");
557  for (auto converter : m_cnvs) {
558  if (!converter->cleanUp(conn).isSuccess()) {
559  ATH_MSG_WARNING("AthenaPoolConverter cleanUp failed.");
560  retError = true;
561  }
562  }
563  return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
564 }

◆ commitOutput()

StatusCode AthenaPoolCnvSvc::commitOutput ( const std::string &  outputConnectionSpec,
bool  doCommit 
)
overridevirtual

Implementation of IConversionSvc: Commit pending output.

Parameters
doCommit[IN] boolean to force full commit

Definition at line 342 of file AthenaPoolCnvSvc.cxx.

342  {
343  // This is called after all DataObjects are converted.
344  std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
345  // StopWatch listens from here until the end of this current scope
346  PMonUtils::BasicStopWatch stopWatch("commitOutput", m_chronoMap);
347  std::unique_lock<std::mutex> lock(m_mutex);
348  // Extract the technology
349  int tech{0};
350  if (!decodeOutputSpec(outputConnection, tech).isSuccess()) {
351  ATH_MSG_ERROR("connectOutput FAILED extract file name and technology.");
352  return(StatusCode::FAILURE);
353  }
354  unsigned int contextId = outputContextId(outputConnection);
355  if (!processPoolAttributes(m_domainAttr, outputConnection, contextId).isSuccess()) {
356  ATH_MSG_DEBUG("commitOutput failed process POOL domain attributes.");
357  }
358  if (!processPoolAttributes(m_databaseAttr, outputConnection, contextId).isSuccess()) {
359  ATH_MSG_DEBUG("commitOutput failed process POOL database attributes.");
360  }
361  if (!processPoolAttributes(m_containerAttr, outputConnection, contextId).isSuccess()) {
362  ATH_MSG_DEBUG("commitOutput failed process POOL container attributes.");
363  }
364  std::size_t merge = outputConnection.find("?pmerge="); // Used to remove trailing TMemFile
365  const std::string baseOutputConnection = outputConnection.substr(0, merge);
366  m_fileCommitCounter[baseOutputConnection]++;
367  if (merge != std::string::npos && m_fileFlushSetting[baseOutputConnection] > 0 && m_fileCommitCounter[baseOutputConnection] % m_fileFlushSetting[baseOutputConnection] == 0) {
368  doCommit = true;
369  ATH_MSG_DEBUG("commitOutput sending data.");
370  }
371 
372  // lock.unlock(); //MN: first need to make commitCache slot-specific
373  try {
374  if (doCommit) {
375  if (!m_poolSvc->commit(contextId).isSuccess()) {
376  ATH_MSG_ERROR("commitOutput FAILED to commit OutputStream.");
377  return(StatusCode::FAILURE);
378  }
379  } else {
380  if (!m_poolSvc->commitAndHold(contextId).isSuccess()) {
381  ATH_MSG_ERROR("commitOutput FAILED to commitAndHold OutputStream.");
382  return(StatusCode::FAILURE);
383  }
384  }
385  } catch (std::exception& e) {
386  ATH_MSG_ERROR("commitOutput - caught exception: " << e.what());
387  return(StatusCode::FAILURE);
388  }
389  if (!this->cleanUp(baseOutputConnection).isSuccess()) {
390  ATH_MSG_ERROR("commitOutput FAILED to cleanup converters.");
391  return(StatusCode::FAILURE);
392  }
393  // Check FileSize
394  long long int currentFileSize = m_poolSvc->getFileSize(outputConnection, tech, contextId);
395  if (m_databaseMaxFileSize.find(outputConnection) != m_databaseMaxFileSize.end()) {
396  if (currentFileSize > m_databaseMaxFileSize[outputConnection]) {
397  ATH_MSG_WARNING(std::format("FileSize {} > {} for {}", currentFileSize, m_databaseMaxFileSize[outputConnection], outputConnection));
398  return(StatusCode::RECOVERABLE);
399  }
400  } else if (currentFileSize > m_domainMaxFileSize) {
401  ATH_MSG_WARNING(std::format("FileSize {} > {} for {}", currentFileSize, m_domainMaxFileSize, outputConnection));
402  return(StatusCode::RECOVERABLE);
403  }
404  return(StatusCode::SUCCESS);
405 }

◆ connectOutput() [1/2]

StatusCode AthenaPoolCnvSvc::connectOutput ( const std::string &  outputConnectionSpec)
overridevirtual

Implementation of IConversionSvc: Connect to the output connection specification with open mode.

Parameters
outputConnectionSpec[IN] the name of the output connection specification as string.

Definition at line 270 of file AthenaPoolCnvSvc.cxx.

270  {
271 // This is called before DataObjects are being converted.
272  std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
273  // Extract the technology
274  int tech{0};
275  if (!decodeOutputSpec(outputConnection, tech).isSuccess()) {
276  ATH_MSG_ERROR("connectOutput FAILED extract file name and technology.");
277  return(StatusCode::FAILURE);
278  }
279  unsigned int contextId = outputContextId(outputConnection);
280  try {
281  if (!m_poolSvc->connect(pool::ITransaction::UPDATE, contextId).isSuccess()) {
282  ATH_MSG_ERROR("connectOutput FAILED to open an UPDATE transaction.");
283  return(StatusCode::FAILURE);
284  }
285  } catch (std::exception& e) {
286  ATH_MSG_ERROR("connectOutput - caught exception: " << e.what());
287  return(StatusCode::FAILURE);
288  }
289 
290  std::unique_lock<std::mutex> lock(m_mutex);
291  if (std::find(m_contextAttr.begin(), m_contextAttr.end(), contextId) == m_contextAttr.end()) {
292  std::size_t merge = outputConnection.find("?pmerge="); // Used to remove trailing TMemFile
293  int flush = m_numberEventsPerWrite.value();
294  m_contextAttr.push_back(contextId);
295  // Setting default 'TREE_MAX_SIZE' for ROOT to 1024 GB to avoid file chains.
296  std::vector<std::string> maxFileSize;
297  maxFileSize.push_back("TREE_MAX_SIZE");
298  maxFileSize.push_back("1099511627776L");
299  m_domainAttr.emplace_back(std::move(maxFileSize));
300  // Extracting OUTPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
302  //FIXME
303  for (auto& dbAttrEntry : m_databaseAttr) {
304  const std::string& opt = dbAttrEntry[0];
305  std::string& data = dbAttrEntry[1];
306  const std::string& file = dbAttrEntry[2];
307  const std::string& cont = dbAttrEntry[3];
308  std::size_t equal = cont.find('='); // Used to remove leading "TTree="
309  if (equal == std::string::npos) equal = 0;
310  else equal++;
311  const auto& prefix = m_containerPrefixProp.value();
312  std::size_t colon = prefix.find(':');
313  if (colon == std::string::npos) colon = 0; // Used to remove leading technology
314  else colon++;
315  const auto defaultContName = (tech == pool::ROOTRNTUPLE_StorageType.type()) ? APRDefaults::RNTupleNames::EventData : APRDefaults::TTreeNames::EventData;
316  const auto& strProp = (prefix == "Default") ? defaultContName : prefix;
317  if (merge != std::string::npos && opt == "TREE_AUTO_FLUSH" && 0 == outputConnection.compare(0, merge, file) &&cont.compare(equal, std::string::npos, strProp, colon) == 0 && data != "int" && data != "DbLonglong" && data != "double" && data != "string") {
318  flush = atoi(data.c_str());
319  if (flush < 0 && m_numberEventsPerWrite.value() > 0) {
320  flush = m_numberEventsPerWrite.value();
322  } else if (flush > 0 && flush < m_numberEventsPerWrite.value()) {
323  flush = flush * (int(static_cast<float>(m_numberEventsPerWrite.value()) / flush - 0.5) + 1);
324  }
325  }
326  }
327  if (merge != std::string::npos) {
328  ATH_MSG_INFO("connectOutput setting auto write for: " << outputConnection << " to " << flush << " events");
329  m_fileFlushSetting[outputConnection.substr(0, merge)] = flush;
330  }
331  }
332  if (!processPoolAttributes(m_domainAttr, outputConnection, contextId).isSuccess()) {
333  ATH_MSG_DEBUG("connectOutput failed process POOL domain attributes.");
334  }
335  if (!processPoolAttributes(m_databaseAttr, outputConnection, contextId).isSuccess()) {
336  ATH_MSG_DEBUG("connectOutput failed process POOL database attributes.");
337  }
338  return(StatusCode::SUCCESS);
339 }

◆ connectOutput() [2/2]

StatusCode AthenaPoolCnvSvc::connectOutput ( const std::string &  outputConnectionSpec,
const std::string &  openMode 
)
overridevirtual

Implementation of IConversionSvc: Connect to the output connection specification with open mode.

Parameters
outputConnectionSpec[IN] the name of the output connection specification as string.
openMode[IN] the open mode of the file as string.

Definition at line 265 of file AthenaPoolCnvSvc.cxx.

266  {
267  return(connectOutput(outputConnectionSpec));
268 }

◆ convertAddress()

StatusCode AthenaPoolCnvSvc::convertAddress ( const IOpaqueAddress *  pAddress,
std::string &  refAddress 
)
overridevirtual

Convert address to string form.

Parameters
pAddress[IN] address to be converted.
refAddress[OUT] converted string form.

Definition at line 493 of file AthenaPoolCnvSvc.cxx.

494  {
495  assert(pAddress);
496  const TokenAddress* tokAddr = dynamic_cast<const TokenAddress*>(pAddress);
497  if (tokAddr != nullptr && tokAddr->getToken() != nullptr) {
498  refAddress = tokAddr->getToken()->toString();
499  } else {
500  refAddress = *pAddress->par();
501  }
502  return(StatusCode::SUCCESS);
503 }

◆ createAddress() [1/2]

StatusCode AthenaPoolCnvSvc::createAddress ( long  svcType,
const CLID clid,
const std::string &  refAddress,
IOpaqueAddress *&  refpAddress 
)
overridevirtual

Create address from string form.

Parameters
svcType[IN] service type of the address.
clid[IN] class id for the address.
refAddress[IN] string form to be converted.
refpAddress[OUT] converted address.

Definition at line 481 of file AthenaPoolCnvSvc.cxx.

484  {
485  if (svcType != repSvcType()) {
486  ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << repSvcType());
487  return(StatusCode::FAILURE);
488  }
489  refpAddress = new GenericAddress(repSvcType(), clid, refAddress);
490  return(StatusCode::SUCCESS);
491 }

◆ createAddress() [2/2]

StatusCode AthenaPoolCnvSvc::createAddress ( long  svcType,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress 
)
override

Create a Generic address using explicit arguments to identify a single object.

Parameters
svcType[IN] service type of the address.
clid[IN] class id for the address.
par[IN] string containing the database name.
ip[IN] object identifier.
refpAddress[OUT] converted address.

Definition at line 455 of file AthenaPoolCnvSvc.cxx.

459  {
460  if( svcType != repSvcType() ) {
461  ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << repSvcType());
462  return(StatusCode::FAILURE);
463  }
464  std::unique_ptr<Token> token;
465  if (par[0].compare(0, 3, "SHM") == 0) {
466  token = std::make_unique<Token>();
467  token->setOid(Token::OID_t(ip[0], ip[1]));
468  token->setAuxString("[PNAME=" + par[2] + "]");
469  RootType classDesc = RootType::ByNameNoQuiet(par[2]);
470  token->setClassID(pool::DbReflex::guid(classDesc));
471  } else {
472  token.reset(m_poolSvc->getToken(par[0], par[1], ip[0]));
473  }
474  if (token == nullptr) {
475  return(StatusCode::RECOVERABLE);
476  }
477  refpAddress = new TokenAddress(repSvcType(), clid, "", par[1], IPoolSvc::kInputStream, std::move(token));
478  return(StatusCode::SUCCESS);
479 }

◆ createObj()

StatusCode AthenaPoolCnvSvc::createObj ( IOpaqueAddress *  pAddress,
DataObject *&  refpObject 
)
overridevirtual

Implementation of IConversionSvc: Create the transient representation of an object from persistent state.

Parameters
pAddress[IN] pointer to IOpaqueAddress of the representation.
refpObject[OUT] pointer to DataObject to be created.

Definition at line 169 of file AthenaPoolCnvSvc.cxx.

169  {
170  assert(pAddress);
171  std::string objName = "ALL";
172  if (m_useDetailChronoStat.value()) {
173  if (m_clidSvc->getTypeNameOfID(pAddress->clID(), objName).isFailure()) {
174  objName = std::to_string(pAddress->clID());
175  }
176  objName += '#';
177  objName += *(pAddress->par() + 1);
178  }
179  // StopWatch listens from here until the end of this current scope
180  PMonUtils::BasicStopWatch stopWatch("cObj_" + objName, m_chronoMap);
181  if (!m_persSvcPerInputType.empty()) { // Use separate PersistencySvc for each input data type
182  TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddress);
183  if (tokAddr != nullptr && tokAddr->getToken() != nullptr && (tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "(") || tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "_"))) {
184  const unsigned int maxContext = m_poolSvc->getInputContextMap().size();
185  const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString() + tokAddr->getToken()->dbID().toString(), 1);
186  char text[32];
187  const std::string contextStr = std::format("[CTXT={:08X}]", auxContext);
188  std::strncpy(text, contextStr.c_str(), sizeof(text) - 1);
189  text[sizeof(text) - 1] = '\0';
190  if (m_poolSvc->getInputContextMap().size() > maxContext) {
191  if (m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), "FID:" + tokAddr->getToken()->dbID().toString(), m_persSvcPerInputType.value(), auxContext).isSuccess()) {
192  ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for id = " << auxContext << ".");
193  }
194  }
195  tokAddr->getToken()->setAuxString(text);
196  }
197  }
198  // Forward to base class createObj
199  StatusCode status = ::AthCnvSvc::createObj(pAddress, refpObject);
200  return(status);
201 }

◆ createRep()

StatusCode AthenaPoolCnvSvc::createRep ( DataObject *  pObject,
IOpaqueAddress *&  refpAddress 
)
overridevirtual

Implementation of IConversionSvc: Convert the transient object to the requested representation.

Parameters
pObject[IN] pointer to DataObject.
refpAddress[OUT] pointer to IOpaqueAddress of the representation to be created.

Definition at line 203 of file AthenaPoolCnvSvc.cxx.

203  {
204  assert(pObject);
205  std::string objName = "ALL";
206  if (m_useDetailChronoStat.value()) {
207  if (m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
208  objName = std::to_string(pObject->clID());
209  }
210  objName += '#';
211  objName += pObject->registry()->name();
212  }
213  // StopWatch listens from here until the end of this current scope
214  PMonUtils::BasicStopWatch stopWatch("cRep_" + objName, m_chronoMap);
215  StatusCode status = StatusCode::FAILURE;
216  if (pObject->clID() == 1) {
217  // No transient object was found use cnv to write default persistent object
218  SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(pObject->registry());
219  if (proxy != nullptr) {
220  IConverter* cnv = converter(proxy->clID());
221  status = cnv->createRep(pObject, refpAddress);
222  }
223  } else {
224  // Forward to base class createRep
225  try {
226  status = ::AthCnvSvc::createRep(pObject, refpAddress);
227  } catch(std::runtime_error& e) {
228  ATH_MSG_FATAL(e.what());
229  }
230  }
231  return(status);
232 }

◆ decodeOutputSpec()

StatusCode AthenaPoolCnvSvc::decodeOutputSpec ( std::string &  connectionSpec,
int &  outputTech 
) const
overridevirtual

Extract/deduce the DB technology from the connection string/file specification.

Definition at line 505 of file AthenaPoolCnvSvc.cxx.

505  {
506  if (fileSpec.starts_with ( "ROOTKEY:")) {
507  outputTech = pool::ROOTKEY_StorageType.type();
508  fileSpec.erase(0, 8);
509  } else if (fileSpec.starts_with ( "ROOTTREE:")) {
510  outputTech = pool::ROOTTREE_StorageType.type();
511  fileSpec.erase(0, 9);
512  } else if (fileSpec.starts_with ( "ROOTTREEINDEX:")) {
513  outputTech = pool::ROOTTREEINDEX_StorageType.type();
514  fileSpec.erase(0, 14);
515  } else if (fileSpec.starts_with ( "ROOTRNTUPLE:")) {
516  outputTech = pool::ROOTRNTUPLE_StorageType.type();
517  fileSpec.erase(0, 12);
518  } else if (outputTech == 0) {
519  // Extract the file name
520  std::string fileName{fileSpec};
521  if (auto pos = fileSpec.find("?pmerge="); pos != std::string::npos) {
522  fileName = fileSpec.substr(0, pos);
523  }
524  // Find the appropriate event data technology for this file
525  // This will be used for event data and its data header
526  // First we look for an exact file name match
527  // If that fails, we look for a wildcard ("*") match
528  // If that also fails, we use the default value from PoolSvc
529  if (auto it = m_storageTechMap.find(fileName); it != m_storageTechMap.end()) {
530  outputTech = it->second;
531  } else if (it = m_storageTechMap.find("*"); it != m_storageTechMap.end()) {
532  outputTech = it->second;
533  } else {
535  }
536  }
537  return StatusCode::SUCCESS;
538 }

◆ disconnectOutput()

StatusCode AthenaPoolCnvSvc::disconnectOutput ( const std::string &  outputConnectionSpec)
overridevirtual

Disconnect to the output connection.

Definition at line 408 of file AthenaPoolCnvSvc.cxx.

408  {
409  std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
410  unsigned int contextId = outputContextId(outputConnection);
411  StatusCode sc = m_poolSvc->disconnect(contextId);
412  return sc;
413 }

◆ extractPoolAttributes()

void AthenaPoolCnvSvc::extractPoolAttributes ( const Gaudi::Property< std::vector< std::string >> &  property,
std::vector< std::vector< std::string > > *  contAttr,
std::vector< std::vector< std::string > > *  dbAttr,
std::vector< std::vector< std::string > > *  domAttr = 0 
) const
private

Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property.

Definition at line 600 of file AthenaPoolCnvSvc.cxx.

603  {
604  std::vector<std::string> opt;
605  std::string attributeName, containerName, databaseName, valueString;
606  for (const auto& propertyValue : property.value()) {
607  opt.clear();
608  attributeName.clear();
609  containerName.clear();
610  databaseName.clear();
611  valueString.clear();
612  using Gaudi::Utils::AttribStringParser;
613  for (const AttribStringParser::Attrib& attrib : AttribStringParser (propertyValue)) {
614  const std::string tag = attrib.tag;
615  const std::string val = attrib.value;
616  if (tag == "DatabaseName") {
617  databaseName = std::move(val);
618  } else if (tag == "ContainerName") {
619  if (databaseName.empty()) {
620  databaseName = "*";
621  }
622  containerName = std::move(val);
623  } else {
624  attributeName = std::move(tag);
625  valueString = std::move(val);
626  }
627  }
628  if (!attributeName.empty() && !valueString.empty()) {
629  opt.push_back(attributeName);
630  opt.push_back(valueString);
631  if (!databaseName.empty()) {
632  opt.push_back(databaseName);
633  if (!containerName.empty()) {
634  opt.push_back(containerName);
635  if (containerName.compare(0, 6, "TTree=") == 0) {
636  dbAttr->push_back(opt);
637  } else {
638  contAttr->push_back(opt);
639  }
640  } else {
641  opt.push_back("");
642  dbAttr->push_back(opt);
643  }
644  } else if (domAttr != 0) {
645  domAttr->push_back(opt);
646  } else {
647  opt.push_back("*");
648  opt.push_back("");
649  dbAttr->push_back(opt);
650  }
651  }
652  }
653 }

◆ fillRepRefs()

StatusCode AthenaPoolCnvSvc::fillRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtual

Implementation of IConversionSvc: Resolve the references of the converted object.

Parameters
pAddress[IN] pointer to IOpaqueAddress of the representation to be resolved.
pObject[IN] pointer to DataObject to be created.

Definition at line 234 of file AthenaPoolCnvSvc.cxx.

234  {
235  assert(pObject);
236  std::string objName = "ALL";
237  if (m_useDetailChronoStat.value()) {
238  if (m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
239  objName = std::to_string(pObject->clID());
240  }
241  objName += '#';
242  objName += pObject->registry()->name();
243  }
244  // StopWatch listens from here until the end of this current scope
245  PMonUtils::BasicStopWatch stopWatch("fRep_" + objName, m_chronoMap);
246  StatusCode status = StatusCode::FAILURE;
247  if (pObject->clID() == 1) {
248  // No transient object was found use cnv to write default persistent object
249  SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(pObject->registry());
250  if (proxy != nullptr) {
251  IConverter* cnv = converter(proxy->clID());
252  status = cnv->fillRepRefs(pAddress, pObject);
253  }
254  } else {
255  // Forward to base class fillRepRefs
256  try {
257  status = ::AthCnvSvc::fillRepRefs(pAddress, pObject);
258  } catch(std::runtime_error& e) {
259  ATH_MSG_FATAL(e.what());
260  }
261  }
262  return(status);
263 }

◆ finalize()

StatusCode AthenaPoolCnvSvc::finalize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 135 of file AthenaPoolCnvSvc.cxx.

135  {
136  ATH_MSG_VERBOSE("Finalizing...");
137  // Some algorithms write in finalize(), flush DHForms if any are left
139  // Release ClassIDSvc
140  if (!m_clidSvc.release().isSuccess()) {
141  ATH_MSG_WARNING("Cannot release ClassIDSvc.");
142  }
143  // Release PoolSvc
144  if (!m_poolSvc.release().isSuccess()) {
145  ATH_MSG_WARNING("Cannot release PoolSvc.");
146  }
147  // Print Performance Statistics
148  // The pattern AthenaPoolCnvSvc.*PerfStats is ignored in AtlasTest/TestTools/share/post.sh
149  const std::string msgPrefix{"PerfStats "};
150  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
151  ATH_MSG_INFO(msgPrefix << "Timing Measurements for AthenaPoolCnvSvc");
152  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
153  for(const auto& [key, value] : m_chronoMap) {
154  ATH_MSG_INFO(msgPrefix << "| " << std::left << std::setw(15) << key << " | "
155  << std::right << std::setw(15) << std::fixed << std::setprecision(0) << value << " ms |");
156  }
157  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
158 
159  m_cnvs.clear();
160  m_cnvs.shrink_to_fit();
161  return(StatusCode::SUCCESS);
162 }

◆ flushDataHeaderForms()

void AthenaPoolCnvSvc::flushDataHeaderForms ( const std::string &  streamName = "*")

Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)

Definition at line 121 of file AthenaPoolCnvSvc.cxx.

121  {
122  // Write remaining DataHeaderForms for a given streamName, "*"" means all
123  auto DHCnvListener = dynamic_cast<IIncidentListener*>( converter( ClassID_traits<DataHeader>::ID() ) );
124  FileIncident incident(name(), "WriteDataHeaderForms", streamName);
125  if( DHCnvListener ) DHCnvListener->handle(incident);
126 }

◆ getPoolSvc()

IPoolSvc * AthenaPoolCnvSvc::getPoolSvc ( )
overridevirtual
Returns
pointer to PoolSvc instance.

Definition at line 422 of file AthenaPoolCnvSvc.cxx.

422  {
423  return(&*m_poolSvc);
424 }

◆ handle()

void AthenaPoolCnvSvc::handle ( const Incident &  incident)
overridevirtual

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 588 of file AthenaPoolCnvSvc.cxx.

588  {
589  if (incident.type() == "EndEvent") {
591  ATH_MSG_DEBUG("handle EndEvent failed process POOL database attributes.");
592  }
593  }
594 }

◆ initialize()

StatusCode AthenaPoolCnvSvc::initialize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 35 of file AthenaPoolCnvSvc.cxx.

35  {
36  // Initialize DataModelCompatSvc
37  ServiceHandle<IService> dmcsvc("DataModelCompatSvc", this->name());
38  ATH_CHECK(dmcsvc.retrieve());
39  // Retrieve PoolSvc
40  ATH_CHECK(m_poolSvc.retrieve());
41  StringProperty defContainerType("DefaultContainerType", "ROOTTREEINDEX");
42  if(IProperty* propertyServer = dynamic_cast<IProperty*>(m_poolSvc.get())) {
43  propertyServer->getProperty(&defContainerType).ignore();
44  }
45  m_defContainerType = defContainerType.value();
46  // Retrieve ClassIDSvc
47  ATH_CHECK(m_clidSvc.retrieve());
48  // Register this service for 'I/O' events
49  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
50  ATH_CHECK(iomgr.retrieve());
51  if (!iomgr->io_register(this).isSuccess()) {
52  ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !");
53  return(StatusCode::FAILURE);
54  }
55  // Extracting MaxFileSizes for global default and map by Database name.
56  for (const auto& maxFileSizeSpec : m_maxFileSizes.value()) {
57  if (auto p = maxFileSizeSpec.find('='); p != std::string::npos) {
58  long long maxFileSize = 0;
59  const char* start = maxFileSizeSpec.data() + (p + 1);
60  const char* end = maxFileSizeSpec.data() + maxFileSizeSpec.size();
61  if (auto [ptr, ec] = std::from_chars(start, end, maxFileSize); ec != std::errc{}) {
62  ATH_MSG_WARNING(std::format("Invalid MaxFileSize value: {}", std::string(start, end)));
63  }
64  std::string databaseName = maxFileSizeSpec.substr(0, maxFileSizeSpec.find_first_of(" ="));
65  m_databaseMaxFileSize.emplace(std::move(databaseName), maxFileSize);
66  } else {
67  if (auto [ptr, ec] = std::from_chars(maxFileSizeSpec.data(), maxFileSizeSpec.data() + maxFileSizeSpec.size(), m_domainMaxFileSize); ec != std::errc{}) {
68  ATH_MSG_WARNING(std::format("Invalid MaxFileSize value: {}", maxFileSizeSpec));
69  }
70  }
71  }
72  // Validate provided event data technologies and fill the internal cache
73  for (const auto& [key, value] : m_storageTechProp.value()) {
74  try {
75  const auto dbType = pool::DbType::getType(value);
76  if (dbType == pool::TEST_StorageType) {
77  ATH_MSG_FATAL(std::format("Unknown storage type requested for file {}: {}", key, value));
78  return StatusCode::FAILURE;
79  }
80  m_storageTechMap.emplace(key, dbType.type());
81  } catch (const std::exception& e) {
82  ATH_MSG_FATAL(std::format("Exception while getting storage type for file {}: {}", key, e.what()));
83  return StatusCode::FAILURE;
84  } catch (...) {
85  ATH_MSG_FATAL(std::format("Unknown exception while getting storage type for file {}", key));
86  return StatusCode::FAILURE;
87  }
88  }
89  // Extracting INPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
91  // Extracting the INPUT POOL ItechnologySpecificAttributes which are to be printed for each event
93  // Setup incident for EndEvent to print out attributes each event
94  ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
95  long int pri = 1000;
96  if (!m_inputPoolAttrPerEvent.value().empty()) {
97  // Set to be listener for EndEvent
98  incSvc->addListener(this, "EndEvent", pri);
99  ATH_MSG_DEBUG("Subscribed to EndEvent for printing out input file attributes.");
100  }
101  if (!processPoolAttributes(m_inputAttr, "", IPoolSvc::kInputStream, false, true, true).isSuccess()) {
102  ATH_MSG_DEBUG("setInputAttribute failed setting POOL domain attributes.");
103  }
104 
105  // Load these dictionaries now, so we don't need to try to do so
106  // while multiple threads are running.
107  TClass::GetClass ("TLeafI");
108  TClass::GetClass ("TLeafL");
109  TClass::GetClass ("TLeafD");
110  TClass::GetClass ("TLeafF");
111 
112  return(StatusCode::SUCCESS);
113 }

◆ io_finalize()

StatusCode AthenaPoolCnvSvc::io_finalize ( )
overridevirtual

Definition at line 164 of file AthenaPoolCnvSvc.cxx.

164  {
165  ATH_MSG_DEBUG("I/O finalization...");
166  return(StatusCode::SUCCESS);
167 }

◆ io_reinit()

StatusCode AthenaPoolCnvSvc::io_reinit ( )
overridevirtual

Definition at line 115 of file AthenaPoolCnvSvc.cxx.

115  {
116  ATH_MSG_DEBUG("I/O reinitialization...");
117  m_contextAttr.clear();
118  return(StatusCode::SUCCESS);
119 }

◆ outputContextId()

unsigned int AthenaPoolCnvSvc::outputContextId ( const std::string &  outputConnection)
protected

Definition at line 416 of file AthenaPoolCnvSvc.cxx.

416  {
417  return m_persSvcPerOutput?
418  m_poolSvc->getOutputContext(outputConnection) : (unsigned int)IPoolSvc::kOutputStream;
419 }

◆ processPoolAttributes()

StatusCode AthenaPoolCnvSvc::processPoolAttributes ( std::vector< std::vector< std::string > > &  attr,
const std::string &  fileName,
unsigned long  contextId,
bool  doGet = true,
bool  doSet = true,
bool  doClear = true 
) const
private

Set/get technology dependent POOL attributes.

Definition at line 655 of file AthenaPoolCnvSvc.cxx.

660  {
661  bool retError = false;
662  for (auto& attrEntry : attr) {
663  if (attrEntry.size() == 2) {
664  const std::string& opt = attrEntry[0];
665  std::string data = attrEntry[1];
666  if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
667  if (doGet) {
668  if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
669  ATH_MSG_DEBUG("getAttribute failed for domain attr " << opt);
670  retError = true;
671  }
672  }
673  } else if (doSet) {
674  if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
675  ATH_MSG_DEBUG("setAttribute " << opt << " to " << data);
676  if (doClear) {
677  attrEntry.clear();
678  }
679  } else {
680  ATH_MSG_DEBUG("setAttribute failed for domain attr " << opt << " to " << data);
681  retError = true;
682  }
683  }
684  }
685  if (attrEntry.size() == 4) {
686  const std::string& opt = attrEntry[0];
687  std::string data = attrEntry[1];
688  const std::string& file = attrEntry[2];
689  const std::string& cont = attrEntry[3];
690  if (!fileName.empty() && (0 == fileName.compare(0, fileName.find('?'), file)
691  || (file[0] == '*' && file.find("," + fileName + ",") == std::string::npos))) {
692  if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
693  if (doGet) {
694  if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
695  ATH_MSG_DEBUG("getAttribute failed for database/container attr " << opt);
696  retError = true;
697  }
698  }
699  } else if (doSet) {
700  if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
701  ATH_MSG_DEBUG("setAttribute " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
702  if (doClear) {
703  if (file[0] == '*' && !m_persSvcPerOutput) {
704  attrEntry[2] += "," + fileName + ",";
705  } else {
706  attrEntry.clear();
707  }
708  }
709  } else {
710  ATH_MSG_DEBUG("setAttribute failed for " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
711  retError = true;
712  }
713  }
714  }
715  }
716  }
717  std::erase_if(attr, [](const auto& entry) { return entry.empty(); });
718  return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
719 }

◆ registerCleanUp()

StatusCode AthenaPoolCnvSvc::registerCleanUp ( IAthenaPoolCleanUp cnv)
overridevirtual

Implement registerCleanUp to register a IAthenaPoolCleanUp to be called during cleanUp.

Definition at line 540 of file AthenaPoolCnvSvc.cxx.

540  {
541  m_cnvs.push_back(cnv);
542  return(StatusCode::SUCCESS);
543 }

◆ registerForWrite()

Token * AthenaPoolCnvSvc::registerForWrite ( Placement placement,
const void *  obj,
const RootType classDesc 
)
overridevirtual
Returns
a string token to a Data Object written to Pool
Parameters
placement[IN] pointer to the placement hint
obj[IN] pointer to the Data Object to be written to Pool
classDesc[IN] pointer to the Seal class description for the Data Object.

Definition at line 426 of file AthenaPoolCnvSvc.cxx.

426  {
427  // StopWatch listens from here until the end of this current scope
428  PMonUtils::BasicStopWatch stopWatch("cRepR_ALL", m_chronoMap);
429  Token* token = nullptr;
430  if (m_persSvcPerOutput) { // Use separate PersistencySvc for each output stream/file
431  char text[32];
432  const std::string contextStr = std::format("[CTXT={:08X}]", m_poolSvc->getOutputContext(placement->fileName()));
433  std::strncpy(text, contextStr.c_str(), sizeof(text) - 1);
434  text[sizeof(text) - 1] = '\0';
435  placement->setAuxString(text);
436  }
437  token = m_poolSvc->registerForWrite(placement, obj, classDesc);
438  return(token);
439 }

◆ setInputAttributes()

StatusCode AthenaPoolCnvSvc::setInputAttributes ( const std::string &  fileName)
overridevirtual

Set the input file attributes, if any are requested from jobOpts.

Parameters
fileName[IN] name of the input file

Definition at line 566 of file AthenaPoolCnvSvc.cxx.

566  {
567  // Set attributes for input file
568  m_lastInputFileName = fileName; // Save file name for printing attributes per event
569  if (!processPoolAttributes(m_inputAttr, m_lastInputFileName, IPoolSvc::kInputStream, false, true, false).isSuccess()) {
570  ATH_MSG_DEBUG("setInputAttribute failed setting POOL database/container attributes.");
571  }
573  ATH_MSG_DEBUG("setInputAttribute failed getting POOL database/container attributes.");
574  }
575  if (!m_persSvcPerInputType.empty()) {
576  // Loop over all extra event input contexts and switch off TTreeCache
577  const auto& extraInputContextMap = m_poolSvc->getInputContextMap();
578  for (const auto& [label, id]: extraInputContextMap) {
579  if (m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), m_lastInputFileName, m_persSvcPerInputType.value(), id).isSuccess()) {
580  ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for = " << label << ".");
581  }
582  }
583  }
584  return(StatusCode::SUCCESS);
585 }

◆ setObjPtr()

void AthenaPoolCnvSvc::setObjPtr ( void *&  obj,
const Token token 
)
overridevirtual
Parameters
obj[OUT] pointer to the Data Object.
token[IN] string token of the Data Object for which a Pool Ref is filled.

Definition at line 441 of file AthenaPoolCnvSvc.cxx.

441  {
442  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
443  // StopWatch listens from here until the end of this current scope
444  PMonUtils::BasicStopWatch stopWatch("cObjR_ALL", m_chronoMap);
445  if (token->dbID() != Guid::null()) {
446  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
447  m_poolSvc->setObjPtr(obj, token);
448  }
449 }

◆ stop()

StatusCode AthenaPoolCnvSvc::stop ( )
overridevirtual

Definition at line 128 of file AthenaPoolCnvSvc.cxx.

128  {
129  ATH_MSG_VERBOSE("stop()");
130  // In case of direct writing without an OutputStream, this should be a good time to flush DHForms
132  return StatusCode::SUCCESS;
133 }

◆ useDetailChronoStat()

bool AthenaPoolCnvSvc::useDetailChronoStat ( ) const
overridevirtual
Returns
a boolean for using detailed time and size statistics.

Definition at line 451 of file AthenaPoolCnvSvc.cxx.

451  {
452  return(m_useDetailChronoStat.value());
453 }

Friends And Related Function Documentation

◆ SvcFactory< AthenaPoolCnvSvc >

friend class SvcFactory< AthenaPoolCnvSvc >
friend

Definition at line 1 of file AthenaPoolCnvSvc.h.

Member Data Documentation

◆ m_branchNameHintProp

Gaudi::Property<std::string> AthenaPoolCnvSvc::m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"}
private

SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching)

Definition at line 197 of file AthenaPoolCnvSvc.h.

◆ m_chronoMap

PMonUtils::BasicStopWatchResultMap_t AthenaPoolCnvSvc::m_chronoMap {}
protected

Map that holds chrono information.

Definition at line 181 of file AthenaPoolCnvSvc.h.

◆ m_clidSvc

ServiceHandle<IClassIDSvc> AthenaPoolCnvSvc::m_clidSvc {this,"ClassIDSvc","ClassIDSvc"}
private

Definition at line 177 of file AthenaPoolCnvSvc.h.

◆ m_containerAttr

std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_containerAttr
private

Definition at line 203 of file AthenaPoolCnvSvc.h.

◆ m_containerNameHintProp

Gaudi::Property<std::string> AthenaPoolCnvSvc::m_containerNameHintProp {this,"TopLevelContainerName",""}
private

TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>".

Definition at line 195 of file AthenaPoolCnvSvc.h.

◆ m_containerPrefixProp

Gaudi::Property<std::string> AthenaPoolCnvSvc::m_containerPrefixProp {this,"PoolContainerPrefix","Default"}
private

POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix from APRDefaults according to StorageTech.

Definition at line 193 of file AthenaPoolCnvSvc.h.

◆ m_contextAttr

std::vector<unsigned int> AthenaPoolCnvSvc::m_contextAttr
private

Definition at line 204 of file AthenaPoolCnvSvc.h.

◆ m_databaseAttr

std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_databaseAttr
private

Definition at line 202 of file AthenaPoolCnvSvc.h.

◆ m_databaseMaxFileSize

std::map<std::string, long long> AthenaPoolCnvSvc::m_databaseMaxFileSize
private

Definition at line 218 of file AthenaPoolCnvSvc.h.

◆ m_defContainerType

std::string AthenaPoolCnvSvc::m_defContainerType {}
private

Default container type (from PoolSvc)

Definition at line 221 of file AthenaPoolCnvSvc.h.

◆ m_DHFilterAliases

Gaudi::Property<bool> AthenaPoolCnvSvc::m_DHFilterAliases { this, "doFilterDHAliases", true }
protected

Flag to control SG alias filtering when writing out DataHeader (see DataHeaderCnv_p6)

Definition at line 243 of file AthenaPoolCnvSvc.h.

◆ m_DHFormCacheSize

Gaudi::Property<int> AthenaPoolCnvSvc::m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 }
protected

Property for DataHeaderCnv input DHForm cache size.

Definition at line 241 of file AthenaPoolCnvSvc.h.

◆ m_domainAttr

std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_domainAttr
private

Definition at line 201 of file AthenaPoolCnvSvc.h.

◆ m_domainMaxFileSize

long long AthenaPoolCnvSvc::m_domainMaxFileSize =std::numeric_limits<long long>::max()
private

Definition at line 217 of file AthenaPoolCnvSvc.h.

◆ m_fileCommitCounter

std::map<std::string, int> AthenaPoolCnvSvc::m_fileCommitCounter
private

Definition at line 205 of file AthenaPoolCnvSvc.h.

◆ m_fileFlushSetting

std::map<std::string, int> AthenaPoolCnvSvc::m_fileFlushSetting
private

Definition at line 206 of file AthenaPoolCnvSvc.h.

◆ m_inputAttr

std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttr
private

Definition at line 209 of file AthenaPoolCnvSvc.h.

◆ m_inputAttrPerEvent

std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttrPerEvent
private

Definition at line 213 of file AthenaPoolCnvSvc.h.

◆ m_inputPoolAttr

Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_inputPoolAttr {this,"InputPoolAttributes",{}}
private

Input PoolAttributes, vector with names and values of technology specific attributes for POOL.

Definition at line 208 of file AthenaPoolCnvSvc.h.

◆ m_inputPoolAttrPerEvent

Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}}
private

Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event.

Definition at line 212 of file AthenaPoolCnvSvc.h.

◆ m_lastInputFileName

std::string AthenaPoolCnvSvc::m_lastInputFileName
private

decoded storage tech requested in "StorageTechnology" property

Definition at line 175 of file AthenaPoolCnvSvc.h.

◆ m_maxFileSizes

Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_maxFileSizes {this,"MaxFileSizes",{}}
private

MaxFileSizes, vector with maximum file sizes for Athena POOL output files.

Definition at line 216 of file AthenaPoolCnvSvc.h.

◆ m_mutex

std::mutex AthenaPoolCnvSvc::m_mutex
protected

Definition at line 232 of file AthenaPoolCnvSvc.h.

◆ m_numberEventsPerWrite

Gaudi::Property<int> AthenaPoolCnvSvc::m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1}
protected

To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush.

Definition at line 236 of file AthenaPoolCnvSvc.h.

◆ m_oneDataHeaderForm

Gaudi::Property<bool> AthenaPoolCnvSvc::m_oneDataHeaderForm { this, "OneDataHeaderForm", false }
protected

If true, use only one DataHeaderForm per Stream.

Definition at line 239 of file AthenaPoolCnvSvc.h.

◆ m_persSvcPerInputType

Gaudi::Property<std::string> AthenaPoolCnvSvc::m_persSvcPerInputType {this,"PersSvcPerInputType",""}
protected

PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type.

default = "", no tree name results in a single persistency service.

Definition at line 231 of file AthenaPoolCnvSvc.h.

◆ m_persSvcPerOutput

Gaudi::Property<bool> AthenaPoolCnvSvc::m_persSvcPerOutput {this,"PersSvcPerOutput",true}
protected

PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.

default = true.

Definition at line 226 of file AthenaPoolCnvSvc.h.

◆ m_poolAttr

Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"}
private

Output PoolAttributes, vector with names and values of technology specific attributes for POOL.

Definition at line 200 of file AthenaPoolCnvSvc.h.

◆ m_poolSvc

ServiceHandle<IPoolSvc> AthenaPoolCnvSvc::m_poolSvc {this,"PoolSvc","PoolSvc"}
private

Definition at line 176 of file AthenaPoolCnvSvc.h.

◆ m_storageTechMap

std::map<std::string, int> AthenaPoolCnvSvc::m_storageTechMap
private

Definition at line 190 of file AthenaPoolCnvSvc.h.

◆ m_storageTechProp

Gaudi::Property<std::map<std::string, std::string> > AthenaPoolCnvSvc::m_storageTechProp {this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}}
private

Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)

Definition at line 189 of file AthenaPoolCnvSvc.h.

◆ m_useDetailChronoStat

Gaudi::Property<bool> AthenaPoolCnvSvc::m_useDetailChronoStat {this,"UseDetailChronoStat",false}
private

UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false.

Definition at line 186 of file AthenaPoolCnvSvc.h.


The documentation for this class was generated from the following files:
AthenaPoolCnvSvc::m_poolSvc
ServiceHandle< IPoolSvc > m_poolSvc
Definition: AthenaPoolCnvSvc.h:176
AthenaPoolCnvSvc::m_contextAttr
std::vector< unsigned int > m_contextAttr
Definition: AthenaPoolCnvSvc.h:204
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
IPoolSvc::kOutputStream
@ kOutputStream
Definition: IPoolSvc.h:39
AthenaPoolCnvSvc::cleanUp
virtual StatusCode cleanUp(const std::string &connection) override
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
Definition: AthenaPoolCnvSvc.cxx:545
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Amg::compare
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
Definition: EventPrimitivesHelpers.h:109
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
TScopeAdapter::ByNameNoQuiet
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
Definition: RootType.cxx:586
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
pool::DbType::getType
static DbType getType(const std::string &name)
Access known storage type object by name.
AthenaPoolCnvSvc::outputContextId
unsigned outputContextId(const std::string &outputConnection)
Definition: AthenaPoolCnvSvc.cxx:416
AthenaPoolCnvSvc::m_defContainerType
std::string m_defContainerType
Default container type (from PoolSvc)
Definition: AthenaPoolCnvSvc.h:221
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:138
AthenaPoolCnvSvc::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Definition: AthenaPoolCnvSvc.h:177
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:194
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
Token::contID
const std::string & contID() const
Access container identifier.
Definition: Token.h:69
AthenaPoolCnvSvc::m_numberEventsPerWrite
Gaudi::Property< int > m_numberEventsPerWrite
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on numb...
Definition: AthenaPoolCnvSvc.h:236
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:13
AthenaPoolCnvSvc::m_domainMaxFileSize
long long m_domainMaxFileSize
Definition: AthenaPoolCnvSvc.h:217
AthenaPoolCnvSvc::m_inputAttrPerEvent
std::vector< std::vector< std::string > > m_inputAttrPerEvent
Definition: AthenaPoolCnvSvc.h:213
pool::ITransaction::UPDATE
@ UPDATE
Definition: ITransaction.h:30
skel.it
it
Definition: skel.GENtoEVGEN.py:407
AthenaPoolCnvSvc::decodeOutputSpec
virtual StatusCode decodeOutputSpec(std::string &connectionSpec, int &outputTech) const override
Extract/deduce the DB technology from the connection string/file specification.
Definition: AthenaPoolCnvSvc.cxx:505
Token::dbID
const Guid & dbID() const
Access database identifier.
Definition: Token.h:64
AthenaPoolCnvSvc::m_databaseAttr
std::vector< std::vector< std::string > > m_databaseAttr
Definition: AthenaPoolCnvSvc.h:202
AthenaPoolCnvSvc::m_chronoMap
PMonUtils::BasicStopWatchResultMap_t m_chronoMap
Map that holds chrono information.
Definition: AthenaPoolCnvSvc.h:181
athena.value
value
Definition: athena.py:124
AthenaPoolCnvSvc::m_containerPrefixProp
Gaudi::Property< std::string > m_containerPrefixProp
POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix f...
Definition: AthenaPoolCnvSvc.h:193
AthenaPoolCnvSvc::m_mutex
std::mutex m_mutex
Definition: AthenaPoolCnvSvc.h:232
AthenaPoolCnvSvc::m_maxFileSizes
Gaudi::Property< std::vector< std::string > > m_maxFileSizes
MaxFileSizes, vector with maximum file sizes for Athena POOL output files.
Definition: AthenaPoolCnvSvc.h:216
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
Token::classID
const Guid & classID() const
Access database identifier.
Definition: Token.h:73
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
MuonR4::to_string
std::string to_string(const SectorProjector proj)
Definition: MsTrackSeeder.cxx:66
Placement::setAuxString
Placement & setAuxString(const std::string &auxString)
Set auxiliary string.
Definition: Placement.h:42
AthenaPoolCnvSvc::processPoolAttributes
StatusCode processPoolAttributes(std::vector< std::vector< std::string > > &attr, const std::string &fileName, unsigned long contextId, bool doGet=true, bool doSet=true, bool doClear=true) const
Set/get technology dependent POOL attributes.
Definition: AthenaPoolCnvSvc.cxx:655
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthenaPoolCnvSvc::flushDataHeaderForms
void flushDataHeaderForms(const std::string &streamName="*")
Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
Definition: AthenaPoolCnvSvc.cxx:121
AthenaPoolCnvSvc::m_fileFlushSetting
std::map< std::string, int > m_fileFlushSetting
Definition: AthenaPoolCnvSvc.h:206
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
pool::DbType::type
int type() const
Access to full type.
Definition: DbType.h:65
AthenaPoolCnvSvc::m_useDetailChronoStat
Gaudi::Property< bool > m_useDetailChronoStat
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = fa...
Definition: AthenaPoolCnvSvc.h:186
CxxUtils::fpcompare::equal
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:114
PMonUtils::BasicStopWatch
Definition: BasicStopWatch.h:17
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
TokenAddress
This class provides a Generic Transient Address for POOL tokens.
Definition: TokenAddress.h:23
Token::OID_t
Definition: Token.h:24
APRDefaults::RNTupleNames::EventData
static constexpr const char * EventData
Definition: APRDefaults.h:18
Token::setClassID
Token & setClassID(const Guid &cl_id)
Access database identifier.
Definition: Token.h:75
IPoolSvc::kInputStream
@ kInputStream
Definition: IPoolSvc.h:39
Guid::toString
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
pool::DbType
Definition: DbType.h:30
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
AthenaPoolCnvSvc::m_persSvcPerOutput
Gaudi::Property< bool > m_persSvcPerOutput
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
Definition: AthenaPoolCnvSvc.h:226
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
calibdata.exception
exception
Definition: calibdata.py:495
add-xsec-uncert-quadrature-N.label
label
Definition: add-xsec-uncert-quadrature-N.py:104
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
file
TFile * file
Definition: tile_monitor.h:29
AthenaPoolCnvSvc::m_inputAttr
std::vector< std::vector< std::string > > m_inputAttr
Definition: AthenaPoolCnvSvc.h:209
AthenaPoolCnvSvc::m_databaseMaxFileSize
std::map< std::string, long long > m_databaseMaxFileSize
Definition: AthenaPoolCnvSvc.h:218
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Placement::fileName
const std::string & fileName() const
Access file name.
Definition: Placement.h:28
TokenAddress::getToken
Token * getToken()
Definition: TokenAddress.cxx:15
AthenaPoolCnvSvc::m_inputPoolAttrPerEvent
Gaudi::Property< std::vector< std::string > > m_inputPoolAttrPerEvent
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to...
Definition: AthenaPoolCnvSvc.h:212
AthenaPoolCnvSvc::m_poolAttr
Gaudi::Property< std::vector< std::string > > m_poolAttr
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition: AthenaPoolCnvSvc.h:200
std::erase_if
std::size_t erase_if(T_container &container, T_Func pred)
Definition: TruthParticleHitCountAlg.cxx:29
AthenaPoolCnvSvc::m_containerAttr
std::vector< std::vector< std::string > > m_containerAttr
Definition: AthenaPoolCnvSvc.h:203
AthenaPoolCnvSvc::extractPoolAttributes
void extractPoolAttributes(const Gaudi::Property< std::vector< std::string >> &property, std::vector< std::vector< std::string > > *contAttr, std::vector< std::vector< std::string > > *dbAttr, std::vector< std::vector< std::string > > *domAttr=0) const
Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property.
Definition: AthenaPoolCnvSvc.cxx:600
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:28
AthenaPoolCnvSvc::m_inputPoolAttr
Gaudi::Property< std::vector< std::string > > m_inputPoolAttr
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition: AthenaPoolCnvSvc.h:208
AthCnvSvc::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
Definition: AthCnvSvc.cxx:244
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:134
Token::setOid
Token & setOid(const OID_t &oid)
Set object identifier.
Definition: Token.h:85
AthenaPoolCnvSvc::m_persSvcPerInputType
Gaudi::Property< std::string > m_persSvcPerInputType
PersSvcPerInputType, string property, tree name to use multiple persistency services,...
Definition: AthenaPoolCnvSvc.h:231
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
AthenaPoolCnvSvc::m_domainAttr
std::vector< std::vector< std::string > > m_domainAttr
Definition: AthenaPoolCnvSvc.h:201
Guid::null
static const Guid & null() noexcept
NULL-Guid: static class method.
Definition: Guid.cxx:14
AthenaPoolCnvSvc::m_fileCommitCounter
std::map< std::string, int > m_fileCommitCounter
Definition: AthenaPoolCnvSvc.h:205
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Token::setAuxString
Token & setAuxString(const std::string &auxString)
Set auxiliary string.
Definition: Token.h:93
AthenaPoolCnvSvc::connectOutput
virtual StatusCode connectOutput(const std::string &outputConnectionSpec, const std::string &openMode) override
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
Definition: AthenaPoolCnvSvc.cxx:265
AthCnvSvc::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
Definition: AthCnvSvc.cxx:284
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
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:16
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:23
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
AthenaPoolCnvSvc::m_storageTechProp
Gaudi::Property< std::map< std::string, std::string > > m_storageTechProp
Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)
Definition: AthenaPoolCnvSvc.h:189
APRDefaults::TTreeNames::EventData
static constexpr const char * EventData
Definition: APRDefaults.h:12
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:45
AthenaPoolCnvSvc::m_lastInputFileName
std::string m_lastInputFileName
decoded storage tech requested in "StorageTechnology" property
Definition: AthenaPoolCnvSvc.h:175
AthCnvSvc::createRep
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
Definition: AthCnvSvc.cxx:276
merge
Definition: merge.py:1
AthenaPoolCnvSvc::m_storageTechMap
std::map< std::string, int > m_storageTechMap
Definition: AthenaPoolCnvSvc.h:190
ServiceHandle
Definition: ClusterMakerTool.h:36
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TScopeAdapter
Definition: RootType.h:119
pool::DbReflex::guid
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.