ROOT
v6-26
Reference Guide
Loading...
Searching...
No Matches
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
21
class
RooArgSet
;
22
namespace
RooBatchCompute
{
23
struct
RunContext;
24
}
25
26
class
RooConstVar
final :
public
RooAbsReal
{
27
public
:
28
// Constructors, assignment etc
29
RooConstVar
() { }
30
RooConstVar
(
const
char
*
name
,
const
char
*title,
Double_t
value);
31
RooConstVar
(
const
RooConstVar
& other,
const
char
*
name
=0);
32
virtual
TObject
*
clone
(
const
char
* newname)
const
{
return
new
RooConstVar
(*
this
,newname); }
33
virtual
~RooConstVar
() =
default
;
34
35
/// Return (constant) value.
36
virtual
Double_t
getValV
(
const
RooArgSet
*)
const
{
37
return
_value
;
38
}
39
40
RooSpan<const double>
getValues
(
RooBatchCompute::RunContext
& evalData,
const
RooArgSet
*)
const
;
41
42
void
writeToStream
(std::ostream& os,
Bool_t
compact)
const
;
43
44
/// Returns false, as the value of the constant doesn't depend on other objects.
45
virtual
Bool_t
isDerived
()
const
{
46
return
false
;
47
}
48
49
/// Change the value of this constant.
50
/// On purpose, this is not `setVal`, as this could be confused with the `setVal`
51
/// that is available for variables. Constants, however, should remain mostly constant.
52
/// This function is e.g. useful when reading the constant from a file.
53
void
changeVal
(
double
value) {
54
_value
= value;
55
}
56
57
protected
:
58
59
Double_t
evaluate
()
const
{
60
return
_value
;
61
}
62
63
ClassDef
(
RooConstVar
,2)
// Constant RooAbsReal value object
64
};
65
66
#endif
RooAbsReal.h
Double_t
double Double_t
Definition
RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition
Rtypes.h:325
name
char name[80]
Definition
TGX11.cxx:110
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition
RooAbsReal.h:64
RooAbsReal::_value
Double_t _value
Definition
RooAbsReal.h:484
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition
RooArgSet.h:35
RooConstVar
RooConstVar represent a constant real-valued object.
Definition
RooConstVar.h:26
RooConstVar::writeToStream
void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream.
Definition
RooConstVar.cxx:69
RooConstVar::~RooConstVar
virtual ~RooConstVar()=default
RooConstVar::getValues
RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *) const
Return batch with 1 constant element.
Definition
RooConstVar.cxx:57
RooConstVar::clone
virtual TObject * clone(const char *newname) const
Definition
RooConstVar.h:32
RooConstVar::RooConstVar
RooConstVar()
Definition
RooConstVar.h:29
RooConstVar::getValV
virtual Double_t getValV(const RooArgSet *) const
Return (constant) value.
Definition
RooConstVar.h:36
RooConstVar::evaluate
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition
RooConstVar.h:59
RooConstVar::isDerived
virtual Bool_t isDerived() const
Returns false, as the value of the constant doesn't depend on other objects.
Definition
RooConstVar.h:45
RooConstVar::changeVal
void changeVal(double value)
Change the value of this constant.
Definition
RooConstVar.h:53
RooSpan
A simple container to hold a batch of data values.
Definition
RooSpan.h:34
TObject
Mother of all ROOT objects.
Definition
TObject.h:41
bool
RooBatchCompute
Namespace for dispatching RooFit computations to various backends.
Definition
BracketAdapters.h:24
RooBatchCompute::RunContext
This struct enables passing computation data around between elements of a computation graph.
Definition
RunContext.h:32
roofit
roofitcore
inc
RooConstVar.h
ROOT v6-26 - Reference Guide Generated on Mon Sep 11 2023 21:02:49 (GVA Time) using Doxygen 1.9.8