KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDBParameterSet.h
Go to the documentation of this file.
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 
34 protected:
37 
38 public:
40  KVDBParameterSet(const Char_t* name, const Char_t* type,
41  UShort_t pnum);
42  virtual ~ KVDBParameterSet();
43 
45  {
46  return fParamNumber;
47  }
48  Double_t GetParameter(UShort_t i = 0) const;
49  Double_t GetParameter(TString name) const;
50  TString GetStringParameter(const TString& name) const;
51  const Char_t* GetParamName(UShort_t i = 0) const;
52  Bool_t HasParameter(const Char_t* name) const
53  {
54  return fParameters.HasParameter(name);
55  }
57  {
58  return fParameters;
59  }
60  KVRList* GetRuns() const;
61  void SetParameter(UShort_t i, Double_t val);
62  void SetParameter(Double_t val);
63  void SetParameter(TString name, Double_t val);
64  void SetParameter(const TString& name, const char* value);
65  void SetParameters(Double_t val, ...);
66  void SetParameters(const std::vector<Double_t>* const pars);
67  void SetParamName(UShort_t i, const Char_t* name);
68  void SetParamNames(const Char_t* name, ...);
69  void Print(Option_t* option = "") const;
70 
71  ClassDef(KVDBParameterSet, 1) // Set of parameters for calibration
72 };
73 
75 {
76  return fParameters.GetDoubleValue(i);
77 }
78 
80 {
81  return fParameters.GetNameAt(i);
82 }
83 
85 {
86  return GetKey("Runs")->GetLinks();
87 }
89 {
90  fParameters.GetParameter(i)->Set(val);
91 }
92 
94 {
95  SetParameter(0, val);
96 }
97 
98 
99 #endif
int Int_t
unsigned short UShort_t
char Char_t
bool Bool_t
double Double_t
const char Option_t
#define ClassDef(name, id)
virtual KVRList * GetLinks() const
return the list of cross-referenced objects
Definition: KVDBKey.h:64
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:42
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:36