ROOT  6.06/09
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 //
19 // BEGIN_HTML
20 // RooConstVar represent a constant real-valued object
21 // END_HTML
22 //
23 
24 
25 #include "RooFit.h"
26 
27 #include "Riostream.h"
28 #include "RooConstVar.h"
29 
30 using namespace std;
31 
33  ;
34 
35 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Constructor with value
39 ///_fast = kTRUE ;
40 
41 RooConstVar::RooConstVar(const char *name, const char *title, Double_t value) :
42  RooAbsReal(name,title), _value(value)
43 {
44  setAttribute("Constant",kTRUE) ;
45 }
46 
47 
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// Copy constructor
51 ///_fast = kTRUE ;
52 
53 RooConstVar::RooConstVar(const RooConstVar& other, const char* name) :
54  RooAbsReal(other, name), _value(other._value)
55 {
56 }
57 
58 
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Destructor
62 
64 {
65 }
66 
67 
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Return value
71 
73 {
74  return _value ;
75 }
76 
77 
78 
79 ////////////////////////////////////////////////////////////////////////////////
80 /// Write object contents to stream
81 
82 void RooConstVar::writeToStream(ostream& os, Bool_t /*compact*/) const
83 {
84  os << _value ;
85 }
86 
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
Definition: RooAbsArg.cxx:265
bool Bool_t
Definition: RtypesCore.h:59
STL namespace.
virtual ~RooConstVar()
Destructor.
Definition: RooConstVar.cxx:63
ClassImp(RooConstVar)
Double_t _value
Definition: RooConstVar.h:49
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition: RooConstVar.cxx:82
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual Double_t getValV(const RooArgSet *set=0) const
Return value.
Definition: RooConstVar.cxx:72
const Bool_t kTRUE
Definition: Rtypes.h:91
float value
Definition: math.cpp:443