 |
ATLAS Offline Software
|
Go to the documentation of this file.
46 return StatusCode::SUCCESS;
50 return StatusCode::SUCCESS;
77 "in createObj: creating a IdDictManager object in the detector store");
81 return StatusCode::FAILURE;
85 std::string mgrKey = *(ddAddr->par());
105 return StatusCode::SUCCESS;
128 m_parser = std::make_unique<IdDictParser>();
159 "Dictonary file name from job options or using defaults.");
218 return StatusCode::FAILURE;
227 "NOTE: ** parseXMLDescription called, but parsing was deemed "
230 ATH_MSG_DEBUG(
"parseXMLDescription: Finished parsing and setting options ");
231 return StatusCode::SUCCESS;
238 const IRDBRecord *neighborTable = (*recordset)[0];
280 IdDictMgr::dictionary_map::const_iterator
it;
290 std::string space(20 -
dictionary.m_name.size(),
' ');
291 msg(MSG::INFO) << space;
295 std::string space(20 -
version.size(),
' ');
296 msg(MSG::INFO) << space;
301 std::string space(25 -
dictionary.dict_tag().size(),
' ');
302 msg(MSG::INFO) << space;
305 msg(MSG::INFO) <<
" DetDescr tag (using default)";
337 return StatusCode::SUCCESS;
344 bool skipDbDictAccess =
m_geoDbTagSvc->getParamSvcName().empty();
345 std::string paramSvcName = skipDbDictAccess ?
"RDBAccessSvc" :
m_geoDbTagSvc->getParamSvcName();
350 if(skipDbDictAccess) {
351 ATH_MSG_WARNING(
"Unable to determine RDBAccessSvc backend. Using default dictionaries");
355 return StatusCode::SUCCESS;
360 std::string &dictTag) {
361 if (idDictSet->size()) {
362 const IRDBRecord *idDictTable = (*idDictSet)[0];
363 const std::string dictName = idDictTable->
getString(
"DICT_NAME");
365 dictTag = idDictSet->tagName();
372 << dictName <<
", file: " <<
fileName
374 <<
", dictionary tag: " << dictTag);
377 ATH_MSG_WARNING(
" no record set found for dictionary"<<idDictSet->nodeName()<<
" - using default dictionary ");
383 auto getEmbeddedDict = [
this](
const std::string& dictName,
385 std::string &dictTag) ->
bool
391 std::string dictString = dictRecord->
getString(
"CONTENTS");
393 std::string dictFileName = dictName+
"-fromSQLite.xml";
394 std::ofstream dictFile;
395 dictFile.open(dictFileName);
396 dictFile << dictString;
402 ATH_MSG_DEBUG(dictName <<
" read from the SQLite database as a BLOB");
408 bool useGeomDB = (
m_geoDbTagSvc->getSqliteReader() ==
nullptr);
410 std::string detTag{
""}, detNode{
""}, dictName{
""};
414 bool embeddedDict{
false};
422 << detectorKey.
node());
423 detTag = detectorKey.
tag();
424 detNode = detectorKey.
node();
425 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"DICTXDD", detTag, detNode);
428 if (idDictSet->size()) {
429 const IRDBRecord *recordInDet = (*idDictSet)[0];
430 std::string InDetString = recordInDet->
getString(
"XMLCLOB");
433 std::ofstream blobFile;
434 blobFile.open(
"InDetIdDict.xml");
435 blobFile << InDetString << std::endl;
438 ATH_MSG_WARNING(
" no record set found for InDetIdentifier - using default dictionary ");
448 detTag = detectorKey.
tag();
449 detNode = detectorKey.
node();
451 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"InDetIdentifier", detTag, detNode);
463 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
464 detTag = detectorKey.
tag();
465 detNode = detectorKey.
node();
467 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"LArIdentifier", detTag, detNode);
478 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
479 detTag = detectorKey.
tag();
480 detNode = detectorKey.
node();
482 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"TileIdentifier", detTag, detNode);
493 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag()<<
" at Node: " << detectorKey.
node() );
494 detTag = detectorKey.
tag();
495 detNode = detectorKey.
node();
497 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"CaloIdentifier", detTag, detNode);
503 if (caloNeighborTable->size() == 0 && useGeomDB) {
504 caloNeighborTable =
m_rdbAccessSvc->getRecordsetPtr(
"CaloNeighborTable",
"CaloNeighborTable-00");
507 if (caloNeighborTable->size()) {
518 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag()<<
" at Node: " << detectorKey.
node() );
519 detTag = detectorKey.
tag();
520 detNode = detectorKey.
node();
522 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"MuonIdentifier", detTag, detNode);
533 ATH_MSG_DEBUG(
"From Version Tag: " << detectorKey.
tag() <<
" at Node: " << detectorKey.
node() );
534 detTag = detectorKey.
tag();
535 detNode = detectorKey.
node();
537 idDictSet =
m_rdbAccessSvc->getRecordsetPtr(
"ForDetIdentifier", detTag, detNode);
540 if (idDictSet->size() == 0 && useGeomDB) {
542 "ForDetIdentifier-00");
543 ATH_MSG_DEBUG(
" explicitly requesting ForDetIdentifier-00 tag for pre-forward "
550 return StatusCode::SUCCESS;
558 ifile.open(
"InDetIdDict.xml");
592 m_parser->register_external_entity(
"MuonSpectrometer",
598 m_parser->register_external_entity(
"ForwardDetectors",
603 return StatusCode::SUCCESS;
611 auto setDictPaths = [
this, &
mgr](
const std::string &dict_name,
613 const std::string &dict_tag) {
616 return StatusCode::SUCCESS;
621 return StatusCode::FAILURE;
625 ATH_MSG_DEBUG(
"For " << dict_name <<
" idDict, setting file/tag: "
627 return StatusCode::SUCCESS;
637 auto addMetaData = [&
mgr,
this](
const std::string &
key,
638 const std::string &
value) {
653 return StatusCode::SUCCESS;
656 template <
class dType>
663 return StatusCode::FAILURE;
665 const Gaudi::Details::PropertyBase &prop =
667 const Gaudi::Property<dType> *propPtr{
668 dynamic_cast<const Gaudi::Property<dType> *
>(&prop)};
670 ATH_MSG_ERROR(
"Property " << propertyName <<
" is not of type"
671 <<
typeid(dType).
name() <<
" but of "
672 <<
typeid(prop).
name());
673 return StatusCode::FAILURE;
675 pipeTo = propPtr->value();
677 return StatusCode::SUCCESS;
682 template <
class dType>
684 const std::string &propertyName, dType &pipeTo) {
688 pipeTo = std::move(cache);
689 return StatusCode::SUCCESS;
std::string m_tileIdDictTag
Tag of RDB record for Tile ids.
std::map< std::string, IdDictDictionary * > dictionary_map
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.
const dictionary_map & get_dictionary_map() const
Access to all dictionaries.
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)
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)