Logo ROOT  
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
23class RooArgSet ;
24
25class RooConstVar final : public RooAbsReal {
26public:
27 // Constructors, assignment etc
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
47protected:
48
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
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooConstVar represent a constant real-valued object.
Definition: RooConstVar.h:25
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition: RooConstVar.cxx:72
Double_t _value
Definition: RooConstVar.h:53
virtual TObject * clone(const char *newname) const
Definition: RooConstVar.h:31
virtual Double_t getValV(const RooArgSet *) const
Return (constant) value.
Definition: RooConstVar.h:36
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooConstVar.h:49
virtual Bool_t isDerived() const
Does value or shape of this arg depend on any other arg?
Definition: RooConstVar.h:42
virtual ~RooConstVar()
Destructor.
Definition: RooConstVar.cxx:64
Mother of all ROOT objects.
Definition: TObject.h:37