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
 

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 589 of file AthenaPoolCnvSvc.cxx.

589  :
590  base_class(name, pSvcLocator, pool::POOL_StorageType.type()) {
591 }

◆ ~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 538 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 335 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 265 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 260 of file AthenaPoolCnvSvc.cxx.

261  {
262  return(connectOutput(outputConnectionSpec));
263 }

◆ 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 486 of file AthenaPoolCnvSvc.cxx.

487  {
488  assert(pAddress);
489  const TokenAddress* tokAddr = dynamic_cast<const TokenAddress*>(pAddress);
490  if (tokAddr != nullptr && tokAddr->getToken() != nullptr) {
491  refAddress = tokAddr->getToken()->toString();
492  } else {
493  refAddress = *pAddress->par();
494  }
495  return(StatusCode::SUCCESS);
496 }

◆ 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 474 of file AthenaPoolCnvSvc.cxx.

477  {
478  if (svcType != repSvcType()) {
479  ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << repSvcType());
480  return(StatusCode::FAILURE);
481  }
482  refpAddress = new GenericAddress(repSvcType(), clid, refAddress);
483  return(StatusCode::SUCCESS);
484 }

◆ 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 448 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 164 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 198 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 498 of file AthenaPoolCnvSvc.cxx.

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

◆ disconnectOutput()

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

Disconnect to the output connection.

Definition at line 401 of file AthenaPoolCnvSvc.cxx.

401  {
402  std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
403  unsigned int contextId = outputContextId(outputConnection);
404  StatusCode sc = m_poolSvc->disconnect(contextId);
405  return sc;
406 }

◆ 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 593 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 229 of file AthenaPoolCnvSvc.cxx.

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

◆ finalize()

StatusCode AthenaPoolCnvSvc::finalize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 130 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 116 of file AthenaPoolCnvSvc.cxx.

116  {
117  // Write remaining DataHeaderForms for a given streamName, "*"" means all
118  auto DHCnvListener = dynamic_cast<IIncidentListener*>( converter( ClassID_traits<DataHeader>::ID() ) );
119  FileIncident incident(name(), "WriteDataHeaderForms", streamName);
120  if( DHCnvListener ) DHCnvListener->handle(incident);
121 }

◆ getPoolSvc()

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

Definition at line 415 of file AthenaPoolCnvSvc.cxx.

415  {
416  return(&*m_poolSvc);
417 }

◆ handle()

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

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 581 of file AthenaPoolCnvSvc.cxx.

581  {
582  if (incident.type() == "EndEvent") {
584  ATH_MSG_DEBUG("handle EndEvent failed process POOL database attributes.");
585  }
586  }
587 }

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

◆ io_finalize()

StatusCode AthenaPoolCnvSvc::io_finalize ( )
overridevirtual

Definition at line 159 of file AthenaPoolCnvSvc.cxx.

159  {
160  ATH_MSG_DEBUG("I/O finalization...");
161  return(StatusCode::SUCCESS);
162 }

◆ io_reinit()

StatusCode AthenaPoolCnvSvc::io_reinit ( )
overridevirtual

Definition at line 110 of file AthenaPoolCnvSvc.cxx.

110  {
111  ATH_MSG_DEBUG("I/O reinitialization...");
112  m_contextAttr.clear();
113  return(StatusCode::SUCCESS);
114 }

◆ outputContextId()

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

Definition at line 409 of file AthenaPoolCnvSvc.cxx.

409  {
410  return m_persSvcPerOutput?
411  m_poolSvc->getOutputContext(outputConnection) : (unsigned int)IPoolSvc::kOutputStream;
412 }

◆ 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 648 of file AthenaPoolCnvSvc.cxx.

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

◆ registerCleanUp()

StatusCode AthenaPoolCnvSvc::registerCleanUp ( IAthenaPoolCleanUp cnv)
overridevirtual

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

Definition at line 533 of file AthenaPoolCnvSvc.cxx.

533  {
534  m_cnvs.push_back(cnv);
535  return(StatusCode::SUCCESS);
536 }

◆ 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 419 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 559 of file AthenaPoolCnvSvc.cxx.

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

◆ 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 434 of file AthenaPoolCnvSvc.cxx.

434  {
435  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
436  // StopWatch listens from here until the end of this current scope
437  PMonUtils::BasicStopWatch stopWatch("cObjR_ALL", m_chronoMap);
438  if (token->dbID() != Guid::null()) {
439  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
440  m_poolSvc->setObjPtr(obj, token);
441  }
442 }

◆ stop()

StatusCode AthenaPoolCnvSvc::stop ( )
overridevirtual

Definition at line 123 of file AthenaPoolCnvSvc.cxx.

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

◆ useDetailChronoStat()

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

Definition at line 444 of file AthenaPoolCnvSvc.cxx.

444  {
445  return(m_useDetailChronoStat.value());
446 }

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_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 240 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 238 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 229 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 233 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 236 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 228 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 223 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:538
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:409
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:135
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:233
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:498
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:229
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:648
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:116
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:66
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
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:31
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:223
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
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:593
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:228
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:260
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
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:37
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.