Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
22 RooConstVar represent a constant real-valued object
23 **/
24 
25 
26 #include "RooFit.h"
27 
28 #include "Riostream.h"
29 #include "RooConstVar.h"
30 
31 using namespace std;
32 
33 ClassImp(RooConstVar);
34  ;
35 
36 
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Constructor with value
40 ///_fast = kTRUE ;
41 
42 RooConstVar::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 
54 RooConstVar::RooConstVar(const RooConstVar& other, const char* name) :
55  RooAbsReal(other, name), _value(other._value)
56 {
57 }
58 
59 
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Destructor
63 
64 RooConstVar::~RooConstVar()
65 {
66 }
67 
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Write object contents to stream
71 
72 void RooConstVar::writeToStream(ostream& os, Bool_t /*compact*/) const
73 {
74  os << _value ;
75 }
76