Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
HLFactory.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2
3/*************************************************************************
4 * Project: RooStats *
5 * Package: RooFit/RooStats *
6 * Authors: *
7 * Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke *
8 *************************************************************************
9 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef RooStats_HLFactory
17#define RooStats_HLFactory
18
19#include "RooAbsPdf.h"
20#include "RooCategory.h"
21#include "RooDataSet.h"
22#include "RooWorkspace.h"
23
24#include <ROOT/RConfig.hxx> // for R__DEPRECATED
25
26 class TString;
28namespace RooStats {
29
30 class HLFactory : public TNamed {
31
32 public:
34 /// Constructor
35 HLFactory(const char *name,
36 const char *fileName=nullptr,
37 bool isVerbose = false);
38
39 /// Constructor with external RooWorkspace
40 HLFactory(const char* name,
42 bool isVerbose = false);
43
44 /// Default Constructor
46
47 /// Default Destructor
48 ~HLFactory() override;
49
50 /// Add channel for the combination
51 int AddChannel(const char* label,
52 const char* SigBkgPdfName,
53 const char* BkgPdfName=nullptr,
54 const char* datasetName=nullptr);
55
56 /// Dump the Workspace content as configuration file
57 /* It needs some workspace object list or something..*/
58 void DumpCfg(const char* /*cardname*/ ){ /* t.b.i. */ }; // Dump the factory content as configuration file
60 /// Get the combined signal plus background pdf
61 RooAbsPdf* GetTotSigBkgPdf(); // Get the Signal and Background combined model
63 /// Get the combined background pdf
64 RooAbsPdf* GetTotBkgPdf(); // Get the Background combined model
66 /// Get the combined dataset
67 RooDataSet* GetTotDataSet(); // Get the combined dataset
69 /// Get the combined dataset
70 RooCategory* GetTotCategory(); // Get the category
72 /// Get the RooWorkspace containing the models and variables
73 RooWorkspace* GetWs(){return fWs;}; // Expose the internal Workspace
74
75 /// Process a configuration file
76 int ProcessCard(const char* filename);
77
78 private:
79
80 /// Create the category for the combinations
81 void fCreateCategory();
82
83 /// Check the length of the lists
85
86 /// Read the actual cfg file
87 int fReadFile(const char*fileName, bool is_included = false);
88
89 /// Parse a single line an puts the content in the RooWorkSpace
91
92 RooCategory *fComboCat = nullptr; ///< The category of the combination
93 RooAbsPdf *fComboBkgPdf = nullptr; ///< The background model combination
94 RooAbsPdf *fComboSigBkgPdf = nullptr; ///< The signal plus background model combination
95 RooDataSet *fComboDataset = nullptr; ///< The datasets combination
96 bool fCombinationDone = false; ///< Flag to keep trace of the status of the combination
97 TList fSigBkgPdfNames; ///< List of channels names to combine for the signal plus background pdfs
98 TList fBkgPdfNames; ///< List of channels names to combine for the background pdfs
99 TList fDatasetsNames; ///< List of channels names to combine for the datasets
100 TList fLabelsNames; ///< List of channels names to combine for the datasets
101 bool fVerbose = false; ///< The verbosity flag
102 int fInclusionLevel = 0; ///< Keep trace of the inclusion deepness
103 RooWorkspace *fWs = nullptr; ///< The RooWorkspace containing the models and variables
104 bool fOwnWs = false; ///< Owns workspace
105
106 ClassDefOverride(HLFactory,1) // The high Level Model Factory to create models from datacards
107
108#ifdef ROOFIT_BUILDS_ITSELF // to avoid the deprecation warnings when building RooFit itself
109 };
110#else
111 } R__DEPRECATED(6,38, "Outdated higher-level interface around RooWorkspace. Use RooWorkspace directly.");
112#endif
113}
114
115#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:520
#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
char name[80]
Definition TGX11.cxx:110
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Object to represent discrete states.
Definition RooCategory.h:28
Container class to hold unbinned data.
Definition RooDataSet.h:34
HLFactory is an High Level model Factory allows you to describe your models in a configuration file (...
Definition HLFactory.h:30
TList fSigBkgPdfNames
List of channels names to combine for the signal plus background pdfs.
Definition HLFactory.h:97
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
Definition HLFactory.h:103
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
Definition HLFactory.h:98
int fInclusionLevel
Keep trace of the inclusion deepness.
Definition HLFactory.h:102
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition HLFactory.h:93
TList fLabelsNames
List of channels names to combine for the datasets.
Definition HLFactory.h:100
RooDataSet * GetTotDataSet()
Get the combined dataset.
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
HLFactory()
Default Constructor.
Definition HLFactory.cxx:75
RooCategory * fComboCat
The category of the combination.
Definition HLFactory.h:92
RooDataSet * fComboDataset
The datasets combination.
Definition HLFactory.h:95
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition HLFactory.h:99
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
void DumpCfg(const char *)
Dump the Workspace content as configuration file.
Definition HLFactory.h:58
RooAbsPdf * fComboSigBkgPdf
The signal plus background model combination.
Definition HLFactory.h:94
bool fNamesListsConsistent()
Check the length of the lists.
bool fCombinationDone
Flag to keep trace of the status of the combination.
Definition HLFactory.h:96
RooAbsPdf * GetTotSigBkgPdf()
Get the combined signal plus background pdf.
int AddChannel(const char *label, const char *SigBkgPdfName, const char *BkgPdfName=nullptr, const char *datasetName=nullptr)
Add channel for the combination.
int ProcessCard(const char *filename)
Process a configuration file.
RooCategory * GetTotCategory()
Get the combined dataset.
bool fOwnWs
Owns workspace.
Definition HLFactory.h:104
RooWorkspace * GetWs()
Get the RooWorkspace containing the models and variables.
Definition HLFactory.h:73
~HLFactory() override
Default Destructor.
Definition HLFactory.cxx:85
void fCreateCategory()
Create the category for the combinations.
bool fVerbose
The verbosity flag.
Definition HLFactory.h:101
int fReadFile(const char *fileName, bool is_included=false)
Read the actual cfg file.
Persistable container for RooFit projects.
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Basic string class.
Definition TString.h:139
TLine * line
Namespace for the RooStats classes.
Definition CodegenImpl.h:58