#include <ASCIICondDbSvc.h>
|
| 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"} |
| registry_t | m_registry |
| std::mutex | m_lock |
Definition at line 21 of file ASCIICondDbSvc.h.
◆ registry_t
◆ ASCIICondDbSvc()
| ASCIICondDbSvc::ASCIICondDbSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | svc ) |
◆ ~ASCIICondDbSvc()
| ASCIICondDbSvc::~ASCIICondDbSvc |
( |
| ) |
|
|
default |
◆ dump() [1/2]
| void ASCIICondDbSvc::dump |
( |
| ) |
const |
|
overridevirtual |
Definition at line 119 of file ASCIICondDbSvc.cxx.
119 {
120
121 std::ostringstream
ost;
123
125
126}
virtual void dump() const override
◆ dump() [2/2]
| void ASCIICondDbSvc::dump |
( |
std::ostringstream & | ost | ) |
const |
Definition at line 132 of file ASCIICondDbSvc.cxx.
132 {
133
135
136 ost <<
"ASCIICondDbSvc::dump()";
137
139
140}
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
◆ finalize()
| StatusCode ASCIICondDbSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 145 of file ASCIICondDbSvc.cxx.
145 {
146
148
149 if (msgLvl(MSG::DEBUG)) {
150 std::ostringstream
ost;
152
154 }
155
157 for (
auto ie :
e.second ) {
160 }
161 }
162
163
164 return StatusCode::SUCCESS;
165
166}
◆ getRange()
Definition at line 237 of file ASCIICondDbSvc.cxx.
238 {
239
241
242 registry_t::const_iterator itr =
m_registry.find(dbKey);
243
245 error() <<
"getRange: no dbKey " << dbKey <<
" found in registry"
247 return StatusCode::FAILURE;
248 }
249
250 for (const IOVEntryT<IASCIICondDbSvc::dbData_t>& e : itr->second) {
251 debug() <<
"compare " <<
e.range() <<
" with " << ctx.eventID()
253 if (
e.range().isInRange(EventIDBase(ctx.eventID()))) {
256 return StatusCode::SUCCESS;
257 }
258 }
259
260 error() <<
"getRange: no range for Time " << ctx.eventID()
261 <<
" found for dbKey " << dbKey <<
endmsg;
262
263 return StatusCode::FAILURE;
264}
◆ initialize()
| StatusCode ASCIICondDbSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 31 of file ASCIICondDbSvc.cxx.
31 {
32
33
35 msg().setLevel( m_outputLevel.value() );
36
37 if (!
sc.isSuccess()) {
38 warning () <<
"Base class could not be initialized" <<
endmsg;
39 return StatusCode::FAILURE;
40 }
41
44 return StatusCode::SUCCESS;
45 }
46
48 return StatusCode::FAILURE;
49 }
50
51 std::ostringstream
ost;
52 ost <<
" Printing CondDB registry";
54 ost << std::endl <<
" - id: " <<
e.first <<
" r:";
55 for (
const IOVEntryT<IASCIICondDbSvc::dbData_t>&
r :
e.second) {
56 ost <<
" " <<
r.range() <<
" :: " << *
r.objPtr();
57 }
58 }
59
61
62 return StatusCode::SUCCESS;
63
64}
Gaudi::Property< std::string > m_file
StatusCode readDbFile(const std::string &)
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ parse() [1/2]
| bool ASCIICondDbSvc::parse |
( |
EventIDRange & | t, |
|
|
const std::string & | s ) |
|
private |
Definition at line 171 of file ASCIICondDbSvc.cxx.
171 {
172
174 std::regex_match(s,m,
rr);
175
176
177
178
179
180 if (
m.size() != 5) {
return false; }
181
182
183 EventIDBase
start(std::stoi(m[1]), EventIDBase::UNDEFEVT, std::stoi(m[2]));
184 EventIDBase
end(std::stoi(m[3]), EventIDBase::UNDEFEVT, std::stoi(m[4]));
185
188
189 t = EventIDRange(start, end);
190
191 return true;
192
193}
Gaudi::Property< unsigned int > m_lbn
◆ parse() [2/2]
Definition at line 198 of file ASCIICondDbSvc.cxx.
198 {
199
201 std::regex_match(s,m,
ref);
202
203 if (
m.size() != 6) {
return false; }
204
205
206
207
208
209
210
211
212 EventIDBase
start(0, EventIDBase::UNDEFEVT,
213 std::stoi(m[2]));
214 EventIDBase
end(EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT,
215 std::stoi(m[4]));
216 start.set_lumi_block(std::stoi(m[1]));
217 end.set_lumi_block(std::stoi(m[3]));
218
219
220
221
222
223
224
225 ie.setRange(EventIDRange(start,end));
226
229
230 return true;
231
232}
const std::regex ref(r_ef)
◆ readDbFile()
| StatusCode ASCIICondDbSvc::readDbFile |
( |
const std::string & | fname | ) |
|
|
private |
Definition at line 68 of file ASCIICondDbSvc.cxx.
68 {
69
71
73
74 std::ifstream ifs (fname);
76 if(ifs.is_open()) {
77
78 IOVEntryT<IASCIICondDbSvc::dbData_t>
ie;
79
80 while( getline (ifs, line) ) {
81
82
83 size_t fh =
line.find(
"#");
84 if(fh != std::string::npos)
86 if (
line.length() == 0)
continue;
87
88 std::vector<std::string>
tokens;
89 for (
auto&& token : line | std::views::split(
' '))
if (!token.empty())
tokens.emplace_back(token.begin(), token.end());
91
92 std::string dbKey = *
it;
93
95
96 while (it !=
tokens.end()) {
99 } else {
100 error() <<
"while reading " <<
fname <<
" problem parsing " << *
it
102 sc = StatusCode::FAILURE;
103 }
105 }
106 }
107 ifs.close();
108 } else {
110 sc = StatusCode::FAILURE;
111 }
112
114
115}
bool parse(EventIDRange &t, const std::string &s)
◆ m_file
| Gaudi::Property<std::string> ASCIICondDbSvc::m_file {this, "CondFile", "", "cond db file name"} |
|
private |
Definition at line 48 of file ASCIICondDbSvc.h.
48{this, "CondFile", "", "cond db file name"};
◆ m_lbn
| Gaudi::Property<unsigned int> ASCIICondDbSvc::m_lbn {this, "LBN", 1, "explicit lumi block number"} |
|
private |
Definition at line 49 of file ASCIICondDbSvc.h.
49{this, "LBN", 1, "explicit lumi block number"};
◆ m_lock
| std::mutex ASCIICondDbSvc::m_lock |
|
mutableprivate |
◆ m_registry
The documentation for this class was generated from the following files: