Hall C ROOT/C++ Analyzer (hcana)
|
A list parameters and their values. More...
#include <THcParmList.h>
Public Member Functions | |
Int_t | AddString (const std::string &name, const std::string &value) |
Int_t | GetArray (const char *attr, Double_t *array, Int_t size) |
Read in a set of Double_t's in to a vector. | |
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 |
virtual void | Load (const char *fname, Int_t RunNumber=0) |
Load the parameter cache by reading a CTP style parameter file. | |
Int_t | LoadParmValues (const DBRequest *list, const char *prefix="") |
Retrieve parameter values from the parameter cache. | |
virtual void | PrintFull (Option_t *opt="") const |
Print all the numeric parameter desciptions and value and text parameters. | |
void | RemoveString (const std::string &name) |
THcParmList () | |
virtual | ~THcParmList () |
Public Member Functions inherited from THaVarList | |
THaVar * | Define (const char *name, const Byte_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Byte_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Byte_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Byte_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Char_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Char_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Double_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Double_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Float_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Float_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Int_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Int_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Long_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Long_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Short_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const Short_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const std::vector< Double_t > &var) |
THaVar * | Define (const char *name, const char *descript, const std::vector< Float_t > &var) |
THaVar * | Define (const char *name, const char *descript, const std::vector< Int_t > &var) |
THaVar * | Define (const char *name, const char *descript, const std::vector< UInt_t > &var) |
THaVar * | Define (const char *name, const char *descript, const UInt_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const UInt_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const ULong_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const ULong_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const UShort_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const char *descript, const UShort_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Char_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Char_t *&var) |
THaVar * | Define (const char *name, const Double_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Double_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Float_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Float_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Int_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Int_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Long_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Long_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Short_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const Short_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const std::vector< Double_t > &var) |
THaVar * | Define (const char *name, const std::vector< Float_t > &var) |
THaVar * | Define (const char *name, const std::vector< Int_t > &var) |
THaVar * | Define (const char *name, const std::vector< UInt_t > &var) |
THaVar * | Define (const char *name, const UInt_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const UInt_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const ULong_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const ULong_t *&var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const UShort_t &var, const Int_t *count=nullptr) |
THaVar * | Define (const char *name, const UShort_t *&var, const Int_t *count=nullptr) |
virtual THaVar * | DefineByRTTI (const TString &name, const TString &desc, const TString &def, const void *obj, TClass *cl, const char *errloc="DefineByRTTI") |
virtual THaVar * | DefineByType (const char *name, const char *desc, const void *loc, VarType type, const Int_t *count, const char *errloc="DefineByType") |
virtual Int_t | DefineVariables (const RVarDef *list, const TObject *obj, const char *prefix="", const char *caller="", const char *def_prefix="", const char *comment_subst="") |
virtual Int_t | DefineVariables (const VarDef *list, const char *prefix="", const char *caller="") |
virtual THaVar * | Find (const char *name) const |
virtual Int_t | RemoveName (const char *name) |
virtual Int_t | RemoveRegexp (const char *expr, Bool_t wildcard=true) |
THaVarList () | |
virtual | ~THaVarList ()=default |
Public Member Functions inherited from THashList | |
void | AddAfter (const TObject *after, TObject *obj) override |
void | AddAfter (TObjLink *after, TObject *obj) override |
void | AddAt (TObject *obj, Int_t idx) override |
void | AddBefore (const TObject *before, TObject *obj) override |
void | AddBefore (TObjLink *before, TObject *obj) override |
void | AddFirst (TObject *obj) override |
void | AddFirst (TObject *obj, Option_t *opt) override |
void | AddLast (TObject *obj) override |
void | AddLast (TObject *obj, Option_t *opt) override |
Float_t | AverageCollisions () const |
void | Clear (Option_t *option="") override |
void | Delete (Option_t *option="") override |
TObject * | FindObject (const char *name) const override |
TObject * | FindObject (const TObject *obj) const override |
const TList * | GetListForObject (const char *name) const |
const TList * | GetListForObject (const TObject *obj) const |
TClass * | IsA () const override |
void | RecursiveRemove (TObject *obj) override |
void | Rehash (Int_t newCapacity) |
TObject * | Remove (TObject *obj) override |
TObject * | Remove (TObjLink *lnk) override |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
THashList (Int_t capacity=TCollection::kInitHashTableCapacity, Int_t rehash=0) | |
THashList (TObject *parent, Int_t capacity=TCollection::kInitHashTableCapacity, Int_t rehash=0) | |
bool | UseRWLock (Bool_t enable=true) override |
virtual | ~THashList () |
Public Member Functions inherited from TList | |
void | Add (TObject *obj) override |
virtual void | Add (TObject *obj, Option_t *opt) |
void | AddAfter (const TObject *after, TObject *obj) override |
void | AddAt (TObject *obj, Int_t idx) override |
void | AddBefore (const TObject *before, TObject *obj) override |
void | AddFirst (TObject *obj) override |
void | AddLast (TObject *obj) override |
TObject * | After (const TObject *obj) const override |
TObject * | At (Int_t idx) const override |
TObject * | Before (const TObject *obj) const override |
void | Clear (Option_t *option="") override |
void | Delete (Option_t *option="") override |
TObject * | FindObject (const char *name) const override |
TObject * | FindObject (const TObject *obj) const override |
TObject * | First () const override |
virtual TObjLink * | FirstLink () const |
TObject ** | GetObjectRef (const TObject *obj) const override |
TClass * | IsA () const override |
Bool_t | IsAscending () |
TObject * | Last () const override |
virtual TObjLink * | LastLink () const |
TIterator * | MakeIterator (Bool_t dir=kIterForward) const override |
void | RecursiveRemove (TObject *obj) override |
TObject * | Remove (const TObjLinkPtr_t &lnk) |
TObject * | Remove (TObject *obj) override |
void | RemoveLast () override |
virtual void | Sort (Bool_t order=kSortAscending) |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
TList () | |
TList (TObject *) | |
virtual | ~TList () |
Public Member Functions inherited from TSeqCollection | |
void | Add (TObject *obj) override |
virtual Int_t | GetLast () const |
virtual Int_t | IndexOf (const TObject *obj) const |
TClass * | IsA () const override |
virtual Bool_t | IsSorted () const |
Int_t | LastIndex () const |
Long64_t | Merge (TCollection *list) |
virtual void | RemoveAfter (TObject *after) |
virtual TObject * | RemoveAt (Int_t idx) |
virtual void | RemoveBefore (TObject *before) |
virtual void | RemoveFirst () |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
void | UnSort () |
virtual | ~TSeqCollection () |
Public Member Functions inherited from TCollection | |
virtual void | AddAll (const TCollection *col) |
void | AddVector (TObject *obj1,...) |
Bool_t | AssertClass (TClass *cl) const |
TIter | begin () const |
void | Browse (TBrowser *b) override |
Int_t | Capacity () const |
TObject * | Clone (const char *newname="") const override |
Int_t | Compare (const TObject *obj) const override |
Bool_t | Contains (const char *name) const |
Bool_t | Contains (const TObject *obj) const |
void | Draw (Option_t *option="") override |
void | Dump () const override |
TIter | end () const |
virtual Int_t | GetEntries () const |
const char * | GetName () const override |
virtual Int_t | GetSize () const |
virtual Int_t | GrowBy (Int_t delta) const |
ULong_t | Hash () const override |
Bool_t | IsArgNull (const char *where, const TObject *obj) const |
virtual Bool_t | IsEmpty () const |
Bool_t | IsFolder () const override |
Bool_t | IsOwner () const |
Bool_t | IsSortable () const override |
R__ALWAYS_INLINE Bool_t | IsUsingRWLock () const |
void | ls (Option_t *option="") const override |
virtual TIterator * | MakeReverseIterator () const |
Bool_t | Notify () override |
TObject * | operator() (const char *name) const |
void | Paint (Option_t *option="") override |
virtual void | Print (Option_t *option, const char *wildcard, Int_t recurse=1) const |
virtual void | Print (Option_t *option, Int_t recurse) const |
virtual void | Print (Option_t *option, TPRegexp ®exp, Int_t recurse=1) const |
void | Print (Option_t *option="") const override |
void | RemoveAll () |
virtual void | RemoveAll (TCollection *col) |
void | SetCurrentCollection () |
void | SetName (const char *name) |
virtual void | SetOwner (Bool_t enable=kTRUE) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override |
Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override |
virtual | ~TCollection () |
Public Member Functions inherited from TObject | |
void | AbstractMethod (const char *method) const |
virtual void | AppendPad (Option_t *option="") |
ULong_t | CheckedHash () |
virtual const char * | ClassName () const |
virtual void | Copy (TObject &object) const |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
virtual void | DrawClass () const |
virtual TObject * | DrawClone (Option_t *option="") const |
virtual void | Error (const char *method, const char *msgfmt,...) const |
virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
virtual Option_t * | GetDrawOption () const |
virtual const char * | GetIconName () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
virtual Option_t * | GetOption () const |
virtual const char * | GetTitle () const |
virtual UInt_t | GetUniqueID () const |
virtual Bool_t | HandleTimer (TTimer *timer) |
Bool_t | HasInconsistentHash () const |
virtual void | Info (const char *method, const char *msgfmt,...) const |
virtual Bool_t | InheritsFrom (const char *classname) const |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
virtual void | Inspect () const |
void | InvertBit (UInt_t f) |
Bool_t | IsDestructed () const |
virtual Bool_t | IsEqual (const TObject *obj) const |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
void | MayNotUse (const char *method) const |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
virtual void | Pop () |
virtual Int_t | Read (const char *name) |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
virtual void | SetDrawOption (Option_t *option="") |
virtual void | SetUniqueID (UInt_t uid) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
TObject () | |
TObject (const TObject &object) | |
virtual void | UseCurrentStyle () |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
virtual | ~TObject () |
Private Member Functions | |
template<class T > | |
Int_t | ReadArray (const char *attrC, T *array, Int_t size) |
Dictionary of string parameters. | |
Private Attributes | |
Podd::Textvars * | TextList |
Additional Inherited Members | |
Public Types inherited from TList | |
typedef TListIter | Iterator_t |
Public Types inherited from TObject | |
enum | EDeprecatedStatusBits |
enum | EStatusBits |
Static Public Member Functions inherited from THashList | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TList | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TSeqCollection | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Int_t | ObjCompare (TObject *a, TObject *b) |
static void | QSort (TObject **a, Int_t first, Int_t last) |
static void | QSort (TObject **a, Int_t nBs, TObject ***b, Int_t first, Int_t last) |
static void | QSort (TObject **a, TObject **b, Int_t first, Int_t last) |
Static Public Member Functions inherited from TCollection | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static void | EmptyGarbageCollection () |
static void | GarbageCollect (TObject *obj) |
static TCollection * | GetCurrentCollection () |
static void | StartGarbageCollection () |
Static Public Member Functions inherited from TObject | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Longptr_t | GetDtorOnly () |
static Bool_t | GetObjectStat () |
static void | SetDtorOnly (void *obj) |
static void | SetObjectStat (Bool_t stat) |
Public Attributes inherited from TCollection | |
kInitCapacity | |
kInitHashTableCapacity | |
Public Attributes inherited from TObject | |
kBitMask | |
kCanDelete | |
kCannotPick | |
kHasUUID | |
kInconsistent | |
kInvalidObject | |
kIsOnHeap | |
kIsReferenced | |
kMustCleanup | |
kNoContextMenu | |
kNotDeleted | |
kObjInCanvas | |
kOverwrite | |
kSingleKey | |
kWriteDelete | |
kZombie | |
Protected Types inherited from TList | |
typedef std::shared_ptr< TObjLink > | TObjLinkPtr_t |
typedef std::weak_ptr< TObjLink > | TObjLinkWeakPtr_t |
Protected Types inherited from TCollection | |
enum | EStatusBits |
Protected Member Functions inherited from TList | |
TObjLinkPtr_t * | DoSort (TObjLinkPtr_t *head, Int_t n) |
TObjLink * | FindLink (const TObject *obj, Int_t &idx) const |
void | InsertAfter (const TObjLinkPtr_t &newlink, const TObjLinkPtr_t &prev) |
TObjLink * | LinkAt (Int_t idx) const |
Bool_t | LnkCompare (const TObjLinkPtr_t &l1, const TObjLinkPtr_t &l2) |
TObjLinkPtr_t | NewLink (TObject *obj, const TObjLinkPtr_t &prev=nullptr) |
TObjLinkPtr_t | NewLink (TObject *obj, TObjLink *prev) |
TObjLinkPtr_t | NewOptLink (TObject *obj, Option_t *opt, const TObjLinkPtr_t &prev=nullptr) |
TObjLinkPtr_t | NewOptLink (TObject *obj, Option_t *opt, TObjLink *prev) |
Protected Member Functions inherited from TSeqCollection | |
virtual void | Changed () |
TSeqCollection () | |
Protected Member Functions inherited from TCollection | |
virtual const char * | GetCollectionEntryName (TObject *entry) const |
virtual void | PrintCollectionEntry (TObject *entry, Option_t *option, Int_t recurse) const |
virtual void | PrintCollectionHeader (Option_t *option) const |
TCollection () | |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
void | MakeZombie () |
Protected Attributes inherited from THashList | |
THashTable * | fTable |
Protected Attributes inherited from TList | |
Bool_t | fAscending |
TObjLinkWeakPtr_t | fCache |
TObjLinkPtr_t | fFirst |
TObjLinkPtr_t | fLast |
Protected Attributes inherited from TSeqCollection | |
Bool_t | fSorted |
Protected Attributes inherited from TCollection | |
TString | fName |
Int_t | fSize |
kIsOwner | |
kUseRWLock | |
Protected Attributes inherited from TObject | |
kOnlyPrepStep | |
A list parameters and their values.
Parameters may be integers, real numbers or strings. Integers and floating point numbers can be one dimensional arrays. (Strings can not be arrays.) In addition to values, each parameter may have a title/description. (No titles are saved for string parameters.)
The Hall C analyzer make one instance of this class available via the global gHcParms
. The detector classes look for their configuration parameters in that list.
This class is built on THaVarList, adding a method to load the list of parameters from Hall C ENGINE style CTP parameter files and a method to retrieve a set of parameters from the list.
An instance of Podd::Textvars is created to hold the string parameters.
Definition at line 27 of file THcParmList.h.
THcParmList::THcParmList | ( | ) |
|
inlinevirtual |
Definition at line 32 of file THcParmList.h.
|
inline |
Definition at line 42 of file THcParmList.h.
Read in a set of Double_t's in to a vector.
Definition at line 636 of file THcParmList.cxx.
Read in a set of Int_t's in to a C-style array.
Definition at line 631 of file THcParmList.cxx.
|
inline |
Definition at line 38 of file THcParmList.h.
Load the parameter cache by reading a CTP style parameter file.
Most parameter files used in the ENGINE should work.
A line in the file of the form
adds the variable varname
to the parameter cache and the value after the equal sign is stored. If a list of values is given, then the values are saved as an array. Lists of values may be continued on additional lines. Lines without a =
are interpreted as such continuation lines. Text after a ";" is treated as a comment. If this comment is on a line defining a parameter, then it is saved as the title/description for the parameter.
Values may be expressions composed of numbers and previously defined parameters. These expressions are evaluated with THaFormula.
Lines of the form
or
create string parameters.
A parameter file can load other files with the include statement
The ENGINE CTP support parameter "blocks" which were marked with begin
and end
statements. These statements are ignored.
Definition at line 84 of file THcParmList.cxx.
Int_t THcParmList::LoadParmValues | ( | const DBRequest * | list, |
const char * | prefix = "" |
||
) |
Retrieve parameter values from the parameter cache.
The following example loads several parameters held in the gHcParms
parameter cache into scalar variables or arrays.
If a string is passed as the second parameter of LoadParmValues, then that string is prepended to the parameter names given in the DBRequest list. In the above example, the values for the parameters hnplanes
, hname
, harray
, and hoptional
are loaded.
If a requested parameter is not found in the parameter cache, an error is printed. If the 5th element of a DBRequest structure is true (non zero), then there will be no error if the parameter is missing.
Definition at line 522 of file THcParmList.cxx.
Print all the numeric parameter desciptions and value and text parameters.
Reimplemented from THaVarList.
Definition at line 690 of file THcParmList.cxx.
|
private |
Dictionary of string parameters.
Copy values from parameter store to array.
No resizing is done, so only 'size' elements may be stored.
Definition at line 643 of file THcParmList.cxx.
|
inline |
Definition at line 45 of file THcParmList.h.
|
private |
Definition at line 64 of file THcParmList.h.