40 _gamma(
"gamma",
"gamma",
this),
41 _nominal(
"nominal",
"nominal",
this),
56 coutE(InputArguments) <<
"RooHistConstraint::ctor(" <<
GetName()
57 <<
") ERROR: input object must be a RooParamHistFunc" << std::endl ;
58 throw std::string(
"RooHistConstraint::ctor ERROR incongruent input arguments") ;
62 for (
int i=0 ; i<
phf->_dh.numEntries() ; i++) {
66 auto var = std::make_unique<RooRealVar>(
vname,
vname,0,1.E30);
67 var->setVal(
phf->_dh.weight()) ;
68 var->setConstant(
true);
71 if (var->getVal() > 0.0) {
72 gamma->setConstant(
false);
86 std::vector<RooParamHistFunc*>
phvec ;
89 for (
const auto arg :
phfSet) {
99 if (
int(
phfComp->_p.size())!=nbins) {
100 coutE(InputArguments) <<
"RooHistConstraint::ctor(" <<
GetName()
101 <<
") ERROR: incongruent input arguments: all input RooParamHistFuncs should have same #bins" << std::endl ;
102 throw std::string(
"RooHistConstraint::ctor ERROR incongruent input arguments") ;
105 coutE(InputArguments) <<
"RooHistConstraint::ctor(" <<
GetName()
106 <<
") ERROR: incongruent input arguments: all input RooParamHistFuncs should have the same bin parameters.\n"
107 <<
"Previously found " <<
bin0_name <<
", now found " <<
phfComp->_p.at(0)->GetName() <<
".\n"
108 <<
"Check that the right RooParamHistFuncs have been passed to this RooHistConstraint." << std::endl;
109 throw std::string(
"RooHistConstraint::ctor ERROR incongruent input arguments") ;
114 coutW(InputArguments) <<
"RooHistConstraint::ctor(" <<
GetName()
115 <<
") WARNING: ignoring input argument " << arg->GetName() <<
" which is not of type RooParamHistFunc" << std::endl;
122 for (
int i=0 ; i<nbins ; i++) {
132 auto var = std::make_unique<RooRealVar>(
vname,
vname,0,1000);
139 var->setConstant(
true) ;
166 _relParam(
other._relParam)
180 const int nomVal =
static_cast<int>(nominal.getVal());
190 coutE(Eval) <<
"ERROR in RooHistConstraint: gamma=0 and nom>0" << std::endl;
206 const int nomVal =
static_cast<int>(nominal.getVal());
216 coutE(Eval) <<
"ERROR in RooHistConstraint: gamma=0 and nom>0" << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Storage_t::size_type size() const
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
bool addOwned(RooAbsArg &var, bool silent=false) override
Overloaded RooCollection_t::addOwned() method insert object into owning set and registers object as s...
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
The RooHistConstraint implements constraint terms for a binned PDF with statistical uncertainties.
double getLogVal(const RooArgSet *set=nullptr) const override
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
A histogram function that assigns scale parameters to every bin.
Variable that can be changed from the outside.
const char * GetName() const override
Returns name of object.
double poisson_pdf(unsigned int n, double mu)
Probability density function of the Poisson distribution.
static uint64_t sum(uint64_t i)