ROOT
master
Reference Guide
Loading...
Searching...
No Matches
RooNormalizedPdf.cxx
Go to the documentation of this file.
1
/*
2
* Project: RooFit
3
* Authors:
4
* Jonas Rembser, CERN 2022
5
*
6
* Copyright (c) 2022, CERN
7
*
8
* Redistribution and use in source and binary forms,
9
* with or without modification, are permitted according to the terms
10
* listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11
*/
12
13
#include "
RooFit/Detail/RooNormalizedPdf.h
"
14
15
#include "
RooBatchCompute.h
"
16
17
#include <array>
18
19
/**
20
* \class RooNormalizedPdf
21
*
22
* A RooNormalizedPdf wraps a pdf divided by its integral for a given
23
* normalization set into a new self-normalized pdf.
24
*/
25
26
namespace
RooFit::Detail
{
27
28
void
RooNormalizedPdf::doEval
(
RooFit::EvalContext
&ctx)
const
29
{
30
auto
nums
= ctx.
at
(
_pdf
);
31
auto
integralSpan
= ctx.
at
(
_normIntegral
);
32
33
// We use the extraArgs as output parameter to count evaluation errors.
34
std::array<double, 3>
extraArgs
{0.0, 0.0, 0.0};
35
36
RooBatchCompute::compute
(ctx.
config
(
this
),
RooBatchCompute::NormalizedPdf
, ctx.
output
(), {nums, integralSpan},
37
extraArgs
);
38
39
std::size_t
nEvalErrorsType0
=
extraArgs
[0];
40
std::size_t
nEvalErrorsType1
=
extraArgs
[1];
41
std::size_t
nEvalErrorsType2
=
extraArgs
[2];
42
43
for
(std::size_t i = 0; i <
nEvalErrorsType0
; ++i) {
44
logEvalError
(
"p.d.f normalization integral is zero or negative"
);
45
}
46
for
(std::size_t i = 0; i <
nEvalErrorsType1
; ++i) {
47
logEvalError
(
"p.d.f value is less than zero, trying to recover"
);
48
}
49
for
(std::size_t i = 0; i <
nEvalErrorsType2
; ++i) {
50
logEvalError
(
"p.d.f value is Not-a-Number"
);
51
}
52
}
53
54
}
// namespace RooFit::Detail
RooBatchCompute.h
RooNormalizedPdf.h
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:360
ROOT::Detail::TRangeCast
Definition
TCollection.h:313
RooAbsReal::logEvalError
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
Definition
RooAbsReal.cxx:3357
RooFit::Detail::RooNormalizedPdf::_normIntegral
RooRealProxy _normIntegral
Definition
RooNormalizedPdf.h:92
RooFit::Detail::RooNormalizedPdf::_pdf
RooTemplateProxy< RooAbsPdf > _pdf
Definition
RooNormalizedPdf.h:91
RooFit::Detail::RooNormalizedPdf::doEval
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
Definition
RooNormalizedPdf.cxx:28
RooFit::EvalContext
Definition
EvalContext.h:84
RooFit::EvalContext::at
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
Definition
EvalContext.cxx:35
RooFit::EvalContext::output
std::span< double > output()
Definition
EvalContext.h:112
RooFit::EvalContext::config
RooBatchCompute::Config config(RooAbsArg const *arg) const
Definition
EvalContext.cxx:73
RooBatchCompute::compute
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
Definition
RooBatchCompute.h:212
RooBatchCompute::NormalizedPdf
@ NormalizedPdf
Definition
RooBatchCompute.h:99
RooFit::Detail
Definition
CodegenImpl.h:69
roofit
roofitcore
src
RooNormalizedPdf.cxx
ROOT master - Reference Guide Generated on Wed Dec 10 2025 03:59:42 (GVA Time) using Doxygen 1.10.0