Logo ROOT   6.14/05
Reference Guide
HLFactory.cxx
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Danilo Piparo 25/08/2009
3 
4 
5 /*************************************************************************
6  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 ////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #include <iostream>
17 #include <fstream>
18 
19 #include "RooStats/HLFactory.h"
20 #include "TFile.h"
21 #include "TObject.h"
22 #include "TObjArray.h"
23 #include "TObjString.h"
24 
25 #include "RooSimultaneous.h"
26 
27 /** \class RooStats::HLFactory
28  \ingroup Roostats
29 
30 HLFactory is an High Level model Factory allows you to
31 describe your models in a configuration file
32 (_datacards_) acting as an interface with the RooFactoryWSTool.
33 Moreover it provides tools for the combination of models and datasets.
34 
35 */
36 
37 using namespace std;
38 
40 
41 
42 using namespace RooStats;
43 using namespace RooFit;
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Constructor with the name of the config file to interpret and the
47 /// verbosity flag. The extension for the config files is assumed to
48 /// be ".rs".
49 
50 HLFactory::HLFactory(const char *name,
51  const char *fileName,
52  bool isVerbose):
53  TNamed(name,name),
54  fComboCat(0),
55  fComboBkgPdf(0),
56  fComboSigBkgPdf(0),
57  fComboDataset(0),
58  fCombinationDone(false),
59  fVerbose(isVerbose),
60  fInclusionLevel(0),
61  fOwnWs(true){
62  TString wsName(name);
63  wsName+="_ws";
64  fWs = new RooWorkspace(wsName,true);
65 
69 
70  // Start the parsing
71  fReadFile(fileName);
72 }
73 
74 ////////////////////////////////////////////////////////////////////////////////
75 /// Constructor without a card but with an external workspace.
76 
78  RooWorkspace* externalWs,
79  bool isVerbose):
80  TNamed(name,name),
81  fComboCat(0),
82  fComboBkgPdf(0),
83  fComboSigBkgPdf(0),
84  fComboDataset(0),
85  fCombinationDone(false),
86  fVerbose(isVerbose),
87  fInclusionLevel(0),
88  fOwnWs(false){
89  fWs=externalWs;
93 
94 }
95 
96 ////////////////////////////////////////////////////////////////////////////////
97 
99  TNamed("hlfactory","hlfactory"),
100  fComboCat(0),
101  fComboBkgPdf(0),
102  fComboSigBkgPdf(0),
103  fComboDataset(0),
104  fCombinationDone(false),
105  fVerbose(false),
106  fInclusionLevel(0),
107  fOwnWs(true){
108  fWs = new RooWorkspace("hlfactory_ws",true);
109 
113 
114  }
115 
116 ////////////////////////////////////////////////////////////////////////////////
117 /// destructor
118 
120  if (fComboSigBkgPdf!=NULL)
121  delete fComboSigBkgPdf;
122  if (fComboBkgPdf!=NULL)
123  delete fComboBkgPdf;
124  if (fComboDataset!=NULL)
125  delete fComboDataset;
126  if (fComboCat!=NULL)
127  delete fComboCat;
128 
129  if (fOwnWs)
130  delete fWs;
131 }
132 
133 ////////////////////////////////////////////////////////////////////////////////
134 /// Add a channel to the combination. The channel can be specified as:
135 /// - A signal plus background pdf
136 /// - A background only pdf
137 /// - A dataset
138 /// Once the combination of the pdfs is done, no more channels should be
139 /// added.
140 
141 int HLFactory::AddChannel(const char* label,
142  const char* SigBkgPdfName,
143  const char* BkgPdfName,
144  const char* DatasetName){
145  if (fCombinationDone){
146  std::cerr << "Cannot add anymore channels. "
147  << "Combination already carried out.\n";
148  return -1;
149  }
150 
151  if (SigBkgPdfName!=0){
152  if (fWs->pdf(SigBkgPdfName)==NULL){
153  std::cerr << "Pdf " << SigBkgPdfName << " not found in workspace!\n";
154  return -1;
155  }
156  TObjString* name = new TObjString(SigBkgPdfName);
157  fSigBkgPdfNames.Add(name);
158  }
159 
160  if (BkgPdfName!=0){
161  if (fWs->pdf(BkgPdfName)==NULL){
162  std::cerr << "Pdf " << BkgPdfName << " not found in workspace!\n";
163  return -1;
164  }
165  TObjString* name = new TObjString(BkgPdfName);
166  fBkgPdfNames.Add(name);
167  }
168 
169  if (DatasetName!=0){
170  if (fWs->data(DatasetName)==NULL){
171  std::cerr << "Dataset " << DatasetName << " not found in workspace!\n";
172  return -1;
173  }
174  TObjString* name = new TObjString(DatasetName);
175  fDatasetsNames.Add(name);
176  }
177 
178  if (label!=0){
179  TObjString* name = new TObjString(label);
180  fLabelsNames.Add(name);
181  }
182  return 0;
183 
184 }
185 
186 ////////////////////////////////////////////////////////////////////////////////
187 /// Return the combination of the signal plus background channels.
188 /// The factory owns the object.
189 
191  if (fSigBkgPdfNames.GetSize()==0)
192  return 0;
193 
194  if (fComboSigBkgPdf!=NULL)
195  return fComboSigBkgPdf;
196 
197  if (!fNamesListsConsistent())
198  return NULL;
199 
200  if (fSigBkgPdfNames.GetSize()==1){
201  TString name(((TObjString*)fSigBkgPdfNames.At(0))->String());
203  return fComboSigBkgPdf;
204  }
205 
206  if (!fCombinationDone)
207  fCreateCategory();
208 
209  RooArgList pdfs("pdfs");
210 
212  TObjString* ostring;
213  TObject* obj;
214  while ((obj = it->Next())){
215  ostring=(TObjString*) obj;
216  pdfs.add( *(fWs->pdf(ostring->String())) );
217  }
218  delete it;
219 
220  TString name(GetName());
221  name+="_sigbkg";
222 
223  TString title(GetName());
224  title+="_sigbkg";
225 
227  new RooSimultaneous(name,
228  title,
229  pdfs,
230  *fComboCat);
231 
232  return fComboSigBkgPdf;
233 
234 }
235 
236 ////////////////////////////////////////////////////////////////////////////////
237 /// Return the combination of the background only channels.
238 /// If no background channel is specified a NULL pointer is returned.
239 /// The factory owns the object.
240 
242  if (fBkgPdfNames.GetSize()==0)
243  return 0;
244 
245  if (fComboBkgPdf!=NULL)
246  return fComboBkgPdf;
247 
248  if (!fNamesListsConsistent())
249  return NULL;
250 
251  if (fBkgPdfNames.GetSize()==1){
253  return fComboBkgPdf;
254  }
255 
256  if (!fCombinationDone)
257  fCreateCategory();
258 
259  RooArgList pdfs("pdfs");
260 
262  TObjString* ostring;
263  TObject* obj;
264  while ((obj = it->Next())){
265  ostring=(TObjString*) obj;
266  pdfs.add( *(fWs->pdf(ostring->String())) );
267  }
268 
269  TString name(GetName());
270  name+="_bkg";
271 
272  TString title(GetName());
273  title+="_bkg";
274 
275  fComboBkgPdf=
276  new RooSimultaneous(name,
277  title,
278  pdfs,
279  *fComboCat);
280 
281  return fComboBkgPdf;
282 
283 }
284 
285 ////////////////////////////////////////////////////////////////////////////////
286 /// Return the combination of the datasets.
287 /// If no dataset is specified a NULL pointer is returned.
288 /// The factory owns the object.
289 
291  if (fDatasetsNames.GetSize()==0)
292  return 0;
293 
294  if (fComboDataset!=NULL)
295  return fComboDataset;
296 
297  if (!fNamesListsConsistent())
298  return NULL;
299 
300  if (fDatasetsNames.GetSize()==1){
302  return fComboDataset;
303  }
304 
305  if (!fCombinationDone)
306  fCreateCategory();
307 
308 
310  TObjString* ostring;
311  TObject* obj = it->Next();
312  ostring = (TObjString*) obj;
313  fComboDataset = (RooDataSet*) fWs->data(ostring->String()) ;
314  if (!fComboDataset) return NULL;
315  fComboDataset->Print();
316  TString dataname(GetName());
317  fComboDataset = new RooDataSet(*fComboDataset,dataname+"_TotData");
318  int catindex=0;
319  fComboCat->setIndex(catindex);
321  while ((obj = it->Next())){
322  ostring=(TObjString*) obj;
323  catindex++;
324  RooDataSet * data = (RooDataSet*)fWs->data(ostring->String());
325  if (!data) return NULL;
326  RooDataSet* dummy = new RooDataSet(*data,"");
327  fComboCat->setIndex(catindex);
328  fComboCat->Print();
329  dummy->addColumn(*fComboCat);
330  fComboDataset->append(*dummy);
331  delete dummy;
332  }
333 
334  delete it;
335  return fComboDataset;
336 
337 }
338 
339 ////////////////////////////////////////////////////////////////////////////////
340 /// Return the category.
341 /// The factory owns the object.
342 
344  if (fComboCat!=NULL)
345  return fComboCat;
346 
347  if (!fNamesListsConsistent())
348  return NULL;
349 
350  if (!fCombinationDone)
351  fCreateCategory();
352 
353  return fComboCat;
354 
355  }
356 
357 ////////////////////////////////////////////////////////////////////////////////
358 /// Process an additional configuration file
359 
360 int HLFactory::ProcessCard(const char* filename){
361  return fReadFile(filename,0);
362 }
363 
364 ////////////////////////////////////////////////////////////////////////////////
365 /// Parses the configuration file. The objects can be specified following
366 /// the rules of the RooFactoryWSTool, plus some more flexibility.
367 ///
368 /// The official format for the datacards is ".rs".
369 ///
370 /// All the instructions end with a ";" (like in C++).
371 ///
372 /// Carriage returns and white lines are irrelevant but advised since they
373 /// improve readability (like in C++).
374 ///
375 /// The `(Roo)ClassName::objname(description)` can be replaced with the more
376 /// "pythonic" `objname = (Roo)ClassName(description)`.
377 ///
378 /// The comments can be specified with a "//" if on a single line or with
379 /// "multiple lines" in C/C++ like comments.
380 ///
381 /// The `"#include path/to/file.rs"` statement triggers the inclusion of a
382 /// configuration fragment.
383 ///
384 /// The `"import myobject:myworkspace:myrootfile"` will add to the Workspace
385 /// the object myobject located in myworkspace recorded in myrootfile.
386 /// Alternatively, one could choose the `"import myobject:myrootfile"` in case
387 /// no Workspace is present.
388 ///
389 /// The `"echo"` statement prompts a message on screen.
390 
391 int HLFactory::fReadFile(const char*fileName, bool is_included){
392  // Check the deepness of the inclusion
393  if (is_included)
394  fInclusionLevel+=1;
395  else
396  fInclusionLevel=0;
397 
398  const int maxDeepness=50;
399  if (fInclusionLevel>maxDeepness){
400  TString warning("The inclusion stack is deeper than ");
401  warning+=maxDeepness;
402  warning+=". Is this a recursive inclusion?";
403  Warning("fReadFile", "%s", warning.Data());
404  }
405 
406 
407  // open the config file and go through it
408  std::ifstream ifile(fileName);
409 
410  if(ifile.fail()){
411  TString error("File ");
412  error+=fileName;
413  error+=" could not be opened.";
414  Error("fReadFile", "%s", error.Data());
415  return -1;
416  }
417 
418  TString ifileContent("");
419  ifileContent.ReadFile(ifile);
420  ifile.close();
421 
422  // Tokenise the file using the "\n" char and parse it line by line to strip
423  // the comments.
424  TString ifileContentStripped("");
425 
426  TObjArray* lines_array = ifileContent.Tokenize("\n");
427  TIterator* lineIt=lines_array->MakeIterator();
428 
429  bool in_comment=false;
430  TString line;
431  TObject* line_o;
432 
433  while((line_o=(*lineIt)())){ // Start iteration on lines array
434  line = (static_cast<TObjString*>(line_o))->GetString();
435 
436  // Are we in a multiline comment?
437  if (in_comment)
438  if (line.EndsWith("*/")){
439  in_comment=false;
440  if (fVerbose) Info("fReadFile","Out of multiline comment ...");
441 
442  continue;
443  }
444 
445  // Was line a single line comment?
446 
447  if ((line.BeginsWith("/*") && line.EndsWith("*/")) ||
448  line.BeginsWith("//")){
449  if (fVerbose) Info("fReadFile","In single line comment ...");
450  continue;
451  }
452 
453  // Did a multiline comment just begin?
454  if (line.BeginsWith("/*")){
455  in_comment=true;
456  if (fVerbose) Info("fReadFile","In multiline comment ...");
457  continue;
458  }
459 
460  ifileContentStripped+=line+"\n";
461  }
462 
463  delete lines_array;
464  delete lineIt;
465 
466  // Now proceed with the parsing of the stripped file
467 
468  lines_array = ifileContentStripped.Tokenize(";");
469  lineIt=lines_array->MakeIterator();
470  in_comment=false;
471 
472  const int nNeutrals=2;
473  TString neutrals[nNeutrals]={"\t"," "};
474 
475  while((line_o=(*lineIt)())){
476 
477  line = (static_cast<TObjString*>(line_o))->GetString();
478 
479  // Strip spaces at the beginning and the end of the line
480  line.Strip(TString::kBoth,' ');
481 
482  // Put the single statement in one single line
483  line.ReplaceAll("\n","");
484 
485  // Do we have an echo statement? "A la RooFit"
486  if (line.BeginsWith("echo")){
487  line = line(5,line.Length()-1);
488  if (fVerbose)
489  std::cout << "Echoing line " << line.Data() << std::endl;
490  std::cout << "[" << GetName() << "] echo: "
491  << line.Data() << std::endl;
492  continue;
493  }
494 
495  // Spaces and tabs at this point are not needed.
496  for (int i=0;i<nNeutrals;++i)
497  line.ReplaceAll(neutrals[i],"");
498 
499 
500  if (fVerbose) Info("fReadFile","Reading --> %s <--", line.Data());
501 
502  // Was line a white space?
503  if (line == ""){
504  if (fVerbose) Info("fReadFile", "%s", "Empty line: skipping ...");
505  continue;
506  }
507 
508  // Do we have an include statement?
509  // We treat this recursively.
510  if (line.BeginsWith("#include")){
511  line.ReplaceAll("#include","");
512  if (fVerbose) Info("fReadFile","Reading included file...");
513  fReadFile(line,true);
514  continue;
515  }
516 
517  // We parse the line
518  if (fVerbose) Info("fReadFile","Parsing the line...");
519  fParseLine(line);
520  }
521 
522  delete lineIt;
523  delete lines_array;
524 
525  return 0;
526 }
527 
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 /// Builds the category necessary for the mutidimensional models. Its name
531 /// will be `<HLFactory name>_category` and the types are specified by the
532 /// model labels.
533 
535  fCombinationDone=true;
536 
537  TString name(GetName());
538  name+="_category";
539 
540  TString title(GetName());
541  title+="_category";
542 
543  fComboCat=new RooCategory(name,title);
544 
546  TObjString* ostring;
547  TObject* obj;
548  while ((obj = it->Next())){
549  ostring=(TObjString*) obj;
550  fComboCat->defineType(ostring->String());
551  }
552 
553  }
554 
555 ////////////////////////////////////////////////////////////////////////////////
556 /// Check the number of entries in each list. If not the same and the list
557 /// is not empty prompt an error.
558 
563  return true;
564  else{
565  std::cerr << "The number of datasets and models added as channels "
566  << " is not the same!\n";
567  return false;
568  }
569  }
570 
571 ////////////////////////////////////////////////////////////////////////////////
572 /// Parse a single line and puts the content in the RooWorkSpace
573 
575  if (fVerbose) Info("fParseLine", "Parsing line: %s", line.Data());
576 
577  TString new_line("");
578 
579  const int nequals = line.CountChar('=');
580 
581  // Build with the factory a var or cat, or pipe the command directly.
582 
583  if (line.Contains("::") || // It is a ordinary statement
584  nequals==0 || //it is a RooRealVar or cat with 0,1,2,3.. indexes
585  (line.Contains("[") &&
586  line.Contains("]") &&
587  nequals>0 && // It is a cat like "tag[B0=1,B0bar=-1]"
588  ! line.Contains("(") &&
589  ! line.Contains(")"))) {
590  fWs->factory(line);
591  return 0;
592  }
593 
594  // Transform the line o_name = o_class(o_descr) in o_class::o_name(o_descr)
595  if (nequals==1 ||
596  (nequals > 1 && line.Contains("SIMUL"))){
597 
598  // Divide the line in 3 components: o_name,o_class and o_descr
599  // assuming that o_name=o_class(o_descr)
600  const int equal_index=line.First('=');
601  const int par_index=line.First('(');
602  TString o_name(line(0,equal_index));
603  TString o_class(line(equal_index+1,par_index-equal_index-1));
604  TString o_descr(line(par_index+1,line.Length()-par_index-2));
605 
606  if (fVerbose) Info("fParseLine", "o_name=%s o_class=%s o_descr=%s",
607  o_name.Data(), o_class.Data(), o_descr.Data());
608 
609  // Now two cases either we wanna produce an object or import something
610  // under a new name.
611  if (o_class =="import"){// import a generic TObject into the WS
612  // Now see if we have a workspace or not, according to the number of
613  // entries in the description..
614 
615  TObjArray* descr_array = o_descr.Tokenize(",");
616 
617  const int n_descr_parts=descr_array->GetEntries();
618 
619  if (n_descr_parts<2 || n_descr_parts>3)
620  Error("fParseLine","Import wrong syntax: cannot process %s", o_descr.Data());
621 
622  TString obj_name (static_cast<TObjString*>(descr_array->At(n_descr_parts-1))->GetString());
623  TString ws_name("");
624  TString rootfile_name (static_cast<TObjString*>(descr_array->At(0))->GetString());
625 
626  TFile* ifile=TFile::Open(rootfile_name);
627  if (ifile==0)
628  return 1;
629 
630  if (n_descr_parts==3){// in presence of a Ws
631  o_descr.ReplaceAll(",",":");
632  fWs->import(o_descr);
633  }
634  else if(n_descr_parts==2){ // in presence of an object in rootfile
635  if (fVerbose)
636  Info("fParseLine","Importing %s from %s under the name of %s",
637  obj_name.Data(), rootfile_name.Data(), o_name.Data());
638  TObject* the_obj=ifile->Get(obj_name);
639  fWs->import(*the_obj,o_name);
640  }
641  delete ifile;
642  return 0;
643  } // end of import block
644 
645  new_line=o_class+"::"+o_name+"("+o_descr+")";
646 
647  if (fVerbose){
648  std::cout << "DEBUG: line: " << line.Data() << std::endl;
649  std::cout << "DEBUG: new_line: " << new_line.Data() << std::endl;
650  }
651 
652  fWs->factory(new_line);
653 
654  return 0;
655  }
656 
657  else { // In case we do not know what to do we pipe it..
658  fWs->factory(line);
659  }
660 
661  return 0;
662 
663 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
An array of TObjects.
Definition: TObjArray.h:37
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:854
RooCategory * fComboCat
The category of the combination.
Definition: HLFactory.h:82
TLine * line
Collectable string class.
Definition: TObjString.h:28
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
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set value by specifying the index code of the desired state.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetEntries() const
Definition: TCollection.h:177
RooDataSet * GetTotDataSet()
Get the combined dataset.
Definition: HLFactory.cxx:290
STL namespace.
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
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
Iterator abstract base class.
Definition: TIterator.h:30
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3976
const char * String
Definition: TXMLSetup.cxx:93
void fCreateCategory()
Create the category for the combinations.
Definition: HLFactory.cxx:534
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
Add a column with the values of the given (function) argument to this dataset.
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
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsArg.h:227
RooDataSet * fComboDataset
The datasets combination.
Definition: HLFactory.h:91
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:718
HLFactory()
Default Constructor.
Definition: HLFactory.cxx:98
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
RooAbsPdf * GetTotBkgPdf()
Get the combined background pdf.
Definition: HLFactory.cxx:241
RooAbsPdf * fComboBkgPdf
The background model combination.
Definition: HLFactory.h:85
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:655
TList fDatasetsNames
List of channels names to combine for the datasets.
Definition: HLFactory.h:109
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:354
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
TString & String()
Definition: TObjString.h:49
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
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsData.h:159
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Definition: TObjArray.cxx:633
RooCategory * GetTotCategory()
Get the combined dataset.
Definition: HLFactory.cxx:343
#define ClassImp(name)
Definition: Rtypes.h:359
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
void append(RooDataSet &data)
Add all data points of given data set to this data set.
static RooMathCoreReg dummy
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
Mother of all ROOT objects.
Definition: TObject.h:37
RooFactoryWSTool & factory()
Return instance to factory tool.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
virtual void Add(TObject *obj)
Definition: TList.h:87
int fParseLine(TString &line)
Parse a single line an puts the content in the RooWorkSpace.
Definition: HLFactory.cxx:574
virtual TObject * Next()=0
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index...
RooAbsPdf * GetTotSigBkgPdf()
Get the combined signal plus background pdf.
Definition: HLFactory.cxx:190
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset...
char name[80]
Definition: TGX11.cxx:109
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43