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:
36  Int_t fParamNumber=0; //number of parameters
38 
39 public:
41  KVDBParameterSet(const TString& name, const TString& type, 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(const 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 TString& name) const
53  {
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(const TString& name, Double_t val);
64  void SetParameter(const TString& name, const TString& value);
65 
66  void SetParameters(const std::vector<Double_t>& pars);
67 
68  void SetParamName(UShort_t i, const TString& name);
69 
70  void SetParamNames(const std::vector<TString>& name_list);
71 
72  void Print(Option_t* option = "") const override;
73 
74  ClassDefOverride(KVDBParameterSet, 1) // Set of parameters for calibration
75 };
76 
78 {
79  return fParameters.GetDoubleValue(i);
80 }
81 
83 {
84  return fParameters.GetNameAt(i);
85 }
86 
88 {
89  return GetKey("Runs")->GetLinks();
90 }
92 {
93  fParameters.GetParameter(i)->Set(val);
94 }
95 
97 {
98  SetParameter(0, val);
99 }
100 
101 
102 #endif
int Int_t
bool Bool_t
unsigned short UShort_t
char Char_t
double Double_t
const char Option_t
#define ClassDefOverride(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 ,.
TString GetStringParameter(const TString &name) const
const Char_t * GetParamName(UShort_t i=0) const
void SetParameters(const std::vector< Double_t > &pars)
void SetParamNames(const std::vector< TString > &name_list)
Set names of numerical parameters using given list.
Double_t GetParameter(UShort_t i=0) const
Bool_t HasParameter(const TString &name) const
void SetParamName(UShort_t i, const TString &name)
void Print(Option_t *option="") const override
KVNameValueList fParameters
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