00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooConstVar.h,v 1.9 2007/05/11 09:11:30 verkerke Exp $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 #ifndef ROO_CONST_VAR 00017 #define ROO_CONST_VAR 00018 00019 #include "RooAbsReal.h" 00020 #include "RooArgList.h" 00021 #include "RooListProxy.h" 00022 00023 class RooArgSet ; 00024 00025 class RooConstVar : public RooAbsReal { 00026 public: 00027 // Constructors, assignment etc 00028 inline RooConstVar() { 00029 // Default constructor 00030 } 00031 RooConstVar(const char *name, const char *title, Double_t value); 00032 RooConstVar(const RooConstVar& other, const char* name=0); 00033 virtual TObject* clone(const char* newname) const { return new RooConstVar(*this,newname); } 00034 virtual ~RooConstVar(); 00035 00036 virtual Double_t getVal(const RooArgSet* set=0) const ; 00037 void writeToStream(ostream& os, Bool_t compact) const ; 00038 00039 protected: 00040 00041 virtual Double_t evaluate() const { 00042 // Return value 00043 return _value ; 00044 } ; 00045 00046 Double_t _value ; // Constant value of self 00047 00048 ClassDef(RooConstVar,1) // Constant RooAbsReal value object 00049 }; 00050 00051 #endif