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
19#include <ROOT/RSpan.hxx>
20
21namespace RooStats::HistFactory {
22
23namespace Constraint {
24
29std::string Name(Type type);
30Type GetType(const std::string &Name);
31
32} // namespace Constraint
33
34namespace Detail {
35
36namespace MagicConstants {
37
38constexpr double defaultGammaMin = 0;
39constexpr double defaultShapeFactorGammaMax = 1000;
40constexpr double defaultShapeSysGammaMax = 10;
41constexpr double defaultStatErrorGammaMax = 10;
42constexpr double minShapeUncertainty = 0.0;
43
44} // namespace MagicConstants
45
46template <class Arg_t, class... Params_t>
47Arg_t &getOrCreate(RooWorkspace &ws, std::string const &name, Params_t &&...params)
48{
49 Arg_t *arg = static_cast<Arg_t *>(ws.obj(name));
50 if (arg)
51 return *arg;
52 Arg_t newArg(name.c_str(), name.c_str(), std::forward<Params_t>(params)...);
54 return *static_cast<Arg_t *>(ws.obj(name));
55}
56
57void configureConstrainedGammas(RooArgList const &gammas, std::span<const double> relSigmas, double minSigma);
58
60 std::vector<std::unique_ptr<RooAbsPdf>> constraints;
61 std::vector<RooRealVar *> globalObservables;
62};
63
64CreateGammaConstraintsOutput createGammaConstraints(RooArgList const &paramList, std::span<const double> relSigmas,
66
67} // namespace Detail
68} // namespace RooStats::HistFactory
69
70#endif
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:145
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
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={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
RooCmdArg RecycleConflictNodes(bool flag=true)
RooCmdArg Silence(bool flag=true)
Type GetType(const std::string &Name)
void configureConstrainedGammas(RooArgList const &gammas, std::span< const double > relSigmas, double minSigma)
Configure constrained gamma parameters for fitting.
Arg_t & getOrCreate(RooWorkspace &ws, std::string const &name, Params_t &&...params)
CreateGammaConstraintsOutput createGammaConstraints(RooArgList const &paramList, std::span< const double > relSigmas, double minSigma, Constraint::Type type)
std::vector< std::unique_ptr< RooAbsPdf > > constraints