ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
RooPullVar.cxx
Go to the documentation of this file.
1
/*****************************************************************************
2
* Project: RooFit *
3
* Package: RooFitCore *
4
* @(#)root/roofitcore:$Id$
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
17
/**
18
\file RooPullVar.cxx
19
\class RooPullVar
20
\ingroup Roofitcore
21
22
Represents the pull of a measurement w.r.t. the true value
23
using the measurement and its error. Both the true value and
24
the measured value (with error) are taken from two user-supplied
25
RooRealVars. If the measured parameter has an asymmetric error, the proper
26
side of that error will be used:
27
\f[
28
\mathrm{Pull}_x = \frac{x_\mathrm{meas}-x_\mathrm{true}}{\Delta_x}
29
\f]
30
**/
31
32
#include "
RooPullVar.h
"
33
34
#include "
RooAbsReal.h
"
35
#include "
RooRealVar.h
"
36
37
38
////////////////////////////////////////////////////////////////////////////////
39
/// Construct the pull of the RooRealVar 'meas'.
40
///
41
/// \param[in] name Name of the pull variable.
42
/// \param[in] title The title (for plotting).
43
/// \param[in] meas The measurement. This variable needs to have an error, and therefore is a RooRealVar.
44
/// \param[in] truth The true value.
45
RooPullVar::RooPullVar
(
const
char
*
name
,
const
char
* title,
RooRealVar
& meas,
RooAbsReal
& truth) :
46
RooAbsReal
(
name
, title),
47
_meas
(
"meas"
,
"Measurement"
,this,meas),
48
_true
(
"true"
,
"Truth"
,this,truth)
49
{
50
}
51
52
53
54
55
56
////////////////////////////////////////////////////////////////////////////////
57
/// Copy constructor
58
59
RooPullVar::RooPullVar
(
const
RooPullVar
& other,
const
char
*
name
) :
60
RooAbsReal
(other,
name
),
61
_meas
(
"meas"
,this,other.
_meas
),
62
_true
(
"true"
,this,other.
_true
)
63
{
64
}
65
66
////////////////////////////////////////////////////////////////////////////////
67
/// Calculate pull. Use asymmetric error if defined in measurement,
68
/// otherwise use symmetric error. If measurement has no error
69
/// return zero.
70
71
double
RooPullVar::evaluate
()
const
72
{
73
const
auto
& meas =
_meas
.arg();
74
if
(meas.hasAsymError()) {
75
double
delta =
_meas
-
_true
;
76
if
(delta<0) {
77
return
delta/meas.getAsymErrorHi() ;
78
}
else
{
79
return
-delta/meas.getAsymErrorLo() ;
80
}
81
}
else
if
(meas.hasError()) {
82
return
(
_meas
-
_true
)/meas.getError() ;
83
}
else
{
84
return
0 ;
85
}
86
}
RooAbsReal.h
RooPullVar.h
RooRealVar.h
name
char name[80]
Definition
TGX11.cxx:148
RooAbsReal::RooAbsReal
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
Definition
RooAbsReal.cxx:196
RooPullVar::RooPullVar
RooPullVar()=default
RooPullVar::evaluate
double evaluate() const override
Calculate pull.
Definition
RooPullVar.cxx:71
RooPullVar::_meas
RooTemplateProxy< RooRealVar > _meas
Definition
RooPullVar.h:36
RooPullVar::_true
RooRealProxy _true
Definition
RooPullVar.h:37
RooRealVar
Variable that can be changed from the outside.
Definition
RooRealVar.h:37
roofit
roofitcore
src
RooPullVar.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1