CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CDFRunInfo.h
Go to the documentation of this file.
1 #ifndef CDFRunInfo_hh_included
2 #define CDFRunInfo_hh_included 1
3 
4 #include <map>
5 #include <string>
6 #include <TFile.h>
7 
15 class CDFRunInfo {
16 public:
17  CDFRunInfo();
18  CDFRunInfo(TFile* fromFile);
19 
21  const char* get(const char* key) const;
23  int getInt(const char* key) const;
25  double getDouble(const char* key) const;
27  inline int getSize() const { return m_mapData.size(); }
29  int getKeys(const char** buffer, int nbufs);
31  bool hasKey(const char* key) const;
32 
34  void setInfo(const char* key, const char* value);
36  void print() const;
37 
38  void store(TFile* toFile);
39 private:
40  bool load(TFile* fromFile);
41  static const char* RootVariableName;
42  std::map<std::string,std::string> m_mapData;
43 };
44 
45 #endif // CDFRunInfo_hh_included
Per-run or per-file information.
Definition: CDFRunInfo.h:15
bool hasKey(const char *key) const
test for thr presence of given key
Definition: CDFRunInfo.cc:41
std::map< std::string, std::string > m_mapData
Definition: CDFRunInfo.h:42
void setInfo(const char *key, const char *value)
add some information to the run info
Definition: CDFRunInfo.cc:46
void store(TFile *toFile)
Definition: CDFRunInfo.cc:66
void print() const
print all information to the terminal
Definition: CDFRunInfo.cc:76
double getDouble(const char *key) const
Get a run info item by name and convert it to a double.
Definition: CDFRunInfo.cc:27
static const char * RootVariableName
Definition: CDFRunInfo.h:41
int getSize() const
get the number of items
Definition: CDFRunInfo.h:27
int getKeys(const char **buffer, int nbufs)
fill the given array with key name pointers
Definition: CDFRunInfo.cc:33
list key
Definition: combine.py:13
int getInt(const char *key) const
Get a run info item by name and convert it to an integer.
Definition: CDFRunInfo.cc:21
bool load(TFile *fromFile)
Definition: CDFRunInfo.cc:50