|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/ServiceHandle.h"
27 if(!rdbAccessSvc->connect(connName)) {
29 return StatusCode::FAILURE;
35 ATH_MSG_FATAL(
"Unable to cast IRDBAccessSvc to RDBAccessSvc");
36 return StatusCode::FAILURE;
43 std::vector<std::string> tagList;
54 if(!tagList.empty()) {
69 return StatusCode::SUCCESS;
75 return StatusCode::SUCCESS;
81 std::vector<std::string> tagdiff, taglist1, taglist2;
82 std::vector<char> leftright;
85 tagdiff.resize(taglist1.size()+taglist2.size());
86 auto it1 = taglist1.begin();
87 auto it1last = taglist1.end();
88 auto it2 = taglist2.begin();
89 auto it2last = taglist2.end();
90 auto itdiff = tagdiff.begin();
95 leftright.push_back(
'>');
103 while(
it1!=it1last) {
104 leftright.push_back(
'<');
116 leftright.push_back(
'<');
118 else if (*it2<*
it1) {
122 leftright.push_back(
'>');
130 tagdiff.resize(itdiff-tagdiff.begin());
131 if(!tagdiff.empty()) {
132 log <<
"The databases contain different sets of supported locked global tags" << std::endl;
133 auto leftrightIt = leftright.begin();
134 for(
const std::string&
tag : tagdiff ) {
135 log << *leftrightIt <<
" " <<
tag << std::endl;
147 , std::ofstream&
log)
150 for(
const std::string&
tag : globalTags) {
152 std::vector<NodeToRecordsetMap> map;
155 for(
auto& mapel : map) {
159 return StatusCode::FAILURE;
165 std::ostringstream tagDetailStream;
166 tagDetailStream << atlasTagDetails << std::endl;
172 std::vector<std::string> leafNodes;
174 for(
size_t ii=0; ii<leafNodes.size(); ++ii) {
175 std::string nodeName = leafNodes[ii];
176 int perc = ii*100/leafNodes.size();
179 if(!childTag.empty()) {
182 mapel[nodeName] = recPtr;
191 log << std::endl <<
"TAG: " <<
tag << std::endl
192 <<
"Different number of leaf nodes in databases! " << map[0].size() <<
" vs " << map[1].size() << std::endl;
195 bool difFound{
false};
196 NodeToRecordsetMap::const_iterator
it = map[0].begin();
197 for(;
it!=map[0].end(); ++
it) {
198 if(map[1].
find(
it->first)==map[1].end()) {
201 log << std::endl <<
"TAG: " <<
tag << std::endl
202 <<
"Nodes existing in Session0 but missing in Session1:" << std::endl;
204 log <<
"** " <<
it->first << std::endl;
210 for(;
it!=map[1].end(); ++
it) {
211 if(map[0].
find(
it->first)==map[0].end()) {
214 log << std::endl <<
"TAG: " <<
tag << std::endl
215 <<
"Nodes existing in Session1 but missing in Session0:" << std::endl;
217 log <<
"** " <<
it->first << std::endl;
223 for(;
it!=map[0].end(); ++
it) {
224 NodeToRecordsetMap::const_iterator
it1 = map[1].find(
it->first);
232 && *recConcrete0!=*recConcrete1) {
235 log << std::endl <<
"TAG: " <<
tag << std::endl
236 <<
"Differences for common nodes:" << std::endl;
238 log <<std::endl <<
"** " <<
it->first << std::endl;
244 return StatusCode::SUCCESS;
std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName) override
Gets the tag name for the node by giving its parent node tag.
StatusCode compareGlobalTags(const std::vector< std::string > &globalTags, RDBAccessSvc *rdbAccessSvc, std::ofstream &log)
Gaudi::Property< std::string > m_supportedGeometry
std::vector< std::string > getLockedSupportedTags(const std::string &supportedFlag, const std::string &connName="ATLASDD")
std::string find(const std::string &s)
return a remapped string
Definition of RDBAccessSvc class.
std::map< std::string, IRDBRecordset_ptr > NodeToRecordsetMap
RDBAccessSvc is the implementation of IRDBAccessSvc interface.
Gaudi::Property< std::string > m_globalTag
std::vector< HWIdentifier >::iterator it1
::StatusCode StatusCode
StatusCode definition for legacy code.
IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD") override
Provides access to the Recordset object containing HVS-tagged data.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
coral::AttributeList RDBTagDetails
std::vector< std::string > getGlobalTags(RDBAccessSvc *rdbAccessSvc, std::ofstream &log)
SourceCompAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute() override
#define ATLAS_THREAD_SAFE
virtual StatusCode finalize() override
Define macros for attributes used to control the static checker.
std::vector< std::string > m_connNames
void getTagDetails(RDBTagDetails &tagDetails, const std::string &tag, const std::string &connName="ATLASDD") override
Returns AttributeList with tag details Attributes in the list: Locked (bool), Supported (bool)
virtual StatusCode initialize() override
void getAllLeafNodes(std::vector< std::string > &list, const std::string &connName="ATLASDD")
bool disconnect(const std::string &connName) override
If the counnection counter==1 closes the connection.
RDBRecordset is an implementation of IRDBRecordset interface.
void compare(const RDBRecordset &rec, std::ostream &os) const