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 "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
94  bool fCombinationDone;
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
118  int fInclusionLevel;
119 
120  /// The RooWorkspace containing the models and variables
121  RooWorkspace* fWs;
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
RooWorkspace.h
RooStats::HLFactory::fComboCat
RooCategory * fComboCat
The category of the combination.
Definition: HLFactory.h:104
RooStats::HLFactory::fDatasetsNames
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:131
RooStats::HLFactory::GetTotDataSet
RooDataSet * GetTotDataSet()
Get the combined dataset.
Definition: HLFactory.cxx:290
RooStats::HLFactory::DumpCfg
void DumpCfg(const char *)
Dump the Workspace content as configuration file.
Definition: HLFactory.h:81
RooStats::HLFactory::fLabelsNames
TList fLabelsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:134
RooStats::HLFactory::GetWs
RooWorkspace * GetWs()
Get the RooWorkspace containing the models and variables.
Definition: HLFactory.h:96
RooStats::HLFactory::fSigBkgPdfNames
TList fSigBkgPdfNames
List of channels names to combine for the signal plus background pdfs.
Definition: HLFactory.h:125
RooStats::HLFactory
Definition: HLFactory.h:42
RooStats::HLFactory::fCreateCategory
void fCreateCategory()
Create the category for the combinations.
Definition: HLFactory.cxx:534
TString
Definition: TString.h:136
RooDataSet.h
TString.h
RooStats::HLFactory::AddChannel
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
RooStats::HLFactory::fComboBkgPdf
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition: HLFactory.h:107
RooStats::HLFactory::ProcessCard
int ProcessCard(const char *filename)
Process a configuration file.
Definition: HLFactory.cxx:360
RooStats::HLFactory::GetTotSigBkgPdf
RooAbsPdf * GetTotSigBkgPdf()
Get the combined signal plus background pdf.
Definition: HLFactory.cxx:190
RooStats::HLFactory::fWs
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
Definition: HLFactory.h:143
RooStats::HLFactory::GetTotCategory
RooCategory * GetTotCategory()
Get the combined dataset.
Definition: HLFactory.cxx:343
RooStats::HLFactory::fCombinationDone
bool fCombinationDone
Flag to keep trace of the status of the combination.
Definition: HLFactory.h:116
RooStats::HLFactory::GetTotBkgPdf
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
Definition: HLFactory.cxx:241
RooStats::HLFactory::fReadFile
int fReadFile(const char *fileName, bool is_included=false)
Read the actual cfg file.
Definition: HLFactory.cxx:391
RooStats::HLFactory::~HLFactory
~HLFactory()
Default Destructor.
Definition: HLFactory.cxx:119
RooAbsPdf.h
TNamed
Definition: TNamed.h:29
RooStats::HLFactory::fInclusionLevel
int fInclusionLevel
Keep trace of the inclusion deepness.
Definition: HLFactory.h:140
RooStats::HLFactory::fParseLine
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
Definition: HLFactory.cxx:574
RooCategory.h
line
TLine * line
Definition: entrylistblock_figure1.C:235
RooStats::HLFactory::fOwnWs
bool fOwnWs
Owns workspace.
Definition: HLFactory.h:146
RooStats::HLFactory::fNamesListsConsistent
bool fNamesListsConsistent()
Check the length of the lists.
Definition: HLFactory.cxx:559
RooWorkspace
Definition: RooWorkspace.h:43
RooCategory
Definition: RooCategory.h:27
RooStats
Definition: Asimov.h:19
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooStats::HLFactory::fComboSigBkgPdf
RooAbsPdf * fComboSigBkgPdf
The signal plus background model combination.
Definition: HLFactory.h:110
name
char name[80]
Definition: TGX11.cxx:110
RooStats::HLFactory::fBkgPdfNames
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
Definition: HLFactory.h:128
RooDataSet
Definition: RooDataSet.h:33
RooAbsPdf
Definition: RooAbsPdf.h:40
RooStats::HLFactory::HLFactory
HLFactory()
Default Constructor.
Definition: HLFactory.cxx:98
RooStats::HLFactory::fComboDataset
RooDataSet * fComboDataset
The datasets combination.
Definition: HLFactory.h:113
TList
Definition: TList.h:44
RooStats::HLFactory::fVerbose
bool fVerbose
The verbosity flag.
Definition: HLFactory.h:137