1 #ifndef __JSUPPORT__JMETA__
2 #define __JSUPPORT__JMETA__
71 public std::map<std::string, std::string>
86 JMeta(
const int argc,
const char*
const argv[])
99 for (
int i = 1; i != argc; ++i) {
109 << buffer.sysname <<
' '
110 << buffer.nodename <<
' '
111 << buffer.release <<
' '
112 << buffer.version <<
' '
127 for (const_iterator i = this->begin(); i != this->end(); ++i) {
128 comment.push_back(i->first +
' ' + i->second);
141 static void copy(
const char*
const file_name, TFile& out);
170 istringstream is(buffer);
174 for (
JEquation equation; is >> equation; ) {
175 meta[equation.getKey()] = equation.getValue();
196 for (JMeta::const_iterator i = this->begin(); i != this->end(); ++i) {
217 if (p != meta.end()) {
218 for (const_iterator i = meta.begin(); i != meta.end(); ++i) {
220 out << p->second <<
' ' << i->second << endl;
259 file->GetObject(key, __p);
265 const TString title = __p->GetTitle();
269 const string::size_type pos = buffer.find(
';');
271 if (pos != string::npos) {
275 istringstream(buffer.substr(pos + 1)) >> cycle;
277 buffer = buffer.substr(0, pos);
279 for (
int i = 1; i < cycle; ++i) {
283 if (__p != NULL && __p->GetTitle() == title) {
318 if (number_of_cycles != 0) {
346 inline bool putMeta(TDirectory& dir,
const std::string& key,
const std::string& buffer)
348 static TNamed object;
356 object.SetName (key.c_str());
357 object.SetTitle(buffer.c_str());
359 return (p->WriteTObject(&
object) > 0);
374 if (p != meta.end()) {
427 while (in.hasNext()) {
429 const JMeta* p = in.next();
473 const char* buffer[number_of_items] = {
493 if (number_of_cycles != 0) {
497 file->GetObject(key, __p);
503 for (
int i = 1; i != number_of_items; ++i) {
508 (*ps)[buffer[i]] = __p->GetTitle();
#define MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
Jpp environment information.
Auxiliary class for fit parameter with optional limits.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
General purpose equation class.
static equation_type< T > make_equation(const std::string &key, const T &value)
Auxiliary method to create equation type.
static const char *const PATH
binary file paths
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
std::vector< std::string > JComment_t
Type definition of comment block.
size_t get_number_of_tokens(const std::string &buffer)
Count number of white space separated tokens.
JLANG::JEquationFacet setequation
Type definition of stream manipulator for equational I/O.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Support classes and methods for experiment specific I/O.
bool putObject(TDirectory &dir, const JMetaOld_t &meta)
Write old meta data to ROOT directory in new format.
static const char *const SVNrelease_t
SVN release.
void getObject(TFile *file, const TString &key, JMetaOld_t *&ps)
Read object from ROOT file.
const char * getName(const JType< JMetaOld_t > &type)
Get ROOT name of given data type.
bool putMeta(TDirectory &dir, const std::string &key, const std::string &buffer)
Write meta data as ROOT TNamed object.
static const char *const command_t
Linux command.
static const char *const META_NAME
ROOT name for meta data.
static const char *const GITrelease_t
GIT release.
static const char *const META_DIRECTORY
ROOT sub-directory for meta data.
static const char *const application_t
Definition of meta data parameters.
static const char *const namespace_t
name space
int getNumberOfCycles(TFile *file, const TString &key)
Get number of cycles of named objects with same title as given key.
static const char *const ROOTrelease_t
ROOT release.
static const char *const system_t
system information
Auxiliary class for a type holder.
Auxiliary class for operating system information.