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
60 RooWorkspace* MakeSingleChannelModel( Measurement& measurement, Channel& channel );
61 RooWorkspace* MakeCombinedModel(std::vector<std::string>, std::vector<std::unique_ptr<RooWorkspace>>&);
62
63 static RooWorkspace* MakeCombinedModel( Measurement& measurement );
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
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
94 std::vector<std::string>& constraintTerms,
95 ParamHistFunc& paramHist, const TH1* uncertHist,
96 Constraint::Type type, double minSigma );
97
98 void ConfigureHistFactoryDataset(RooDataSet& obsData, TH1 const& nominal, RooWorkspace& proto,
99 std::vector<std::string> const& obsNameVec);
100
101 std::vector<std::string> fSystToFix;
102 std::map<std::string, double> fParamValues;
103 double fNomLumi = 1.0;
104 double fLumiError = 0.0;
105 int fLowBin = 0;
106 int fHighBin = 0;
107
108 private:
109
110 void GuessObsNameVec(const TH1* hist);
111
112 std::vector<std::string> fObsNameVec;
113 std::string fObsName;
114 std::vector<std::string> fPreprocessFunctions;
116
118
120 };
121
122 }
123}
124
125#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
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
const char * proto
Definition civetweb.c:17502
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)
RooWorkspace * MakeSingleChannelModel(Measurement &measurement, Channel &channel)
RooWorkspace * MakeSingleChannelWorkspace(Measurement &measurement, Channel &channel)
RooArgList createStatConstraintTerms(RooWorkspace *proto, std::vector< std::string > &constraintTerms, ParamHistFunc &paramHist, const TH1 *uncertHist, Constraint::Type type, double minSigma)
std::unique_ptr< TH1 > MakeScaledUncertaintyHist(const std::string &Name, std::vector< std::pair< const TH1 *, std::unique_ptr< TH1 > > > const &HistVec) const
void SetFunctionsToPreprocess(std::vector< std::string > lines)
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.
TH1 * MakeAbsolUncertaintyHist(const std::string &Name, const TH1 *Hist)
static void ConfigureWorkspaceForMeasurement(const std::string &ModelName, RooWorkspace *ws_single, Measurement &measurement)
void MakeTotalExpected(RooWorkspace *proto, const std::string &totName, const std::vector< RooProduct * > &sampleScaleFactors, std::vector< std::vector< RooAbsArg * > > &sampleHistFuncs) const
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)
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)
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...
RooWorkspace * MakeCombinedModel(std::vector< std::string >, std::vector< std::unique_ptr< RooWorkspace > > &)
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
Definition Measurement.h:31
The RooWorkspace is a 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
Namespace for the RooStats classes.
Definition Asimov.h:19