#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 122 of file ASCIICondDbSvc.cxx.
122 {
123
124 std::ostringstream
ost;
126
128
129}
virtual void dump() const override
◆ dump() [2/2]
| void ASCIICondDbSvc::dump |
( |
std::ostringstream & | ost | ) |
const |
Definition at line 135 of file ASCIICondDbSvc.cxx.
135 {
136
137 std::lock_guard<std::mutex> lock(
m_lock);
138
139 ost <<
"ASCIICondDbSvc::dump()";
140
142
143}
◆ finalize()
| StatusCode ASCIICondDbSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 148 of file ASCIICondDbSvc.cxx.
148 {
149
151
152 if (msgLvl(MSG::DEBUG)) {
153 std::ostringstream
ost;
155
157 }
158
160 for (
auto ie :
e.second ) {
163 }
164 }
165
166
167 return StatusCode::SUCCESS;
168
169}
◆ getRange()
| StatusCode ASCIICondDbSvc::getRange |
( |
const std::string & | dbKey, |
|
|
const EventContext & | ctx, |
|
|
EventIDRange & | rng, |
|
|
IASCIICondDbSvc::dbData_t & | val ) const |
|
overridevirtual |
Definition at line 240 of file ASCIICondDbSvc.cxx.
241 {
242
243 std::lock_guard<std::mutex> lock(
m_lock);
244
245 registry_t::const_iterator itr =
m_registry.find(dbKey);
246
248 error() <<
"getRange: no dbKey " << dbKey <<
" found in registry"
250 return StatusCode::FAILURE;
251 }
252
253 for (const IOVEntryT<IASCIICondDbSvc::dbData_t>& e : itr->second) {
254 debug() <<
"compare " <<
e.range() <<
" with " << ctx.eventID()
256 if (
e.range().isInRange(EventIDBase(ctx.eventID()))) {
259 return StatusCode::SUCCESS;
260 }
261 }
262
263 error() <<
"getRange: no range for Time " << ctx.eventID()
264 <<
" found for dbKey " << dbKey <<
endmsg;
265
266 return StatusCode::FAILURE;
267}
◆ initialize()
| StatusCode ASCIICondDbSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 32 of file ASCIICondDbSvc.cxx.
32 {
33
34
36 msg().setLevel( m_outputLevel.value() );
37
38 if (!
sc.isSuccess()) {
39 warning () <<
"Base class could not be initialized" <<
endmsg;
40 return StatusCode::FAILURE;
41 }
42
45 return StatusCode::SUCCESS;
46 }
47
49 return StatusCode::FAILURE;
50 }
51
52 std::ostringstream
ost;
53 ost <<
" Printing CondDB registry";
55 ost << std::endl <<
" - id: " <<
e.first <<
" r:";
56 for (
const IOVEntryT<IASCIICondDbSvc::dbData_t>&
r :
e.second) {
57 ost <<
" " <<
r.range() <<
" :: " << *
r.objPtr();
58 }
59 }
60
62
63 return StatusCode::SUCCESS;
64
65}
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 174 of file ASCIICondDbSvc.cxx.
174 {
175
177 boost::regex_match(s,m,
rr);
178
179
180
181
182
183 if (
m.size() != 5) {
return false; }
184
185
186 EventIDBase
start(std::stoi(m[1]), EventIDBase::UNDEFEVT, std::stoi(m[2]));
187 EventIDBase
end(std::stoi(m[3]), EventIDBase::UNDEFEVT, std::stoi(m[4]));
188
191
192 t = EventIDRange(start, end);
193
194 return true;
195
196}
const boost::regex rr(r_r)
Gaudi::Property< unsigned int > m_lbn
◆ parse() [2/2]
Definition at line 201 of file ASCIICondDbSvc.cxx.
201 {
202
204 boost::regex_match(s,m,
ref);
205
206 if (
m.size() != 6) {
return false; }
207
208
209
210
211
212
213
214
215 EventIDBase
start(0, EventIDBase::UNDEFEVT,
216 std::stoi(m[2]));
217 EventIDBase
end(EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT,
218 std::stoi(m[4]));
219 start.set_lumi_block(std::stoi(m[1]));
220 end.set_lumi_block(std::stoi(m[3]));
221
222
223
224
225
226
227
228 ie.setRange(EventIDRange(start,end));
229
232
233 return true;
234
235}
const boost::regex ref(r_ef)
◆ readDbFile()
| StatusCode ASCIICondDbSvc::readDbFile |
( |
const std::string & | fname | ) |
|
|
private |
Definition at line 69 of file ASCIICondDbSvc.cxx.
69 {
70
72
74
75 std::ifstream ifs (fname);
77 if(ifs.is_open()) {
78
79 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
80 boost::char_separator<char>
sep(
" ");
81
82 IOVEntryT<IASCIICondDbSvc::dbData_t>
ie;
83
84 while( getline (ifs, line) ) {
85
86
87 size_t fh =
line.find(
"#");
88 if(fh != std::string::npos)
90 if (
line.length() == 0)
continue;
91
92 tokenizer
tokens(line, sep);
94
95 std::string dbKey = *
it;
96
98
99 while (it !=
tokens.end()) {
102 } else {
103 error() <<
"while reading " <<
fname <<
" problem parsing " << *
it
105 sc = StatusCode::FAILURE;
106 }
108 }
109 }
110 ifs.close();
111 } else {
113 sc = StatusCode::FAILURE;
114 }
115
117
118}
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: