Hall C ROOT/C++ Analyzer (hcana)
THcParmList.h
Go to the documentation of this file.
1 #ifndef ROOT_THcParmList
2 #define ROOT_THcParmList
3 
5 //
6 // THcParmList
7 //
9 
10 #include "THaVarList.h"
11 #include "Textvars.h"
12 
13 #ifdef WITH_CCDB
14 #ifdef __CINT__
15 struct pthread_cond_t;
16 struct pthread_mutex_t;
17 #endif
18 #include <CCDB/Calibration.h>
19 #include <CCDB/SQLiteCalibration.h>
20 using namespace ccdb;
21 #endif
22 
23 using namespace std;
24 
25 
26 
27 class THcParmList : public THaVarList {
28 
29 public:
30 
31  THcParmList();
32  virtual ~THcParmList() { Clear(); delete TextList; }
33 
34  virtual void Load( const char *fname, Int_t RunNumber=0);
35 
36  virtual void PrintFull(Option_t *opt="") const;
37 
38  const char* GetString(const std::string& name) const {
39  return(TextList->Get(name, 0));
40  }
41 
42  Int_t AddString(const std::string& name, const std::string& value) {
43  return(TextList->Add(name, value));
44  }
45  void RemoveString(const std::string& name) {
46  TextList->Remove(name);
47  }
48 
49  Int_t LoadParmValues(const DBRequest* list, const char* prefix=""); // assign values to the variables in list
50 
51  Int_t GetArray(const char* attr, Int_t* array, Int_t size);
52  Int_t GetArray(const char* attr, Double_t* array, Int_t size);
53 
54 #ifdef WITH_CCDB
55  Int_t OpenCCDB(Int_t runnum);
56  Int_t OpenCCDB(Int_t runnum, const char* connection_string);
57  Int_t CloseCCDB();
58  Int_t LoadCCDBDirectory(const char* directory,
59  const char* prefix);
60 #endif
61 
62 private:
63 
64  Podd::Textvars* TextList;
65 
66 #ifdef WITH_CCDB
67  SQLiteCalibration* CCDB_obj;
68 #endif
69 
70  template<class T>
71  Int_t ReadArray(const char* attrC, T* array, Int_t size);
72 
73 protected:
74 
75  ClassDef(THcParmList,0) // List of analyzer global parameters
76 
77 };
78 #endif
79 
const char Option_t
void RemoveString(const std::string &name)
Definition: THcParmList.h:45
int Int_t
STL namespace.
#define ClassDef(name, id)
Podd::Textvars * TextList
Definition: THcParmList.h:64
virtual ~THcParmList()
Definition: THcParmList.h:32
Int_t AddString(const std::string &name, const std::string &value)
Definition: THcParmList.h:42
tuple list
Definition: SConscript.py:9
double Double_t
const char * GetString(const std::string &name) const
Definition: THcParmList.h:38
A list parameters and their values.
Definition: THcParmList.h:27