CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
GenericFunctions
GenericFunctions/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>
27
#include "
CLHEP/GenericFunctions/AbsParameter.hh
"
28
29
namespace
Genfun {
30
35
class
Parameter:
public
AbsParameter {
36
37
PARAMETER_OBJECT_DEF
(
Parameter
)
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
48
Parameter
(const
Parameter
& right);
49
50
// Destructor
51
virtual ~
Parameter
();
52
53
// Assignment
54
const Parameter & operator=(const Parameter &right);
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
72
void
setLowerLimit
(
double
lowerLimit);
73
74
// Set Upper Limit
75
void
setUpperLimit
(
double
upperLimit);
76
77
// Take values + limits from some other parameter.
78
void
connectFrom
(const
AbsParameter
* source);
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
};
93
std::ostream &
operator <<
( std::ostream & o,
const
Parameter &p);
94
}
// namespace Genfun
95
96
#endif
Generated on Sun Jun 17 2012 08:08:27 for CLHEP by
1.8.1.1