ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
RooFracRemainder.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 RooFracRemainder.cxx
19
\class RooFracRemainder
20
\ingroup Roofitcore
21
22
23
Calculates the remainder fraction of a sum of RooAbsReal
24
fraction, i.e (1 - sum_i a_i). This class is used by RooSimWSTool to
25
as specialization of the remainder fraction term of a parameter with
26
a constrained split
27
**/
28
29
30
#include "
Riostream.h
"
31
#include <cmath>
32
33
#include "
RooFracRemainder.h
"
34
#include "
RooAbsReal.h
"
35
#include "
RooAbsPdf.h
"
36
#include "
RooErrorHandler.h
"
37
#include "
RooArgSet.h
"
38
#include "
RooMsgService.h
"
39
40
using
std::endl;
41
42
43
44
////////////////////////////////////////////////////////////////////////////////
45
/// Constructor with given set of input fractions. All arguments in sumSet must be of type RooAbsReal.
46
47
RooFracRemainder::RooFracRemainder
(
const
char
*
name
,
const
char
* title,
const
RooArgSet
& sumSet) :
48
RooAbsReal
(
name
, title),
49
_set1
(
"set1"
,
"First set of components"
,this)
50
{
51
for
(
RooAbsArg
* comp : sumSet) {
52
if
(!
dynamic_cast<
RooAbsReal
*
>
(comp)) {
53
coutE
(InputArguments) <<
"RooFracRemainder::ctor("
<<
GetName
() <<
") ERROR: component "
<< comp->GetName()
54
<<
" is not of type RooAbsReal"
<< std::endl ;
55
RooErrorHandler::softAbort
() ;
56
}
57
_set1
.add(*comp) ;
58
}
59
}
60
61
62
////////////////////////////////////////////////////////////////////////////////
63
/// Copy constructor
64
65
RooFracRemainder::RooFracRemainder
(
const
RooFracRemainder
& other,
const
char
*
name
) :
66
RooAbsReal
(other,
name
),
67
_set1
(
"set1"
,this,other.
_set1
)
68
{
69
// Member _ownedList is intentionally not copy-constructed -- ownership is not transferred
70
}
71
72
73
////////////////////////////////////////////////////////////////////////////////
74
/// Calculate value
75
76
double
RooFracRemainder::evaluate
()
const
77
{
78
double
sum
(1);
79
const
RooArgSet
* nset =
_set1
.nset() ;
80
81
for
(
auto
* comp :
static_range_cast<RooAbsReal*>
(
_set1
)) {
82
sum
-= comp->getVal(nset) ;
83
}
84
85
return
sum
;
86
}
Riostream.h
static_range_cast
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
Definition
RooAbsCollection.h:45
RooAbsPdf.h
RooAbsReal.h
RooArgSet.h
RooErrorHandler.h
RooFracRemainder.h
RooMsgService.h
coutE
#define coutE(a)
Definition
RooMsgService.h:37
name
char name[80]
Definition
TGX11.cxx:148
RooAbsArg::RooAbsArg
RooAbsArg()
Default constructor.
Definition
RooAbsArg.cxx:125
RooAbsReal::RooAbsReal
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
Definition
RooAbsReal.cxx:196
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition
RooArgSet.h:24
RooErrorHandler::softAbort
static void softAbort()
Soft abort function that interrupts macro execution but doesn't kill ROOT.
Definition
RooErrorHandler.h:30
RooFracRemainder::_set1
RooListProxy _set1
Set of input fractions.
Definition
RooFracRemainder.h:37
RooFracRemainder::evaluate
double evaluate() const override
Calculate value.
Definition
RooFracRemainder.cxx:76
RooFracRemainder::RooFracRemainder
RooFracRemainder()
Default constructor.
Definition
RooFracRemainder.h:29
TNamed::GetName
const char * GetName() const override
Returns name of object.
Definition
TNamed.h:49
sum
static uint64_t sum(uint64_t i)
Definition
Factory.cxx:2338
roofit
roofitcore
src
RooFracRemainder.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1