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