1 #ifndef INCLUDE_HISTFACTORYNAVIGATION_H
2 #define INCLUDE_HISTFACTORYNAVIGATION_H
16 namespace HistFactory {
18 class HistFactoryNavigation {
24 HistFactoryNavigation(ModelConfig* mc);
25 HistFactoryNavigation(
const std::string& File,
26 const std::string& WorkspaceName=
"combined",
27 const std::string& ModelConfigName=
"ModelConfig");
28 HistFactoryNavigation(RooAbsPdf* model, RooArgSet* observables);
30 virtual ~HistFactoryNavigation() {}
35 void PrintState(
const std::string& channel);
38 void PrintParameters(
bool IncludeConstantParams=
false);
41 void PrintChannelParameters(
const std::string& channel,
42 bool IncludeConstantParams=
false);
45 void PrintSampleParameters(
const std::string& channel,
const std::string& sample,
46 bool IncludeConstantParams=
false);
50 void PrintSampleComponents(
const std::string& channel,
const std::string& sample);
53 void PrintDataSet(RooDataSet* data,
const std::string& channel=
"");
56 void PrintModelAndData(RooDataSet* data);
59 double GetBinValue(
int bin,
const std::string& channel);
61 double GetBinValue(
int bin,
const std::string& channel,
const std::string& sample);
65 TH1* GetSampleHist(
const std::string& channel,
66 const std::string& sample,
const std::string& name=
"");
69 TH1* GetChannelHist(
const std::string& channel,
const std::string& name=
"");
72 TH1* GetDataHist(RooDataSet* data,
const std::string& channel,
const std::string& name=
"");
75 THStack* GetChannelStack(
const std::string& channel,
const std::string& name=
"");
78 void DrawChannel(
const std::string& channel, RooDataSet* data=NULL);
81 RooAbsReal* SampleFunction(
const std::string& channel,
const std::string& sample);
84 RooArgSet* GetObservableSet(
const std::string& channel);
87 RooAbsReal* GetConstraintTerm(
const std::string& parameter);
90 double GetConstraintUncertainty(
const std::string& parameter);
95 void ReplaceNode(
const std::string& ToReplace, RooAbsArg* ReplaceWith);
99 void SetConstant(
const std::string& regExpr=
".*",
bool constant=
true);
101 void SetMaxBinToPrint(
int max) { _maxBinToPrint = max; }
102 int GetMaxBinToPrint()
const {
return _maxBinToPrint; }
104 void SetMinBinToPrint(
int min) { _minBinToPrint = min; }
105 int GetMinBinToPrint()
const {
return _minBinToPrint; }
108 RooAbsPdf* GetModel()
const {
return fModel; }
111 RooAbsPdf* GetChannelPdf(
const std::string& channel);
114 std::vector< std::string > GetChannelSampleList(
const std::string& channel);
118 RooRealVar* var(
const std::string& varName)
const;
140 void SetPrintWidths(
const std::string& channel);
144 void _GetNodes(ModelConfig* mc);
145 void _GetNodes(RooAbsPdf* model,
const RooArgSet* observables);
149 void PrintMultiDimHist(TH1* hist,
int bin_print_width);
153 TH1* MakeHistFromRooFunction( RooAbsReal* func, RooArgList vars, std::string name=
"Hist" );
156 std::map< std::string, RooAbsReal*> GetSampleFunctionMap(
const std::string& channel);
164 RooArgSet* fObservables;
169 int _label_print_width;
170 int _bin_print_width;
173 std::vector<std::string> fChannelNameVec;
176 std::map< std::string, RooAbsPdf* > fChannelPdfMap;
179 std::map< std::string, RooAbsPdf* > fChannelSumNodeMap;
182 std::map< std::string, RooArgSet*> fChannelObservMap;
186 std::map< std::string, std::map< std::string, RooAbsReal*> > fChannelSampleFunctionMap;
190 RooAbsArg* findChild(
const std::string& name, RooAbsReal* parent)
const;
193 RooArgSet _GetAllProducts(RooProduct* node);
197 ClassDef(RooStats::HistFactory::HistFactoryNavigation,2)
203 #endif // INCLUDE_HISTFACTORYNAVIGATION_H