Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
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__
15struct pthread_cond_t;
16struct pthread_mutex_t;
17#endif
18#include <CCDB/Calibration.h>
19#include <CCDB/SQLiteCalibration.h>
20using namespace ccdb;
21#endif
22
23using namespace std;
24
25
26
27class THcParmList : public THaVarList {
28
29public:
30
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
62private:
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
73protected:
74
75 ClassDef(THcParmList,0) // List of analyzer global parameters
76
77};
78#endif
79
int Int_t
double Double_t
const char Option_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
void Clear(Option_t *option="") override
A list parameters and their values.
Definition THcParmList.h:27
Int_t ReadArray(const char *attrC, T *array, Int_t size)
Dictionary of string parameters.
Podd::Textvars * TextList
Definition THcParmList.h:64
Int_t GetArray(const char *attr, Int_t *array, Int_t size)
Read in a set of Int_t's in to a C-style array.
const char * GetString(const std::string &name) const
Definition THcParmList.h:38
virtual void Load(const char *fname, Int_t RunNumber=0)
Load the parameter cache by reading a CTP style parameter file.
Int_t AddString(const std::string &name, const std::string &value)
Definition THcParmList.h:42
void RemoveString(const std::string &name)
Definition THcParmList.h:45
virtual void PrintFull(Option_t *opt="") const
Print all the numeric parameter desciptions and value and text parameters.
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
virtual ~THcParmList()
Definition THcParmList.h:32
STL namespace.