44 _nll(
"input",
"-log(L) function",this,nllIn),
45 _obs(
"paramOfInterest",
"Parameters of interest",this),
46 _par(
"nuisanceParam",
"Nuisance parameters",this,false,false)
109 coutI(Minimization) <<
"RooProfileLL::evaluate(" <<
GetName() <<
") Creating instance of MINUIT" << std::endl;
134 _obs.snapshot(obsSetOrig) ;
154 for(
auto const& arg : obsSetOrig) {
157 auto target =
static_cast<RooRealVar*
>(
_obs.find(var->GetName())) ;
158 target->
setVal(var->getVal()) ;
159 target->setConstant(var->isConstant()) ;
176 for(
auto const& par :
_par) {
177 if (
_paramFixed[par->GetName()] != par->isConstant()) {
178 cxcoutI(Minimization) <<
"RooProfileLL::evaluate(" <<
GetName() <<
") constant status of parameter " << par->GetName() <<
" has changed from "
179 << (
_paramFixed[par->GetName()]?
"fixed":
"floating") <<
" to " << (par->isConstant()?
"fixed":
"floating")
180 <<
", recalculating absolute minimum" << std::endl;
191 cxcoutI(Minimization) <<
"RooProfileLL::evaluate(" <<
GetName() <<
") determining minimum likelihood for current configurations w.r.t all observable" << std::endl;
200 _obs.snapshot(obsStart,
false) ;
223 _paramAbsMin.addClone(*std::unique_ptr<RooArgSet>{
_par.selectByAttrib(
"Constant",
false)});
228 for(
auto const& par :
_par) {
232 if (
dologI(Minimization)) {
233 cxcoutI(Minimization) <<
"RooProfileLL::evaluate(" <<
GetName() <<
") minimum found at (" ;
236 for(
auto const& arg :
_obs) {
237 ccxcoutI(Minimization) << (first?
"":
", ") << arg->GetName() <<
"="
241 ccxcoutI(Minimization) <<
")" << std::endl;
245 _obs.assign(obsStart) ;
255 bool nameChange,
bool isRecursive)
RooCollectionProxy< RooArgSet > RooSetProxy
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
friend class RooAbsCollection
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Function that is called at the end of redirectServers().
virtual RooFit::OwningPtr< RooAbsReal > createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static RooMsgService & instance()
Return reference to singleton instance.
void setSilentMode(bool flag)
const RooArgSet & bestFitObs() const
RooArgSet _paramAbsMin
Parameter values at absolute minimum.
RooSetProxy _obs
Parameters of profile likelihood.
Int_t _neval
Number evaluations used in last minimization.
void initializeMinimizer() const
bool _absMinValid
flag if absmin is up-to-date
std::map< std::string, bool > _paramFixed
Parameter constant status at last time of use.
bool _startFromMin
Always start minimization for global minimum?
std::unique_ptr< RooMinimizer > _minimizer
! Internal minimizer instance
RooArgSet _obsAbsMin
Observable values at absolute minimum.
void validateAbsMin() const
Check that parameters and likelihood value for 'best fit' are still valid.
RooSetProxy _par
Marginalised parameters of likelihood.
double _absMin
absolute minimum of -log(L)
RooProfileLL(const char *name, const char *title, RooAbsReal &nll, const RooArgSet &observables)
Constructor of profile likelihood given input likelihood nll w.r.t the given set of variables.
double evaluate() const override
Evaluate profile likelihood by minimizing likelihood w.r.t.
RooFit::OwningPtr< RooAbsReal > createProfile(const RooArgSet ¶msOfInterest) override
Optimized implementation of createProfile for profile likelihoods.
RooRealProxy _nll
Input -log(L) function.
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Function that is called at the end of redirectServers().
const RooArgSet & bestFitParams() const
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
const char * GetName() const override
Returns name of object.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...