rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.2
SingleValueProjection.hh
1// -*- C++ -*-
2#ifndef RIVET_SINGLEVALUEPROJECTION_HH
3#define RIVET_SINGLEVALUEPROJECTION_HH
4
5#include "Rivet/Projection.hh"
6
7namespace Rivet {
8
9
18 public:
19
21 SingleValueProjection() : _value(-1.0), _isSet(false) {
22 setName("SingleValueProjection");
23 }
24
26 using Projection::operator =;
27
28
30 bool isValueSet() const {
31 return _isSet;
32 }
33
35 double value() const {
36 return _value;
37 }
38
40 double operator()() const {
41 return value();
42 }
43
44
45 protected:
46
48 void setValue(double v) {
49 _value = v;
50 _isSet = true;
51 }
52
54 void clear() {
55 _value = -1.0;
56 _isSet = false;
57 }
58
59
60 protected:
61
62 double _value;
63
65 bool _isSet;
66
67 };
68
69
70}
71
72#endif
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:148
Base class for projections returning a single floating point value.
Definition SingleValueProjection.hh:17
double operator()() const
Return the single value.
Definition SingleValueProjection.hh:40
bool isValueSet() const
Returns true if the value has been set.
Definition SingleValueProjection.hh:30
void setValue(double v)
Set the value.
Definition SingleValueProjection.hh:48
double value() const
Return the single value.
Definition SingleValueProjection.hh:35
SingleValueProjection()
The default constructor.
Definition SingleValueProjection.hh:21
void clear()
Unset the value.
Definition SingleValueProjection.hh:54
Definition MC_CENT_PPB_Projections.hh:10