Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooConstraintSum.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $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#ifndef ROO_CONSTRAINT_SUM
17#define ROO_CONSTRAINT_SUM
18
19#include "RooAbsReal.h"
20#include "RooListProxy.h"
21#include "RooSetProxy.h"
22
23class RooRealVar;
24class RooArgList ;
25class RooWorkspace ;
26
28public:
29
31 RooConstraintSum(const char *name, const char *title, const RooArgSet& constraintSet, const RooArgSet& paramSet, bool takeGlobalObservablesFromData=false) ;
32
33 RooConstraintSum(const RooConstraintSum& other, const char* name = 0);
34 virtual TObject* clone(const char* newname) const override { return new RooConstraintSum(*this, newname); }
35
36 const RooArgList& list() { return _set1 ; }
37
38 static std::unique_ptr<RooAbsReal> createConstraintTerm(
39 std::string const& name,
40 RooAbsPdf const& pdf,
41 RooAbsData const& data,
42 RooArgSet const* constrainedParameters,
43 RooArgSet const* externalConstraints,
44 RooArgSet const* globalObservables,
45 const char* globalObservablesTag,
46 bool takeGlobalObservablesFromData,
47 RooWorkspace * workspace);
48
49 bool setData(RooAbsData const& data, bool cloneData=true);
50 /// \copydoc setData(RooAbsData const&, bool)
51 bool setData(RooAbsData& data, bool cloneData=true) override {
52 return setData(static_cast<RooAbsData const&>(data), cloneData);
53 }
54
55 void computeBatch(cudaStream_t*, double* output, size_t size, RooFit::Detail::DataMap const&) const override;
56
57 std::unique_ptr<RooArgSet> fillNormSetForServer(RooArgSet const& normSet, RooAbsArg const& server) const override;
58
59protected:
60
61 RooListProxy _set1 ; ///< Set of constraint terms
62 RooArgSet _paramSet ; ///< Set of parameters to which constraints apply
63 const bool _takeGlobalObservablesFromData = false; ///< If the global observable values are taken from data
64
65 Double_t evaluate() const override;
66
67 ClassDefOverride(RooConstraintSum,4) // sum of -log of set of RooAbsPdf representing parameter constraints
68};
69
70#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
double Double_t
Definition RtypesCore.h:59
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
char name[80]
Definition TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:69
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:82
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
RooConstraintSum calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent co...
Double_t evaluate() const override
Return sum of -log of constraint p.d.f.s.
bool setData(RooAbsData &data, bool cloneData=true) override
Replace the variables in this RooConstraintSum with the global observables in the dataset if they mat...
bool setData(RooAbsData const &data, bool cloneData=true)
Replace the variables in this RooConstraintSum with the global observables in the dataset if they mat...
virtual TObject * clone(const char *newname) const override
RooListProxy _set1
Set of constraint terms.
void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
static std::unique_ptr< RooAbsReal > createConstraintTerm(std::string const &name, RooAbsPdf const &pdf, RooAbsData const &data, RooArgSet const *constrainedParameters, RooArgSet const *externalConstraints, RooArgSet const *globalObservables, const char *globalObservablesTag, bool takeGlobalObservablesFromData, RooWorkspace *workspace)
Create the parameter constraint sum to add to the negative log-likelihood.
RooArgSet _paramSet
Set of parameters to which constraints apply.
const RooArgList & list()
std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &normSet, RooAbsArg const &server) const override
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
const bool _takeGlobalObservablesFromData
If the global observable values are taken from data.
RooListProxy is the concrete proxy for RooArgList objects.
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:39
The RooWorkspace is a persistable container for RooFit projects.
Mother of all ROOT objects.
Definition TObject.h:41
static void output(int code)
Definition gifencode.c:226