Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
HistFactoryImpl.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Jonas Rembser, CERN 2023
5 *
6 * Copyright (c) 2023, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef HistFactoryImplHelpers_h
14#define HistFactoryImplHelpers_h
15
16#include <RooGlobalFunc.h>
17#include <RooWorkspace.h>
18
19namespace RooStats {
20namespace HistFactory {
21namespace Detail {
22
23template <class Arg_t, class... Params_t>
24Arg_t &getOrCreate(RooWorkspace &ws, std::string const &name, Params_t &&...params)
25{
26 Arg_t *arg = static_cast<Arg_t *>(ws.obj(name));
27 if (arg)
28 return *arg;
29 Arg_t newArg(name.c_str(), name.c_str(), std::forward<Params_t>(params)...);
31 return *static_cast<Arg_t *>(ws.obj(name));
32}
33
34} // namespace Detail
35} // namespace HistFactory
36} // namespace RooStats
37
38#endif
char name[80]
Definition TGX11.cxx:110
The RooWorkspace is a persistable container for RooFit projects.
TObject * obj(RooStringView name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
bool import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
RooCmdArg RecycleConflictNodes(bool flag=true)
RooCmdArg Silence(bool flag=true)
Arg_t & getOrCreate(RooWorkspace &ws, std::string const &name, Params_t &&...params)
Namespace for the RooStats classes.
Definition Asimov.h:19