1 #ifndef __JSUPPORT__JMETA__
2 #define __JSUPPORT__JMETA__
33 namespace JPP {
using namespace JSUPPORT; }
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) {
106 const JUTSName buffer;
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;
358 object.SetName (key.c_str());
359 object.SetTitle(buffer.c_str());
361 return (dir->WriteTObject(&
object) > 0);
379 if (p != meta.end()) {
414 JRootFileReader<JMeta>
in(file_name);
416 while (in.hasNext()) {
418 const JMeta* p = in.next();
462 const char* buffer[number_of_items] = {
482 if (number_of_cycles != 0) {
486 file->GetObject(key, __p);
492 for (
int i = 1; i != number_of_items; ++i) {
497 (*ps)[buffer[i]] = __p->GetTitle();
515 return putObject(dir, static_cast<const JMeta&>(meta));
static const char *const application_t
Definition of meta data parameters.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
static const char *const GITrelease_t
GIT release.
bool putMeta(TDirectory *dir, const std::string key, const std::string buffer)
Write meta data as ROOT TNamed object.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
bool putObject(TDirectory *dir, const TObject &object)
Write object to ROOT directory.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
#define MAKE_CSTRING(A)
Make C-string.
static equation_type< T > make_equation(const std::string &key, const T &value)
Auxiliary method to create equation type.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Jpp environment information.
then usage $script< string identifier >< detectorfile > input file(toashort file)+" "\nNote that the input files and toashort files should be one-to-one related." fi if (( $
Auxiliary class for a type holder.
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
static const char *const ROOTrelease_t
ROOT release.
static const char *const SVNrelease_t
SVN release.
#define MAKE_STRING(A)
Make string.
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
size_t get_number_of_tokens(const std::string &buffer)
Count number of white space separated tokens.
static const char *const system_t
system information
static const char *const namespace_t
name space
JLANG::JEquationFacet setequation
Type definition of stream manipulator for equational I/O.
static const char *const META_NAME
ROOT name for meta data.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
const char * getName()
Get ROOT name of given data type.
std::vector< std::string > JComment_t
Type definition of comment block.
static const char *const command_t
Linux command.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
int getNumberOfCycles(TFile *file, const TString key)
Get number of cycles of named objects with same title as given key.
static const char *const PATH
binary file paths
static const char *const META_DIRECTORY
ROOT sub-directory for meta data.