Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
HistoToWorkspaceFactoryFast.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id: cranmer $
2// Author: Kyle Cranmer, Akira Shibata
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOSTATS_HISTOTOWORKSPACEFACTORYFAST
12#define ROOSTATS_HISTOTOWORKSPACEFACTORYFAST
13
14#include <vector>
15#include <string>
16#include <map>
17#include <iostream>
18#include <sstream>
19#include <memory>
20
21#include <RooPlot.h>
22#include <RooArgSet.h>
23#include <RooFitResult.h>
24#include <RooAbsReal.h>
25#include <RooRealVar.h>
26#include <RooWorkspace.h>
27#include <TObject.h>
28#include <TH1.h>
29#include <TDirectory.h>
30
32class ParamHistFunc;
33class RooProduct;
34class RooHistFunc;
35
36namespace RooStats{
37 namespace HistFactory{
38
39 // Forward Declarations FTW
40 class Measurement;
41 class Channel;
42 class Sample;
43
45
46 public:
47
51 };
52
56
57 static void ConfigureWorkspaceForMeasurement( const std::string& ModelName,
58 RooWorkspace* ws_single,
59 Measurement& measurement );
60
62 RooFit::OwningPtr<RooWorkspace> MakeCombinedModel(std::vector<std::string>, std::vector<std::unique_ptr<RooWorkspace>>&);
63
66 std::string filename);
67
68 void SetFunctionsToPreprocess(std::vector<std::string> lines) { fPreprocessFunctions=lines; }
69
70 protected:
71
72 void AddConstraintTerms(RooWorkspace& proto, Measurement& measurement, std::string prefix, std::string interpName,
73 std::vector<OverallSys>& systList,
74 std::vector<std::string>& likelihoodTermNames,
75 std::vector<std::string>& totSystTermNames);
76
77 std::unique_ptr<RooProduct> CreateNormFactor(RooWorkspace& proto, std::string& channel,
78 std::string& sigmaEpsilon, Sample& sample, bool doRatio);
79
80 std::unique_ptr<RooWorkspace> MakeSingleChannelWorkspace(Measurement& measurement, Channel& channel);
81
82 void MakeTotalExpected(RooWorkspace& proto, const std::string& totName,
83 const std::vector<RooProduct*>& sampleScaleFactors,
84 std::vector<std::vector<RooAbsArg*>>& sampleHistFuncs) const;
85
86 RooHistFunc* MakeExpectedHistFunc(const TH1* hist, RooWorkspace& proto, std::string prefix,
87 const RooArgList& observables) const;
88
89 std::unique_ptr<TH1> MakeScaledUncertaintyHist(const std::string& Name,
90 std::vector< std::pair<const TH1*, std::unique_ptr<TH1>> > const& HistVec ) const;
91
92 TH1* MakeAbsolUncertaintyHist( const std::string& Name, const TH1* Hist );
93
94 void ConfigureHistFactoryDataset(RooDataSet& obsData, TH1 const& nominal, RooWorkspace& proto,
95 std::vector<std::string> const& obsNameVec);
96
97 std::vector<std::string> fSystToFix;
98 std::map<std::string, double> fParamValues;
99 double fNomLumi = 1.0;
100 double fLumiError = 0.0;
101 int fLowBin = 0;
102 int fHighBin = 0;
103
104 private:
105
106 void GuessObsNameVec(const TH1* hist);
107
108 std::vector<std::string> fObsNameVec;
109 std::string fObsName;
110 std::vector<std::string> fPreprocessFunctions;
112
114
116 };
117
118 }
119}
120
121#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
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 filename
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 result
const char * proto
Definition civetweb.c:17535
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
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:24
Container class to hold unbinned data.
Definition RooDataSet.h:33
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
A real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:31
Represents the product of a given set of RooAbsReal objects.
Definition RooProduct.h:29
This class encapsulates all information for the statistical interpretation of one experiment.
Definition Channel.h:30
This class provides helper functions for creating likelihood models from histograms.
std::unique_ptr< RooProduct > CreateNormFactor(RooWorkspace &proto, std::string &channel, std::string &sigmaEpsilon, Sample &sample, bool doRatio)
std::unique_ptr< RooWorkspace > MakeSingleChannelWorkspace(Measurement &measurement, Channel &channel)
void MakeTotalExpected(RooWorkspace &proto, const std::string &totName, const std::vector< RooProduct * > &sampleScaleFactors, std::vector< std::vector< RooAbsArg * > > &sampleHistFuncs) const
std::unique_ptr< TH1 > MakeScaledUncertaintyHist(const std::string &Name, std::vector< std::pair< const TH1 *, std::unique_ptr< TH1 > > > const &HistVec) const
RooHistFunc * MakeExpectedHistFunc(const TH1 *hist, RooWorkspace &proto, std::string prefix, const RooArgList &observables) const
Create the nominal hist function from hist, and register it in the workspace.
void SetFunctionsToPreprocess(std::vector< std::string > lines)
RooFit::OwningPtr< RooWorkspace > MakeSingleChannelModel(Measurement &measurement, Channel &channel)
RooFit::OwningPtr< RooWorkspace > MakeCombinedModel(std::vector< std::string >, std::vector< std::unique_ptr< RooWorkspace > > &)
TH1 * MakeAbsolUncertaintyHist(const std::string &Name, const TH1 *Hist)
static void ConfigureWorkspaceForMeasurement(const std::string &ModelName, RooWorkspace *ws_single, Measurement &measurement)
void AddConstraintTerms(RooWorkspace &proto, Measurement &measurement, std::string prefix, std::string interpName, std::vector< OverallSys > &systList, std::vector< std::string > &likelihoodTermNames, std::vector< std::string > &totSystTermNames)
void ConfigureHistFactoryDataset(RooDataSet &obsData, TH1 const &nominal, RooWorkspace &proto, std::vector< std::string > const &obsNameVec)
static void PrintCovarianceMatrix(RooFitResult *result, RooArgSet *params, std::string filename)
RooArgList createObservables(const TH1 *hist, RooWorkspace &proto) const
Create observables of type RooRealVar. Creates 1 to 3 observables, depending on the type of the histo...
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
Definition Measurement.h:31
Persistable container for RooFit projects.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
Mother of all ROOT objects.
Definition TObject.h:41
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35
Namespace for the RooStats classes.
Definition CodegenImpl.h:58