CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
Parameter.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Parameter.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3//-----------------------Class Parameter------------------------------------//
4// //
5// Joe Boudreau //
6// Petar Maksimovic //
7// November 1999 //
8// //
9// This class is a simple low-level double precision number, together with //
10// some limiting values. It is designed essentially as an ingredient for //
11// building function objects. //
12// //
13// Parameters can be connnected to one another. If a parameter is //
14// connected, it takes is value (and limits) from the parameter to which //
15// it is connected. //
16// When disconnected, it captures the values of the connected field before //
17// dropping the connection. An attempt to alter the values of the field //
18// while the Parameter is connected to another parameter will result in //
19// an obnoxious warning mesage. //
20// //
21//--------------------------------------------------------------------------//
22#ifndef Parameter_h
23#define Parameter_h 1
24
25#include <string>
26#include <iostream>
28
29namespace Genfun {
30
35 class Parameter:public AbsParameter {
36
38
39 public:
40
41 // Constructor.
42 Parameter(std::string name,
43 double value,
44 double lowerLimit=-1e100,
45 double upperLimit= 1e100);
46
47 // Copy constructor
49
50 // Destructor
51 virtual ~Parameter();
52
53 // Assignment
55
56 // Accessor for the Parameter name
57 const std::string & getName() const;
58
59 // Accessor for value
60 virtual double getValue() const;
61
62 // Accessor for Lower Limit
63 double getLowerLimit() const;
64
65 // Accessor for Upper Limit
66 double getUpperLimit() const;
67
68 // Set Value
69 void setValue(double value);
70
71 // Set Lower Limit
73
74 // Set Upper Limit
76
77 // Take values + limits from some other parameter.
79
80 // Extra lingual type information:
81 virtual Parameter *parameter() {return this;}
82 virtual const Parameter *parameter() const {return this;}
83
84 private:
85
86 std::string _name ; // name
87 double _value; // value
88 double _lowerLimit; // lower limit
89 double _upperLimit; // upper limit
90 const AbsParameter *_sourceParameter; // connection
91
92 };
93std::ostream & operator << ( std::ostream & o, const Parameter &p);
94} // namespace Genfun
95
96#endif
#define PARAMETER_OBJECT_DEF(classname)
const Parameter & operator=(const Parameter &right)
const std::string & getName() const
void setLowerLimit(double lowerLimit)
void connectFrom(const AbsParameter *source)
virtual ~Parameter()
virtual Parameter * parameter()
Definition Parameter.hh:81
double getLowerLimit() const
virtual double getValue() const
Parameter(const Parameter &right)
void setUpperLimit(double upperLimit)
double getUpperLimit() const
Parameter(std::string name, double value, double lowerLimit=-1e100, double upperLimit=1e100)
virtual const Parameter * parameter() const
Definition Parameter.hh:82
void setValue(double value)
Definition Abs.hh:14
std::ostream & operator<<(std::ostream &os, const Argument &a)
Definition Argument.hh:81