Logo ROOT   6.16/01
Reference Guide
RooConstVar.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooConstVar.cxx
19\class RooConstVar
20\ingroup Roofitcore
21
22RooConstVar represent a constant real-valued object
23**/
24
25
26#include "RooFit.h"
27
28#include "Riostream.h"
29#include "RooConstVar.h"
30
31using namespace std;
32
34 ;
35
36
37
38////////////////////////////////////////////////////////////////////////////////
39/// Constructor with value
40///_fast = kTRUE ;
41
42RooConstVar::RooConstVar(const char *name, const char *title, Double_t value) :
43 RooAbsReal(name,title), _value(value)
44{
45 setAttribute("Constant",kTRUE) ;
46}
47
48
49
50////////////////////////////////////////////////////////////////////////////////
51/// Copy constructor
52///_fast = kTRUE ;
53
54RooConstVar::RooConstVar(const RooConstVar& other, const char* name) :
55 RooAbsReal(other, name), _value(other._value)
56{
57}
58
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Destructor
63
65{
66}
67
68
69
70////////////////////////////////////////////////////////////////////////////////
71/// Return value
72
74{
75 return _value ;
76}
77
78
79
80////////////////////////////////////////////////////////////////////////////////
81/// Write object contents to stream
82
83void RooConstVar::writeToStream(ostream& os, Bool_t /*compact*/) const
84{
85 os << _value ;
86}
87
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:241
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooConstVar represent a constant real-valued object.
Definition: RooConstVar.h:25
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition: RooConstVar.cxx:83
Double_t _value
Definition: RooConstVar.h:49
virtual Double_t getValV(const RooArgSet *set=0) const
Return value.
Definition: RooConstVar.cxx:73
virtual ~RooConstVar()
Destructor.
Definition: RooConstVar.cxx:64
STL namespace.