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...
 
BooleanProperty m_persSvcPerOutput {this,"PersSvcPerOutput",true}
 PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream. More...
 
StringProperty m_persSvcPerInputType {this,"PersSvcPerInputType",""}
 PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type. More...
 
std::mutex m_mutex
 
IntegerProperty 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...
 
BooleanProperty m_oneDataHeaderForm { this, "OneDataHeaderForm", false }
 If true, use only one DataHeaderForm per Stream. More...
 
IntegerProperty m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 }
 Property for DataHeaderCnv input DHForm cache size. More...
 
BooleanProperty 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 StringArrayProperty &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

pool::DbType m_dbType
 decoded storage tech requested in "StorageTechnology" property More...
 
std::string m_lastInputFileName
 
ServiceHandle< IPoolSvcm_poolSvc {this,"PoolSvc","PoolSvc"}
 
ServiceHandle< IClassIDSvc > m_clidSvc {this,"ClassIDSvc","ClassIDSvc"}
 
BooleanProperty m_useDetailChronoStat {this,"UseDetailChronoStat",false}
 UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false. More...
 
StringProperty m_storageTechProp {this,"StorageTechnology", "ROOTTREEINDEX"}
 Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE) More...
 
StringProperty 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...
 
StringProperty m_containerNameHintProp {this,"TopLevelContainerName",""}
 TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>". More...
 
StringProperty m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"}
 SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching) More...
 
StringArrayProperty 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
 
StringArrayProperty 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
 
StringArrayProperty 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
 
StringArrayProperty 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 567 of file AthenaPoolCnvSvc.cxx.

567  :
568  base_class(name, pSvcLocator, POOL_StorageType) {
569 }

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

516  {
517  bool retError = false;
518  std::size_t cpos = connection.find(':');
519  std::size_t bpos = connection.find('[');
520  if (cpos == std::string::npos) {
521  cpos = 0;
522  } else {
523  cpos++;
524  }
525  if (bpos != std::string::npos) bpos = bpos - cpos;
526  const std::string conn = connection.substr(cpos, bpos);
527  ATH_MSG_VERBOSE("Cleanup for Connection='"<< conn <<"'");
528  for (auto converter : m_cnvs) {
529  if (!converter->cleanUp(conn).isSuccess()) {
530  ATH_MSG_WARNING("AthenaPoolConverter cleanUp failed.");
531  retError = true;
532  }
533  }
534  return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
535 }

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

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

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

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

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

252  {
253  return(connectOutput(outputConnectionSpec));
254 }

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

479  {
480  assert(pAddress);
481  const TokenAddress* tokAddr = dynamic_cast<const TokenAddress*>(pAddress);
482  if (tokAddr != nullptr && tokAddr->getToken() != nullptr) {
483  refAddress = tokAddr->getToken()->toString();
484  } else {
485  refAddress = *pAddress->par();
486  }
487  return(StatusCode::SUCCESS);
488 }

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

469  {
470  if (svcType != POOL_StorageType) {
471  ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << POOL_StorageType);
472  return(StatusCode::FAILURE);
473  }
474  refpAddress = new GenericAddress(POOL_StorageType, clid, refAddress);
475  return(StatusCode::SUCCESS);
476 }

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

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

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

151  {
152  assert(pAddress);
153  std::string objName = "ALL";
154  if (m_useDetailChronoStat.value()) {
155  if (m_clidSvc->getTypeNameOfID(pAddress->clID(), objName).isFailure()) {
156  std::ostringstream oss;
157  oss << std::dec << pAddress->clID();
158  objName = oss.str();
159  }
160  objName += '#';
161  objName += *(pAddress->par() + 1);
162  }
163  // StopWatch listens from here until the end of this current scope
164  PMonUtils::BasicStopWatch stopWatch("cObj_" + objName, m_chronoMap);
165  if (!m_persSvcPerInputType.empty()) { // Use separate PersistencySvc for each input data type
166  TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddress);
167  if (tokAddr != nullptr && tokAddr->getToken() != nullptr && (tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "(") || tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "_"))) {
168  const unsigned int maxContext = m_poolSvc->getInputContextMap().size();
169  const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString() + tokAddr->getToken()->dbID().toString(), 1);
170  char text[32];
171  ::sprintf(text, "[CTXT=%08X]", auxContext);
172  if (m_poolSvc->getInputContextMap().size() > maxContext) {
173  if (m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), "FID:" + tokAddr->getToken()->dbID().toString(), m_persSvcPerInputType.value(), auxContext).isSuccess()) {
174  ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for id = " << auxContext << ".");
175  }
176  }
177  tokAddr->getToken()->setAuxString(text);
178  }
179  }
180  // Forward to base class createObj
181  StatusCode status = ::AthCnvSvc::createObj(pAddress, refpObject);
182  return(status);
183 }

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

185  {
186  assert(pObject);
187  std::string objName = "ALL";
188  if (m_useDetailChronoStat.value()) {
189  if (m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
190  std::ostringstream oss;
191  oss << std::dec << pObject->clID();
192  objName = oss.str();
193  }
194  objName += '#';
195  objName += pObject->registry()->name();
196  }
197  // StopWatch listens from here until the end of this current scope
198  PMonUtils::BasicStopWatch stopWatch("cRep_" + objName, m_chronoMap);
199  StatusCode status = StatusCode::FAILURE;
200  if (pObject->clID() == 1) {
201  // No transient object was found use cnv to write default persistent object
202  SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(pObject->registry());
203  if (proxy != nullptr) {
204  IConverter* cnv = converter(proxy->clID());
205  status = cnv->createRep(pObject, refpAddress);
206  }
207  } else {
208  // Forward to base class createRep
209  try {
210  status = ::AthCnvSvc::createRep(pObject, refpAddress);
211  } catch(std::runtime_error& e) {
212  ATH_MSG_FATAL(e.what());
213  }
214  }
215  return(status);
216 }

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

490  {
491  if (fileSpec.starts_with ( "oracle") || fileSpec.starts_with ( "mysql")) {
492  outputTech = pool::POOL_RDBMS_StorageType.type();
493  } else if (fileSpec.starts_with ( "ROOTKEY:")) {
494  outputTech = pool::ROOTKEY_StorageType.type();
495  fileSpec.erase(0, 8);
496  } else if (fileSpec.starts_with ( "ROOTTREE:")) {
497  outputTech = pool::ROOTTREE_StorageType.type();
498  fileSpec.erase(0, 9);
499  } else if (fileSpec.starts_with ( "ROOTTREEINDEX:")) {
500  outputTech = pool::ROOTTREEINDEX_StorageType.type();
501  fileSpec.erase(0, 14);
502  } else if (fileSpec.starts_with ( "ROOTRNTUPLE:")) {
503  outputTech = pool::ROOTRNTUPLE_StorageType.type();
504  fileSpec.erase(0, 12);
505  } else if (outputTech == 0) {
506  outputTech = m_dbType.type();
507  }
508  return(StatusCode::SUCCESS);
509 }

◆ disconnectOutput()

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

Disconnect to the output connection.

Definition at line 395 of file AthenaPoolCnvSvc.cxx.

395  {
396  std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
397  unsigned int contextId = outputContextId(outputConnection);
398  StatusCode sc = m_poolSvc->disconnect(contextId);
399  return sc;
400 }

◆ extractPoolAttributes()

void AthenaPoolCnvSvc::extractPoolAttributes ( const StringArrayProperty &  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 571 of file AthenaPoolCnvSvc.cxx.

574  {
575  std::vector<std::string> opt;
576  std::string attributeName, containerName, databaseName, valueString;
577  for (std::vector<std::string>::const_iterator iter = property.value().begin(),
578  last = property.value().end(); iter != last; ++iter) {
579  opt.clear();
580  attributeName.clear();
581  containerName.clear();
582  databaseName.clear();
583  valueString.clear();
584  using Gaudi::Utils::AttribStringParser;
585  for (const AttribStringParser::Attrib& attrib : AttribStringParser (*iter)) {
586  const std::string tag = attrib.tag;
587  const std::string val = attrib.value;
588  if (tag == "DatabaseName") {
589  databaseName = val;
590  } else if (tag == "ContainerName") {
591  if (databaseName.empty()) {
592  databaseName = "*";
593  }
594  containerName = std::move(val);
595  } else {
596  attributeName = std::move(tag);
597  valueString = std::move(val);
598  }
599  }
600  if (!attributeName.empty() && !valueString.empty()) {
601  opt.push_back(attributeName);
602  opt.push_back(valueString);
603  if (!databaseName.empty()) {
604  opt.push_back(databaseName);
605  if (!containerName.empty()) {
606  opt.push_back(containerName);
607  if (containerName.compare(0, 6, "TTree=") == 0) {
608  dbAttr->push_back(opt);
609  } else {
610  contAttr->push_back(opt);
611  }
612  } else {
613  opt.push_back("");
614  dbAttr->push_back(opt);
615  }
616  } else if (domAttr != 0) {
617  domAttr->push_back(opt);
618  } else {
619  opt.push_back("*");
620  opt.push_back("");
621  dbAttr->push_back(opt);
622  }
623  }
624  }
625 }

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

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

◆ finalize()

StatusCode AthenaPoolCnvSvc::finalize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 117 of file AthenaPoolCnvSvc.cxx.

117  {
118  ATH_MSG_VERBOSE("Finalizing...");
119  // Some algorithms write in finalize(), flush DHForms if any are left
121  // Release ClassIDSvc
122  if (!m_clidSvc.release().isSuccess()) {
123  ATH_MSG_WARNING("Cannot release ClassIDSvc.");
124  }
125  // Release PoolSvc
126  if (!m_poolSvc.release().isSuccess()) {
127  ATH_MSG_WARNING("Cannot release PoolSvc.");
128  }
129  // Print Performance Statistics
130  // The pattern AthenaPoolCnvSvc.*PerfStats is ignored in AtlasTest/TestTools/share/post.sh
131  const std::string msgPrefix{"PerfStats "};
132  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
133  ATH_MSG_INFO(msgPrefix << "Timing Measurements for AthenaPoolCnvSvc");
134  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
135  for(const auto& [key, value] : m_chronoMap) {
136  ATH_MSG_INFO(msgPrefix << "| " << std::left << std::setw(15) << key << " | "
137  << std::right << std::setw(15) << std::fixed << std::setprecision(0) << value << " ms |");
138  }
139  ATH_MSG_INFO(msgPrefix << std::string(40, '-'));
140 
141  m_cnvs.clear();
142  m_cnvs.shrink_to_fit();
143  return(StatusCode::SUCCESS);
144 }

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

103  {
104  // Write remaining DataHeaderForms for a given streamName, "*"" means all
105  auto DHCnvListener = dynamic_cast<IIncidentListener*>( converter( ClassID_traits<DataHeader>::ID() ) );
106  FileIncident incident(name(), "WriteDataHeaderForms", streamName);
107  if( DHCnvListener ) DHCnvListener->handle(incident);
108 }

◆ getPoolSvc()

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

Definition at line 409 of file AthenaPoolCnvSvc.cxx.

409  {
410  return(&*m_poolSvc);
411 }

◆ handle()

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

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 559 of file AthenaPoolCnvSvc.cxx.

559  {
560  if (incident.type() == "EndEvent") {
562  ATH_MSG_DEBUG("handle EndEvent failed process POOL database attributes.");
563  }
564  }
565 }

◆ initialize()

StatusCode AthenaPoolCnvSvc::initialize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 33 of file AthenaPoolCnvSvc.cxx.

33  {
34  // Initialize DataModelCompatSvc
35  ServiceHandle<IService> dmcsvc("DataModelCompatSvc", this->name());
36  ATH_CHECK(dmcsvc.retrieve());
37  // Retrieve PoolSvc
38  ATH_CHECK(m_poolSvc.retrieve());
39  // Retrieve ClassIDSvc
40  ATH_CHECK(m_clidSvc.retrieve());
41  // Register this service for 'I/O' events
42  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
43  ATH_CHECK(iomgr.retrieve());
44  if (!iomgr->io_register(this).isSuccess()) {
45  ATH_MSG_FATAL("Could not register myself with the IoComponentMgr !");
46  return(StatusCode::FAILURE);
47  }
48  // Extracting MaxFileSizes for global default and map by Database name.
49  for (std::vector<std::string>::const_iterator iter = m_maxFileSizes.value().begin(),
50  last = m_maxFileSizes.value().end(); iter != last; ++iter) {
51  if (auto p = iter->find('='); p != std::string::npos) {
52  long long maxFileSize = atoll(iter->data() + (p + 1));
53  std::string databaseName = iter->substr(0, iter->find_first_of(" ="));
54  m_databaseMaxFileSize.insert(std::make_pair(databaseName, maxFileSize));
55  } else {
56  m_domainMaxFileSize = atoll(iter->c_str());
57  }
58  }
59  ATH_MSG_DEBUG("Setting StorageType to " << m_storageTechProp.value());
61  if( m_dbType == TEST_StorageType ) {
62  ATH_MSG_FATAL("Unknown StorageType rquested: " << m_storageTechProp.value());
63  return StatusCode::FAILURE;
64  }
65  if( m_containerPrefixProp.value() == "Default" ) {
66  // select default storage element name accoring to storage tech
67  if( m_dbType.exactMatch(pool::ROOTRNTUPLE_StorageType) ) m_containerPrefixProp.setValue( APRDefaults::RNTupleNames::EventData );
69  }
70 
71  // Extracting INPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
73  // Extracting the INPUT POOL ItechnologySpecificAttributes which are to be printed for each event
75  // Setup incident for EndEvent to print out attributes each event
76  ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
77  long int pri = 1000;
78  if (!m_inputPoolAttrPerEvent.value().empty()) {
79  // Set to be listener for EndEvent
80  incSvc->addListener(this, "EndEvent", pri);
81  ATH_MSG_DEBUG("Subscribed to EndEvent for printing out input file attributes.");
82  }
83  if (!processPoolAttributes(m_inputAttr, "", IPoolSvc::kInputStream, false, true, true).isSuccess()) {
84  ATH_MSG_DEBUG("setInputAttribute failed setting POOL domain attributes.");
85  }
86 
87  // Load these dictionaries now, so we don't need to try to do so
88  // while multiple threads are running.
89  TClass::GetClass ("TLeafI");
90  TClass::GetClass ("TLeafL");
91  TClass::GetClass ("TLeafD");
92  TClass::GetClass ("TLeafF");
93 
94  return(StatusCode::SUCCESS);
95 }

◆ io_finalize()

StatusCode AthenaPoolCnvSvc::io_finalize ( )
overridevirtual

Definition at line 146 of file AthenaPoolCnvSvc.cxx.

146  {
147  ATH_MSG_DEBUG("I/O finalization...");
148  return(StatusCode::SUCCESS);
149 }

◆ io_reinit()

StatusCode AthenaPoolCnvSvc::io_reinit ( )
overridevirtual

Definition at line 97 of file AthenaPoolCnvSvc.cxx.

97  {
98  ATH_MSG_DEBUG("I/O reinitialization...");
99  m_contextAttr.clear();
100  return(StatusCode::SUCCESS);
101 }

◆ outputContextId()

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

Definition at line 403 of file AthenaPoolCnvSvc.cxx.

403  {
404  return m_persSvcPerOutput?
405  m_poolSvc->getOutputContext(outputConnection) : (unsigned int)IPoolSvc::kOutputStream;
406 }

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

632  {
633  bool retError = false;
634  for (std::vector<std::vector<std::string> >::iterator iter = attr.begin(), last = attr.end();
635  iter != last; ++iter) {
636  if (iter->size() == 2) {
637  const std::string& opt = (*iter)[0];
638  std::string data = (*iter)[1];
639  if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
640  if (doGet) {
641  if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
642  ATH_MSG_DEBUG("getAttribute failed for domain attr " << opt);
643  retError = true;
644  }
645  }
646  } else if (doSet) {
647  if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
648  ATH_MSG_DEBUG("setAttribute " << opt << " to " << data);
649  if (doClear) {
650  iter->clear();
651  }
652  } else {
653  ATH_MSG_DEBUG("setAttribute failed for domain attr " << opt << " to " << data);
654  retError = true;
655  }
656  }
657  }
658  if (iter->size() == 4) {
659  const std::string& opt = (*iter)[0];
660  std::string data = (*iter)[1];
661  const std::string& file = (*iter)[2];
662  const std::string& cont = (*iter)[3];
663  if (!fileName.empty() && (0 == fileName.compare(0, fileName.find('?'), file)
664  || (file[0] == '*' && file.find("," + fileName + ",") == std::string::npos))) {
665  if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
666  if (doGet) {
667  if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
668  ATH_MSG_DEBUG("getAttribute failed for database/container attr " << opt);
669  retError = true;
670  }
671  }
672  } else if (doSet) {
673  if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
674  ATH_MSG_DEBUG("setAttribute " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
675  if (doClear) {
676  if (file[0] == '*' && !m_persSvcPerOutput) {
677  (*iter)[2] += "," + fileName + ",";
678  } else {
679  iter->clear();
680  }
681  }
682  } else {
683  ATH_MSG_DEBUG("setAttribute failed for " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
684  retError = true;
685  }
686  }
687  }
688  }
689  }
690  for (std::vector<std::vector<std::string> >::iterator iter = attr.begin(); iter != attr.end(); ) {
691  if (iter->empty()) {
692  iter = attr.erase(iter);
693  } else {
694  ++iter;
695  }
696  }
697  return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
698 }

◆ registerCleanUp()

StatusCode AthenaPoolCnvSvc::registerCleanUp ( IAthenaPoolCleanUp cnv)
overridevirtual

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

Definition at line 511 of file AthenaPoolCnvSvc.cxx.

511  {
512  m_cnvs.push_back(cnv);
513  return(StatusCode::SUCCESS);
514 }

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

413  {
414  // StopWatch listens from here until the end of this current scope
415  PMonUtils::BasicStopWatch stopWatch("cRepR_ALL", m_chronoMap);
416  Token* token = nullptr;
417  if (m_persSvcPerOutput) { // Use separate PersistencySvc for each output stream/file
418  char text[32];
419  ::sprintf(text, "[CTXT=%08X]", m_poolSvc->getOutputContext(placement->fileName()));
420  placement->setAuxString(text);
421  }
422  token = m_poolSvc->registerForWrite(placement, obj, classDesc);
423  return(token);
424 }

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

537  {
538  // Set attributes for input file
539  m_lastInputFileName = fileName; // Save file name for printing attributes per event
540  if (!processPoolAttributes(m_inputAttr, m_lastInputFileName, IPoolSvc::kInputStream, false, true, false).isSuccess()) {
541  ATH_MSG_DEBUG("setInputAttribute failed setting POOL database/container attributes.");
542  }
544  ATH_MSG_DEBUG("setInputAttribute failed getting POOL database/container attributes.");
545  }
546  if (!m_persSvcPerInputType.empty()) {
547  // Loop over all extra event input contexts and switch off TTreeCache
548  const auto& extraInputContextMap = m_poolSvc->getInputContextMap();
549  for (const auto& [label, id]: extraInputContextMap) {
550  if (m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), m_lastInputFileName, m_persSvcPerInputType.value(), id).isSuccess()) {
551  ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for = " << label << ".");
552  }
553  }
554  }
555  return(StatusCode::SUCCESS);
556 }

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

426  {
427  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
428  // StopWatch listens from here until the end of this current scope
429  PMonUtils::BasicStopWatch stopWatch("cObjR_ALL", m_chronoMap);
430  if (token->dbID() != Guid::null()) {
431  ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
432  m_poolSvc->setObjPtr(obj, token);
433  }
434 }

◆ stop()

StatusCode AthenaPoolCnvSvc::stop ( )
overridevirtual

Definition at line 110 of file AthenaPoolCnvSvc.cxx.

110  {
111  ATH_MSG_VERBOSE("stop()");
112  // In case of direct writing without an OutputStream, this should be a good time to flush DHForms
114  return StatusCode::SUCCESS;
115 }

◆ useDetailChronoStat()

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

Definition at line 436 of file AthenaPoolCnvSvc.cxx.

436  {
437  return(m_useDetailChronoStat.value());
438 }

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

StringProperty 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 182 of file AthenaPoolCnvSvc.h.

◆ m_clidSvc

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

Definition at line 178 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

StringProperty 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

StringProperty 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_dbType

pool::DbType AthenaPoolCnvSvc::m_dbType
private

decoded storage tech requested in "StorageTechnology" property

Definition at line 175 of file AthenaPoolCnvSvc.h.

◆ m_DHFilterAliases

BooleanProperty 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

IntegerProperty 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

StringArrayProperty 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

StringArrayProperty 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

Definition at line 176 of file AthenaPoolCnvSvc.h.

◆ m_maxFileSizes

StringArrayProperty 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

IntegerProperty 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

BooleanProperty 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

StringProperty 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

BooleanProperty 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

StringArrayProperty 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 177 of file AthenaPoolCnvSvc.h.

◆ m_storageTechProp

StringProperty AthenaPoolCnvSvc::m_storageTechProp {this,"StorageTechnology", "ROOTTREEINDEX"}
private

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

Definition at line 190 of file AthenaPoolCnvSvc.h.

◆ m_useDetailChronoStat

BooleanProperty AthenaPoolCnvSvc::m_useDetailChronoStat {this,"UseDetailChronoStat",false}
private

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

Definition at line 187 of file AthenaPoolCnvSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthenaPoolCnvSvc::m_poolSvc
ServiceHandle< IPoolSvc > m_poolSvc
Definition: AthenaPoolCnvSvc.h:177
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:516
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Guid::null
static const Guid & null()
NULL-Guid: static class method.
Definition: Guid.cxx:18
createLinkingScheme.iter
iter
Definition: createLinkingScheme.py:62
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:403
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:178
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_useDetailChronoStat
BooleanProperty m_useDetailChronoStat
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = fa...
Definition: AthenaPoolCnvSvc.h:187
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
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:490
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:182
athena.value
value
Definition: athena.py:124
Guid::toString
const std::string toString() const
Automatic conversion to string representation.
Definition: Guid.cxx:58
AthenaPoolCnvSvc::m_dbType
pool::DbType m_dbType
decoded storage tech requested in "StorageTechnology" property
Definition: AthenaPoolCnvSvc.h:175
AthenaPoolCnvSvc::m_mutex
std::mutex m_mutex
Definition: AthenaPoolCnvSvc.h:229
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
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:627
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:103
AthenaPoolCnvSvc::m_fileFlushSetting
std::map< std::string, int > m_fileFlushSetting
Definition: AthenaPoolCnvSvc.h:206
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
pool::DbType::type
int type() const
Access to full type.
Definition: DbType.h:66
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
AthenaPoolCnvSvc::m_persSvcPerInputType
StringProperty m_persSvcPerInputType
PersSvcPerInputType, string property, tree name to use multiple persistency services,...
Definition: AthenaPoolCnvSvc.h:228
AthenaPoolCnvSvc::m_storageTechProp
StringProperty m_storageTechProp
Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)
Definition: AthenaPoolCnvSvc.h:190
AthenaPoolCnvSvc::extractPoolAttributes
void extractPoolAttributes(const StringArrayProperty &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:571
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
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
AthenaPoolCnvSvc::m_maxFileSizes
StringArrayProperty m_maxFileSizes
MaxFileSizes, vector with maximum file sizes for Athena POOL output files.
Definition: AthenaPoolCnvSvc.h:216
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
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_numberEventsPerWrite
IntegerProperty m_numberEventsPerWrite
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on numb...
Definition: AthenaPoolCnvSvc.h:233
AthenaPoolCnvSvc::m_containerAttr
std::vector< std::vector< std::string > > m_containerAttr
Definition: AthenaPoolCnvSvc.h:203
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
AthCnvSvc::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
Definition: AthCnvSvc.cxx:244
AthenaPoolCnvSvc::m_persSvcPerOutput
BooleanProperty m_persSvcPerOutput
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
Definition: AthenaPoolCnvSvc.h:223
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:129
AthenaPoolCnvSvc::m_inputPoolAttr
StringArrayProperty m_inputPoolAttr
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition: AthenaPoolCnvSvc.h:208
Token::setOid
Token & setOid(const OID_t &oid)
Set object identifier.
Definition: Token.h:85
AthenaPoolCnvSvc::m_domainAttr
std::vector< std::vector< std::string > > m_domainAttr
Definition: AthenaPoolCnvSvc.h:201
AthenaPoolCnvSvc::m_fileCommitCounter
std::map< std::string, int > m_fileCommitCounter
Definition: AthenaPoolCnvSvc.h:205
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
pool::DbType::exactMatch
bool exactMatch(const DbType &typ) const
Definition: DbType.h:73
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:251
AthenaPoolCnvSvc::m_poolAttr
StringArrayProperty m_poolAttr
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition: AthenaPoolCnvSvc.h:200
AthCnvSvc::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
Definition: AthCnvSvc.cxx:284
AthenaPoolCnvSvc::m_inputPoolAttrPerEvent
StringArrayProperty m_inputPoolAttrPerEvent
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to...
Definition: AthenaPoolCnvSvc.h:212
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_containerPrefixProp
StringProperty m_containerPrefixProp
POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix f...
Definition: AthenaPoolCnvSvc.h:193
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
Definition: AthenaPoolCnvSvc.h:176
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
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.