 |
ATLAS Offline Software
|
This class provides the interface between Athena and PoolSvc.
More...
#include <AthenaPoolCnvSvc.h>
|
| 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 IPoolSvc * | getPoolSvc () override |
| |
| virtual Token * | registerForWrite (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...
|
| |
|
| PMonUtils::BasicStopWatchResultMap_t | m_chronoMap {} |
| | Map that holds chrono information. More...
|
| |
| Gaudi::Property< bool > | m_persSvcPerOutput {this,"PersSvcPerOutput",true} |
| | PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream. More...
|
| |
| Gaudi::Property< std::string > | m_persSvcPerInputType {this,"PersSvcPerInputType",""} |
| | PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type. More...
|
| |
| std::mutex | m_mutex |
| |
| Gaudi::Property< int > | m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1} |
| | To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush. More...
|
| |
| Gaudi::Property< bool > | m_oneDataHeaderForm { this, "OneDataHeaderForm", false } |
| | If true, use only one DataHeaderForm per Stream. More...
|
| |
| Gaudi::Property< int > | m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 } |
| | Property for DataHeaderCnv input DHForm cache size. More...
|
| |
| Gaudi::Property< bool > | m_DHFilterAliases { this, "doFilterDHAliases", true } |
| | Flag to control SG alias filtering when writing out DataHeader (see DataHeaderCnv_p6) More...
|
| |
|
| void | extractPoolAttributes (const Gaudi::Property< std::vector< std::string >> &property, std::vector< std::vector< std::string > > *contAttr, std::vector< std::vector< std::string > > *dbAttr, std::vector< std::vector< std::string > > *domAttr=0) const |
| | Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property. More...
|
| |
| StatusCode | processPoolAttributes (std::vector< std::vector< std::string > > &attr, const std::string &fileName, unsigned long contextId, bool doGet=true, bool doSet=true, bool doClear=true) const |
| | Set/get technology dependent POOL attributes. More...
|
| |
|
| std::string | m_lastInputFileName |
| | decoded storage tech requested in "StorageTechnology" property More...
|
| |
| ServiceHandle< IPoolSvc > | m_poolSvc {this,"PoolSvc","PoolSvc"} |
| |
| ServiceHandle< IClassIDSvc > | m_clidSvc {this,"ClassIDSvc","ClassIDSvc"} |
| |
| Gaudi::Property< bool > | m_useDetailChronoStat {this,"UseDetailChronoStat",false} |
| | UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false. More...
|
| |
| Gaudi::Property< std::map< std::string, std::string > > | m_storageTechProp {this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}} |
| | Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE) More...
|
| |
| std::map< std::string, int > | m_storageTechMap |
| |
| Gaudi::Property< std::string > | m_containerPrefixProp {this,"PoolContainerPrefix","Default"} |
| | POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix from APRDefaults according to StorageTech. More...
|
| |
| Gaudi::Property< std::string > | m_containerNameHintProp {this,"TopLevelContainerName",""} |
| | TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>". More...
|
| |
| Gaudi::Property< std::string > | m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"} |
| | SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching) More...
|
| |
| Gaudi::Property< std::vector< std::string > > | m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"} |
| | Output PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
|
| |
| std::vector< std::vector< std::string > > | m_domainAttr |
| |
| std::vector< std::vector< std::string > > | m_databaseAttr |
| |
| std::vector< std::vector< std::string > > | m_containerAttr |
| |
| std::vector< unsigned int > | m_contextAttr |
| |
| std::map< std::string, int > | m_fileCommitCounter |
| |
| std::map< std::string, int > | m_fileFlushSetting |
| |
| Gaudi::Property< std::vector< std::string > > | m_inputPoolAttr {this,"InputPoolAttributes",{}} |
| | Input PoolAttributes, vector with names and values of technology specific attributes for POOL. More...
|
| |
| std::vector< std::vector< std::string > > | m_inputAttr |
| |
| Gaudi::Property< std::vector< std::string > > | m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}} |
| | Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event. More...
|
| |
| std::vector< std::vector< std::string > > | m_inputAttrPerEvent |
| |
| Gaudi::Property< std::vector< std::string > > | m_maxFileSizes {this,"MaxFileSizes",{}} |
| | MaxFileSizes, vector with maximum file sizes for Athena POOL output files. More...
|
| |
| long long | m_domainMaxFileSize =std::numeric_limits<long long>::max() |
| |
| std::map< std::string, long long > | m_databaseMaxFileSize |
| |
This class provides the interface between Athena and PoolSvc.
Definition at line 40 of file AthenaPoolCnvSvc.h.
◆ AthenaPoolCnvSvc()
| AthenaPoolCnvSvc::AthenaPoolCnvSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AthenaPoolCnvSvc()
| virtual AthenaPoolCnvSvc::~AthenaPoolCnvSvc |
( |
| ) |
|
|
virtualdefault |
◆ cleanUp()
| StatusCode AthenaPoolCnvSvc::cleanUp |
( |
const std::string & |
connection | ) |
|
|
overridevirtual |
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
Definition at line 538 of file AthenaPoolCnvSvc.cxx.
539 bool retError =
false;
540 std::size_t cpos = connection.find(
':');
541 std::size_t bpos = connection.find(
'[');
542 if (cpos == std::string::npos) {
547 if (bpos != std::string::npos) bpos = bpos - cpos;
548 const std::string
conn = connection.substr(cpos, bpos);
550 for (
auto converter : m_cnvs) {
551 if (!converter->cleanUp(
conn).isSuccess()) {
556 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
◆ commitOutput()
| StatusCode AthenaPoolCnvSvc::commitOutput |
( |
const std::string & |
outputConnectionSpec, |
|
|
bool |
doCommit |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Commit pending output.
- Parameters
-
| doCommit | [IN] boolean to force full commit |
Definition at line 335 of file AthenaPoolCnvSvc.cxx.
337 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
344 ATH_MSG_ERROR(
"connectOutput FAILED extract file name and technology.");
345 return(StatusCode::FAILURE);
349 ATH_MSG_DEBUG(
"commitOutput failed process POOL domain attributes.");
352 ATH_MSG_DEBUG(
"commitOutput failed process POOL database attributes.");
355 ATH_MSG_DEBUG(
"commitOutput failed process POOL container attributes.");
357 std::size_t
merge = outputConnection.find(
"?pmerge=");
358 const std::string baseOutputConnection = outputConnection.substr(0,
merge);
368 if (!
m_poolSvc->commit(contextId).isSuccess()) {
369 ATH_MSG_ERROR(
"commitOutput FAILED to commit OutputStream.");
370 return(StatusCode::FAILURE);
373 if (!
m_poolSvc->commitAndHold(contextId).isSuccess()) {
374 ATH_MSG_ERROR(
"commitOutput FAILED to commitAndHold OutputStream.");
375 return(StatusCode::FAILURE);
380 return(StatusCode::FAILURE);
382 if (!this->
cleanUp(baseOutputConnection).isSuccess()) {
384 return(StatusCode::FAILURE);
387 long long int currentFileSize =
m_poolSvc->getFileSize(outputConnection, tech, contextId);
391 return(StatusCode::RECOVERABLE);
395 return(StatusCode::RECOVERABLE);
397 return(StatusCode::SUCCESS);
◆ connectOutput() [1/2]
| StatusCode AthenaPoolCnvSvc::connectOutput |
( |
const std::string & |
outputConnectionSpec | ) |
|
|
overridevirtual |
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
- Parameters
-
| outputConnectionSpec | [IN] the name of the output connection specification as string. |
Definition at line 265 of file AthenaPoolCnvSvc.cxx.
267 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
271 ATH_MSG_ERROR(
"connectOutput FAILED extract file name and technology.");
272 return(StatusCode::FAILURE);
277 ATH_MSG_ERROR(
"connectOutput FAILED to open an UPDATE transaction.");
278 return(StatusCode::FAILURE);
282 return(StatusCode::FAILURE);
287 std::size_t
merge = outputConnection.find(
"?pmerge=");
291 std::vector<std::string> maxFileSize;
292 maxFileSize.push_back(
"TREE_MAX_SIZE");
293 maxFileSize.push_back(
"1099511627776L");
299 const std::string&
opt = dbAttrEntry[0];
300 std::string&
data = dbAttrEntry[1];
301 const std::string&
file = dbAttrEntry[2];
302 const std::string& cont = dbAttrEntry[3];
303 std::size_t
equal = cont.find(
'=');
307 if (colon == std::string::npos) colon = 0;
310 if (
merge != std::string::npos &&
opt ==
"TREE_AUTO_FLUSH" && 0 == outputConnection.compare(0,
merge,
file) &&cont.compare(
equal, std::string::npos, strProp, colon) == 0 &&
data !=
"int" &&
data !=
"DbLonglong" &&
data !=
"double" &&
data !=
"string") {
320 if (
merge != std::string::npos) {
321 ATH_MSG_INFO(
"connectOutput setting auto write for: " << outputConnection <<
" to " <<
flush <<
" events");
326 ATH_MSG_DEBUG(
"connectOutput failed process POOL domain attributes.");
329 ATH_MSG_DEBUG(
"connectOutput failed process POOL database attributes.");
331 return(StatusCode::SUCCESS);
◆ connectOutput() [2/2]
| StatusCode AthenaPoolCnvSvc::connectOutput |
( |
const std::string & |
outputConnectionSpec, |
|
|
const std::string & |
openMode |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Connect to the output connection specification with open mode.
- Parameters
-
| outputConnectionSpec | [IN] the name of the output connection specification as string. |
| openMode | [IN] the open mode of the file as string. |
Definition at line 260 of file AthenaPoolCnvSvc.cxx.
◆ convertAddress()
| StatusCode AthenaPoolCnvSvc::convertAddress |
( |
const IOpaqueAddress * |
pAddress, |
|
|
std::string & |
refAddress |
|
) |
| |
|
overridevirtual |
Convert address to string form.
- Parameters
-
| pAddress | [IN] address to be converted. |
| refAddress | [OUT] converted string form. |
Definition at line 486 of file AthenaPoolCnvSvc.cxx.
490 if (tokAddr !=
nullptr && tokAddr->
getToken() !=
nullptr) {
493 refAddress = *pAddress->par();
495 return(StatusCode::SUCCESS);
◆ createAddress() [1/2]
| StatusCode AthenaPoolCnvSvc::createAddress |
( |
long |
svcType, |
|
|
const CLID & |
clid, |
|
|
const std::string & |
refAddress, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
overridevirtual |
Create address from string form.
- Parameters
-
| svcType | [IN] service type of the address. |
| clid | [IN] class id for the address. |
| refAddress | [IN] string form to be converted. |
| refpAddress | [OUT] converted address. |
Definition at line 474 of file AthenaPoolCnvSvc.cxx.
478 if (svcType != repSvcType()) {
479 ATH_MSG_ERROR(
"createAddress: svcType != POOL_StorageType " << svcType <<
" " << repSvcType());
480 return(StatusCode::FAILURE);
482 refpAddress =
new GenericAddress(repSvcType(), clid, refAddress);
483 return(StatusCode::SUCCESS);
◆ createAddress() [2/2]
| StatusCode AthenaPoolCnvSvc::createAddress |
( |
long |
svcType, |
|
|
const CLID & |
clid, |
|
|
const std::string * |
par, |
|
|
const unsigned long * |
ip, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
override |
Create a Generic address using explicit arguments to identify a single object.
- Parameters
-
| svcType | [IN] service type of the address. |
| clid | [IN] class id for the address. |
| par | [IN] string containing the database name. |
| ip | [IN] object identifier. |
| refpAddress | [OUT] converted address. |
Definition at line 448 of file AthenaPoolCnvSvc.cxx.
453 if( svcType != repSvcType() ) {
454 ATH_MSG_ERROR(
"createAddress: svcType != POOL_StorageType " << svcType <<
" " << repSvcType());
455 return(StatusCode::FAILURE);
457 std::unique_ptr<Token> token;
459 token = std::make_unique<Token>();
467 if (token ==
nullptr) {
468 return(StatusCode::RECOVERABLE);
471 return(StatusCode::SUCCESS);
◆ createObj()
| StatusCode AthenaPoolCnvSvc::createObj |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject *& |
refpObject |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Create the transient representation of an object from persistent state.
- Parameters
-
| pAddress | [IN] pointer to IOpaqueAddress of the representation. |
| refpObject | [OUT] pointer to DataObject to be created. |
Definition at line 164 of file AthenaPoolCnvSvc.cxx.
166 std::string objName =
"ALL";
168 if (
m_clidSvc->getTypeNameOfID(pAddress->clID(), objName).isFailure()) {
172 objName += *(pAddress->par() + 1);
179 const unsigned int maxContext =
m_poolSvc->getInputContextMap().size();
182 const std::string contextStr =
std::format(
"[CTXT={:08X}]", auxContext);
183 std::strncpy(
text, contextStr.c_str(),
sizeof(
text) - 1);
185 if (
m_poolSvc->getInputContextMap().size() > maxContext) {
187 ATH_MSG_DEBUG(
"setInputAttribute failed to switch off TTreeCache for id = " << auxContext <<
".");
◆ createRep()
| StatusCode AthenaPoolCnvSvc::createRep |
( |
DataObject * |
pObject, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Convert the transient object to the requested representation.
- Parameters
-
| pObject | [IN] pointer to DataObject. |
| refpAddress | [OUT] pointer to IOpaqueAddress of the representation to be created. |
Definition at line 198 of file AthenaPoolCnvSvc.cxx.
200 std::string objName =
"ALL";
202 if (
m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
206 objName += pObject->registry()->name();
211 if (pObject->clID() == 1) {
214 if (
proxy !=
nullptr) {
215 IConverter* cnv = converter(
proxy->clID());
216 status = cnv->createRep(pObject, refpAddress);
222 }
catch(std::runtime_error&
e) {
◆ decodeOutputSpec()
| StatusCode AthenaPoolCnvSvc::decodeOutputSpec |
( |
std::string & |
connectionSpec, |
|
|
int & |
outputTech |
|
) |
| const |
|
overridevirtual |
Extract/deduce the DB technology from the connection string/file specification.
Definition at line 498 of file AthenaPoolCnvSvc.cxx.
499 if (fileSpec.starts_with (
"ROOTKEY:")) {
500 outputTech = pool::ROOTKEY_StorageType.
type();
501 fileSpec.erase(0, 8);
502 }
else if (fileSpec.starts_with (
"ROOTTREE:")) {
503 outputTech = pool::ROOTTREE_StorageType.
type();
504 fileSpec.erase(0, 9);
505 }
else if (fileSpec.starts_with (
"ROOTTREEINDEX:")) {
506 outputTech = pool::ROOTTREEINDEX_StorageType.
type();
507 fileSpec.erase(0, 14);
508 }
else if (fileSpec.starts_with (
"ROOTRNTUPLE:")) {
509 outputTech = pool::ROOTRNTUPLE_StorageType.
type();
510 fileSpec.erase(0, 12);
511 }
else if (outputTech == 0) {
514 if (
auto pos = fileSpec.find(
"?pmerge=");
pos != std::string::npos) {
523 outputTech =
it->second;
525 outputTech =
it->second;
527 outputTech = pool::ROOTTREEINDEX_StorageType.
type();
530 return StatusCode::SUCCESS;
◆ disconnectOutput()
| StatusCode AthenaPoolCnvSvc::disconnectOutput |
( |
const std::string & |
outputConnectionSpec | ) |
|
|
overridevirtual |
Disconnect to the output connection.
Definition at line 401 of file AthenaPoolCnvSvc.cxx.
402 std::string outputConnection = outputConnectionSpec.substr(0, outputConnectionSpec.find(
'['));
◆ extractPoolAttributes()
| void AthenaPoolCnvSvc::extractPoolAttributes |
( |
const Gaudi::Property< std::vector< std::string >> & |
property, |
|
|
std::vector< std::vector< std::string > > * |
contAttr, |
|
|
std::vector< std::vector< std::string > > * |
dbAttr, |
|
|
std::vector< std::vector< std::string > > * |
domAttr = 0 |
|
) |
| const |
|
private |
Extract POOL ItechnologySpecificAttributes for Domain, Database and Container from property.
Definition at line 593 of file AthenaPoolCnvSvc.cxx.
597 std::vector<std::string>
opt;
598 std::string attributeName, containerName, databaseName, valueString;
599 for (
const auto& propertyValue : property.value()) {
601 attributeName.clear();
602 containerName.clear();
603 databaseName.clear();
605 using Gaudi::Utils::AttribStringParser;
606 for (
const AttribStringParser::Attrib& attrib : AttribStringParser (propertyValue)) {
607 const std::string
tag = attrib.tag;
608 const std::string
val = attrib.value;
609 if (
tag ==
"DatabaseName") {
611 }
else if (
tag ==
"ContainerName") {
612 if (databaseName.empty()) {
615 containerName = std::move(
val);
617 attributeName = std::move(
tag);
618 valueString = std::move(
val);
621 if (!attributeName.empty() && !valueString.empty()) {
622 opt.push_back(attributeName);
623 opt.push_back(valueString);
624 if (!databaseName.empty()) {
625 opt.push_back(databaseName);
626 if (!containerName.empty()) {
627 opt.push_back(containerName);
628 if (containerName.compare(0, 6,
"TTree=") == 0) {
629 dbAttr->push_back(
opt);
631 contAttr->push_back(
opt);
635 dbAttr->push_back(
opt);
637 }
else if (domAttr != 0) {
638 domAttr->push_back(
opt);
642 dbAttr->push_back(
opt);
◆ fillRepRefs()
| StatusCode AthenaPoolCnvSvc::fillRepRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
overridevirtual |
Implementation of IConversionSvc: Resolve the references of the converted object.
- Parameters
-
| pAddress | [IN] pointer to IOpaqueAddress of the representation to be resolved. |
| pObject | [IN] pointer to DataObject to be created. |
Definition at line 229 of file AthenaPoolCnvSvc.cxx.
231 std::string objName =
"ALL";
233 if (
m_clidSvc->getTypeNameOfID(pObject->clID(), objName).isFailure()) {
237 objName += pObject->registry()->name();
242 if (pObject->clID() == 1) {
245 if (
proxy !=
nullptr) {
246 IConverter* cnv = converter(
proxy->clID());
247 status = cnv->fillRepRefs(pAddress, pObject);
253 }
catch(std::runtime_error&
e) {
◆ finalize()
| StatusCode AthenaPoolCnvSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Required of all Gaudi Services.
Definition at line 130 of file AthenaPoolCnvSvc.cxx.
144 const std::string msgPrefix{
"PerfStats "};
146 ATH_MSG_INFO(msgPrefix <<
"Timing Measurements for AthenaPoolCnvSvc");
149 ATH_MSG_INFO(msgPrefix <<
"| " << std::left << std::setw(15) <<
key <<
" | "
150 << std::right << std::setw(15) << std::fixed << std::setprecision(0) <<
value <<
" ms |");
155 m_cnvs.shrink_to_fit();
156 return(StatusCode::SUCCESS);
◆ flushDataHeaderForms()
| void AthenaPoolCnvSvc::flushDataHeaderForms |
( |
const std::string & |
streamName = "*" | ) |
|
Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
Definition at line 116 of file AthenaPoolCnvSvc.cxx.
119 FileIncident incident(
name(),
"WriteDataHeaderForms",
streamName);
120 if( DHCnvListener ) DHCnvListener->handle(incident);
◆ getPoolSvc()
| IPoolSvc * AthenaPoolCnvSvc::getPoolSvc |
( |
| ) |
|
|
overridevirtual |
◆ handle()
| void AthenaPoolCnvSvc::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
◆ initialize()
| StatusCode AthenaPoolCnvSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Required of all Gaudi Services.
Definition at line 35 of file AthenaPoolCnvSvc.cxx.
46 if (!iomgr->io_register(
this).isSuccess()) {
47 ATH_MSG_FATAL(
"Could not register myself with the IoComponentMgr !");
48 return(StatusCode::FAILURE);
52 if (
auto p = maxFileSizeSpec.find(
'=');
p != std::string::npos) {
53 long long maxFileSize = 0;
54 const char*
start = maxFileSizeSpec.data() + (
p + 1);
55 const char*
end = maxFileSizeSpec.data() + maxFileSizeSpec.size();
56 if (
auto [
ptr, ec] = std::from_chars(
start,
end, maxFileSize); ec != std::errc{}) {
59 std::string databaseName = maxFileSizeSpec.substr(0, maxFileSizeSpec.find_first_of(
" ="));
62 if (
auto [
ptr, ec] = std::from_chars(maxFileSizeSpec.data(), maxFileSizeSpec.data() + maxFileSizeSpec.size(),
m_domainMaxFileSize); ec != std::errc{}) {
71 if (dbType == pool::TEST_StorageType) {
73 return StatusCode::FAILURE;
78 return StatusCode::FAILURE;
81 return StatusCode::FAILURE;
93 incSvc->addListener(
this,
"EndEvent", pri);
94 ATH_MSG_DEBUG(
"Subscribed to EndEvent for printing out input file attributes.");
97 ATH_MSG_DEBUG(
"setInputAttribute failed setting POOL domain attributes.");
102 TClass::GetClass (
"TLeafI");
103 TClass::GetClass (
"TLeafL");
104 TClass::GetClass (
"TLeafD");
105 TClass::GetClass (
"TLeafF");
107 return(StatusCode::SUCCESS);
◆ io_finalize()
| StatusCode AthenaPoolCnvSvc::io_finalize |
( |
| ) |
|
|
overridevirtual |
◆ io_reinit()
| StatusCode AthenaPoolCnvSvc::io_reinit |
( |
| ) |
|
|
overridevirtual |
◆ outputContextId()
| unsigned int AthenaPoolCnvSvc::outputContextId |
( |
const std::string & |
outputConnection | ) |
|
|
protected |
◆ processPoolAttributes()
| StatusCode AthenaPoolCnvSvc::processPoolAttributes |
( |
std::vector< std::vector< std::string > > & |
attr, |
|
|
const std::string & |
fileName, |
|
|
unsigned long |
contextId, |
|
|
bool |
doGet = true, |
|
|
bool |
doSet = true, |
|
|
bool |
doClear = true |
|
) |
| const |
|
private |
Set/get technology dependent POOL attributes.
Definition at line 648 of file AthenaPoolCnvSvc.cxx.
654 bool retError =
false;
655 for (
auto& attrEntry : attr) {
656 if (attrEntry.size() == 2) {
657 const std::string&
opt = attrEntry[0];
658 std::string
data = attrEntry[1];
659 if (
data ==
"int" ||
data ==
"DbLonglong" ||
data ==
"double" ||
data ==
"string") {
678 if (attrEntry.size() == 4) {
679 const std::string&
opt = attrEntry[0];
680 std::string
data = attrEntry[1];
681 const std::string&
file = attrEntry[2];
682 const std::string& cont = attrEntry[3];
684 || (
file[0] ==
'*' &&
file.find(
"," +
fileName +
",") == std::string::npos))) {
685 if (
data ==
"int" ||
data ==
"DbLonglong" ||
data ==
"double" ||
data ==
"string") {
697 attrEntry[2] +=
"," +
fileName +
",";
711 return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS);
◆ registerCleanUp()
◆ registerForWrite()
- Returns
- a string token to a Data Object written to Pool
- Parameters
-
| placement | [IN] pointer to the placement hint |
| obj | [IN] pointer to the Data Object to be written to Pool |
| classDesc | [IN] pointer to the Seal class description for the Data Object. |
Definition at line 419 of file AthenaPoolCnvSvc.cxx.
422 Token* token =
nullptr;
426 std::strncpy(
text, contextStr.c_str(),
sizeof(
text) - 1);
430 token =
m_poolSvc->registerForWrite(placement,
obj, classDesc);
◆ setInputAttributes()
| StatusCode AthenaPoolCnvSvc::setInputAttributes |
( |
const std::string & |
fileName | ) |
|
|
overridevirtual |
Set the input file attributes, if any are requested from jobOpts.
- Parameters
-
| fileName | [IN] name of the input file |
Definition at line 559 of file AthenaPoolCnvSvc.cxx.
563 ATH_MSG_DEBUG(
"setInputAttribute failed setting POOL database/container attributes.");
566 ATH_MSG_DEBUG(
"setInputAttribute failed getting POOL database/container attributes.");
570 const auto& extraInputContextMap =
m_poolSvc->getInputContextMap();
571 for (
const auto& [
label,
id]: extraInputContextMap) {
573 ATH_MSG_DEBUG(
"setInputAttribute failed to switch off TTreeCache for = " <<
label <<
".");
577 return(StatusCode::SUCCESS);
◆ setObjPtr()
| void AthenaPoolCnvSvc::setObjPtr |
( |
void *& |
obj, |
|
|
const Token * |
token |
|
) |
| |
|
overridevirtual |
- Parameters
-
| obj | [OUT] pointer to the Data Object. |
| token | [IN] string token of the Data Object for which a Pool Ref is filled. |
Definition at line 434 of file AthenaPoolCnvSvc.cxx.
◆ stop()
| StatusCode AthenaPoolCnvSvc::stop |
( |
| ) |
|
|
overridevirtual |
◆ useDetailChronoStat()
| bool AthenaPoolCnvSvc::useDetailChronoStat |
( |
| ) |
const |
|
overridevirtual |
◆ SvcFactory< AthenaPoolCnvSvc >
◆ m_branchNameHintProp
| Gaudi::Property<std::string> AthenaPoolCnvSvc::m_branchNameHintProp {this,"SubLevelBranchName", "<type>/<key>"} |
|
private |
SubLevelBranchName, naming hint policy for POOL branching: ("" = no branching)
Definition at line 197 of file AthenaPoolCnvSvc.h.
◆ m_chronoMap
◆ m_clidSvc
◆ m_containerAttr
| std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_containerAttr |
|
private |
◆ m_containerNameHintProp
| Gaudi::Property<std::string> AthenaPoolCnvSvc::m_containerNameHintProp {this,"TopLevelContainerName",""} |
|
private |
TopLevelContainerName, naming hint policy for top level POOL container: default = "<type>".
Definition at line 195 of file AthenaPoolCnvSvc.h.
◆ m_containerPrefixProp
| Gaudi::Property<std::string> AthenaPoolCnvSvc::m_containerPrefixProp {this,"PoolContainerPrefix","Default"} |
|
private |
◆ m_contextAttr
| std::vector<unsigned int> AthenaPoolCnvSvc::m_contextAttr |
|
private |
◆ m_databaseAttr
| std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_databaseAttr |
|
private |
◆ m_databaseMaxFileSize
| std::map<std::string, long long> AthenaPoolCnvSvc::m_databaseMaxFileSize |
|
private |
◆ m_DHFilterAliases
| Gaudi::Property<bool> AthenaPoolCnvSvc::m_DHFilterAliases { this, "doFilterDHAliases", true } |
|
protected |
◆ m_DHFormCacheSize
| Gaudi::Property<int> AthenaPoolCnvSvc::m_DHFormCacheSize { this, "maxDHFormCacheSize", 100 } |
|
protected |
◆ m_domainAttr
| std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_domainAttr |
|
private |
◆ m_domainMaxFileSize
| long long AthenaPoolCnvSvc::m_domainMaxFileSize =std::numeric_limits<long long>::max() |
|
private |
◆ m_fileCommitCounter
| std::map<std::string, int> AthenaPoolCnvSvc::m_fileCommitCounter |
|
private |
◆ m_fileFlushSetting
| std::map<std::string, int> AthenaPoolCnvSvc::m_fileFlushSetting |
|
private |
◆ m_inputAttr
| std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttr |
|
private |
◆ m_inputAttrPerEvent
| std::vector<std::vector<std::string> > AthenaPoolCnvSvc::m_inputAttrPerEvent |
|
private |
◆ m_inputPoolAttr
| Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_inputPoolAttr {this,"InputPoolAttributes",{}} |
|
private |
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition at line 208 of file AthenaPoolCnvSvc.h.
◆ m_inputPoolAttrPerEvent
| Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_inputPoolAttrPerEvent {this,"PrintInputAttrPerEvt",{}} |
|
private |
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to be printed each event.
Definition at line 212 of file AthenaPoolCnvSvc.h.
◆ m_lastInputFileName
| std::string AthenaPoolCnvSvc::m_lastInputFileName |
|
private |
decoded storage tech requested in "StorageTechnology" property
Definition at line 175 of file AthenaPoolCnvSvc.h.
◆ m_maxFileSizes
| Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_maxFileSizes {this,"MaxFileSizes",{}} |
|
private |
◆ m_mutex
| std::mutex AthenaPoolCnvSvc::m_mutex |
|
protected |
◆ m_numberEventsPerWrite
| Gaudi::Property<int> AthenaPoolCnvSvc::m_numberEventsPerWrite {this,"NumberEventsPerWrite",-1} |
|
protected |
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on number of Events, respecting CollectionTree auto_flush.
Definition at line 233 of file AthenaPoolCnvSvc.h.
◆ m_oneDataHeaderForm
| Gaudi::Property<bool> AthenaPoolCnvSvc::m_oneDataHeaderForm { this, "OneDataHeaderForm", false } |
|
protected |
◆ m_persSvcPerInputType
| Gaudi::Property<std::string> AthenaPoolCnvSvc::m_persSvcPerInputType {this,"PersSvcPerInputType",""} |
|
protected |
PersSvcPerInputType, string property, tree name to use multiple persistency services, one per input type.
default = "", no tree name results in a single persistency service.
Definition at line 228 of file AthenaPoolCnvSvc.h.
◆ m_persSvcPerOutput
| Gaudi::Property<bool> AthenaPoolCnvSvc::m_persSvcPerOutput {this,"PersSvcPerOutput",true} |
|
protected |
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
default = true.
Definition at line 223 of file AthenaPoolCnvSvc.h.
◆ m_poolAttr
| Gaudi::Property<std::vector<std::string> > AthenaPoolCnvSvc::m_poolAttr {this,"PoolAttributes",{},"Pool Attributes","OrderedSet<std::string>"} |
|
private |
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
Definition at line 200 of file AthenaPoolCnvSvc.h.
◆ m_poolSvc
◆ m_storageTechMap
| std::map<std::string, int> AthenaPoolCnvSvc::m_storageTechMap |
|
private |
◆ m_storageTechProp
| Gaudi::Property<std::map<std::string, std::string> > AthenaPoolCnvSvc::m_storageTechProp {this, "StorageTechnology", {{"*","ROOTTREEINDEX"}}} |
|
private |
◆ m_useDetailChronoStat
| Gaudi::Property<bool> AthenaPoolCnvSvc::m_useDetailChronoStat {this,"UseDetailChronoStat",false} |
|
private |
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = false.
Definition at line 186 of file AthenaPoolCnvSvc.h.
The documentation for this class was generated from the following files:
ServiceHandle< IPoolSvc > m_poolSvc
std::vector< unsigned int > m_contextAttr
virtual StatusCode cleanUp(const std::string &connection) override
Implement cleanUp to call all registered IAthenaPoolCleanUp cleanUp() function.
char data[hepevt_bytes_allocation_ATLAS]
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,...
static TScopeAdapter ByNameNoQuiet(const std::string &name, Bool_t load=kTRUE)
static DbType getType(const std::string &name)
Access known storage type object by name.
unsigned outputContextId(const std::string &outputConnection)
std::string find(const std::string &s)
return a remapped string
ServiceHandle< IClassIDSvc > m_clidSvc
const std::string & contID() const
Access container identifier.
Gaudi::Property< int > m_numberEventsPerWrite
To use MetadataSvc to merge data placed in a certain container When using TMemFile call Write on numb...
long long m_domainMaxFileSize
std::vector< std::vector< std::string > > m_inputAttrPerEvent
virtual StatusCode decodeOutputSpec(std::string &connectionSpec, int &outputTech) const override
Extract/deduce the DB technology from the connection string/file specification.
const Guid & dbID() const
Access database identifier.
std::vector< std::vector< std::string > > m_databaseAttr
PMonUtils::BasicStopWatchResultMap_t m_chronoMap
Map that holds chrono information.
Gaudi::Property< std::string > m_containerPrefixProp
POOL Container name prefix - will be part of or whole TTree/RNTuple name 'Default' takes the prefix f...
Gaudi::Property< std::vector< std::string > > m_maxFileSizes
MaxFileSizes, vector with maximum file sizes for Athena POOL output files.
const Guid & classID() const
Access database identifier.
#define ATH_MSG_VERBOSE(x)
std::string to_string(const SectorProjector proj)
Placement & setAuxString(const std::string &auxString)
Set auxiliary string.
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.
void flushDataHeaderForms(const std::string &streamName="*")
Tell DataHeaderCnv to write out all DataHeaderForms for a given streamName (default is all)
std::map< std::string, int > m_fileFlushSetting
int type() const
Access to full type.
Gaudi::Property< bool > m_useDetailChronoStat
UseDetailChronoStat, enable detailed output for time and size statistics for AthenaPOOL: default = fa...
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
This class provides a token that identifies in a unique way objects on the persistent storage.
This class provides a Generic Transient Address for POOL tokens.
Token & setClassID(const Guid &cl_id)
Access database identifier.
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_persSvcPerOutput
PersSvcPerOutput, boolean property to use multiple persistency services, one per output stream.
Default, invalid implementation of ClassID_traits.
std::vector< std::vector< std::string > > m_inputAttr
std::map< std::string, long long > m_databaseMaxFileSize
const std::string & fileName() const
Access file name.
Gaudi::Property< std::vector< std::string > > m_inputPoolAttrPerEvent
Print input PoolAttributes per event, vector with names of technology specific attributes for POOL to...
Gaudi::Property< std::vector< std::string > > m_poolAttr
Output PoolAttributes, vector with names and values of technology specific attributes for POOL.
std::size_t erase_if(T_container &container, T_Func pred)
std::vector< std::vector< std::string > > m_containerAttr
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.
Gaudi::Property< std::vector< std::string > > m_inputPoolAttr
Input PoolAttributes, vector with names and values of technology specific attributes for POOL.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
virtual const std::string toString() const
Retrieve the string representation of the token.
Token & setOid(const OID_t &oid)
Set object identifier.
Gaudi::Property< std::string > m_persSvcPerInputType
PersSvcPerInputType, string property, tree name to use multiple persistency services,...
std::vector< std::vector< std::string > > m_domainAttr
static const Guid & null() noexcept
NULL-Guid: static class method.
std::map< std::string, int > m_fileCommitCounter
#define ATH_MSG_WARNING(x)
Token & setAuxString(const std::string &auxString)
Set auxiliary string.
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 fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Gaudi::Property< std::map< std::string, std::string > > m_storageTechProp
Default Storage Tech for containers (ROOTTREE, ROOTTREEINDEX, ROOTRNTUPLE)
std::string m_lastInputFileName
decoded storage tech requested in "StorageTechnology" property
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
std::map< std::string, int > m_storageTechMap
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.