KaliVeda
Toolkit for HIC analysis
KVDBParameterSet.h
1 /***************************************************************************
2 $Id: KVDBParameterSet.h,v 1.13 2007/04/18 14:28:49 ebonnet Exp $
3  KVDBParameterSet.h - description
4  -------------------
5  begin : wed feb 12 2003
6  copyright : (C) 2003 by Alexis Mignon
7  email : mignon@ganil.fr
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 #ifndef KVDB_PARAMETER_SET_H
19 #define KVDB_PARAMETER_SET_H
20 
21 #include <cassert>
22 #include "KVDBRecord.h"
23 #include "TString.h"
24 #include "KVDBKey.h"
25 #include "KVNameValueList.h"
26 
35 protected:
38 
39 public:
41  KVDBParameterSet(const Char_t* name, const Char_t* type,
42  UShort_t pnum);
43  virtual ~ KVDBParameterSet();
44 
46  {
47  return fParamNumber;
48  }
49  Double_t GetParameter(UShort_t i = 0) const;
50  Double_t GetParameter(TString name) const;
51  TString GetStringParameter(const TString& name) const;
52  const Char_t* GetParamName(UShort_t i = 0) const;
53  Bool_t HasParameter(const Char_t* name) const
54  {
56  }
58  {
59  return fParameters;
60  }
61  KVRList* GetRuns() const;
62  void SetParameter(UShort_t i, Double_t val);
63  void SetParameter(Double_t val);
64  void SetParameter(TString name, Double_t val);
65  void SetParameter(const TString& name, const char* value);
66  void SetParameters(Double_t val, ...);
67  void SetParameters(const std::vector<Double_t>* const pars);
68  void SetParamName(UShort_t i, const Char_t* name);
69  void SetParamNames(const Char_t* name, ...);
70  void Print(Option_t* option = "") const;
71 
72  ClassDef(KVDBParameterSet, 1) // Set of parameters for calibration
73 };
74 
76 {
77  return fParameters.GetDoubleValue(i);
78 }
79 
81 {
82  return fParameters.GetNameAt(i);
83 }
84 
86 {
87  return GetKey("Runs")->GetLinks();
88 }
90 {
91  fParameters.GetParameter(i)->Set(val);
92 }
93 
95 {
96  SetParameter(0, val);
97 }
98 
99 
100 #endif
int Int_t
bool Bool_t
unsigned short UShort_t
char Char_t
double Double_t
const char Option_t
#define ClassDef(name, id)
char name[80]
virtual KVRList * GetLinks() const
return the list of cross-referenced objects
Definition: KVDBKey.h:65
To store calibration parameters in a database ,.
Bool_t HasParameter(const Char_t *name) const
TString GetStringParameter(const TString &name) const
const Char_t * GetParamName(UShort_t i=0) const
void SetParamName(UShort_t i, const Char_t *name)
Double_t GetParameter(UShort_t i=0) const
void Print(Option_t *option="") const
void SetParamNames(const Char_t *name,...)
void SetParameters(Double_t val,...)
KVNameValueList fParameters
parameters
Int_t fParamNumber
number of parameters
Int_t GetParamNumber() const
virtual ~ KVDBParameterSet()
void SetParameter(UShort_t i, Double_t val)
KVRList * GetRuns() const
const KVNameValueList & GetParameters() const
Record folder for the database.
Definition: KVDBRecord.h:43
virtual KVDBKey * GetKey(const Char_t *key) const
Definition: KVDBRecord.cpp:290
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
Double_t GetDoubleValue(const Char_t *name) const
const Char_t * GetNameAt(Int_t idx) const
Bool_t HasParameter(const Char_t *name) const
void Set(const char *, const char *)
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37