10#include "GaudiKernel/IClassIDSvc.h"
17 ISvcLocator* pSvcLocator) :
30 if (StatusCode::SUCCESS!=
p_clidsvc.retrieve()) {
32 return StatusCode::FAILURE;
36 if (StatusCode::SUCCESS!=
p_regsvc.retrieve()) {
38 return StatusCode::FAILURE;
45 ATH_MSG_ERROR (
"Unable to find AthenaOutputStreamTool with name " <<
47 return StatusCode::FAILURE;
49 return StatusCode::SUCCESS;
55 return StatusCode::SUCCESS;
59 ATH_MSG_INFO (
"Finalize: preparing to write conditions objects ");
64 return( StatusCode::FAILURE);
67 std::vector<std::string>
types;
68 std::vector<std::string> keys;
69 std::vector<std::string> folders;
70 std::vector<std::string>
tags;
71 for (
unsigned int iobj=0;iobj<
m_objectList.size();++iobj) {
73 std::string::size_type ihash=
m_objectList[iobj].find_first_of(
"#");
74 if (ihash==std::string::npos) {
79 if (StatusCode::SUCCESS==
p_clidsvc->getIDOfTypeName(
84 keys.push_back(proxy->name());
85 folders.push_back(proxy->name());
103 std::string::size_type ihash2=
m_objectList[iobj].find_first_of(
"#",ihash+1);
104 if (ihash2==std::string::npos) {
105 std::string key=
m_objectList[iobj].substr(ihash+1,std::string::npos);
107 folders.push_back(std::move(key));
109 keys.push_back(
m_objectList[iobj].substr(ihash+1,ihash2-ihash-1));
121 int nObjects=
types.size();
124 " objects to write out:");
126 if (nObjects==0)
return StatusCode::SUCCESS;
127 for (
int i=0;i<nObjects;i++) {
134 if (StatusCode::SUCCESS==
p_clidsvc->getIDOfTypeName(
types[i],clid))
135 proxy=
detStore()->proxy(clid,keys[i]);
137 ATH_MSG_ERROR (
"Could not find proxy for object with key " <<
138 keys[i] <<
" - abort write");
139 return StatusCode::FAILURE;
145 if (
sc.isFailure()) {
147 return StatusCode::FAILURE;
151 if (
sc.isFailure()) {
153 return StatusCode::FAILURE;
155 ATH_MSG_INFO (
"Written " << nObjects <<
" objects to output stream");
158 msg() << MSG::INFO <<
159 "Register objects in IOV database, interval of validity ";
161 msg() <<
"[time] from [" <<
164 msg() <<
"[run,LB] from [" <<
169 for (
int iobj=0;iobj<nObjects;++iobj) {
170 msg() << MSG::INFO <<
"Register object " <<
types[iobj] <<
"#" <<
171 keys[iobj] <<
" in IOV database folder " << folders[iobj] <<
" ";
172 if (
tags[iobj]==
"") {
173 msg() << MSG::INFO <<
"without tagging" <<
endmsg;
184 if (
sc==StatusCode::SUCCESS) {
190 ATH_MSG_INFO (
"Registered " << nreg <<
" objects in IOV database");
192 ATH_MSG_INFO (
"Objects NOT registered in IOV database");
194 return StatusCode::SUCCESS;
204 return static_cast<uint64_t
>(timesec)*1000000000;
uint32_t CLID
The Class ID type.
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
static const std::vector< std::string > types
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
static constexpr uint64_t MAXTIMESTAMP
static constexpr uint32_t MAXEVENT
uint64_t timeToNano(unsigned long int timesec) const
UnsignedLongProperty m_par_time2
ServiceHandle< IClassIDSvc > p_clidsvc
Gaudi::Property< bool > m_par_writeIOV
ServiceHandle< IIOVRegistrationSvc > p_regsvc
OutputConditionsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< unsigned int > m_par_lumib2
Gaudi::Property< std::vector< std::string > > m_par_iovtags
ToolHandle< IAthenaOutputStreamTool > IAthenaOutputStreamTool_t
Gaudi::Property< bool > m_par_timestamp
IAthenaOutputStreamTool_t m_streamer
Gaudi::Property< std::string > m_streamName
Gaudi::Property< std::vector< std::string > > m_objectList
Gaudi::Property< unsigned int > m_par_run2
UnsignedLongProperty m_par_time1
Gaudi::Property< unsigned int > m_par_lumib1
Gaudi::Property< unsigned int > m_par_run1
std::vector< std::string > tags