Logo ROOT  
Reference Guide
 
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
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 /// Create the category for the combinations
80 void fCreateCategory();
81
82 /// Check the length of the lists
84
85 /// Read the actual cfg file
86 int fReadFile(const char*fileName, bool is_included = false);
87
88 /// Parse a single line an puts the content in the RooWorkSpace
90
91 RooCategory *fComboCat = nullptr; ///< The category of the combination
92 RooAbsPdf *fComboBkgPdf = nullptr; ///< The background model combination
93 RooAbsPdf *fComboSigBkgPdf = nullptr; ///< The signal plus background model combination
94 RooDataSet *fComboDataset = nullptr; ///< The datasets combination
95 bool fCombinationDone = false; ///< Flag to keep trace of the status of the combination
96 TList fSigBkgPdfNames; ///< List of channels names to combine for the signal plus background pdfs
97 TList fBkgPdfNames; ///< List of channels names to combine for the background pdfs
98 TList fDatasetsNames; ///< List of channels names to combine for the datasets
99 TList fLabelsNames; ///< List of channels names to combine for the datasets
100 bool fVerbose = false; ///< The verbosity flag
101 int fInclusionLevel = 0; ///< Keep trace of the inclusion deepness
102 RooWorkspace *fWs = nullptr; ///< The RooWorkspace containing the models and variables
103 bool fOwnWs = false; ///< Owns workspace
104
105 ClassDefOverride(HLFactory,1) // The high Level Model Factory to create models from datacards
106
107 };
108}
109
110#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
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:57
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:96
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
Definition HLFactory.h:102
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
Definition HLFactory.h:97
int fInclusionLevel
Keep trace of the inclusion deepness.
Definition HLFactory.h:101
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition HLFactory.h:92
TList fLabelsNames
List of channels names to combine for the datasets.
Definition HLFactory.h:99
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:76
RooCategory * fComboCat
The category of the combination.
Definition HLFactory.h:91
RooDataSet * fComboDataset
The datasets combination.
Definition HLFactory.h:94
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition HLFactory.h:98
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
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:93
bool fNamesListsConsistent()
Check the length of the lists.
bool fCombinationDone
Flag to keep trace of the status of the combination.
Definition HLFactory.h:95
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:103
RooWorkspace * GetWs()
Get the RooWorkspace containing the models and variables.
Definition HLFactory.h:72
~HLFactory() override
Default Destructor.
Definition HLFactory.cxx:86
void fCreateCategory()
Create the category for the combinations.
bool fVerbose
The verbosity flag.
Definition HLFactory.h:100
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 Asimov.h:19