Logo ROOT   6.14/05
Reference Guide
RooConstVar.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooConstVar.h,v 1.9 2007/05/11 09:11:30 verkerke Exp $
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 #ifndef ROO_CONST_VAR
17 #define ROO_CONST_VAR
18 
19 #include "RooAbsReal.h"
20 #include "RooArgList.h"
21 #include "RooListProxy.h"
22 
23 class RooArgSet ;
24 
25 class RooConstVar : public RooAbsReal {
26 public:
27  // Constructors, assignment etc
28  inline RooConstVar() {
29  // Default constructor
30  }
31  RooConstVar(const char *name, const char *title, Double_t value);
32  RooConstVar(const RooConstVar& other, const char* name=0);
33  virtual TObject* clone(const char* newname) const { return new RooConstVar(*this,newname); }
34  virtual ~RooConstVar();
35 
36  virtual Double_t getValV(const RooArgSet* set=0) const ;
37  void writeToStream(std::ostream& os, Bool_t compact) const ;
38 
39  virtual Bool_t isDerived() const {
40  // Does value or shape of this arg depend on any other arg?
41  return kFALSE ;
42  }
43 
44 protected:
45 
46  virtual Double_t evaluate() const {
47  // Return value
48  return _value ;
49  } ;
50 
51  Double_t _value ; // Constant value of self
52 
53  ClassDef(RooConstVar,1) // Constant RooAbsReal value object
54 };
55 
56 #endif
bool Bool_t
Definition: RtypesCore.h:59
virtual TObject * clone(const char *newname) const
Definition: RooConstVar.h:33
#define ClassDef(name, id)
Definition: Rtypes.h:320
RooConstVar represent a constant real-valued object.
Definition: RooConstVar.h:25
virtual ~RooConstVar()
Destructor.
Definition: RooConstVar.cxx:64
virtual Bool_t isDerived() const
Definition: RooConstVar.h:39
virtual Double_t evaluate() const
Definition: RooConstVar.h:46
Double_t _value
Definition: RooConstVar.h:49
const Bool_t kFALSE
Definition: RtypesCore.h:88
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
Mother of all ROOT objects.
Definition: TObject.h:37
char name[80]
Definition: TGX11.cxx:109
virtual Double_t getValV(const RooArgSet *set=0) const
Return value.
Definition: RooConstVar.cxx:73
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition: RooConstVar.cxx:83