47HLFactory::HLFactory(
const char *
name,
const char *fileName,
bool isVerbose)
112 std::cerr <<
"Cannot add anymore channels. "
113 <<
"Combination already carried out.\n";
119 std::cerr <<
"Pdf " <<
SigBkgPdfName <<
" not found in workspace!\n";
128 std::cerr <<
"Pdf " <<
BkgPdfName <<
" not found in workspace!\n";
137 std::cerr <<
"Dataset " <<
DatasetName <<
" not found in workspace!\n";
281 if (!
data)
return nullptr;
356 TString warning(
"The inclusion stack is deeper than ");
358 warning+=
". Is this a recursive inclusion?";
364 std::ifstream
ifile(fileName);
369 error+=
" could not be opened.";
392 if (
line.EndsWith(
"*/")){
394 if (
fVerbose)
Info(
"fReadFile",
"Out of multiline comment ...");
402 if ((
line.BeginsWith(
"/*") &&
line.EndsWith(
"*/")) ||
403 line.BeginsWith(
"//")){
404 if (
fVerbose)
Info(
"fReadFile",
"In single line comment ...");
409 if (
line.BeginsWith(
"/*")){
411 if (
fVerbose)
Info(
"fReadFile",
"In multiline comment ...");
434 line.ReplaceAll(
"\n",
"");
437 if (
line.BeginsWith(
"echo")){
440 std::cout <<
"Echoing line " <<
line.Data() << std::endl;
441 std::cout <<
"[" <<
GetName() <<
"] echo: "
442 <<
line.Data() << std::endl;
455 if (
fVerbose)
Info(
"fReadFile",
"%s",
"Empty line: skipping ...");
461 if (
line.BeginsWith(
"#include")){
462 line.ReplaceAll(
"#include",
"");
463 if (
fVerbose)
Info(
"fReadFile",
"Reading included file...");
509 std::cerr <<
"The number of datasets and models added as channels "
510 <<
" is not the same!\n";
527 if (
line.Contains(
"::") ||
529 (
line.Contains(
"[") &&
530 line.Contains(
"]") &&
532 !
line.Contains(
"(") &&
533 !
line.Contains(
")"))) {
550 if (
fVerbose)
Info(
"fParseLine",
"o_name=%s o_class=%s o_descr=%s",
564 Error(
"fParseLine",
"Import wrong syntax: cannot process %s",
o_descr.Data());
592 std::cout <<
"DEBUG: line: " <<
line.Data() << std::endl;
593 std::cout <<
"DEBUG: new_line: " <<
new_line.Data() << std::endl;
bool fOwnWs
Owns workspace.
bool fVerbose
The verbosity flag.
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Abstract interface for all probability density functions.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
bool setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
bool defineType(const std::string &label)
Define a state with given name.
Container class to hold unbinned data.
virtual RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true)
Add a column with the values of the given (function) argument to this dataset.
void append(RooDataSet &data)
Add all data points of given data set to this data set.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
TList fSigBkgPdfNames
List of channels names to combine for the signal plus background pdfs.
RooWorkspace * fWs
The RooWorkspace containing the models and variables.
TList fBkgPdfNames
List of channels names to combine for the background pdfs.
int fInclusionLevel
Keep trace of the inclusion deepness.
RooAbsPdf * fComboBkgPdf
The background model combination.
TList fLabelsNames
List of channels names to combine for the datasets.
RooDataSet * GetTotDataSet()
Get the combined dataset.
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
HLFactory()
Default Constructor.
RooCategory * fComboCat
The category of the combination.
RooDataSet * fComboDataset
The datasets combination.
TList fDatasetsNames
List of channels names to combine for the datasets.
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
RooAbsPdf * fComboSigBkgPdf
The signal plus background model combination.
bool fNamesListsConsistent()
Check the length of the lists.
bool fCombinationDone
Flag to keep trace of the status of the combination.
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.
~HLFactory() override
Default Destructor.
void fCreateCategory()
Create the category for the combinations.
bool fVerbose
The verbosity flag.
int fReadFile(const char *fileName, bool is_included=false)
Read the actual cfg file.
Persistable container for RooFit projects.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooFactoryWSTool & factory()
Return instance to factory tool.
RooAbsData * data(RooStringView name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
bool import(const RooAbsArg &arg, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Add(TObject *obj) override
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Collectable string class.
const TString & GetString() const
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.