ROOT
v6-26
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
RooFracRemainder 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 "
RooFit.h
"
31
32
#include "
Riostream.h
"
33
#include <math.h>
34
35
#include "
RooFracRemainder.h
"
36
#include "
RooAbsReal.h
"
37
#include "
RooAbsPdf.h
"
38
#include "
RooErrorHandler.h
"
39
#include "
RooArgSet.h
"
40
#include "
RooMsgService.h
"
41
42
using namespace
std;
43
44
ClassImp
(
RooFracRemainder
);
45
46
47
48
////////////////////////////////////////////////////////////////////////////////
49
/// Default constructor
50
51
RooFracRemainder::RooFracRemainder
()
52
{
53
_setIter1
=
_set1
.
createIterator
() ;
54
}
55
56
57
58
////////////////////////////////////////////////////////////////////////////////
59
/// Constructor with given set of input fractions. All arguments in sumSet must be of type RooAbsReal.
60
61
RooFracRemainder::RooFracRemainder
(
const
char
*
name
,
const
char
* title,
const
RooArgSet
& sumSet) :
62
RooAbsReal
(
name
, title),
63
_set1(
"set1"
,
"First set of components"
,this)
64
{
65
_setIter1
=
_set1
.
createIterator
() ;
66
67
TIterator
* inputIter = sumSet.
createIterator
() ;
68
RooAbsArg
* comp ;
69
while
((comp = (
RooAbsArg
*)inputIter->
Next
())) {
70
if
(!
dynamic_cast<
RooAbsReal
*
>
(comp)) {
71
coutE
(InputArguments) <<
"RooFracRemainder::ctor("
<<
GetName
() <<
") ERROR: component "
<< comp->
GetName
()
72
<<
" is not of type RooAbsReal"
<< endl ;
73
RooErrorHandler::softAbort
() ;
74
}
75
_set1
.
add
(*comp) ;
76
}
77
78
delete
inputIter ;
79
}
80
81
82
83
84
////////////////////////////////////////////////////////////////////////////////
85
/// Copy constructor
86
87
RooFracRemainder::RooFracRemainder
(
const
RooFracRemainder
& other,
const
char
*
name
) :
88
RooAbsReal
(other,
name
),
89
_set1(
"set1"
,this,other._set1)
90
{
91
_setIter1
=
_set1
.
createIterator
() ;
92
93
// Member _ownedList is intentionally not copy-constructed -- ownership is not transferred
94
}
95
96
97
98
////////////////////////////////////////////////////////////////////////////////
99
/// Destructor
100
101
RooFracRemainder::~RooFracRemainder
()
102
{
103
if
(
_setIter1
)
delete
_setIter1
;
104
}
105
106
107
108
////////////////////////////////////////////////////////////////////////////////
109
/// Calculate value
110
111
Double_t
RooFracRemainder::evaluate
()
const
112
{
113
Double_t
sum
(1);
114
RooAbsReal
* comp ;
115
const
RooArgSet
* nset =
_set1
.
nset
() ;
116
117
_setIter1
->
Reset
() ;
118
119
while
((comp=(
RooAbsReal
*)
_setIter1
->
Next
())) {
120
sum
-= comp->
getVal
(nset) ;
121
}
122
123
return
sum
;
124
}
125
Riostream.h
RooAbsPdf.h
RooAbsReal.h
RooArgSet.h
RooErrorHandler.h
RooFit.h
RooFracRemainder.h
RooMsgService.h
coutE
#define coutE(a)
Definition
RooMsgService.h:33
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:364
name
char name[80]
Definition
TGX11.cxx:110
Double_t
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition
RooAbsArg.h:69
RooAbsCollection::createIterator
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
Definition
RooAbsCollection.h:213
RooAbsProxy::nset
const RooArgSet * nset() const
Definition
RooAbsProxy.h:45
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition
RooAbsReal.h:64
RooAbsReal::getVal
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition
RooAbsReal.h:94
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition
RooArgSet.h:35
RooErrorHandler::softAbort
static void softAbort()
Definition
RooErrorHandler.h:30
RooFracRemainder
RooFracRemainder calculates the remainder fraction of a sum of RooAbsReal fraction,...
Definition
RooFracRemainder.h:25
RooFracRemainder::_set1
RooListProxy _set1
Definition
RooFracRemainder.h:37
RooFracRemainder::~RooFracRemainder
virtual ~RooFracRemainder()
Destructor.
Definition
RooFracRemainder.cxx:101
RooFracRemainder::evaluate
Double_t evaluate() const
Iterator over set of input fractions.
Definition
RooFracRemainder.cxx:111
RooFracRemainder::_setIter1
TIterator * _setIter1
Definition
RooFracRemainder.h:38
RooFracRemainder::RooFracRemainder
RooFracRemainder()
Default constructor.
Definition
RooFracRemainder.cxx:51
RooListProxy::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
Definition
RooListProxy.cxx:104
TIterator
Iterator abstract base class.
Definition
TIterator.h:30
TIterator::Reset
virtual void Reset()=0
TIterator::Next
virtual TObject * Next()=0
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition
TNamed.h:47
sum
static uint64_t sum(uint64_t i)
Definition
Factory.cxx:2345
roofit
roofitcore
src
RooFracRemainder.cxx
ROOT v6-26 - Reference Guide Generated on Mon Sep 11 2023 21:02:51 (GVA Time) using Doxygen 1.9.8