 |
ATLAS Offline Software
|
Go to the documentation of this file.
44 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
75 "in createObj: creating a IdDictManager object in the detector store");
79 return StatusCode::FAILURE;
83 std::string mgrKey = *(ddAddr->par());
103 return StatusCode::SUCCESS;
126 m_parser = std::make_unique<IdDictParser>();
157 "Dictonary file name from job options or using defaults.");
213 size_t ndict =
mgr.get_dictionaries().size();
216 return StatusCode::FAILURE;
225 "NOTE: ** parseXMLDescription called, but parsing was deemed "
228 ATH_MSG_DEBUG(
"parseXMLDescription: Finished parsing and setting options ");
229 return StatusCode::SUCCESS;
236 const IRDBRecord *neighborTable = (*recordset)[0];
281 std::string space(20 -
dictionary->name().size(),
' ');
286 std::string space(20 -
version.size(),
' ');
292 std::string space(25 -
dictionary->dict_tag().size(),
' ');
328 return StatusCode::SUCCESS;
335 bool skipDbDictAccess =
m_geoDbTagSvc->getParamSvcName().empty();
336 std::string paramSvcName = skipDbDictAccess ?
"RDBAccessSvc" :
m_geoDbTagSvc->getParamSvcName();
341 if(skipDbDictAccess) {
342 ATH_MSG_WARNING(
"Unable to determine RDBAccessSvc backend. Using default dictionaries");
346 return StatusCode::SUCCESS;
351 std::string &dictTag) {
352 if (idDictSet->size()) {
353 const IRDBRecord *idDictTable = (*idDictSet)[0];
354 const std::string dictName = idDictTable->
getString(
"DICT_NAME");
356 dictTag = idDictSet->tagName();
363 << dictName <<
", file: " <<
fileName
365 <<
", dictionary tag: " << dictTag);
368 ATH_MSG_WARNING(
" no record set found for dictionary"<<idDictSet->nodeName()<<
" - using default dictionary ");
374 auto getEmbeddedDict = [
this](
const std::string& dictName,
376 std::string &dictTag) ->
bool
382 std::string dictString = dictRecord->
getString(
"CONTENTS");
384 std::string dictFileName = dictName+
"-fromSQLite.xml";
385 std::ofstream dictFile;
386 dictFile.open(dictFileName);
387 dictFile << dictString;
393 ATH_MSG_DEBUG(dictName <<
" read from the SQLite database as a BLOB");
399 bool useGeomDB = (
m_geoDbTagSvc->getSqliteReader() ==
nullptr);
401 std::string detTag{
""}, detNode{
""}, dictName{
""};
405 bool embeddedDict{
false};
413 << detectorKey.
node());
414 detTag = detectorKey.
tag();
415 detNode = detectorKey.
node();
416 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"DICTXDD", detTag, detNode);
419 if (idDictSet->size()) {
420 const IRDBRecord *recordInDet = (*idDictSet)[0];
421 std::string InDetString = recordInDet->
getString(
"XMLCLOB");
424 std::ofstream blobFile;
425 blobFile.open(
"InDetIdDict.xml");
426 blobFile << InDetString << std::endl;
429 ATH_MSG_WARNING(
" no record set found for InDetIdentifier - using default dictionary ");
439 detTag = detectorKey.
tag();
440 detNode = detectorKey.
node();
442 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"InDetIdentifier", detTag, detNode);
454 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
455 detTag = detectorKey.
tag();
456 detNode = detectorKey.
node();
458 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"LArIdentifier", detTag, detNode);
469 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
470 detTag = detectorKey.
tag();
471 detNode = detectorKey.
node();
473 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"TileIdentifier", detTag, detNode);
484 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag()<<
" at Node: " << detectorKey.
node() );
485 detTag = detectorKey.
tag();
486 detNode = detectorKey.
node();
488 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"CaloIdentifier", detTag, detNode);
494 if (caloNeighborTable->size() == 0 && useGeomDB) {
495 caloNeighborTable =
m_rdbAccessSvc->getRecordsetPtr(
"CaloNeighborTable",
"CaloNeighborTable-00");
498 if (caloNeighborTable->size()) {
509 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag()<<
" at Node: " << detectorKey.
node() );
510 detTag = detectorKey.
tag();
511 detNode = detectorKey.
node();
513 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"MuonIdentifier", detTag, detNode);
524 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
525 detTag = detectorKey.
tag();
526 detNode = detectorKey.
node();
528 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"ForDetIdentifier", detTag, detNode);
531 if (idDictSet->size() == 0 && useGeomDB) {
533 "ForDetIdentifier-00");
534 ATH_MSG_DEBUG(
" explicitly requesting ForDetIdentifier-00 tag for pre-forward "
541 return StatusCode::SUCCESS;
549 ifile.open(
"InDetIdDict.xml");
583 m_parser->register_external_entity(
"MuonSpectrometer",
589 m_parser->register_external_entity(
"ForwardDetectors",
594 return StatusCode::SUCCESS;
602 auto setDictPaths = [
this, &
mgr](
const std::string &dict_name,
604 const std::string &dict_tag) {
607 return StatusCode::SUCCESS;
612 return StatusCode::FAILURE;
616 ATH_MSG_DEBUG(
"For " << dict_name <<
" idDict, setting file/tag: "
618 return StatusCode::SUCCESS;
628 auto addMetaData = [&
mgr,
this](
const std::string &
key,
629 const std::string &
value) {
644 return StatusCode::SUCCESS;
647 template <
class dType>
654 return StatusCode::FAILURE;
656 const Gaudi::Details::PropertyBase &prop =
658 const Gaudi::Property<dType> *propPtr{
659 dynamic_cast<const Gaudi::Property<dType> *
>(&prop)};
661 ATH_MSG_ERROR(
"Property " << propertyName <<
" is not of type"
662 <<
typeid(dType).
name() <<
" but of "
663 <<
typeid(prop).
name());
664 return StatusCode::FAILURE;
666 pipeTo = propPtr->value();
668 return StatusCode::SUCCESS;
673 template <
class dType>
675 const std::string &propertyName, dType &pipeTo) {
679 pipeTo = std::move(cache);
680 return StatusCode::SUCCESS;
std::string m_tileIdDictTag
Tag of RDB record for Tile ids.
std::string m_idDictName
Name of top-level xml dict file.
StatusCode loadProperty(const std::string &propertyName, dType &pipeTo)
Loads the property from the DetDecrCnvSvc and pipes its value Returns failure if either the service,...
std::string m_atlasIDFileName
File to be read for top-level subsystem ids values.
std::string m_fcal3dNeighborsPrevName
StatusCode registerInfoWithDicts()
Register the requested files and tag with the created id dicts.
const long DetDescr_StorageType
std::vector< Identifier > ID
std::string m_inDetIDTag
Internal InDet id tag.
std::string m_atlasIdDictTag
Tag of RDB record for Atlas top-level ids.
StatusCode getFileNamesFromTags()
Get file names from properties.
convert to and from a SG storable
bool m_doNeighbours
Flag to generate neighbor information - for calos.
std::string m_muonIDFileName
File to be read for Muon ids.
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
std::string m_fullAtlasNeighborsName
Files for Calo Neighbors.
SmartIF< IProperty > m_detDescrProxy
Propxy to the DetDescrCnvSvc.
std::string m_fcal2dNeighborsName
const std::string & node() const
Return the version node.
void set_dict_tag(const std::string &tag)
Set the dictionary tag.
virtual StatusCode finalize() override
std::string m_forwardIDFileName
File to be read for Forward det ids.
std::string m_tileIDFileName
File to be read for Tile ids.
StatusCode parseXMLDescription()
Create and (re)initialize the IdDictManager - only create the first time.
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
std::string m_larIDFileName
File to be read for LAr ids.
std::string m_tileNeighborsName
Converter for the DetDescrCnvSvc which parses the identifier xml dictionaries and creates an IdDictMa...
void collectCaloNeighbors(IRDBRecordset_ptr recordset)
A helper function for collecting calo neighbor file names from the database.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
dictionary_vec get_dictionaries() const
Access to all dictionaries.
std::string m_inDetIdDictTag
Tag of RDB record for InDet ids.
IdDictDetDescrCnv(ISvcLocator *svcloc)
std::string m_larIdDictTag
Tag of RDB record for LAr ids.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool m_doChecks
Flag to tell helpers to do Checks.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
void set_file_name(const std::string &name)
Set file name.
Default, invalid implementation of ClassID_traits.
const std::string & tag() const
Return version tag.
virtual StatusCode initialize() override
StatusCode registerFilesWithParser()
Register the requested files with the xml parser.
std::string m_inDetIDFileName
File to be read for InDet ids.
uint32_t CLID
The Class ID type.
std::string m_fcal3dNeighborsNextName
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
MsgStream & msg() const
The standard message stream.
std::string m_muonIdDictTag
Tag of RDB record for Muon ids.
virtual long int repSvcType() const override
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
IdDictManager is the interface to identifier dictionaries.
std::string m_caloIdDictTag
Tag of RDB record for Calo ids.
static const CLID & classID()
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc
Definition of the abstract IRDBRecord interface.
std::string m_forwardIdDictTag
Tag of RDB record for forwards det ids.
#define ATH_MSG_WARNING(x)
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
std::string m_caloIDFileName
File to be read for Calo ids.
IRDBRecord is one record in the IRDBRecordset object.
const IdDictMgr * manager(void) const
StatusCode loadPropertyWithParse(const std::string &propertyName, dType &pipeTo)
Same as loadProperty but additionally m_doParsing is set to true if the input value does not match th...
std::unique_ptr< IdDictParser > m_parser
The xml parser for the dictionary descriptions.
void printDicts(const IdDictManager *dictMgr)
Print out the contained dictionaries and version.
Definition of the abstract IRDBRecordset interface.
StatusCode getFileNamesFromProperties()
Get file names from properties.
const std::string & tag() const
Version tag.
bool m_idDictFromRDB
Flag to get dict parameters from Relational DetDescr DB.
bool m_doParsing
Flag to which determines whether the xml files are parsed or not.
static long int storageType()
Storage type and class ID (used by CnvFactory)