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
50 };
51
55
56 static void ConfigureWorkspaceForMeasurement( const std::string& ModelName,
57 RooWorkspace* ws_single,
58 Measurement& measurement );
59
61 RooFit::OwningPtr<RooWorkspace> MakeCombinedModel(std::vector<std::string>, std::vector<std::unique_ptr<RooWorkspace>>&);
62
65 std::string filename);
66
67 void SetFunctionsToPreprocess(std::vector<std::string> lines) { fPreprocessFunctions=lines; }
68
69 protected:
70
71 void AddConstraintTerms(RooWorkspace& proto, Measurement& measurement, std::string prefix, std::string interpName,
72 std::vector<OverallSys>& systList,
73 std::vector<std::string>& likelihoodTermNames,
74 std::vector<std::string>& totSystTermNames);
75
76 std::unique_ptr<RooProduct> CreateNormFactor(RooWorkspace& proto, std::string& channel,
77 std::string& sigmaEpsilon, Sample& sample, bool doRatio);
78
79 std::unique_ptr<RooWorkspace> MakeSingleChannelWorkspace(Measurement& measurement, Channel& channel);
80
81 void MakeTotalExpected(RooWorkspace& proto, const std::string& totName,
82 const std::vector<RooProduct*>& sampleScaleFactors,
83 std::vector<std::vector<RooAbsArg*>>& sampleHistFuncs) const;
84
85 RooHistFunc* MakeExpectedHistFunc(const TH1* hist, RooWorkspace& proto, std::string prefix,
86 const RooArgList& observables) const;
87
88 std::unique_ptr<TH1> MakeScaledUncertaintyHist(const std::string& Name,
89 std::vector< std::pair<const TH1*, std::unique_ptr<TH1>> > const& HistVec ) const;
90
91 TH1* MakeAbsolUncertaintyHist( const std::string& Name, const TH1* Hist );
92
93 void ConfigureHistFactoryDataset(RooDataSet& obsData, TH1 const& nominal, RooWorkspace& proto,
94 std::vector<std::string> const& obsNameVec);
95
96 std::vector<std::string> fSystToFix;
97 std::map<std::string, double> fParamValues;
98 double fNomLumi = 1.0;
99 double fLumiError = 0.0;
100 int fLowBin = 0;
101 int fHighBin = 0;
102
103 private:
104
105 void GuessObsNameVec(const TH1* hist);
106
107 std::vector<std::string> fObsNameVec;
108 std::string fObsName;
109 std::vector<std::string> fPreprocessFunctions;
111
113
115 };
116
117 }
118}
119
120#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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:17536
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:55
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:31
A RooProduct 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:58
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:43
Namespace for the RooStats classes.
Definition Asimov.h:19