Skip to content
Snippets Groups Projects
Commit 313eacb1 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'dev/master/updateAthExHive' into 'master'

AthExHive: use initializer list syntax for Properties

See merge request !4766

Former-commit-id: 20fa1cd2
parents 9a290a67 cfe479d8
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 104 deletions
...@@ -25,11 +25,7 @@ boost::regex ref(r_ef); ...@@ -25,11 +25,7 @@ boost::regex ref(r_ef);
ASCIICondDbSvc::ASCIICondDbSvc( const std::string& name, ISvcLocator* svcLoc ): ASCIICondDbSvc::ASCIICondDbSvc( const std::string& name, ISvcLocator* svcLoc ):
base_class(name,svcLoc) base_class(name,svcLoc)
{ {}
declareProperty("CondFile",m_file="");
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -120,7 +116,7 @@ ASCIICondDbSvc::readDbFile(const std::string& fname) { ...@@ -120,7 +116,7 @@ ASCIICondDbSvc::readDbFile(const std::string& fname) {
} }
ifs.close(); ifs.close();
} else { } else {
error() << "unable to open file " << m_file << endmsg; error() << "unable to open file " << (std::string) m_file << endmsg;
sc = StatusCode::FAILURE; sc = StatusCode::FAILURE;
} }
...@@ -193,8 +189,13 @@ ASCIICondDbSvc::parse(EventIDRange& t, const std::string& s) { ...@@ -193,8 +189,13 @@ ASCIICondDbSvc::parse(EventIDRange& t, const std::string& s) {
if (m.size() != 5) { return false; } if (m.size() != 5) { return false; }
t = EventIDRange( EventIDBase(std::stoi(m[1]),std::stoi(m[2])), EventIDBase start(std::stoi(m[1]), std::stoi(m[2]));
EventIDBase(std::stoi(m[3]), std::stoi(m[4]))); EventIDBase end(std::stoi(m[3]), std::stoi(m[4]));
start.set_lumi_block(m_lbn);
end.set_lumi_block(m_lbn);
t = EventIDRange(start, end);
return true; return true;
...@@ -210,9 +211,14 @@ ASCIICondDbSvc::parse(IOVEntryT<IASCIICondDbSvc::dbData_t>& ie, const std::strin ...@@ -210,9 +211,14 @@ ASCIICondDbSvc::parse(IOVEntryT<IASCIICondDbSvc::dbData_t>& ie, const std::strin
if (m.size() != 6) { return false; } if (m.size() != 6) { return false; }
ie.setRange( EventIDRange( EventIDBase(std::stoi(m[1]), std::stoi(m[2])), EventIDBase start(std::stoi(m[1]), std::stoi(m[2]));
EventIDBase(std::stoi(m[3]), std::stoi(m[4])) ) ); EventIDBase end(std::stoi(m[3]), std::stoi(m[4]));
start.set_lumi_block(m_lbn);
end.set_lumi_block(m_lbn);
ie.setRange(EventIDRange(start,end));
IASCIICondDbSvc::dbData_t *v = new IASCIICondDbSvc::dbData_t( std::stof(m[5]) ); IASCIICondDbSvc::dbData_t *v = new IASCIICondDbSvc::dbData_t( std::stof(m[5]) );
ie.setPtr(v); ie.setPtr(v);
...@@ -237,6 +243,8 @@ ASCIICondDbSvc::getRange(const std::string& dbKey , const EventContext& ctx, ...@@ -237,6 +243,8 @@ ASCIICondDbSvc::getRange(const std::string& dbKey , const EventContext& ctx,
} }
for (auto e : itr->second) { for (auto e : itr->second) {
debug() << "compare " << e.range() << " with " << ctx.eventID()
<< endmsg;
if (e.range().isInRange(EventIDBase(ctx.eventID()))) { if (e.range().isInRange(EventIDBase(ctx.eventID()))) {
rng = e.range(); rng = e.range();
val = *(e.objPtr()); val = *(e.objPtr());
......
...@@ -43,7 +43,8 @@ private: ...@@ -43,7 +43,8 @@ private:
StatusCode readDbFile(const std::string&); StatusCode readDbFile(const std::string&);
std::string m_file; Gaudi::Property<std::string> m_file{this, "CondFile", "", "cond db file name"};
Gaudi::Property<unsigned int> m_lbn{this, "LBN", 1, "explicit lumi block number"};
typedef std::map<std::string, std::vector<IOVEntryT<IASCIICondDbSvc::dbData_t>>> registry_t; typedef std::map<std::string, std::vector<IOVEntryT<IASCIICondDbSvc::dbData_t>>> registry_t;
registry_t m_registry; registry_t m_registry;
......
...@@ -17,15 +17,7 @@ ...@@ -17,15 +17,7 @@
AlgC::AlgC( const std::string& name, AlgC::AlgC( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::AthAlgorithm( name, pSvcLocator ) ::AthAlgorithm( name, pSvcLocator )
// , {}
// m_rdh1("a2"),
// m_rch("X1")
{
// declareProperty("Key_R1",m_rdh1);
// declareProperty("Key_CH", m_rch);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -17,23 +17,8 @@ ...@@ -17,23 +17,8 @@
AlgT::AlgT( const std::string& name, AlgT::AlgT( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::AthAlgorithm( name, pSvcLocator ), ::AthAlgorithm( name, pSvcLocator )
m_wrh1("t1"), m_rdh1(""), {}
m_evt("McEventInfo"),
m_tool1("HiveTool",this),
m_tool2("HiveTool",this),
m_tool3("HiveTool",this)
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_W1",m_wrh1);
declareProperty("EvtInfo", m_evt);
declareProperty("Tool1",m_tool1);
declareProperty("Tool2",m_tool2);
declareProperty("Tool3",m_tool3);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -32,12 +32,14 @@ public: ...@@ -32,12 +32,14 @@ public:
private: private:
SG::WriteHandleKey<HiveDataObj> m_wrh1; SG::ReadHandleKey<EventInfo> m_evt{this, "EvtInfo", "McEventInfo", "EventInfo name"};
SG::ReadHandleKey<HiveDataObj> m_rdh1; SG::ReadHandleKey<HiveDataObj> m_rdh1{this,"Key_R1","","read key"};
SG::ReadHandleKey<EventInfo> m_evt; SG::WriteHandleKey<HiveDataObj> m_wrh1{this,"Key_W1","t1","write key"};
ToolHandle<IHiveTool> m_tool1, m_tool2, m_tool3; ToolHandle<IHiveTool> m_tool1{this, "Tool1", "HiveTool", "tool 1"};
ToolHandle<IHiveTool> m_tool2{this, "Tool2", "HiveTool", "tool 2"};
ToolHandle<IHiveTool> m_tool3{this, "Tool3", "HiveTool", "tool 3"};
}; };
#endif #endif
...@@ -14,9 +14,6 @@ HiveAlgBase::HiveAlgBase( const std::string& name, ...@@ -14,9 +14,6 @@ HiveAlgBase::HiveAlgBase( const std::string& name,
::AthAlgorithm( name, pSvcLocator ), ::AthAlgorithm( name, pSvcLocator ),
m_hes("HiveExSvc",name) m_hes("HiveExSvc",name)
{ {
declareProperty("Time",m_time=0);
} }
HiveAlgBase::~HiveAlgBase() {} HiveAlgBase::~HiveAlgBase() {}
......
...@@ -40,7 +40,7 @@ protected: ...@@ -40,7 +40,7 @@ protected:
private: private:
int m_time; Gaudi::Property<int> m_time{this, "Time", 0, "default alg sleep time"};
}; };
......
...@@ -10,15 +10,8 @@ ...@@ -10,15 +10,8 @@
HiveAlgL1::HiveAlgL1( const std::string& name, HiveAlgL1::HiveAlgL1( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ), ::HiveAlgBase( name, pSvcLocator )
m_rdh1("a2"), {}
m_wrh1("l1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_W1",m_wrh1);
}
HiveAlgL1::~HiveAlgL1() {} HiveAlgL1::~HiveAlgL1() {}
......
...@@ -30,8 +30,8 @@ public: ...@@ -30,8 +30,8 @@ public:
private: private:
SG::ReadHandleKey<HiveDataObj> m_rdh1; SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "a2", "read key"};
SG::WriteHandleKey<HiveDataObj> m_wrh1; SG::WriteHandleKey<HiveDataObj> m_wrh1{this, "Key_W1", "l1", "write key"};
}; };
#endif #endif
...@@ -10,12 +10,10 @@ ...@@ -10,12 +10,10 @@
HiveAlgL2::HiveAlgL2( const std::string& name, HiveAlgL2::HiveAlgL2( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ), ::HiveAlgBase( name, pSvcLocator )
m_rdh1("l1"), ,m_udh1("l1")
m_udh1("l1")
{ {
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_U1",m_udh1); declareProperty("Key_U1",m_udh1);
} }
......
...@@ -31,8 +31,10 @@ public: ...@@ -31,8 +31,10 @@ public:
private: private:
SG::ReadHandleKey<HiveDataObj> m_rdh1; SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "l1", "read key"};
SG::UpdateHandleKey<HiveDataObj> m_udh1; SG::UpdateHandleKey<HiveDataObj> m_udh1;
}; };
#endif #endif
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
HiveAlgL3::HiveAlgL3( const std::string& name, HiveAlgL3::HiveAlgL3( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ), ::HiveAlgBase( name, pSvcLocator )
m_udh1("l1") ,m_udh1("l1")
{ {
declareProperty("Key_U1",m_udh1); declareProperty("Key_U1",m_udh1);
......
...@@ -9,16 +9,8 @@ ...@@ -9,16 +9,8 @@
HiveAlgM::HiveAlgM( const std::string& name, HiveAlgM::HiveAlgM( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ), ::HiveAlgBase( name, pSvcLocator )
m_rdh1("a2"), {}
m_rdh2("l1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_R2",m_rdh2);
declareProperty("Offset",m_off);
}
HiveAlgM::~HiveAlgM() {} HiveAlgM::~HiveAlgM() {}
...@@ -58,7 +50,7 @@ StatusCode HiveAlgM::execute() { ...@@ -58,7 +50,7 @@ StatusCode HiveAlgM::execute() {
ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() ); ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() );
if ( rdh2->val() != (rdh1->val() + m_off) ) { if ( rdh2->val() != (rdh1->val() + m_off) ) {
ATH_MSG_ERROR (rdh2.key() << " != " << rdh1.key() << " + " << m_off); ATH_MSG_ERROR (rdh2.key() << " != " << rdh1.key() << " + " << (int) m_off);
} else { } else {
ATH_MSG_INFO( "loop is ok"); ATH_MSG_INFO( "loop is ok");
} }
......
...@@ -29,9 +29,9 @@ public: ...@@ -29,9 +29,9 @@ public:
private: private:
int m_off { 1 }; Gaudi::Property<int> m_off {this, "Offset", 1, "offset"};
SG::ReadHandleKey<HiveDataObj> m_rdh1; SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "a2", "read key 1"};
SG::ReadHandleKey<HiveDataObj> m_rdh2; SG::ReadHandleKey<HiveDataObj> m_rdh2{this, "Key_R2", "l1", "read key 2"};
}; };
#endif #endif
...@@ -19,14 +19,7 @@ DECLARE_COMPONENT(HiveAlgR) ...@@ -19,14 +19,7 @@ DECLARE_COMPONENT(HiveAlgR)
HiveAlgR::HiveAlgR( const std::string& name, HiveAlgR::HiveAlgR( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::AthReentrantAlgorithm( name, pSvcLocator ) ::AthReentrantAlgorithm( name, pSvcLocator )
,m_evt("McEventInfo") {}
,m_wrh1("ar1")
{
declareProperty("Key_W1",m_wrh1);
declareProperty("EvtInfo",m_evt);
}
HiveAlgR::~HiveAlgR() {} HiveAlgR::~HiveAlgR() {}
......
...@@ -29,9 +29,9 @@ public: ...@@ -29,9 +29,9 @@ public:
private: private:
SG::ReadHandleKey<EventInfo> m_evt; SG::ReadHandleKey<EventInfo> m_evt{this, "EvtInfo", "McEventInfo", "event info key"};
SG::WriteHandleKey<HiveDataObj> m_wrh1; SG::WriteHandleKey<HiveDataObj> m_wrh1 {this, "Key_W1", "ar1", "write handle key"};
}; };
#endif #endif
...@@ -11,11 +11,7 @@ ...@@ -11,11 +11,7 @@
HiveAlgV::HiveAlgV( const std::string& name, HiveAlgV::HiveAlgV( const std::string& name,
ISvcLocator* pSvcLocator ) : ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ) ::HiveAlgBase( name, pSvcLocator )
{ {}
declareProperty("WriteBeforeRead",m_writeFirst=true);
}
HiveAlgV::~HiveAlgV() {} HiveAlgV::~HiveAlgV() {}
......
...@@ -30,7 +30,8 @@ public: ...@@ -30,7 +30,8 @@ public:
private: private:
bool m_writeFirst { true }; Gaudi::Property<bool> m_writeFirst {this, "WriteBeforeRead", true,
"do write before the read" };
SG::ReadHandleKeyArray<HiveDataObj> m_rhv { SG::ReadHandleKeyArray<HiveDataObj> m_rhv {
this, "Key_RV", {"a1","a2","d1","e1","c1"}, this, "Key_RV", {"a1","a2","d1","e1","c1"},
......
...@@ -14,15 +14,8 @@ ...@@ -14,15 +14,8 @@
HiveTool::HiveTool(const std::string& type, const std::string& name, HiveTool::HiveTool(const std::string& type, const std::string& name,
const IInterface* parent) const IInterface* parent)
: base_class( type, name, parent ), : base_class( type, name, parent )
m_rdh1("x1"), {}
m_wrh1("X1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_W1",m_wrh1);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
......
...@@ -25,8 +25,8 @@ public: ...@@ -25,8 +25,8 @@ public:
private: private:
SG::ReadHandleKey<HiveDataObj> m_rdh1; SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "x1", "tool read key"};
SG::WriteHandleKey<HiveDataObj> m_wrh1; SG::WriteHandleKey<HiveDataObj> m_wrh1{this, "Key_W1", "X1", "tool write key"};
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment