ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual StatusCode io_reinit () override
virtual StatusCode finalize () override
 Required of all Gaudi Services.
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.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Implementation of IConversionSvc: Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConversionSvc: Resolve the references of the converted object.
virtual StatusCode connectOutput (const std::string &outputConnectionSpec, const std::string &openMode) override
 Implementation of IConversionSvc: Connect to the output connection specification with open mode.
virtual StatusCode connectOutput (const std::string &outputConnectionSpec) override
 Implementation of IConversionSvc: Connect to the output connection specification with open mode.
virtual StatusCode commitOutput (const std::string &outputConnectionSpec, bool doCommit) override
 Implementation of IConversionSvc: Commit pending output.
virtual StatusCode disconnectOutput (const std::string &outputConnectionSpec) override
 Disconnect to the output connection.
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.
virtual StatusCode createAddress (long svcType, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
 Create address from string form.
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
 Convert address to string form.
virtual StatusCode decodeOutputSpec (std::string &connectionSpec, int &outputTech) const override
 Extract/deduce the DB technology from the connection string/file specification.
virtual StatusCode registerCleanUp (IAthenaPoolCleanUp *cnv) override
 Implement registerCleanUp to register a IAthenaPoolCleanUp to be called during cleanUp.
virtual StatusCode cleanUp (const std::string &connection) override
 Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
virtual StatusCode setInputAttributes (const std::string &fileName) override
 Set the input file attributes, if any are requested from jobOpts.
virtual void handle (const Incident &incident) override
 Implementation of IIncidentListener: Handle for EndEvent incidence.
void flushDataHeaderForms (const std::string &streamName="*")
 Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
 AthenaPoolCnvSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Service Constructor.
virtual ~AthenaPoolCnvSvc ()=default
 Destructor.

Protected Member Functions

unsigned outputContextId (const std::string &outputConnection)

Protected Attributes

PMonUtils::BasicStopWatchResultMap_t m_chronoMap {}
 Map that holds chrono information.
Gaudi::Property< bool > m_persSvcPerOutput {this,"PersSvcPerOutput",true}
 PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
Gaudi::Property< std::string > m_persSvcPerInputType {this,"PersSvcPerInputType",""}
 PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type.
std::mutex m_mutex
std::set< unsigned int > m_processedContextIds
 Track context IDs for which extractPoolAttributes has been called.
Gaudi::Property< bool > m_oneDataHeaderForm { this, "OneDataHeaderForm", false }
 If true, use only one DataHeaderForm per Stream.
Gaudi::Property< int > m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 }
 Property for DataHeaderCnv input DHForm cache size.
Gaudi::Property< bool > m_DHFilterAliases { this, "doFilterDHAliases", true }
 Flag to control SG alias filtering when writing out DataHeader (see DataHeaderCnv_p6)

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

Private Attributes

std::string m_lastInputFileName
 decoded storage tech requested in "StorageTechnology" property
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.
Gaudi::Property< std::map< std::string, std::string > > m_storageTechProp {this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}}
 Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)
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.
Gaudi::Property< std::string > m_containerNameHintProp {this,"TopLevelContainerName",""}
 TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>".
Gaudi::Property< std::string > m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"}
 SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching)
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.
std::vector< std::vector< std::string > > m_domainAttr
std::vector< std::vector< std::string > > m_databaseAttr
std::vector< std::vector< std::string > > m_containerAttr
Gaudi::Property< std::vector< std::string > > m_inputPoolAttr {this,"InputPoolAttributes",{}}
 Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
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.
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.
long long m_domainMaxFileSize =std::numeric_limits<long long>::max()
std::map< std::string, long long > m_databaseMaxFileSize
std::string m_defContainerType {}
 Default container type (from PoolSvc)

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

547 :
548 base_class(name, pSvcLocator, pool::POOL_StorageType.type()) {
549}
static const DbType POOL_StorageType
Definition DbType.h:98

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

496 {
497 bool retError = false;
498 std::size_t cpos = connection.find(':');
499 std::size_t bpos = connection.find('[');
500 if (cpos == std::string::npos) {
501 cpos = 0;
502 } else {
503 cpos++;
504 }
505 if (bpos != std::string::npos) bpos = bpos - cpos;
506 const std::string conn = connection.substr(cpos, bpos);
507 ATH_MSG_VERBOSE("Cleanup for Connection='"<< conn <<"'");
508 for (auto converter : m_cnvs) {
509 if (!converter->cleanUp(conn).isSuccess()) {
510 ATH_MSG_WARNING("AthenaPoolConverter cleanUp failed.");
511 retError = true;
512 }
513 }
514 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
515}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)

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

305 {
306 // This is called after all DataObjects are converted.
307 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
308 // StopWatch listens from here until the end of this current scope
309 PMonUtils::BasicStopWatch stopWatch("commitOutput", m_chronoMap);
310 std::unique_lock<std::mutex> lock(m_mutex);
311 // Extract the technology
312 int tech{0};
313 if (!decodeOutputSpec(outputConnection, tech).isSuccess()) {
314 ATH_MSG_ERROR("connectOutput FAILED extract file name and technology.");
315 return(StatusCode::FAILURE);
316 }
317 unsigned int contextId = outputContextId(outputConnection);
318 if (!processPoolAttributes(m_domainAttr, outputConnection, contextId).isSuccess()) {
319 ATH_MSG_DEBUG("commitOutput failed process POOL domain attributes.");
320 }
321 if (!processPoolAttributes(m_databaseAttr, outputConnection, contextId).isSuccess()) {
322 ATH_MSG_DEBUG("commitOutput failed process POOL database attributes.");
323 }
324 if (!processPoolAttributes(m_containerAttr, outputConnection, contextId).isSuccess()) {
325 ATH_MSG_DEBUG("commitOutput failed process POOL container attributes.");
326 }
327
328 // lock.unlock(); //MN: first need to make commitCache slot-specific
329 try {
330 if (doCommit) {
331 if (!m_poolSvc->commit(contextId).isSuccess()) {
332 ATH_MSG_ERROR("commitOutput FAILED to commit OutputStream.");
333 return(StatusCode::FAILURE);
334 }
335 } else {
336 if (!m_poolSvc->commitAndHold(contextId).isSuccess()) {
337 ATH_MSG_ERROR("commitOutput FAILED to commitAndHold OutputStream.");
338 return(StatusCode::FAILURE);
339 }
340 }
341 } catch (std::exception& e) {
342 ATH_MSG_ERROR("commitOutput - caught exception: " << e.what());
343 return(StatusCode::FAILURE);
344 }
345 if (!this->cleanUp(outputConnection).isSuccess()) {
346 ATH_MSG_ERROR("commitOutput FAILED to cleanup converters.");
347 return(StatusCode::FAILURE);
348 }
349 // Check FileSize
350 long long int currentFileSize = m_poolSvc->getFileSize(outputConnection, tech, contextId);
351 if (m_databaseMaxFileSize.find(outputConnection) != m_databaseMaxFileSize.end()) {
352 if (currentFileSize > m_databaseMaxFileSize[outputConnection]) {
353 ATH_MSG_WARNING(std::format("FileSize {} > {} for {}", currentFileSize, m_databaseMaxFileSize[outputConnection], outputConnection));
354 return(StatusCode::RECOVERABLE);
355 }
356 } else if (currentFileSize > m_domainMaxFileSize) {
357 ATH_MSG_WARNING(std::format("FileSize {} > {} for {}", currentFileSize, m_domainMaxFileSize, outputConnection));
358 return(StatusCode::RECOVERABLE);
359 }
360 return(StatusCode::SUCCESS);
361}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
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.
std::map< std::string, long long > m_databaseMaxFileSize
unsigned outputContextId(const std::string &outputConnection)
ServiceHandle< IPoolSvc > m_poolSvc
virtual StatusCode cleanUp(const std::string &connection) override
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.

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

271 {
272// This is called before DataObjects are being converted.
273 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
274 // Extract the technology
275 int tech{0};
276 if (!decodeOutputSpec(outputConnection, tech).isSuccess()) {
277 ATH_MSG_ERROR("connectOutput FAILED extract file name and technology.");
278 return(StatusCode::FAILURE);
279 }
280 unsigned int contextId = outputContextId(outputConnection);
281 try {
282 if (!m_poolSvc->connect(pool::ITransaction::UPDATE, contextId).isSuccess()) {
283 ATH_MSG_ERROR("connectOutput FAILED to open an UPDATE transaction.");
284 return(StatusCode::FAILURE);
285 }
286 } catch (std::exception& e) {
287 ATH_MSG_ERROR("connectOutput - caught exception: " << e.what());
288 return(StatusCode::FAILURE);
289 }
290 std::unique_lock<std::mutex> lock(m_mutex);
291 if (m_processedContextIds.insert(contextId).second) {
292 // Extracting OUTPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
293 extractPoolAttributes(m_poolAttr, &m_containerAttr, &m_databaseAttr, &m_domainAttr);
294 }
295 if (!processPoolAttributes(m_domainAttr, outputConnection, contextId).isSuccess()) {
296 ATH_MSG_DEBUG("connectOutput failed process POOL domain attributes.");
297 }
298 if (!processPoolAttributes(m_databaseAttr, outputConnection, contextId).isSuccess()) {
299 ATH_MSG_DEBUG("connectOutput failed process POOL database attributes.");
300 }
301 return(StatusCode::SUCCESS);
302}
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.
std::set< unsigned int > m_processedContextIds
Track context IDs for which extractPoolAttributes has been called.

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

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

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

450 {
451 assert(pAddress);
452 const TokenAddress* tokAddr = dynamic_cast<const TokenAddress*>(pAddress);
453 if (tokAddr != nullptr && tokAddr->getToken() != nullptr) {
454 refAddress = tokAddr->getToken()->toString();
455 } else {
456 refAddress = *pAddress->par();
457 }
458 return(StatusCode::SUCCESS);
459}
This class provides a Generic Transient Address for POOL tokens.
Token * getToken()
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition Token.cxx:134

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

440 {
441 if (svcType != repSvcType()) {
442 ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << repSvcType());
443 return(StatusCode::FAILURE);
444 }
445 refpAddress = new GenericAddress(repSvcType(), clid, refAddress);
446 return(StatusCode::SUCCESS);
447}

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

415 {
416 if( svcType != repSvcType() ) {
417 ATH_MSG_ERROR("createAddress: svcType != POOL_StorageType " << svcType << " " << repSvcType());
418 return(StatusCode::FAILURE);
419 }
420 std::unique_ptr<Token> token;
421 if (par[0].compare(0, 3, "SHM") == 0) {
422 token = std::make_unique<Token>();
423 token->setOid(Token::OID_t(ip[0], ip[1]));
424 token->setAuxString("[PNAME=" + par[2] + "]");
425 RootType classDesc = RootType::ByNameNoQuiet(par[2]);
426 token->setClassID(pool::DbReflex::guid(classDesc));
427 } else {
428 token.reset(m_poolSvc->getToken(par[0], par[1], ip[0]));
429 }
430 if (token == nullptr) {
431 return(StatusCode::RECOVERABLE);
432 }
433 refpAddress = new TokenAddress(repSvcType(), clid, "", par[1], IPoolSvc::kInputStream, std::move(token));
434 return(StatusCode::SUCCESS);
435}
TTypeAdapter RootType
Definition RootType.h:211
@ kInputStream
Definition IPoolSvc.h:39
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
Definition RootType.cxx:586
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.

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

170 {
171 assert(pAddress);
172 std::string objName = "ALL";
173 if (m_useDetailChronoStat.value()) {
174 if (m_clidSvc->getTypeNameOfID(pAddress->clID(), objName).isFailure()) {
175 objName = std::to_string(pAddress->clID());
176 }
177 objName += '#';
178 objName += *(pAddress->par() + 1);
179 }
180 // StopWatch listens from here until the end of this current scope
181 PMonUtils::BasicStopWatch stopWatch("cObj_" + objName, m_chronoMap);
182 if (!m_persSvcPerInputType.empty()) { // Use separate PersistencySvc for each input data type
183 TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddress);
184 if (tokAddr != nullptr && tokAddr->getToken() != nullptr && (tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "(") || tokAddr->getToken()->contID().starts_with(m_persSvcPerInputType.value() + "_"))) {
185 const unsigned int maxContext = m_poolSvc->getInputContextMapSize();
186 const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString() + tokAddr->getToken()->dbID().toString(), 1);
187 char text[32];
188 const std::string contextStr = std::format("[CTXT={:08X}]", auxContext);
189 std::strncpy(text, contextStr.c_str(), sizeof(text) - 1);
190 text[sizeof(text) - 1] = '\0';
191 if (m_poolSvc->getInputContextMapSize() > maxContext) {
192 if (!m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), "FID:" + tokAddr->getToken()->dbID().toString(), m_persSvcPerInputType.value(), auxContext).isSuccess()) {
193 ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for id = " << auxContext << ".");
194 }
195 }
196 tokAddr->getToken()->setAuxString(text);
197 }
198 }
199 // Forward to base class createObj
200 StatusCode status = ::AthCnvSvc::createObj(pAddress, refpObject);
201 return(status);
202}
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
Gaudi::Property< std::string > m_persSvcPerInputType
PersSvcPerInputType, string property, tree name to use multiple persistency services,...
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
Token & setAuxString(const std::string &auxString)
Set auxiliary string.
Definition Token.h:93
const std::string & contID() const
Access container identifier.
Definition Token.h:69
const Guid & classID() const
Access database identifier.
Definition Token.h:73
const Guid & dbID() const
Access database identifier.
Definition Token.h:64
::StatusCode StatusCode
StatusCode definition for legacy code.
status
Definition merge.py:16
static const DbType ROOTTREE_StorageType
Definition DbType.h:101

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

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

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

461 {
462 if (fileSpec.starts_with ( "ROOTKEY:")) {
463 outputTech = pool::ROOTKEY_StorageType.type();
464 fileSpec.erase(0, 8);
465 } else if (fileSpec.starts_with ( "ROOTTREE:")) {
466 outputTech = pool::ROOTTREE_StorageType.type();
467 fileSpec.erase(0, 9);
468 } else if (fileSpec.starts_with ( "ROOTTREEINDEX:")) {
470 fileSpec.erase(0, 14);
471 } else if (fileSpec.starts_with ( "ROOTRNTUPLE:")) {
472 outputTech = pool::ROOTRNTUPLE_StorageType.type();
473 fileSpec.erase(0, 12);
474 } else if (outputTech == 0) {
475 // Find the appropriate event data technology for this file
476 // This will be used for event data and its data header
477 // First we look for an exact file name match
478 // If that fails, we look for a wildcard ("*") match
479 // If that also fails, we use the default value from PoolSvc
480 if (auto it = m_storageTechMap.find(fileSpec); it != m_storageTechMap.end()) {
481 outputTech = it->second;
482 } else if (it = m_storageTechMap.find("*"); it != m_storageTechMap.end()) {
483 outputTech = it->second;
484 } else {
485 outputTech = pool::DbType::getType(m_defContainerType).type();
486 }
487 }
488 return StatusCode::SUCCESS;
489}
std::map< std::string, int > m_storageTechMap
int type() const
Access to full type.
Definition DbType.h:65
static DbType getType(const std::string &name)
Access known storage type object by name.
static const DbType ROOTRNTUPLE_StorageType
Definition DbType.h:103
static const DbType ROOTTREEINDEX_StorageType
Definition DbType.h:102
static const DbType ROOTKEY_StorageType
Definition DbType.h:100

◆ disconnectOutput()

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

Disconnect to the output connection.

Definition at line 364 of file AthenaPoolCnvSvc.cxx.

364 {
365 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find('['));
366 unsigned int contextId = outputContextId(outputConnection);
367 StatusCode sc = m_poolSvc->disconnect(contextId);
368 return sc;
369}
static Double_t sc

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

554 {
555 std::vector<std::string> opt;
556 std::string attributeName, containerName, databaseName, valueString;
557 for (const auto& propertyValue : property.value()) {
558 opt.clear();
559 attributeName.clear();
560 containerName.clear();
561 databaseName.clear();
562 valueString.clear();
563 using Gaudi::Utils::AttribStringParser;
564 for (const AttribStringParser::Attrib& attrib : AttribStringParser (propertyValue)) {
565 if (attrib.tag == "DatabaseName") {
566 databaseName = attrib.value;
567 } else if (attrib.tag == "ContainerName") {
568 if (databaseName.empty()) {
569 databaseName = "*";
570 }
571 containerName = attrib.value;
572 } else {
573 attributeName = attrib.tag;
574 valueString = attrib.value;
575 }
576 }
577 if (!attributeName.empty() && !valueString.empty()) {
578 opt.push_back(attributeName);
579 opt.push_back(valueString);
580 if (!databaseName.empty()) {
581 opt.push_back(databaseName);
582 if (!containerName.empty()) {
583 opt.push_back(containerName);
584 if (containerName.compare(0, 6, "TTree=") == 0) {
585 dbAttr->push_back(opt);
586 } else {
587 contAttr->push_back(opt);
588 }
589 } else {
590 opt.push_back("");
591 dbAttr->push_back(opt);
592 }
593 } else if (domAttr != 0) {
594 domAttr->push_back(opt);
595 } else {
596 opt.push_back("*");
597 opt.push_back("");
598 dbAttr->push_back(opt);
599 }
600 }
601 }
602}

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

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

◆ finalize()

StatusCode AthenaPoolCnvSvc::finalize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 136 of file AthenaPoolCnvSvc.cxx.

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

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

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

◆ getPoolSvc()

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

Definition at line 378 of file AthenaPoolCnvSvc.cxx.

378 {
379 return(&*m_poolSvc);
380}

◆ handle()

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

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 539 of file AthenaPoolCnvSvc.cxx.

539 {
540 if (incident.type() == "EndEvent") {
541 if (!processPoolAttributes(m_inputAttrPerEvent, m_lastInputFileName, IPoolSvc::kInputStream).isSuccess()) {
542 ATH_MSG_DEBUG("handle EndEvent failed process POOL database attributes.");
543 }
544 }
545}

◆ initialize()

StatusCode AthenaPoolCnvSvc::initialize ( )
overridevirtual

Required of all Gaudi Services.

Definition at line 35 of file AthenaPoolCnvSvc.cxx.

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

◆ io_finalize()

StatusCode AthenaPoolCnvSvc::io_finalize ( )
overridevirtual

Definition at line 165 of file AthenaPoolCnvSvc.cxx.

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

◆ io_reinit()

StatusCode AthenaPoolCnvSvc::io_reinit ( )
overridevirtual

Definition at line 116 of file AthenaPoolCnvSvc.cxx.

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

◆ outputContextId()

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

Definition at line 372 of file AthenaPoolCnvSvc.cxx.

372 {
373 return m_persSvcPerOutput?
374 m_poolSvc->getOutputContext(outputConnection) : (unsigned int)IPoolSvc::kOutputStream;
375}
@ kOutputStream
Definition IPoolSvc.h:39

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

609 {
610 bool retError = false;
611 for (auto& attrEntry : attr) {
612 if (attrEntry.size() == 2) {
613 const std::string& opt = attrEntry[0];
614 std::string data = attrEntry[1];
615 if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
616 if (doGet) {
617 if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
618 ATH_MSG_DEBUG("getAttribute failed for domain attr " << opt);
619 retError = true;
620 }
621 }
622 } else if (doSet) {
623 if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), contextId).isSuccess()) {
624 ATH_MSG_DEBUG("setAttribute " << opt << " to " << data);
625 if (doClear) {
626 attrEntry.clear();
627 }
628 } else {
629 ATH_MSG_DEBUG("setAttribute failed for domain attr " << opt << " to " << data);
630 retError = true;
631 }
632 }
633 }
634 if (attrEntry.size() == 4) {
635 const std::string& opt = attrEntry[0];
636 std::string data = attrEntry[1];
637 const std::string& file = attrEntry[2];
638 const std::string& cont = attrEntry[3];
639 if (!fileName.empty() && (0 == fileName.compare(0, fileName.find('?'), file)
640 || (file[0] == '*' && file.find("," + fileName + ",") == std::string::npos))) {
641 if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
642 if (doGet) {
643 if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
644 ATH_MSG_DEBUG("getAttribute failed for database/container attr " << opt);
645 retError = true;
646 }
647 }
648 } else if (doSet) {
649 if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
650 ATH_MSG_DEBUG("setAttribute " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
651 if (doClear) {
652 if (file[0] == '*' && !m_persSvcPerOutput) {
653 attrEntry[2] += "," + fileName + ",";
654 } else {
655 attrEntry.clear();
656 }
657 }
658 } else {
659 ATH_MSG_DEBUG("setAttribute failed for " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
660 retError = true;
661 }
662 }
663 }
664 }
665 }
666 std::erase_if(attr, [](const auto& entry) { return entry.empty(); });
667 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
668}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::size_t erase_if(T_container &container, T_Func pred)
TFile * file

◆ registerCleanUp()

StatusCode AthenaPoolCnvSvc::registerCleanUp ( IAthenaPoolCleanUp * cnv)
overridevirtual

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

Definition at line 491 of file AthenaPoolCnvSvc.cxx.

491 {
492 m_cnvs.push_back(cnv);
493 return(StatusCode::SUCCESS);
494}

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

382 {
383 // StopWatch listens from here until the end of this current scope
384 PMonUtils::BasicStopWatch stopWatch("cRepR_ALL", m_chronoMap);
385 Token* token = nullptr;
386 if (m_persSvcPerOutput) { // Use separate PersistencySvc for each output stream/file
387 char text[32];
388 const std::string contextStr = std::format("[CTXT={:08X}]", m_poolSvc->getOutputContext(placement->fileName()));
389 std::strncpy(text, contextStr.c_str(), sizeof(text) - 1);
390 text[sizeof(text) - 1] = '\0';
391 placement->setAuxString(text);
392 }
393 token = m_poolSvc->registerForWrite(placement, obj, classDesc);
394 return(token);
395}
Placement & setAuxString(const std::string &auxString)
Set auxiliary string.
Definition Placement.h:42
const std::string & fileName() const
Access file name.
Definition Placement.h:28
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21

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

517 {
518 // Set attributes for input file
519 m_lastInputFileName = fileName; // Save file name for printing attributes per event
520 if (!processPoolAttributes(m_inputAttr, m_lastInputFileName, IPoolSvc::kInputStream, false, true, false).isSuccess()) {
521 ATH_MSG_DEBUG("setInputAttribute failed setting POOL database/container attributes.");
522 }
523 if (!processPoolAttributes(m_inputAttr, m_lastInputFileName, IPoolSvc::kInputStream, true, false).isSuccess()) {
524 ATH_MSG_DEBUG("setInputAttribute failed getting POOL database/container attributes.");
525 }
526 if (!m_persSvcPerInputType.empty()) {
527 // Loop over all extra event input contexts and switch off TTreeCache
528 const auto& extraInputContextMap = m_poolSvc->getInputContextMap();
529 for (const auto& [label, id]: extraInputContextMap) {
530 if (!m_poolSvc->setAttribute("TREE_CACHE", "0", pool::DbType(pool::ROOTTREE_StorageType).type(), m_lastInputFileName, m_persSvcPerInputType.value(), id).isSuccess()) {
531 ATH_MSG_DEBUG("setInputAttribute failed to switch off TTreeCache for = " << label << ".");
532 }
533 }
534 }
535 return(StatusCode::SUCCESS);
536}
std::string label(const std::string &format, int i)
Definition label.h:19

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

397 {
398 ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
399 // StopWatch listens from here until the end of this current scope
400 PMonUtils::BasicStopWatch stopWatch("cObjR_ALL", m_chronoMap);
401 if (token->dbID() != Guid::null()) {
402 ATH_MSG_VERBOSE("Requesting object for: " << token->toString());
403 m_poolSvc->setObjPtr(obj, token);
404 }
405}
static const Guid & null() noexcept
NULL-Guid: static class method.
Definition Guid.cxx:14

◆ stop()

StatusCode AthenaPoolCnvSvc::stop ( )
overridevirtual

Definition at line 129 of file AthenaPoolCnvSvc.cxx.

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

◆ useDetailChronoStat()

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

Definition at line 407 of file AthenaPoolCnvSvc.cxx.

407 {
408 return(m_useDetailChronoStat.value());
409}

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

197{this,"SubLevelBranchName", "<type>/<key>"};

◆ m_chronoMap

PMonUtils::BasicStopWatchResultMap_t AthenaPoolCnvSvc::m_chronoMap {}
protected

Map that holds chrono information.

Definition at line 181 of file AthenaPoolCnvSvc.h.

181{};

◆ m_clidSvc

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

Definition at line 177 of file AthenaPoolCnvSvc.h.

177{this,"ClassIDSvc","ClassIDSvc"};

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

195{this,"TopLevelContainerName",""};

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

193{this,"PoolContainerPrefix","Default"};

◆ 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 216 of file AthenaPoolCnvSvc.h.

◆ m_defContainerType

std::string AthenaPoolCnvSvc::m_defContainerType {}
private

Default container type (from PoolSvc)

Definition at line 219 of file AthenaPoolCnvSvc.h.

219{};

◆ 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 242 of file AthenaPoolCnvSvc.h.

242{ this, "doFilterDHAliases", true };

◆ m_DHFormCacheSize

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

Property for DataHeaderCnv input DHForm cache size.

Definition at line 239 of file AthenaPoolCnvSvc.h.

239{ this, "maxDHFormCacheSize", 100 };

◆ 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 215 of file AthenaPoolCnvSvc.h.

◆ m_inputAttr

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

Definition at line 207 of file AthenaPoolCnvSvc.h.

◆ m_inputAttrPerEvent

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

Definition at line 211 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 206 of file AthenaPoolCnvSvc.h.

206{this,"InputPoolAttributes",{}};

◆ 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 210 of file AthenaPoolCnvSvc.h.

210{this,"PrintInputAttrPerEvt",{}};

◆ 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 214 of file AthenaPoolCnvSvc.h.

214{this,"MaxFileSizes",{}};

◆ m_mutex

std::mutex AthenaPoolCnvSvc::m_mutex
protected

Definition at line 230 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.

236{ this, "OneDataHeaderForm", false };

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

229{this,"PersSvcPerInputType",""};

◆ 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 224 of file AthenaPoolCnvSvc.h.

224{this,"PersSvcPerOutput",true};

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

200{this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"};

◆ m_poolSvc

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

Definition at line 176 of file AthenaPoolCnvSvc.h.

176{this,"PoolSvc","PoolSvc"};

◆ m_processedContextIds

std::set<unsigned int> AthenaPoolCnvSvc::m_processedContextIds
protected

Track context IDs for which extractPoolAttributes has been called.

Definition at line 233 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.

189{this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}};

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

186{this,"UseDetailChronoStat",false};

The documentation for this class was generated from the following files: