Simple data structure for DAQ run.
More...
#include <JRuncontrolToolkit.hh>
|
static const char * | getPrefix () |
| Get file name prefix.
|
|
static JDAQRun | valueOf (const std::string &file_name) |
| Extract DAQ run parameters.
|
|
static std::string | getFilename (const std::string &path, const int unique_id, const int run) |
| Get file name of run.
|
|
Simple data structure for DAQ run.
Definition at line 131 of file JRuncontrolToolkit.hh.
◆ JDAQRun() [1/4]
KM3NETDAQ::JDAQRun::JDAQRun |
( |
| ) |
|
|
inline |
◆ JDAQRun() [2/4]
KM3NETDAQ::JDAQRun::JDAQRun |
( |
const std::string & | path, |
|
|
const int | run, |
|
|
const std::string & | extension = "root" ) |
|
inline |
Constructor .
- Parameters
-
path | directory path |
run | run number |
extension | file name extension |
Definition at line 148 of file JRuncontrolToolkit.hh.
151 {
156 }
std::string path
directory path
std::string extension
file name extension
◆ JDAQRun() [3/4]
KM3NETDAQ::JDAQRun::JDAQRun |
( |
const std::string & | path, |
|
|
const int | unique_id, |
|
|
const int | run, |
|
|
const std::string & | extension = "root" ) |
|
inline |
Constructor .
- Parameters
-
path | directory path |
unique_id | unique identifier |
run | run number |
extension | file name extension |
Definition at line 167 of file JRuncontrolToolkit.hh.
◆ JDAQRun() [4/4]
KM3NETDAQ::JDAQRun::JDAQRun |
( |
const char * | file_name | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 184 of file JRuncontrolToolkit.hh.
185 {
187 }
static JDAQRun valueOf(const std::string &file_name)
Extract DAQ run parameters.
◆ getPrefix()
static const char * KM3NETDAQ::JDAQRun::getPrefix |
( |
| ) |
|
|
inlinestatic |
Get file name prefix.
- Returns
- prefix
Definition at line 195 of file JRuncontrolToolkit.hh.
196 {
197 return "KM3NeT";
198 }
◆ valueOf()
static JDAQRun KM3NETDAQ::JDAQRun::valueOf |
( |
const std::string & | file_name | ) |
|
|
inlinestatic |
Extract DAQ run parameters.
- Parameters
-
- Returns
- DAQ run parameters
Definition at line 207 of file JRuncontrolToolkit.hh.
208 {
210
212
213 string buffer(file_name);
214
215 for (string::iterator i = buffer.begin(); i != buffer.end(); ++i) {
216 if (*i == '_') {
217 *i = ' ';
218 }
219 }
220
221 istringstream is(buffer);
222
224
226
227 if (pos == string::npos) {
228 pos =
result.path.rfind(
"/");
229 }
230
231 if (pos != string::npos) {
233 }
234
235 if (!(is >>
result.run)) {
236
239
240 is.clear();
241 }
242
244
245 if (!
result.extension.empty() &&
result.extension[0] ==
'.') {
246 result.extension.erase(0, 1);
247 }
248
250 }
251
252 THROW(JIOException,
"JDAQRun::valueOf() error parsing " << buffer);
253 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
static const char * getPrefix()
Get file name prefix.
JDAQRun()
Default constructor .
◆ toString()
std::string KM3NETDAQ::JDAQRun::toString |
( |
| ) |
const |
|
inline |
Convert DAQ run to string.
- Returns
- string
Definition at line 261 of file JRuncontrolToolkit.hh.
262 {
264
265 ostringstream os;
266
268
270
271 if (*
path.rbegin() !=
'/') {
272 os << '/';
273 }
274 }
275
277 <<
"_" << setw(8) << setfill(
'0') <<
unique_id
278 <<
"_" << setw(8) << setfill(
'0') <<
run
280
281 return os.str();
282 }
◆ getFilename()
static std::string KM3NETDAQ::JDAQRun::getFilename |
( |
const std::string & | path, |
|
|
const int | unique_id, |
|
|
const int | run ) |
|
inlinestatic |
Get file name of run.
- Parameters
-
path | directory path |
unique_id | unique identifier |
run | run number |
- Returns
- file name
Definition at line 293 of file JRuncontrolToolkit.hh.
◆ path
std::string KM3NETDAQ::JDAQRun::path |
◆ unique_id
int KM3NETDAQ::JDAQRun::unique_id |
◆ run
int KM3NETDAQ::JDAQRun::run |
◆ extension
std::string KM3NETDAQ::JDAQRun::extension |
The documentation for this struct was generated from the following file: