Logo ROOT  
Reference Guide
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
25 class TString;
26
27namespace RooStats {
28
29 class HLFactory : public TNamed {
30
31 public:
32
33 /// Constructor
34 HLFactory(const char *name,
35 const char *fileName=nullptr,
36 bool isVerbose = false);
37
38 /// Constructor with external RooWorkspace
39 HLFactory(const char* name,
40 RooWorkspace* externalWs,
41 bool isVerbose = false);
42
43 /// Default Constructor
44 HLFactory();
45
46 /// Default Destructor
47 ~HLFactory() override;
48
49 /// Add channel for the combination
50 int AddChannel(const char* label,
51 const char* SigBkgPdfName,
52 const char* BkgPdfName=nullptr,
53 const char* datasetName=nullptr);
54
55 /// Dump the Workspace content as configuration file
56 /* It needs some workspace object list or something..*/
57 void DumpCfg(const char* /*cardname*/ ){ /* t.b.i. */ }; // Dump the factory content as configuration file
58
59 /// Get the combined signal plus background pdf
60 RooAbsPdf* GetTotSigBkgPdf(); // Get the Signal and Background combined model
61
62 /// Get the combined background pdf
63 RooAbsPdf* GetTotBkgPdf(); // Get the Background combined model
64
65 /// Get the combined dataset
66 RooDataSet* GetTotDataSet(); // Get the combined dataset
67
68 /// Get the combined dataset
69 RooCategory* GetTotCategory(); // Get the category
70
71 /// Get the RooWorkspace containing the models and variables
72 RooWorkspace* GetWs(){return fWs;}; // Expose the internal Workspace
73
74 /// Process a configuration file
75 int ProcessCard(const char* filename);
76
77 private:
78
79 /// The category of the combination
81
82 /// The background model combination
84
85 /// The signal plus background model combination
87
88 /// The datasets combination
90
91 /// Flag to keep trace of the status of the combination
93
94 /// Create the category for the combinations
95 void fCreateCategory();
96
97 /// Check the length of the lists
99
100 /// List of channels names to combine for the signal plus background pdfs
102
103 /// List of channels names to combine for the background pdfs
105
106 /// List of channels names to combine for the datasets
108
109 /// List of channels names to combine for the datasets
111
112 /// The verbosity flag
114
115 /// Keep trace of the inclusion deepness
117
118 /// The RooWorkspace containing the models and variables
120
121 /// Owns workspace
122 bool fOwnWs;
123
124 /// Read the actual cfg file
125 int fReadFile(const char*fileName, bool is_included = false);
126
127 /// Parse a single line an puts the content in the RooWorkSpace
128 int fParseLine(TString& line);
129
130
131 ClassDefOverride(HLFactory,1) // The high Level Model Factory to create models from datacards
132
133 };
134}
135
136#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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
RooCategory is an object to represent discrete states.
Definition: RooCategory.h:28
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:55
HLFactory is an High Level model Factory allows you to describe your models in a configuration file (...
Definition: HLFactory.h:29
TList fSigBkgPdfNames
List of channels names to combine for the signal plus background pdfs.
Definition: HLFactory.h:101
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
Definition: HLFactory.h:119
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
Definition: HLFactory.h:104
int fInclusionLevel
Keep trace of the inclusion deepness.
Definition: HLFactory.h:116
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition: HLFactory.h:83
TList fLabelsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:110
RooDataSet * GetTotDataSet()
Get the combined dataset.
Definition: HLFactory.cxx:281
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
Definition: HLFactory.cxx:551
HLFactory()
Default Constructor.
Definition: HLFactory.cxx:98
RooCategory * fComboCat
The category of the combination.
Definition: HLFactory.h:80
RooDataSet * fComboDataset
The datasets combination.
Definition: HLFactory.h:89
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:107
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
Definition: HLFactory.cxx:236
void DumpCfg(const char *)
Dump the Workspace content as configuration file.
Definition: HLFactory.h:57
RooAbsPdf * fComboSigBkgPdf
The signal plus background model combination.
Definition: HLFactory.h:86
bool fNamesListsConsistent()
Check the length of the lists.
Definition: HLFactory.cxx:536
bool fCombinationDone
Flag to keep trace of the status of the combination.
Definition: HLFactory.h:92
RooAbsPdf * GetTotSigBkgPdf()
Get the combined signal plus background pdf.
Definition: HLFactory.cxx:190
int AddChannel(const char *label, const char *SigBkgPdfName, const char *BkgPdfName=nullptr, const char *datasetName=nullptr)
Add channel for the combination.
Definition: HLFactory.cxx:141
int ProcessCard(const char *filename)
Process a configuration file.
Definition: HLFactory.cxx:350
RooCategory * GetTotCategory()
Get the combined dataset.
Definition: HLFactory.cxx:333
bool fOwnWs
Owns workspace.
Definition: HLFactory.h:122
RooWorkspace * GetWs()
Get the RooWorkspace containing the models and variables.
Definition: HLFactory.h:72
~HLFactory() override
Default Destructor.
Definition: HLFactory.cxx:119
void fCreateCategory()
Create the category for the combinations.
Definition: HLFactory.cxx:515
bool fVerbose
The verbosity flag.
Definition: HLFactory.h:113
int fReadFile(const char *fileName, bool is_included=false)
Read the actual cfg file.
Definition: HLFactory.cxx:381
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
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:136
TLine * line
Namespace for the RooStats classes.
Definition: Asimov.h:19