Skip to content
Snippets Groups Projects
Commit 40205328 authored by Charles Leggett's avatar Charles Leggett Committed by Vakhtang Tsulaia
Browse files

AthExHive: use initializer list syntax for Properties

parent 7f2e24c5
No related branches found
No related tags found
1 merge request!20779WIP: Migrate DataQualityTools to ToolHandles
Showing
with 57 additions and 104 deletions
......@@ -25,11 +25,7 @@ boost::regex ref(r_ef);
ASCIICondDbSvc::ASCIICondDbSvc( const std::string& name, ISvcLocator* svcLoc ):
base_class(name,svcLoc)
{
declareProperty("CondFile",m_file="");
}
{}
//---------------------------------------------------------------------------
......@@ -120,7 +116,7 @@ ASCIICondDbSvc::readDbFile(const std::string& fname) {
}
ifs.close();
} else {
error() << "unable to open file " << m_file << endmsg;
error() << "unable to open file " << (std::string) m_file << endmsg;
sc = StatusCode::FAILURE;
}
......@@ -193,8 +189,13 @@ ASCIICondDbSvc::parse(EventIDRange& t, const std::string& s) {
if (m.size() != 5) { return false; }
t = EventIDRange( EventIDBase(std::stoi(m[1]),std::stoi(m[2])),
EventIDBase(std::stoi(m[3]), std::stoi(m[4])));
EventIDBase start(std::stoi(m[1]), std::stoi(m[2]));
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;
......@@ -210,9 +211,14 @@ ASCIICondDbSvc::parse(IOVEntryT<IASCIICondDbSvc::dbData_t>& ie, const std::strin
if (m.size() != 6) { return false; }
ie.setRange( EventIDRange( EventIDBase(std::stoi(m[1]), std::stoi(m[2])),
EventIDBase(std::stoi(m[3]), std::stoi(m[4])) ) );
EventIDBase start(std::stoi(m[1]), std::stoi(m[2]));
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]) );
ie.setPtr(v);
......@@ -237,6 +243,8 @@ ASCIICondDbSvc::getRange(const std::string& dbKey , const EventContext& ctx,
}
for (auto e : itr->second) {
debug() << "compare " << e.range() << " with " << ctx.eventID()
<< endmsg;
if (e.range().isInRange(EventIDBase(ctx.eventID()))) {
rng = e.range();
val = *(e.objPtr());
......
......@@ -43,7 +43,8 @@ private:
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;
registry_t m_registry;
......
......@@ -17,15 +17,7 @@
AlgC::AlgC( const std::string& name,
ISvcLocator* pSvcLocator ) :
::AthAlgorithm( name, pSvcLocator )
// ,
// m_rdh1("a2"),
// m_rch("X1")
{
// declareProperty("Key_R1",m_rdh1);
// declareProperty("Key_CH", m_rch);
}
{}
//---------------------------------------------------------------------------
......
......@@ -17,23 +17,8 @@
AlgT::AlgT( const std::string& name,
ISvcLocator* 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);
}
::AthAlgorithm( name, pSvcLocator )
{}
//---------------------------------------------------------------------------
......
......@@ -32,12 +32,14 @@ public:
private:
SG::WriteHandleKey<HiveDataObj> m_wrh1;
SG::ReadHandleKey<HiveDataObj> m_rdh1;
SG::ReadHandleKey<EventInfo> m_evt;
SG::ReadHandleKey<EventInfo> m_evt{this, "EvtInfo", "McEventInfo", "EventInfo name"};
SG::ReadHandleKey<HiveDataObj> m_rdh1{this,"Key_R1","","read key"};
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
......@@ -14,9 +14,6 @@ HiveAlgBase::HiveAlgBase( const std::string& name,
::AthAlgorithm( name, pSvcLocator ),
m_hes("HiveExSvc",name)
{
declareProperty("Time",m_time=0);
}
HiveAlgBase::~HiveAlgBase() {}
......
......@@ -40,7 +40,7 @@ protected:
private:
int m_time;
Gaudi::Property<int> m_time{this, "Time", 0, "default alg sleep time"};
};
......
......@@ -10,15 +10,8 @@
HiveAlgL1::HiveAlgL1( const std::string& name,
ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ),
m_rdh1("a2"),
m_wrh1("l1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_W1",m_wrh1);
}
::HiveAlgBase( name, pSvcLocator )
{}
HiveAlgL1::~HiveAlgL1() {}
......
......@@ -30,8 +30,8 @@ public:
private:
SG::ReadHandleKey<HiveDataObj> m_rdh1;
SG::WriteHandleKey<HiveDataObj> m_wrh1;
SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "a2", "read key"};
SG::WriteHandleKey<HiveDataObj> m_wrh1{this, "Key_W1", "l1", "write key"};
};
#endif
......@@ -10,12 +10,10 @@
HiveAlgL2::HiveAlgL2( const std::string& name,
ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ),
m_rdh1("l1"),
m_udh1("l1")
::HiveAlgBase( name, pSvcLocator )
,m_udh1("l1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_U1",m_udh1);
}
......
......@@ -31,8 +31,10 @@ public:
private:
SG::ReadHandleKey<HiveDataObj> m_rdh1;
SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "l1", "read key"};
SG::UpdateHandleKey<HiveDataObj> m_udh1;
};
#endif
......@@ -10,8 +10,8 @@
HiveAlgL3::HiveAlgL3( const std::string& name,
ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ),
m_udh1("l1")
::HiveAlgBase( name, pSvcLocator )
,m_udh1("l1")
{
declareProperty("Key_U1",m_udh1);
......
......@@ -9,16 +9,8 @@
HiveAlgM::HiveAlgM( const std::string& name,
ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator ),
m_rdh1("a2"),
m_rdh2("l1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_R2",m_rdh2);
declareProperty("Offset",m_off);
}
::HiveAlgBase( name, pSvcLocator )
{}
HiveAlgM::~HiveAlgM() {}
......@@ -58,7 +50,7 @@ StatusCode HiveAlgM::execute() {
ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() );
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 {
ATH_MSG_INFO( "loop is ok");
}
......
......@@ -29,9 +29,9 @@ public:
private:
int m_off { 1 };
SG::ReadHandleKey<HiveDataObj> m_rdh1;
SG::ReadHandleKey<HiveDataObj> m_rdh2;
Gaudi::Property<int> m_off {this, "Offset", 1, "offset"};
SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "a2", "read key 1"};
SG::ReadHandleKey<HiveDataObj> m_rdh2{this, "Key_R2", "l1", "read key 2"};
};
#endif
......@@ -19,14 +19,7 @@ DECLARE_COMPONENT(HiveAlgR)
HiveAlgR::HiveAlgR( const std::string& name,
ISvcLocator* pSvcLocator ) :
::AthReentrantAlgorithm( name, pSvcLocator )
,m_evt("McEventInfo")
,m_wrh1("ar1")
{
declareProperty("Key_W1",m_wrh1);
declareProperty("EvtInfo",m_evt);
}
{}
HiveAlgR::~HiveAlgR() {}
......
......@@ -29,9 +29,9 @@ public:
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
......@@ -11,11 +11,7 @@
HiveAlgV::HiveAlgV( const std::string& name,
ISvcLocator* pSvcLocator ) :
::HiveAlgBase( name, pSvcLocator )
{
declareProperty("WriteBeforeRead",m_writeFirst=true);
}
{}
HiveAlgV::~HiveAlgV() {}
......
......@@ -30,7 +30,8 @@ public:
private:
bool m_writeFirst { true };
Gaudi::Property<bool> m_writeFirst {this, "WriteBeforeRead", true,
"do write before the read" };
SG::ReadHandleKeyArray<HiveDataObj> m_rhv {
this, "Key_RV", {"a1","a2","d1","e1","c1"},
......
......@@ -14,15 +14,8 @@
HiveTool::HiveTool(const std::string& type, const std::string& name,
const IInterface* parent)
: base_class( type, name, parent ),
m_rdh1("x1"),
m_wrh1("X1")
{
declareProperty("Key_R1",m_rdh1);
declareProperty("Key_W1",m_wrh1);
}
: base_class( type, name, parent )
{}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
......
......@@ -25,8 +25,8 @@ public:
private:
SG::ReadHandleKey<HiveDataObj> m_rdh1;
SG::WriteHandleKey<HiveDataObj> m_wrh1;
SG::ReadHandleKey<HiveDataObj> m_rdh1{this, "Key_R1", "x1", "tool read key"};
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