Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 final : public RooAbsReal {
26 public:
27  // Constructors, assignment etc
28  RooConstVar() { }
29  RooConstVar(const char *name, const char *title, Double_t value);
30  RooConstVar(const RooConstVar& other, const char* name=0);
31  virtual TObject* clone(const char* newname) const { return new RooConstVar(*this,newname); }
32  virtual ~RooConstVar();
33 
34  ////////////////////////////////////////////////////////////////////////////////
35  /// Return (constant) value.
36  virtual Double_t getValV(const RooArgSet*) const {
37  return _value;
38  }
39 
40  void writeToStream(std::ostream& os, Bool_t compact) const ;
41 
42  virtual Bool_t isDerived() const {
43  // Does value or shape of this arg depend on any other arg?
44  return kFALSE ;
45  }
46 
47 protected:
48 
49  Double_t evaluate() const {
50  return _value;
51  }
52 
53  Double_t _value{0.}; // Constant value of self
54 
55  ClassDef(RooConstVar,1) // Constant RooAbsReal value object
56 };
57 
58 #endif